address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0xd85a01e39d82ccc42cf742e945e213613622ca24
// SPDX-License-Identifier: Unlicensed // $SM // Sending to the moon // Stealth Launch // LP will be burned // CA will be renounced // 3% Buy Tax / 3% Sell Tax // Enjoy this better and faster play 🌕 // https://sendingtothemoon.com // https://t.me/sendingtomoon // https://twitter.com/sendingtomoon 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 SM is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Sending to the Moon"; string private constant _symbol = "SM"; 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 = 3; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 3; 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; bool private _removeTxLimit = false; uint256 public _maxTxAmount = 20000000 * 10**9; uint256 public _maxWalletSize = 40000000 * 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 createNewPair() 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) 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"); } if(!_removeTxLimit){ require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { if(!_removeTxLimit){ 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 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 <= 5|| taxFeeOnSell <= 5 ); _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 , uint256 maxWalletSize) external onlyOwner { require(maxTxAmount > 5000000 * 10**9 ); _maxTxAmount = maxTxAmount; _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } function setRemoveTxLimit(bool enable) external onlyOwner{ _removeTxLimit = enable; } }
0x6080604052600436106101db5760003560e01c8063715018a611610102578063a2a957bb11610095578063c3c8cd8011610064578063c3c8cd8014610587578063c492f0461461059c578063dd62ed3e146105bc578063f2fde38b1461060257600080fd5b8063a2a957bb146104f7578063a9059cbb14610517578063ae0f3f4514610537578063bfd792841461055757600080fd5b80638f70ccf7116100d15780638f70ccf7146104765780638f9a55c01461049657806395d89b41146104ac57806398a5c315146104d757600080fd5b8063715018a6146104005780637d1db4a5146104155780637f2feddc1461042b5780638da5cb5b1461045857600080fd5b80632fd689e31161017a5780636b999053116101495780636b9990531461038b5780636d8aa8f8146103ab5780636fc3eaec146103cb57806370a08231146103e057600080fd5b80632fd689e314610324578063313ce5671461033a57806349bd5a5e146103565780635996c6b01461037657600080fd5b8063095ea7b3116101b6578063095ea7b3146102775780631694505e146102a757806318160ddd146102df57806323b872dd1461030457600080fd5b8062b8cf2a146101e757806306fdde0314610209578063093bb7201461025757600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611b2c565b610622565b005b34801561021557600080fd5b5060408051808201909152601381527229b2b73234b733903a37903a34329026b7b7b760691b60208201525b60405161024e9190611bf1565b60405180910390f35b34801561026357600080fd5b50610207610272366004611c56565b6106c1565b34801561028357600080fd5b50610297610292366004611c71565b610709565b604051901515815260200161024e565b3480156102b357600080fd5b506013546102c7906001600160a01b031681565b6040516001600160a01b03909116815260200161024e565b3480156102eb57600080fd5b50670de0b6b3a76400005b60405190815260200161024e565b34801561031057600080fd5b5061029761031f366004611c9d565b610720565b34801561033057600080fd5b506102f660175481565b34801561034657600080fd5b506040516009815260200161024e565b34801561036257600080fd5b506014546102c7906001600160a01b031681565b34801561038257600080fd5b50610207610789565b34801561039757600080fd5b506102076103a6366004611cde565b610941565b3480156103b757600080fd5b506102076103c6366004611c56565b61098c565b3480156103d757600080fd5b506102076109d4565b3480156103ec57600080fd5b506102f66103fb366004611cde565b610a01565b34801561040c57600080fd5b50610207610a23565b34801561042157600080fd5b506102f660155481565b34801561043757600080fd5b506102f6610446366004611cde565b60116020526000908152604090205481565b34801561046457600080fd5b506000546001600160a01b03166102c7565b34801561048257600080fd5b50610207610491366004611c56565b610a97565b3480156104a257600080fd5b506102f660165481565b3480156104b857600080fd5b50604080518082019091526002815261534d60f01b6020820152610241565b3480156104e357600080fd5b506102076104f2366004611cfb565b610af6565b34801561050357600080fd5b50610207610512366004611d14565b610b25565b34801561052357600080fd5b50610297610532366004611c71565b610b7d565b34801561054357600080fd5b50610207610552366004611d46565b610b8a565b34801561056357600080fd5b50610297610572366004611cde565b60106020526000908152604090205460ff1681565b34801561059357600080fd5b50610207610bd2565b3480156105a857600080fd5b506102076105b7366004611d68565b610c08565b3480156105c857600080fd5b506102f66105d7366004611dec565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561060e57600080fd5b5061020761061d366004611cde565b610ca9565b6000546001600160a01b031633146106555760405162461bcd60e51b815260040161064c90611e25565b60405180910390fd5b60005b81518110156106bd5760016010600084848151811061067957610679611e5a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106b581611e86565b915050610658565b5050565b6000546001600160a01b031633146106eb5760405162461bcd60e51b815260040161064c90611e25565b60148054911515600160b81b0260ff60b81b19909216919091179055565b6000610716338484610d93565b5060015b92915050565b600061072d848484610eb7565b61077f843361077a85604051806060016040528060288152602001611f9e602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113c6565b610d93565b5060019392505050565b6000546001600160a01b031633146107b35760405162461bcd60e51b815260040161064c90611e25565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610818573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083c9190611e9f565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610889573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ad9190611e9f565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156108fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091e9190611e9f565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b0316331461096b5760405162461bcd60e51b815260040161064c90611e25565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146109b65760405162461bcd60e51b815260040161064c90611e25565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146109f457600080fd5b476109fe81611400565b50565b6001600160a01b03811660009081526002602052604081205461071a9061143a565b6000546001600160a01b03163314610a4d5760405162461bcd60e51b815260040161064c90611e25565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610ac15760405162461bcd60e51b815260040161064c90611e25565b601454600160a01b900460ff1615610ad857600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610b205760405162461bcd60e51b815260040161064c90611e25565b601755565b6000546001600160a01b03163314610b4f5760405162461bcd60e51b815260040161064c90611e25565b600582111580610b60575060058111155b610b6957600080fd5b600893909355600a91909155600955600b55565b6000610716338484610eb7565b6000546001600160a01b03163314610bb45760405162461bcd60e51b815260040161064c90611e25565b6611c37937e080008211610bc757600080fd5b601591909155601655565b6012546001600160a01b0316336001600160a01b031614610bf257600080fd5b6000610bfd30610a01565b90506109fe816114be565b6000546001600160a01b03163314610c325760405162461bcd60e51b815260040161064c90611e25565b60005b82811015610ca3578160056000868685818110610c5457610c54611e5a565b9050602002016020810190610c699190611cde565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c9b81611e86565b915050610c35565b50505050565b6000546001600160a01b03163314610cd35760405162461bcd60e51b815260040161064c90611e25565b6001600160a01b038116610d385760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161064c565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610df55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161064c565b6001600160a01b038216610e565760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161064c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f1b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161064c565b6001600160a01b038216610f7d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161064c565b60008111610fdf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161064c565b6000546001600160a01b0384811691161480159061100b57506000546001600160a01b03838116911614155b156112bf57601454600160a01b900460ff166110a4576000546001600160a01b038481169116146110a45760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161064c565b601454600160b81b900460ff16611107576015548111156111075760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161064c565b6001600160a01b03831660009081526010602052604090205460ff1615801561114957506001600160a01b03821660009081526010602052604090205460ff16155b6111a15760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161064c565b6014546001600160a01b038381169116146111e857601454600160b81b900460ff166111e857601654816111d484610a01565b6111de9190611ebc565b106111e857600080fd5b60006111f330610a01565b60175460155491925082101590821061120c5760155491505b8080156112235750601454600160a81b900460ff16155b801561123d57506014546001600160a01b03868116911614155b80156112525750601454600160b01b900460ff165b801561127757506001600160a01b03851660009081526005602052604090205460ff16155b801561129c57506001600160a01b03841660009081526005602052604090205460ff16155b156112bc576112aa826114be565b4780156112ba576112ba47611400565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061130157506001600160a01b03831660009081526005602052604090205460ff165b8061133357506014546001600160a01b0385811691161480159061133357506014546001600160a01b03848116911614155b15611340575060006113ba565b6014546001600160a01b03858116911614801561136b57506013546001600160a01b03848116911614155b1561137d57600854600c55600954600d555b6014546001600160a01b0384811691161480156113a857506013546001600160a01b03858116911614155b156113ba57600a54600c55600b54600d555b610ca384848484611638565b600081848411156113ea5760405162461bcd60e51b815260040161064c9190611bf1565b5060006113f78486611ed4565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106bd573d6000803e3d6000fd5b60006006548211156114a15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161064c565b60006114ab611666565b90506114b78382611689565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061150657611506611e5a565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561155f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115839190611e9f565b8160018151811061159657611596611e5a565b6001600160a01b0392831660209182029290920101526013546115bc9130911684610d93565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906115f5908590600090869030904290600401611eeb565b600060405180830381600087803b15801561160f57600080fd5b505af1158015611623573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b80611645576116456116cb565b6116508484846116f9565b80610ca357610ca3600e54600c55600f54600d55565b60008060006116736117f0565b90925090506116828282611689565b9250505090565b60006114b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611830565b600c541580156116db5750600d54155b156116e257565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061170b8761185e565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061173d90876118bb565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461176c90866118fd565b6001600160a01b03891660009081526002602052604090205561178e8161195c565b61179884836119a6565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117dd91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061180b8282611689565b82101561182757505060065492670de0b6b3a764000092509050565b90939092509050565b600081836118515760405162461bcd60e51b815260040161064c9190611bf1565b5060006113f78486611f5c565b600080600080600080600080600061187b8a600c54600d546119ca565b925092509250600061188b611666565b9050600080600061189e8e878787611a1f565b919e509c509a509598509396509194505050505091939550919395565b60006114b783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113c6565b60008061190a8385611ebc565b9050838110156114b75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161064c565b6000611966611666565b905060006119748383611a6f565b3060009081526002602052604090205490915061199190826118fd565b30600090815260026020526040902055505050565b6006546119b390836118bb565b6006556007546119c390826118fd565b6007555050565b60008080806119e460646119de8989611a6f565b90611689565b905060006119f760646119de8a89611a6f565b90506000611a0f82611a098b866118bb565b906118bb565b9992985090965090945050505050565b6000808080611a2e8886611a6f565b90506000611a3c8887611a6f565b90506000611a4a8888611a6f565b90506000611a5c82611a0986866118bb565b939b939a50919850919650505050505050565b600082600003611a815750600061071a565b6000611a8d8385611f7e565b905082611a9a8583611f5c565b146114b75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161064c565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146109fe57600080fd5b8035611b2781611b07565b919050565b60006020808385031215611b3f57600080fd5b823567ffffffffffffffff80821115611b5757600080fd5b818501915085601f830112611b6b57600080fd5b813581811115611b7d57611b7d611af1565b8060051b604051601f19603f83011681018181108582111715611ba257611ba2611af1565b604052918252848201925083810185019188831115611bc057600080fd5b938501935b82851015611be557611bd685611b1c565b84529385019392850192611bc5565b98975050505050505050565b600060208083528351808285015260005b81811015611c1e57858101830151858201604001528201611c02565b81811115611c30576000604083870101525b50601f01601f1916929092016040019392505050565b80358015158114611b2757600080fd5b600060208284031215611c6857600080fd5b6114b782611c46565b60008060408385031215611c8457600080fd5b8235611c8f81611b07565b946020939093013593505050565b600080600060608486031215611cb257600080fd5b8335611cbd81611b07565b92506020840135611ccd81611b07565b929592945050506040919091013590565b600060208284031215611cf057600080fd5b81356114b781611b07565b600060208284031215611d0d57600080fd5b5035919050565b60008060008060808587031215611d2a57600080fd5b5050823594602084013594506040840135936060013592509050565b60008060408385031215611d5957600080fd5b50508035926020909101359150565b600080600060408486031215611d7d57600080fd5b833567ffffffffffffffff80821115611d9557600080fd5b818601915086601f830112611da957600080fd5b813581811115611db857600080fd5b8760208260051b8501011115611dcd57600080fd5b602092830195509350611de39186019050611c46565b90509250925092565b60008060408385031215611dff57600080fd5b8235611e0a81611b07565b91506020830135611e1a81611b07565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e9857611e98611e70565b5060010190565b600060208284031215611eb157600080fd5b81516114b781611b07565b60008219821115611ecf57611ecf611e70565b500190565b600082821015611ee657611ee6611e70565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f3b5784516001600160a01b031683529383019391830191600101611f16565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f7957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f9857611f98611e70565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f2f417ba5bdba89a75df5f950b9ce116ec0761b01e23c65e345949ec04b954f064736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,400
0xc7283b66Eb1EB5FB86327f08e1B5816b0720212B
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; // Forked from Uniswap's UNI // Reference: https://etherscan.io/address/0x1f9840a85d5af5bf1d1762f925bdaddc4201f984#code contract Tribe { /// @notice EIP-20 token name for this token // solhint-disable-next-line const-name-snakecase string public constant name = "Tribe"; /// @notice EIP-20 token symbol for this token // solhint-disable-next-line const-name-snakecase string public constant symbol = "TRIBE"; /// @notice EIP-20 token decimals for this token // solhint-disable-next-line const-name-snakecase uint8 public constant decimals = 18; /// @notice Total number of tokens in circulation // solhint-disable-next-line const-name-snakecase uint public totalSupply = 1_000_000_000e18; // 1 billion Tribe /// @notice Address which may mint new tokens address public minter; /// @notice Allowance amounts on behalf of others mapping (address => mapping (address => uint96)) internal allowances; /// @notice Official record of token balances for each account mapping (address => uint96) internal balances; /// @notice A record of each accounts delegate mapping (address => address) public delegates; /// @notice A checkpoint for marking number of votes from a given block struct Checkpoint { uint32 fromBlock; uint96 votes; } /// @notice A record of votes checkpoints for each account, by index mapping (address => mapping (uint32 => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account mapping (address => uint32) public numCheckpoints; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the delegation struct used by the contract bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); /// @notice The EIP-712 typehash for the permit struct used by the contract bytes32 public constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); /// @notice A record of states for signing / validating signatures mapping (address => uint) public nonces; /// @notice An event thats emitted when the minter address is changed event MinterChanged(address minter, address newMinter); /// @notice An event thats emitted when an account changes its delegate event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /// @notice An event thats emitted when a delegate account's vote balance changes event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance); /// @notice The standard EIP-20 transfer event event Transfer(address indexed from, address indexed to, uint256 amount); /// @notice The standard EIP-20 approval event event Approval(address indexed owner, address indexed spender, uint256 amount); /** * @notice Construct a new Tribe token * @param account The initial account to grant all the tokens * @param minter_ The account with minting ability */ constructor(address account, address minter_) public { balances[account] = uint96(totalSupply); emit Transfer(address(0), account, totalSupply); minter = minter_; emit MinterChanged(address(0), minter); } /** * @notice Change the minter address * @param minter_ The address of the new minter */ function setMinter(address minter_) external { require(msg.sender == minter, "Tribe: only the minter can change the minter address"); emit MinterChanged(minter, minter_); minter = minter_; } /** * @notice Mint new tokens * @param dst The address of the destination account * @param rawAmount The number of tokens to be minted */ function mint(address dst, uint rawAmount) external { require(msg.sender == minter, "Tribe: only the minter can mint"); require(dst != address(0), "Tribe: cannot transfer to the zero address"); // mint the amount uint96 amount = safe96(rawAmount, "Tribe: amount exceeds 96 bits"); uint96 safeSupply = safe96(totalSupply, "Tribe: totalSupply exceeds 96 bits"); totalSupply = add96(safeSupply, amount, "Tribe: totalSupply exceeds 96 bits"); // transfer the amount to the recipient balances[dst] = add96(balances[dst], amount, "Tribe: transfer amount overflows"); emit Transfer(address(0), dst, amount); // move delegates _moveDelegates(address(0), delegates[dst], amount); } /** * @notice Get the number of tokens `spender` is approved to spend on behalf of `account` * @param account The address of the account holding the funds * @param spender The address of the account spending the funds * @return The number of tokens approved */ function allowance(address account, address spender) external view returns (uint) { return allowances[account][spender]; } /** * @notice Approve `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint rawAmount) external returns (bool) { uint96 amount; if (rawAmount == uint(-1)) { amount = uint96(-1); } else { amount = safe96(rawAmount, "Tribe: amount exceeds 96 bits"); } allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /** * @notice Triggers an approval from owner to spends * @param owner The address to approve from * @param spender The address to be approved * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @param deadline The time at which to expire the signature * @param v The recovery byte of the signature * @param r Half of the ECDSA signature pair * @param s Half of the ECDSA signature pair */ function permit(address owner, address spender, uint rawAmount, uint deadline, uint8 v, bytes32 r, bytes32 s) external { uint96 amount; if (rawAmount == uint(-1)) { amount = uint96(-1); } else { amount = safe96(rawAmount, "Tribe: amount exceeds 96 bits"); } bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, rawAmount, nonces[owner]++, deadline)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "Tribe: invalid signature"); require(signatory == owner, "Tribe: unauthorized"); // solhint-disable-next-line not-rely-on-time require(block.timestamp <= deadline, "Tribe: signature expired"); allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @notice Get the number of tokens held by the `account` * @param account The address of the account to get the balance of * @return The number of tokens held */ function balanceOf(address account) external view returns (uint) { return balances[account]; } /** * @notice Transfer `amount` tokens from `msg.sender` to `dst` * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transfer(address dst, uint rawAmount) external returns (bool) { uint96 amount = safe96(rawAmount, "Tribe: amount exceeds 96 bits"); _transferTokens(msg.sender, dst, amount); return true; } /** * @notice Transfer `amount` tokens from `src` to `dst` * @param src The address of the source account * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transferFrom(address src, address dst, uint rawAmount) external returns (bool) { address spender = msg.sender; uint96 spenderAllowance = allowances[src][spender]; uint96 amount = safe96(rawAmount, "Tribe: amount exceeds 96 bits"); if (spender != src && spenderAllowance != uint96(-1)) { uint96 newAllowance = sub96(spenderAllowance, amount, "Tribe: transfer amount exceeds spender allowance"); allowances[src][spender] = newAllowance; emit Approval(src, spender, newAllowance); } _transferTokens(src, dst, amount); return true; } /** * @notice Delegate votes from `msg.sender` to `delegatee` * @param delegatee The address to delegate votes to */ function delegate(address delegatee) public { return _delegate(msg.sender, delegatee); } /** * @notice Delegates votes from signatory to `delegatee` * @param delegatee The address to delegate votes to * @param nonce The contract state required to match the signature * @param expiry The time at which to expire the signature * @param v The recovery byte of the signature * @param r Half of the ECDSA signature pair * @param s Half of the ECDSA signature pair */ function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "Tribe: invalid signature"); require(nonce == nonces[signatory]++, "Tribe: invalid nonce"); // solhint-disable-next-line not-rely-on-time require(block.timestamp <= expiry, "Tribe: signature expired"); return _delegate(signatory, delegatee); } /** * @notice Gets the current votes balance for `account` * @param account The address to get votes balance * @return The number of current votes for `account` */ function getCurrentVotes(address account) external view returns (uint96) { uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; } /** * @notice Determine the prior number of votes for an account as of a block number * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. * @param account The address of the account to check * @param blockNumber The block number to get the vote balance at * @return The number of votes the account had as of the given block */ function getPriorVotes(address account, uint blockNumber) public view returns (uint96) { require(blockNumber < block.number, "Tribe: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return 0; } // First check most recent balance if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) { return checkpoints[account][nCheckpoints - 1].votes; } // Next check implicit zero balance if (checkpoints[account][0].fromBlock > blockNumber) { return 0; } uint32 lower = 0; uint32 upper = nCheckpoints - 1; while (upper > lower) { uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow Checkpoint memory cp = checkpoints[account][center]; if (cp.fromBlock == blockNumber) { return cp.votes; } else if (cp.fromBlock < blockNumber) { lower = center; } else { upper = center - 1; } } return checkpoints[account][lower].votes; } function _delegate(address delegator, address delegatee) internal { address currentDelegate = delegates[delegator]; uint96 delegatorBalance = balances[delegator]; delegates[delegator] = delegatee; emit DelegateChanged(delegator, currentDelegate, delegatee); _moveDelegates(currentDelegate, delegatee, delegatorBalance); } function _transferTokens(address src, address dst, uint96 amount) internal { require(src != address(0), "Tribe: cannot transfer from the zero address"); require(dst != address(0), "Tribe: cannot transfer to the zero address"); balances[src] = sub96(balances[src], amount, "Tribe: transfer amount exceeds balance"); balances[dst] = add96(balances[dst], amount, "Tribe: transfer amount overflows"); emit Transfer(src, dst, amount); _moveDelegates(delegates[src], delegates[dst], amount); } function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal { if (srcRep != dstRep && amount > 0) { if (srcRep != address(0)) { uint32 srcRepNum = numCheckpoints[srcRep]; uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; uint96 srcRepNew = sub96(srcRepOld, amount, "Tribe: vote amount underflows"); _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew); } if (dstRep != address(0)) { uint32 dstRepNum = numCheckpoints[dstRep]; uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0; uint96 dstRepNew = add96(dstRepOld, amount, "Tribe: vote amount overflows"); _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew); } } } function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal { uint32 blockNumber = safe32(block.number, "Tribe: block number exceeds 32 bits"); if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) { checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; } else { checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes); numCheckpoints[delegatee] = nCheckpoints + 1; } emit DelegateVotesChanged(delegatee, oldVotes, newVotes); } function safe32(uint n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } function safe96(uint n, string memory errorMessage) internal pure returns (uint96) { require(n < 2**96, errorMessage); return uint96(n); } function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { uint96 c = a + b; require(c >= a, errorMessage); return c; } function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { require(b <= a, errorMessage); return a - b; } function getChainId() internal pure returns (uint) { uint256 chainId; // solhint-disable-next-line no-inline-assembly assembly { chainId := chainid() } return chainId; } }
0x608060405234801561001057600080fd5b50600436106101585760003560e01c806370a08231116100c3578063c3cda5201161007c578063c3cda520146102cc578063d505accf146102df578063dd62ed3e146102f2578063e7a324dc14610305578063f1127ed81461030d578063fca3b5aa1461032e57610158565b806370a0823114610258578063782d6fe11461026b5780637ecebe001461028b57806395d89b411461029e578063a9059cbb146102a6578063b4b5ea57146102b957610158565b806330adf81f1161011557806330adf81f146101e0578063313ce567146101e857806340c10f19146101fd578063587cde1e146102125780635c19a95c146102255780636fcfff451461023857610158565b806306fdde031461015d578063075461721461017b578063095ea7b31461019057806318160ddd146101b057806320606b70146101c557806323b872dd146101cd575b600080fd5b610165610341565b6040516101729190611b78565b60405180910390f35b610183610362565b6040516101729190611a9c565b6101a361019e3660046118ab565b610371565b6040516101729190611aca565b6101b861043b565b6040516101729190611ad5565b6101b8610441565b6101a36101db3660046117ff565b610458565b6101b86105a7565b6101f06105b3565b6040516101729190611e1c565b61021061020b3660046118ab565b6105b8565b005b6101836102203660046117b0565b610794565b6102106102333660046117b0565b6107af565b61024b6102463660046117b0565b6107bc565b6040516101729190611dec565b6101b86102663660046117b0565b6107d4565b61027e6102793660046118ab565b6107f8565b6040516101729190611e2a565b6101b86102993660046117b0565b610a06565b610165610a18565b6101a36102b43660046118ab565b610a39565b61027e6102c73660046117b0565b610a80565b6102106102da3660046118d5565b610af1565b6102106102ed36600461183f565b610cd8565b6101b86103003660046117cb565b610fcc565b6101b8611000565b61032061031b36600461192e565b61100c565b604051610172929190611dfd565b61021061033c3660046117b0565b611041565b60405180604001604052806005815260200164547269626560d81b81525081565b6001546001600160a01b031681565b60008060001983141561038757506000196103b7565b6103b4836040518060400160405280601d8152602001600080516020611f098339815191528152506110d4565b90505b3360008181526002602090815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610427908590611e2a565b60405180910390a360019150505b92915050565b60005481565b60405161044d906119f2565b604051809103902081565b6001600160a01b038316600090815260026020908152604080832033808552908352818420548251808401909352601d8352600080516020611f0983398151915293830193909352916001600160601b03169083906104b89086906110d4565b9050866001600160a01b0316836001600160a01b0316141580156104e557506001600160601b0382811614155b1561058f57600061050f8383604051806060016040528060308152602001611eb360309139611103565b6001600160a01b038981166000818152600260209081526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610585908590611e2a565b60405180910390a3505b61059a878783611142565b5060019695505050505050565b60405161044d90611988565b601281565b6001546001600160a01b031633146105eb5760405162461bcd60e51b81526004016105e290611bcb565b60405180910390fd5b6001600160a01b0382166106115760405162461bcd60e51b81526004016105e290611c02565b6000610640826040518060400160405280601d8152602001600080516020611f098339815191528152506110d4565b90506000610668600054604051806060016040528060228152602001611e91602291396110d4565b905061068d8183604051806060016040528060228152602001611e9160229139611305565b6001600160601b0390811660009081556001600160a01b0386168152600360209081526040918290205482518084019093528183527f54726962653a207472616e7366657220616d6f756e74206f766572666c6f7773918301919091526106f79216908490611305565b6001600160a01b03851660008181526003602052604080822080546001600160601b0319166001600160601b03959095169490941790935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610761908690611e2a565b60405180910390a36001600160a01b0380851660009081526004602052604081205461078e921684611341565b50505050565b6004602052600090815260409020546001600160a01b031681565b6107b9338261150d565b50565b60066020526000908152604090205463ffffffff1681565b6001600160a01b03166000908152600360205260409020546001600160601b031690565b60004382106108195760405162461bcd60e51b81526004016105e290611db5565b6001600160a01b03831660009081526006602052604090205463ffffffff1680610847576000915050610435565b6001600160a01b038416600090815260056020908152604080832063ffffffff6000198601811685529252909120541683106108c3576001600160a01b03841660009081526005602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b03169050610435565b6001600160a01b038416600090815260056020908152604080832083805290915290205463ffffffff168310156108fe576000915050610435565b600060001982015b8163ffffffff168163ffffffff1611156109c157600282820363ffffffff16048103610930611771565b506001600160a01b038716600090815260056020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b0316918101919091529087141561099c576020015194506104359350505050565b805163ffffffff168711156109b3578193506109ba565b6001820392505b5050610906565b506001600160a01b038516600090815260056020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60076020526000908152604090205481565b60405180604001604052806005815260200164545249424560d81b81525081565b600080610a69836040518060400160405280601d8152602001600080516020611f098339815191528152506110d4565b9050610a76338583611142565b5060019392505050565b6001600160a01b03811660009081526006602052604081205463ffffffff1680610aab576000610aea565b6001600160a01b0383166000908152600560209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03165b9392505050565b6000604051610aff906119f2565b604080519182900382208282019091526005825264547269626560d81b6020909201919091527febed0dee75115424b4c6084a9ab165e0c99bcf5a44403d7510e1ad1caeaea506610b4e611591565b30604051602001610b629493929190611b36565b6040516020818303038152906040528051906020012090506000604051610b8890611a4d565b604051908190038120610ba3918a908a908a90602001611b12565b60405160208183030381529060405280519060200120905060008282604051602001610bd092919061196d565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610c0d9493929190611b5a565b6020604051602081039080840390855afa158015610c2f573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610c625760405162461bcd60e51b81526004016105e290611cfc565b6001600160a01b03811660009081526007602052604090208054600181019091558914610ca15760405162461bcd60e51b81526004016105e290611d33565b87421115610cc15760405162461bcd60e51b81526004016105e290611c4c565b610ccb818b61150d565b505050505b505050505050565b6000600019861415610ced5750600019610d1d565b610d1a866040518060400160405280601d8152602001600080516020611f098339815191528152506110d4565b90505b6000604051610d2b906119f2565b604080519182900382208282019091526005825264547269626560d81b6020909201919091527febed0dee75115424b4c6084a9ab165e0c99bcf5a44403d7510e1ad1caeaea506610d7a611591565b30604051602001610d8e9493929190611b36565b6040516020818303038152906040528051906020012090506000604051610db490611988565b604080519182900382206001600160a01b038d16600090815260076020908152929020805460018101909155610df69391928e928e928e9290918e9101611ade565b60405160208183030381529060405280519060200120905060008282604051602001610e2392919061196d565b604051602081830303815290604052805190602001209050600060018289898960405160008152602001604052604051610e609493929190611b5a565b6020604051602081039080840390855afa158015610e82573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610eb55760405162461bcd60e51b81526004016105e290611cfc565b8b6001600160a01b0316816001600160a01b031614610ee65760405162461bcd60e51b81526004016105e290611ccf565b88421115610f065760405162461bcd60e51b81526004016105e290611c4c565b84600260008e6001600160a01b03166001600160a01b0316815260200190815260200160002060008d6001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160601b0302191690836001600160601b031602179055508a6001600160a01b03168c6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92587604051610fb69190611e2a565b60405180910390a3505050505050505050505050565b6001600160a01b0391821660009081526002602090815260408083209390941682529190915220546001600160601b031690565b60405161044d90611a4d565b600560209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b6001546001600160a01b0316331461106b5760405162461bcd60e51b81526004016105e290611d61565b6001546040517f3b0007eb941cf645526cbb3a4fdaecda9d28ce4843167d9263b536a1f1edc0f6916110aa916001600160a01b03909116908490611ab0565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b600081600160601b84106110fb5760405162461bcd60e51b81526004016105e29190611b78565b509192915050565b6000836001600160601b0316836001600160601b03161115829061113a5760405162461bcd60e51b81526004016105e29190611b78565b505050900390565b6001600160a01b0383166111685760405162461bcd60e51b81526004016105e290611c83565b6001600160a01b03821661118e5760405162461bcd60e51b81526004016105e290611c02565b6001600160a01b0383166000908152600360209081526040918290205482516060810190935260268084526111d9936001600160601b039092169285929190611ee390830139611103565b6001600160a01b03848116600090815260036020908152604080832080546001600160601b0319166001600160601b039687161790559286168252908290205482518084019093528183527f54726962653a207472616e7366657220616d6f756e74206f766572666c6f7773918301919091526112599216908390611305565b6001600160a01b038381166000818152600360205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906112c6908590611e2a565b60405180910390a36001600160a01b0380841660009081526004602052604080822054858416835291205461130092918216911683611341565b505050565b6000838301826001600160601b0380871690831610156113385760405162461bcd60e51b81526004016105e29190611b78565b50949350505050565b816001600160a01b0316836001600160a01b03161415801561136c57506000816001600160601b0316115b15611300576001600160a01b03831615611441576001600160a01b03831660009081526006602052604081205463ffffffff1690816113ac5760006113eb565b6001600160a01b0385166000908152600560209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b9050600061142f82856040518060400160405280601d81526020017f54726962653a20766f746520616d6f756e7420756e646572666c6f7773000000815250611103565b905061143d86848484611595565b5050505b6001600160a01b03821615611300576001600160a01b03821660009081526006602052604081205463ffffffff16908161147c5760006114bb565b6001600160a01b0384166000908152600560209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b905060006114ff82856040518060400160405280601c81526020017f54726962653a20766f746520616d6f756e74206f766572666c6f777300000000815250611305565b9050610cd085848484611595565b6001600160a01b03808316600081815260046020818152604080842080546003845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a461078e828483611341565b4690565b60006115b943604051806060016040528060238152602001611e6e6023913961174a565b905060008463ffffffff1611801561160257506001600160a01b038516600090815260056020908152604080832063ffffffff6000198901811685529252909120548282169116145b15611661576001600160a01b0385166000908152600560209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b03851602179055611700565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152600583528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252600690935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724848460405161173b929190611e3e565b60405180910390a25050505050565b600081600160201b84106110fb5760405162461bcd60e51b81526004016105e29190611b78565b604080518082019091526000808252602082015290565b80356001600160a01b038116811461043557600080fd5b803560ff8116811461043557600080fd5b6000602082840312156117c1578081fd5b610aea8383611788565b600080604083850312156117dd578081fd5b6117e78484611788565b91506117f68460208501611788565b90509250929050565b600080600060608486031215611813578081fd5b833561181e81611e58565b9250602084013561182e81611e58565b929592945050506040919091013590565b600080600080600080600060e0888a031215611859578283fd5b6118638989611788565b96506118728960208a01611788565b9550604088013594506060880135935061188f8960808a0161179f565b925060a0880135915060c0880135905092959891949750929550565b600080604083850312156118bd578182fd5b6118c78484611788565b946020939093013593505050565b60008060008060008060c087890312156118ed578182fd5b6118f78888611788565b95506020870135945060408701359350611914886060890161179f565b92506080870135915060a087013590509295509295509295565b60008060408385031215611940578182fd5b61194a8484611788565b9150602083013563ffffffff81168114611962578182fd5b809150509250929050565b61190160f01b81526002810192909252602282015260420190565b7f5065726d69742861646472657373206f776e65722c616464726573732073706581527f6e6465722c75696e743235362076616c75652c75696e74323536206e6f6e63656020820152712c75696e7432353620646561646c696e652960701b604082015260520190565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430190565b7f44656c65676174696f6e28616464726573732064656c6567617465652c75696e81527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020820152603a0190565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b901515815260200190565b90815260200190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9384526001600160a01b039290921660208401526040830152606082015260800190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b93845260ff9290921660208401526040830152606082015260800190565b6000602080835283518082850152825b81811015611ba457858101830151858201604001528201611b88565b81811115611bb55783604083870101525b50601f01601f1916929092016040019392505050565b6020808252601f908201527f54726962653a206f6e6c7920746865206d696e7465722063616e206d696e7400604082015260600190565b6020808252602a908201527f54726962653a2063616e6e6f74207472616e7366657220746f20746865207a65604082015269726f206164647265737360b01b606082015260800190565b60208082526018908201527f54726962653a207369676e617475726520657870697265640000000000000000604082015260600190565b6020808252602c908201527f54726962653a2063616e6e6f74207472616e736665722066726f6d207468652060408201526b7a65726f206164647265737360a01b606082015260800190565b602080825260139082015272151c9a58994e881d5b985d5d1a1bdc9a5e9959606a1b604082015260600190565b60208082526018908201527f54726962653a20696e76616c6964207369676e61747572650000000000000000604082015260600190565b60208082526014908201527354726962653a20696e76616c6964206e6f6e636560601b604082015260600190565b60208082526034908201527f54726962653a206f6e6c7920746865206d696e7465722063616e206368616e676040820152736520746865206d696e746572206164647265737360601b606082015260800190565b60208082526019908201527f54726962653a206e6f74207965742064657465726d696e656400000000000000604082015260600190565b63ffffffff91909116815260200190565b63ffffffff9290921682526001600160601b0316602082015260400190565b60ff91909116815260200190565b6001600160601b0391909116815260200190565b6001600160601b0392831681529116602082015260400190565b6001600160a01b03811681146107b957600080fdfe54726962653a20626c6f636b206e756d6265722065786365656473203332206269747354726962653a20746f74616c537570706c792065786365656473203936206269747354726962653a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e636554726962653a207472616e7366657220616d6f756e7420657863656564732062616c616e636554726962653a20616d6f756e7420657863656564732039362062697473000000a26469706673582212204b5ab84c8ee5befcd5fba2745834ef385b0d07beb1f852bc25562eb10a137ac064736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
6,401
0x9158f83bc4b5be924227001034cbd40fe0a45114
pragma solidity ^0.4.18; /** * @title Ownable * @dev Adds onlyOwner modifier. Subcontracts should implement checkOwner to check if caller is owner. */ contract Ownable { modifier onlyOwner() { checkOwner(); _; } function checkOwner() internal; } /** * @title Read-only ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ReadOnlyToken { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function allowance(address owner, address spender) public constant returns (uint256); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract Token is ReadOnlyToken { function transfer(address to, uint256 value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract MintableToken is Token { event Mint(address indexed to, uint256 amount); function mint(address _to, uint256 _amount) public returns (bool); } /** * @title Secured * @dev Adds only(role) modifier. Subcontracts should implement checkRole to check if caller is allowed to do action. */ contract Secured { modifier only(string role) { require(msg.sender == getRole(role)); _; } function getRole(string role) constant public returns (address); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error * @dev this version copied from zeppelin-solidity, constant changed to pure */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract ReadOnlyTokenImpl is ReadOnlyToken { mapping(address => uint256) balances; mapping(address => mapping(address => uint256)) internal allowed; /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** * @title 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 TokenImpl is Token, ReadOnlyTokenImpl { using SafeMath for uint256; /** * @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); emitTransfer(msg.sender, _to, _value); return true; } function emitTransfer(address _from, address _to, uint256 _value) internal { emit Transfer(_from, _to, _value); } /** * @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); emitTransfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract MintableTokenImpl is Ownable, Secured, TokenImpl, MintableToken { /** * @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) only("minter") public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emitMint(_to, _amount); emitTransfer(address(0), _to, _amount); return true; } function emitMint(address _to, uint256 _value) internal { emit Mint(_to, _value); } } /** * @title OwnableImpl * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract OwnableImpl is 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 OwnableImpl() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ function checkOwner() internal { 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; } } contract SecuredImpl is Ownable, Secured { mapping(string => address) users; event RoleTransferred(address indexed previousUser, address indexed newUser, string role); function getRole(string role) constant public returns (address) { return users[role]; } function transferRole(string role, address to) onlyOwner public { require(to != address(0)); emit RoleTransferred(users[role], to, role); users[role] = to; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } contract PausableToken is Pausable, TokenImpl { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } contract BurnableToken is Token { event Burn(address indexed burner, uint256 value); function burn(uint256 _value) public; } contract BurnableTokenImpl is TokenImpl, BurnableToken { /** * @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); emit Burn(burner, _value); } } contract DemoToken is OwnableImpl, SecuredImpl, PausableToken, MintableTokenImpl, BurnableTokenImpl { string public constant name = "Demo Token"; string public constant symbol = "DEMO1"; uint8 public constant decimals = 18; function burn(uint256 _value) public whenNotPaused { super.burn(_value); } }
0x6060604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610116578063095ea7b3146101a057806318160ddd146101d657806323b872dd146101fb578063313ce567146102235780633f4ba83a1461024c57806340c10f191461026157806342966c68146102835780634cfe62c7146102995780635c975abb146102f557806366188463146103085780636e9067fb1461032a57806370a08231146103975780638456cb59146103b65780638da5cb5b146103c957806395d89b41146103dc578063a9059cbb146103ef578063d73dd62314610411578063dd62ed3e14610433578063f2fde38b14610458575b600080fd5b341561012157600080fd5b610129610477565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561016557808201518382015260200161014d565b50505050905090810190601f1680156101925780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101ab57600080fd5b6101c2600160a060020a03600435166024356104ae565b604051901515815260200160405180910390f35b34156101e157600080fd5b6101e96104d2565b60405190815260200160405180910390f35b341561020657600080fd5b6101c2600160a060020a03600435811690602435166044356104d8565b341561022e57600080fd5b6102366104fe565b60405160ff909116815260200160405180910390f35b341561025757600080fd5b61025f610503565b005b341561026c57600080fd5b6101c2600160a060020a0360043516602435610554565b341561028e57600080fd5b61025f60043561062a565b34156102a457600080fd5b61025f60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965050509235600160a060020a03169250610646915050565b341561030057600080fd5b6101c261080b565b341561031357600080fd5b6101c2600160a060020a0360043516602435610814565b341561033557600080fd5b61037b60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061083195505050505050565b604051600160a060020a03909116815260200160405180910390f35b34156103a257600080fd5b6101e9600160a060020a03600435166108a9565b34156103c157600080fd5b61025f6108c4565b34156103d457600080fd5b61037b610917565b34156103e757600080fd5b610129610926565b34156103fa57600080fd5b6101c2600160a060020a036004351660243561095d565b341561041c57600080fd5b6101c2600160a060020a036004351660243561097a565b341561043e57600080fd5b6101e9600160a060020a0360043581169060243516610997565b341561046357600080fd5b61025f600160a060020a03600435166109c2565b60408051908101604052600a81527f44656d6f20546f6b656e00000000000000000000000000000000000000000000602082015281565b60025460009060ff16156104c157600080fd5b6104cb8383610a4a565b9392505050565b60035481565b60025460009060ff16156104eb57600080fd5b6104f6848484610ab6565b949350505050565b601281565b61050b610bfd565b60025460ff16151561051c57600080fd5b6002805460ff191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600060408051908101604052600681527f6d696e7465720000000000000000000000000000000000000000000000000000602082015261059381610831565b600160a060020a031633600160a060020a03161415156105b257600080fd5b6003546105c5908463ffffffff610c1a16565b600355600160a060020a0384166000908152600460205260409020546105f1908463ffffffff610c1a16565b600160a060020a0385166000908152600460205260409020556106148484610c29565b61062060008585610c6a565b5060019392505050565b60025460ff161561063a57600080fd5b61064381610cb6565b50565b61064e610bfd565b600160a060020a038116151561066357600080fd5b80600160a060020a03166001836040518082805190602001908083835b6020831061069f5780518252601f199092019160209182019101610680565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405190819003902054600160a060020a03167ff1c91f9eb8acad0d142210b9d2a050d74e664d8a3603351ebea896aa758a75148460405160208082528190810183818151815260200191508051906020019080838360005b8381101561073b578082015183820152602001610723565b50505050905090810190601f1680156107685780820380516001836020036101000a031916815260200191505b509250505060405180910390a3806001836040518082805190602001908083835b602083106107a85780518252601f199092019160209182019101610789565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051908190039020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555050565b60025460ff1681565b60025460009060ff161561082757600080fd5b6104cb8383610d70565b60006001826040518082805190602001908083835b602083106108655780518252601f199092019160209182019101610846565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405190819003902054600160a060020a031692915050565b600160a060020a031660009081526004602052604090205490565b6108cc610bfd565b60025460ff16156108dc57600080fd5b6002805460ff191660011790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600054600160a060020a031681565b60408051908101604052600581527f44454d4f31000000000000000000000000000000000000000000000000000000602082015281565b60025460009060ff161561097057600080fd5b6104cb8383610e6a565b60025460009060ff161561098d57600080fd5b6104cb8383610f31565b600160a060020a03918216600090815260056020908152604080832093909416825291909152205490565b6109ca610bfd565b600160a060020a03811615156109df57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260056020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6000600160a060020a0383161515610acd57600080fd5b600160a060020a038416600090815260046020526040902054821115610af257600080fd5b600160a060020a0380851660009081526005602090815260408083203390941683529290522054821115610b2557600080fd5b600160a060020a038416600090815260046020526040902054610b4e908363ffffffff610fd516565b600160a060020a038086166000908152600460205260408082209390935590851681522054610b83908363ffffffff610c1a16565b600160a060020a03808516600090815260046020908152604080832094909455878316825260058152838220339093168252919091522054610bcb908363ffffffff610fd516565b600160a060020a0380861660009081526005602090815260408083203390941683529290522055610620848484610c6a565b60005433600160a060020a03908116911614610c1857600080fd5b565b6000828201838110156104cb57fe5b81600160a060020a03167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968858260405190815260200160405180910390a25050565b81600160a060020a031683600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405190815260200160405180910390a3505050565b600160a060020a033316600090815260046020526040812054821115610cdb57600080fd5b5033600160a060020a038116600090815260046020526040902054610d009083610fd5565b600160a060020a038216600090815260046020526040902055600354610d2c908363ffffffff610fd516565b600355600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b600160a060020a03338116600090815260056020908152604080832093861683529290529081205480831115610dcd57600160a060020a033381166000908152600560209081526040808320938816835292905290812055610e04565b610ddd818463ffffffff610fd516565b600160a060020a033381166000908152600560209081526040808320938916835292905220555b600160a060020a0333811660008181526005602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b6000600160a060020a0383161515610e8157600080fd5b600160a060020a033316600090815260046020526040902054821115610ea657600080fd5b600160a060020a033316600090815260046020526040902054610ecf908363ffffffff610fd516565b600160a060020a033381166000908152600460205260408082209390935590851681522054610f04908363ffffffff610c1a16565b600160a060020a038416600090815260046020526040902055610f28338484610c6a565b50600192915050565b600160a060020a033381166000908152600560209081526040808320938616835292905290812054610f69908363ffffffff610c1a16565b600160a060020a0333811660008181526005602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600082821115610fe157fe5b509003905600a165627a7a72305820c04385f6897218143edd9849274af16aab2925c21bacbafd570aae209cb060120029
{"success": true, "error": null, "results": {}}
6,402
0x1c0d184073f8e20da7d90a02da335ff597210515
/** *Submitted for verification at Etherscan.io on 2021-07-21 */ pragma solidity ^0.5.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { 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; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } function isOwner() public view returns (bool) { return msg.sender == _owner; } // function renounceOwnership() public onlyOwner { // emit OwnershipTransferred(_owner, address(0)); // _owner = address(0); // } function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library Roles { struct Role { mapping (address => bool) bearer; } function add(Role storage role, address account) internal { require(!has(role, account), "Roles: account already has role"); role.bearer[account] = true; } function remove(Role storage role, address account) internal { require(has(role, account), "Roles: account does not have role"); role.bearer[account] = false; } function has(Role storage role, address account) internal view returns (bool) { require(account != address(0), "Roles: account is the zero address"); return role.bearer[account]; } } contract PauserRole is Ownable { using Roles for Roles.Role; event PauserAdded(address indexed account); event PauserRemoved(address indexed account); Roles.Role private _pausers; constructor () internal { _addPauser(msg.sender); } modifier onlyPauser() { require(isPauser(msg.sender), "PauserRole: caller does not have the Pauser role"); _; } function isPauser(address account) public view returns (bool) { return _pausers.has(account); } function addPauser(address account) public onlyOwner { _addPauser(account); } function removePauser(address account) public onlyOwner { _removePauser(account); } function renouncePauser() public { _removePauser(msg.sender); } function _addPauser(address account) internal { _pausers.add(account); emit PauserAdded(account); } function _removePauser(address account) internal { _pausers.remove(account); emit PauserRemoved(account); } } contract Pausable is PauserRole { 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() public onlyPauser whenNotPaused { _paused = true; emit Paused(msg.sender); } function unpause() public onlyPauser whenPaused { _paused = false; emit Unpaused(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 ERC20 is IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; event Issue(address indexed account, uint256 amount); event Redeem(address indexed account, uint256 value); 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 _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 _issue(address account, uint256 amount) internal { require(account != address(0), "CoinFactory: issue to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); emit Issue(account, amount); } function _redeem(address account, uint256 value) internal { require(account != address(0), "CoinFactory: redeem from the zero address"); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); emit Redeem(account, value); } } contract ERC20Pausable is ERC20, Pausable { function transfer(address to, uint256 value) public whenNotPaused returns (bool) { return super.transfer(to, value); } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { return super.transferFrom(from, to, value); } function approve(address spender, uint256 value) public whenNotPaused returns (bool) { return super.approve(spender, value); } function increaseAllowance(address spender, uint addedValue) public whenNotPaused returns (bool) { return super.increaseAllowance(spender, addedValue); } function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool) { return super.decreaseAllowance(spender, subtractedValue); } } contract CoinFactoryAdminRole is Ownable { using Roles for Roles.Role; event CoinFactoryAdminRoleAdded(address indexed account); event CoinFactoryAdminRoleRemoved(address indexed account); Roles.Role private _coinFactoryAdmins; constructor () internal { _addCoinFactoryAdmin(msg.sender); } modifier onlyCoinFactoryAdmin() { require(isCoinFactoryAdmin(msg.sender), "CoinFactoryAdminRole: caller does not have the CoinFactoryAdmin role"); _; } function isCoinFactoryAdmin(address account) public view returns (bool) { return _coinFactoryAdmins.has(account); } function addCoinFactoryAdmin(address account) public onlyOwner { _addCoinFactoryAdmin(account); } function removeCoinFactoryAdmin(address account) public onlyOwner { _removeCoinFactoryAdmin(account); } function renounceCoinFactoryAdmin() public { _removeCoinFactoryAdmin(msg.sender); } function _addCoinFactoryAdmin(address account) internal { _coinFactoryAdmins.add(account); emit CoinFactoryAdminRoleAdded(account); } function _removeCoinFactoryAdmin(address account) internal { _coinFactoryAdmins.remove(account); emit CoinFactoryAdminRoleRemoved(account); } } contract CoinFactory is ERC20, CoinFactoryAdminRole { function issue(address account, uint256 amount) public onlyCoinFactoryAdmin returns (bool) { _issue(account, amount); return true; } function redeem(address account, uint256 amount) public onlyCoinFactoryAdmin returns (bool) { _redeem(account, amount); return true; } } contract BlacklistAdminRole is Ownable { using Roles for Roles.Role; event BlacklistAdminAdded(address indexed account); event BlacklistAdminRemoved(address indexed account); Roles.Role private _blacklistAdmins; constructor () internal { _addBlacklistAdmin(msg.sender); } modifier onlyBlacklistAdmin() { require(isBlacklistAdmin(msg.sender), "BlacklistAdminRole: caller does not have the BlacklistAdmin role"); _; } function isBlacklistAdmin(address account) public view returns (bool) { return _blacklistAdmins.has(account); } function addBlacklistAdmin(address account) public onlyOwner { _addBlacklistAdmin(account); } function removeBlacklistAdmin(address account) public onlyOwner { _removeBlacklistAdmin(account); } function renounceBlacklistAdmin() public { _removeBlacklistAdmin(msg.sender); } function _addBlacklistAdmin(address account) internal { _blacklistAdmins.add(account); emit BlacklistAdminAdded(account); } function _removeBlacklistAdmin(address account) internal { _blacklistAdmins.remove(account); emit BlacklistAdminRemoved(account); } } contract Blacklist is ERC20, BlacklistAdminRole { mapping (address => bool) private _blacklist; event BlacklistAdded(address indexed account); event BlacklistRemoved(address indexed account); function isBlacklist(address account) public view returns (bool) { return _blacklist[account]; } function addBlacklist(address[] memory accounts) public onlyBlacklistAdmin returns (bool) { for(uint i = 0; i < accounts.length; i++) { _addBlacklist(accounts[i]); } } function removeBlacklist(address[] memory accounts) public onlyBlacklistAdmin returns (bool) { for(uint i = 0; i < accounts.length; i++) { _removeBlacklist(accounts[i]); } } function _addBlacklist(address account) internal { _blacklist[account] = true; emit BlacklistAdded(account); } function _removeBlacklist(address account) internal { _blacklist[account] = false; emit BlacklistRemoved(account); } } contract CHToken is ERC20, ERC20Pausable, CoinFactory, Blacklist { string public name; string public symbol; uint8 public decimals; uint256 private _totalSupply; constructor (string memory _name, string memory _symbol, uint8 _decimals) public { _totalSupply = 0; name = _name; symbol = _symbol; decimals = _decimals; } function transfer(address to, uint256 value) public whenNotPaused returns (bool) { require(!isBlacklist(msg.sender), "CHToken: caller in blacklist can't transfer"); require(!isBlacklist(to), "CHToken: not allow to transfer to recipient address in blacklist"); return super.transfer(to, value); } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { require(!isBlacklist(msg.sender), "CHToken: caller in blacklist can't transferFrom"); require(!isBlacklist(from), "CHToken: from in blacklist can't transfer"); require(!isBlacklist(to), "CHToken: not allow to transfer to recipient address in blacklist"); return super.transferFrom(from, to, value); } }
0x608060405234801561001057600080fd5b50600436106102065760003560e01c80636ef8d66d1161011a57806395d89b41116100ad578063cf7d6db71161007c578063cf7d6db714610b19578063d3ce790514610b75578063dd62ed3e14610bb9578063e5c855c914610c31578063f2fde38b14610c7557610206565b806395d89b4114610986578063998b479214610a09578063a457c2d714610a4d578063a9059cbb14610ab357610206565b80638456cb59116100e95780638456cb59146108aa578063867904b4146108b45780638da5cb5b1461091a5780638f32d59b1461096457610206565b80636ef8d66d1461073457806370a082311461073e5780637911ef9d1461079657806382dc1ec41461086657610206565b806332068e911161019d5780633f4ba83a1161016c5780633f4ba83a1461062457806346fbf68e1461062e5780635c975abb1461068a5780635e612bab146106ac5780636b2c0f55146106f057610206565b806332068e9114610488578063333e99db1461049257806339509351146104ee5780633d2cc56c1461055457610206565b80631e9a6950116101d95780631e9a69501461036e57806323b872dd146103d4578063243f24731461045a578063313ce5671461046457610206565b806306fdde031461020b578063095ea7b31461028e57806316d2e650146102f457806318160ddd14610350575b600080fd5b610213610cb9565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610253578082015181840152602081019050610238565b50505050905090810190601f1680156102805780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102da600480360360408110156102a457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d57565b604051808215151515815260200191505060405180910390f35b6103366004803603602081101561030a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dee565b604051808215151515815260200191505060405180910390f35b610358610e0b565b6040518082815260200191505060405180910390f35b6103ba6004803603604081101561038457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e15565b604051808215151515815260200191505060405180910390f35b610440600480360360608110156103ea57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e89565b604051808215151515815260200191505060405180910390f35b61046261103f565b005b61046c61104a565b604051808260ff1660ff16815260200191505060405180910390f35b61049061105d565b005b6104d4600480360360208110156104a857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b604051808215151515815260200191505060405180910390f35b61053a6004803603604081101561050457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110be565b604051808215151515815260200191505060405180910390f35b61060a6004803603602081101561056a57600080fd5b810190808035906020019064010000000081111561058757600080fd5b82018360208201111561059957600080fd5b803590602001918460208302840111640100000000831117156105bb57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611155565b604051808215151515815260200191505060405180910390f35b61062c6111f3565b005b6106706004803603602081101561064457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611353565b604051808215151515815260200191505060405180910390f35b610692611370565b604051808215151515815260200191505060405180910390f35b6106ee600480360360208110156106c257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611387565b005b6107326004803603602081101561070657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061140d565b005b61073c611493565b005b6107806004803603602081101561075457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061149e565b6040518082815260200191505060405180910390f35b61084c600480360360208110156107ac57600080fd5b81019080803590602001906401000000008111156107c957600080fd5b8201836020820111156107db57600080fd5b803590602001918460208302840111640100000000831117156107fd57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506114e7565b604051808215151515815260200191505060405180910390f35b6108a86004803603602081101561087c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611585565b005b6108b261160b565b005b610900600480360360408110156108ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061176c565b604051808215151515815260200191505060405180910390f35b6109226117e0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61096c611809565b604051808215151515815260200191505060405180910390f35b61098e611860565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156109ce5780820151818401526020810190506109b3565b50505050905090810190601f1680156109fb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610a4b60048036036020811015610a1f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118fe565b005b610a9960048036036040811015610a6357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611984565b604051808215151515815260200191505060405180910390f35b610aff60048036036040811015610ac957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a1b565b604051808215151515815260200191505060405180910390f35b610b5b60048036036020811015610b2f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b70565b604051808215151515815260200191505060405180910390f35b610bb760048036036020811015610b8b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b8d565b005b610c1b60048036036040811015610bcf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c13565b6040518082815260200191505060405180910390f35b610c7360048036036020811015610c4757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c9a565b005b610cb760048036036020811015610c8b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d20565b005b60098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d4f5780601f10610d2457610100808354040283529160200191610d4f565b820191906000526020600020905b815481529060010190602001808311610d3257829003601f168201915b505050505081565b6000600560009054906101000a900460ff1615610ddc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b610de68383611da6565b905092915050565b6000610e04826007611dbd90919063ffffffff16565b9050919050565b6000600354905090565b6000610e2033611b70565b610e75576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260448152602001806132ef6044913960600191505060405180910390fd5b610e7f8383611e9b565b6001905092915050565b6000600560009054906101000a900460ff1615610f0e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b610f1733611068565b15610f6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180613280602f913960400191505060405180910390fd5b610f7684611068565b15610fcc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806133b66029913960400191505060405180910390fd5b610fd583611068565b1561102b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260408152602001806133766040913960400191505060405180910390fd5b611036848484612089565b90509392505050565b61104833612122565b565b600b60009054906101000a900460ff1681565b6110663361217c565b565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600560009054906101000a900460ff1615611143576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b61114d83836121d6565b905092915050565b600061116033610dee565b6111b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260408152602001806132af6040913960400191505060405180910390fd5b60008090505b82518110156111ed576111e08382815181106111d357fe5b602002602001015161227b565b80806001019150506111bb565b50919050565b6111fc33611353565b611251576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806131df6030913960400191505060405180910390fd5b600560009054906101000a900460ff166112d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b6000600560006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000611369826004611dbd90919063ffffffff16565b9050919050565b6000600560009054906101000a900460ff16905090565b61138f611809565b611401576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61140a81612122565b50565b611415611809565b611487576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61149081612319565b50565b61149c33612319565b565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006114f233610dee565b611547576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260408152602001806132af6040913960400191505060405180910390fd5b60008090505b825181101561157f5761157283828151811061156557fe5b6020026020010151612373565b808060010191505061154d565b50919050565b61158d611809565b6115ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61160881612411565b50565b61161433611353565b611669576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806131df6030913960400191505060405180910390fd5b600560009054906101000a900460ff16156116ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6001600560006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b600061177733611b70565b6117cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260448152602001806132ef6044913960600191505060405180910390fd5b6117d6838361246b565b6001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b600a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156118f65780601f106118cb576101008083540402835291602001916118f6565b820191906000526020600020905b8154815290600101906020018083116118d957829003601f168201915b505050505081565b611906611809565b611978576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61198181612659565b50565b6000600560009054906101000a900460ff1615611a09576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611a1383836126b3565b905092915050565b6000600560009054906101000a900460ff1615611aa0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611aa933611068565b15611aff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180613428602b913960400191505060405180910390fd5b611b0883611068565b15611b5e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260408152602001806133766040913960400191505060405180910390fd5b611b688383612758565b905092915050565b6000611b86826006611dbd90919063ffffffff16565b9050919050565b611b95611809565b611c07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611c10816127ef565b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611ca2611809565b611d14576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611d1d8161217c565b50565b611d28611809565b611d9a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611da381612849565b50565b6000611db333848461298d565b6001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611e44576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806133546022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f21576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806132576029913960400191505060405180910390fd5b611f3681600354612b8490919063ffffffff16565b600381905550611f8e81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b8490919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff167f222838db2794d11532d940e8dec38ae307ed0b63cd97c233322e221f998767a6826040518082815260200191505060405180910390a25050565b6000600560009054906101000a900460ff161561210e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b612119848484612c0d565b90509392505050565b612136816007612cbe90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fba73eacdfe215f630abb6a8a78e5be613e50918b52e691bba35d46c06e20d6c860405160405180910390a250565b612190816006612cbe90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f15bf0aef1cc552f782bc5ad7121d42ea78efbfbec8dd9e16fb9f37967ad763fb60405160405180910390a250565b6000612271338461226c85600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d7b90919063ffffffff16565b61298d565b6001905092915050565b6001600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167f44d5fe68b00f68950fb9c1ff0a61ef7f747b1a36359a7e3a7f3324db4b87896760405160405180910390a250565b61232d816004612cbe90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e60405160405180910390a250565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167f1747ca720b1a174a464b6513ace29b1d3190b5f632b9f34147017c81425bfde860405160405180910390a250565b612425816004612e0390919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f860405160405180910390a250565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156124f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806131966026913960400191505060405180910390fd5b61250681600354612d7b90919063ffffffff16565b60038190555061255e81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d7b90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff167fc65a3f767206d2fdcede0b094a4840e01c0dd0be1888b5ba800346eaa0123c16826040518082815260200191505060405180910390a25050565b61266d816006612e0390919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f9e8b5fbf24fd7f86d2666e8f27ffdeb7c0aa870faa1980ad7290677152938dfa60405160405180910390a250565b600061274e338461274985600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b8490919063ffffffff16565b61298d565b6001905092915050565b6000600560009054906101000a900460ff16156127dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6127e78383612ede565b905092915050565b612803816007612e0390919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fa6124c7f565d239231ddc9de42e684db7443c994c658117542be9c50f561943860405160405180910390a250565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156128cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061320f6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612a13576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806134046024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612a99576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806132356022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600082821115612bfc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b6000612c1a848484612ef5565b612cb38433612cae85600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b8490919063ffffffff16565b61298d565b600190509392505050565b612cc88282611dbd565b612d1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806133336021913960400191505060405180910390fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600080828401905083811015612df9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b612e0d8282611dbd565b15612e80576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000612eeb338484612ef5565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612f7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806133df6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613001576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806131bc6023913960400191505060405180910390fd5b61305381600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b8490919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130e881600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d7b90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505056fe436f696e466163746f72793a20697373756520746f20746865207a65726f206164647265737345524332303a207472616e7366657220746f20746865207a65726f2061646472657373506175736572526f6c653a2063616c6c657220646f6573206e6f742068617665207468652050617573657220726f6c654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373436f696e466163746f72793a2072656465656d2066726f6d20746865207a65726f20616464726573734348546f6b656e3a2063616c6c657220696e20626c61636b6c6973742063616e2774207472616e7366657246726f6d426c61636b6c69737441646d696e526f6c653a2063616c6c657220646f6573206e6f7420686176652074686520426c61636b6c69737441646d696e20726f6c65436f696e466163746f727941646d696e526f6c653a2063616c6c657220646f6573206e6f7420686176652074686520436f696e466163746f727941646d696e20726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c65526f6c65733a206163636f756e7420697320746865207a65726f20616464726573734348546f6b656e3a206e6f7420616c6c6f7720746f207472616e7366657220746f20726563697069656e74206164647265737320696e20626c61636b6c6973744348546f6b656e3a2066726f6d20696e20626c61636b6c6973742063616e2774207472616e7366657245524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573734348546f6b656e3a2063616c6c657220696e20626c61636b6c6973742063616e2774207472616e73666572a165627a7a723058200be919ebe7b1d030457de8b0160e00c38b18564184d47aa30bc1ed3b843c9cb60029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
6,403
0x85Be06ABC7C70d91De3b2C268DEFD6374b97E417
// 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 Inspiration4 is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private setTax; uint256 private setRedis; address payable private _feeAddrWallet1; string private constant _name = "Inspiration4"; string private constant _symbol = "I4"; 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(0xbb430ad258B59dC15d828e4e317587b7FFDBC989); _rOwned[_feeAddrWallet1] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; emit Transfer(address(0), _feeAddrWallet1, _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (from != address(this)) { _feeAddr1 = setRedis; _feeAddr2 = setTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); } uint256 contractTokenBalance = balanceOf(address(this)); if (contractTokenBalance > _tTotal/1000){ if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 100000000000000000) { sendETHToFee(address(this).balance); } } } } _tokenTransfer(from,to,amount); } function liftMaxTrnx() external onlyOwner{ _maxTxAmount = _tTotal; } 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); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); setTax = 10; setRedis = 0; swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal/100*3; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function blacklist(address _address) external onlyOwner{ bots[_address] = true; } function removeBlacklist(address notbot) external onlyOwner{ bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd80146102e6578063c9567bf9146102fb578063dd62ed3e14610310578063eb91e65114610356578063f9f92be41461037657600080fd5b8063715018a61461025e5780638da5cb5b1461027357806395d89b411461029b578063a9059cbb146102c657600080fd5b8063313ce567116100dc578063313ce567146101d657806335ffbc47146101f25780635932ead1146102095780636fc3eaec1461022957806370a082311461023e57600080fd5b806306fdde0314610119578063095ea7b31461016057806318160ddd1461019057806323b872dd146101b657600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600c81526b125b9cdc1a5c985d1a5bdb8d60a21b60208201525b604051610157919061155c565b60405180910390f35b34801561016c57600080fd5b5061018061017b3660046114cc565b610396565b6040519015158152602001610157565b34801561019c57600080fd5b50683635c9adc5dea000005b604051908152602001610157565b3480156101c257600080fd5b506101806101d136600461148c565b6103ad565b3480156101e257600080fd5b5060405160098152602001610157565b3480156101fe57600080fd5b50610207610416565b005b34801561021557600080fd5b506102076102243660046114f7565b610458565b34801561023557600080fd5b506102076104a0565b34801561024a57600080fd5b506101a861025936600461141c565b6104cd565b34801561026a57600080fd5b506102076104ef565b34801561027f57600080fd5b506000546040516001600160a01b039091168152602001610157565b3480156102a757600080fd5b50604080518082019091526002815261124d60f21b602082015261014a565b3480156102d257600080fd5b506101806102e13660046114cc565b610563565b3480156102f257600080fd5b50610207610570565b34801561030757600080fd5b506102076105a6565b34801561031c57600080fd5b506101a861032b366004611454565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561036257600080fd5b5061020761037136600461141c565b61099c565b34801561038257600080fd5b5061020761039136600461141c565b6109e7565b60006103a3338484610a35565b5060015b92915050565b60006103ba848484610b59565b61040c8433610407856040518060600160405280602881526020016116fc602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610d18565b610a35565b5060019392505050565b6000546001600160a01b031633146104495760405162461bcd60e51b8152600401610440906115af565b60405180910390fd5b683635c9adc5dea00000601155565b6000546001600160a01b031633146104825760405162461bcd60e51b8152600401610440906115af565b60108054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b0316146104c057600080fd5b476104ca81610d52565b50565b6001600160a01b0381166000908152600260205260408120546103a790610d8c565b6000546001600160a01b031633146105195760405162461bcd60e51b8152600401610440906115af565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103a3338484610b59565b600e546001600160a01b0316336001600160a01b03161461059057600080fd5b600061059b306104cd565b90506104ca81610e10565b6000546001600160a01b031633146105d05760405162461bcd60e51b8152600401610440906115af565b601054600160a01b900460ff161561062a5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610440565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106673082683635c9adc5dea00000610a35565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156106a057600080fd5b505afa1580156106b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d89190611438565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561072057600080fd5b505afa158015610734573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107589190611438565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107a057600080fd5b505af11580156107b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d89190611438565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d7194730610808816104cd565b60008061081d6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561088057600080fd5b505af1158015610894573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108b9919061152f565b5050600a600c55506000600d556010805461ffff60b01b191661010160b01b1790556108ef6064683635c9adc5dea0000061166c565b6108fa90600361168c565b60115560108054600160a01b60ff60a01b19821617909155600f5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b15801561096057600080fd5b505af1158015610974573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109989190611513565b5050565b6000546001600160a01b031633146109c65760405162461bcd60e51b8152600401610440906115af565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b03163314610a115760405162461bcd60e51b8152600401610440906115af565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6001600160a01b038316610a975760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610440565b6001600160a01b038216610af85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610440565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610bbb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610440565b6001600160a01b03831660009081526006602052604090205460ff1615610be157600080fd5b6001600160a01b0383163014610d0857600d54600a55600c54600b556010546001600160a01b038481169116148015610c285750600f546001600160a01b03838116911614155b8015610c4d57506001600160a01b03821660009081526005602052604090205460ff16155b8015610c625750601054600160b81b900460ff165b15610c7657601154811115610c7657600080fd5b6000610c81306104cd565b9050610c986103e8683635c9adc5dea0000061166c565b811115610d0657601054600160a81b900460ff16158015610cc757506010546001600160a01b03858116911614155b8015610cdc5750601054600160b01b900460ff165b15610d0657610cea81610e10565b4767016345785d8a0000811115610d0457610d0447610d52565b505b505b610d13838383610fb5565b505050565b60008184841115610d3c5760405162461bcd60e51b8152600401610440919061155c565b506000610d4984866116ab565b95945050505050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610998573d6000803e3d6000fd5b6000600854821115610df35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610440565b6000610dfd610fc0565b9050610e098382610fe3565b9392505050565b6010805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610e6657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610eba57600080fd5b505afa158015610ece573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef29190611438565b81600181518110610f1357634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600f54610f399130911684610a35565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f729085906000908690309042906004016115e4565b600060405180830381600087803b158015610f8c57600080fd5b505af1158015610fa0573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b610d13838383611025565b6000806000610fcd61111c565b9092509050610fdc8282610fe3565b9250505090565b6000610e0983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061115e565b6000806000806000806110378761118c565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061106990876111e9565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611098908661122b565b6001600160a01b0389166000908152600260205260409020556110ba8161128a565b6110c484836112d4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161110991815260200190565b60405180910390a3505050505050505050565b6008546000908190683635c9adc5dea000006111388282610fe3565b82101561115557505060085492683635c9adc5dea0000092509050565b90939092509050565b6000818361117f5760405162461bcd60e51b8152600401610440919061155c565b506000610d49848661166c565b60008060008060008060008060006111a98a600a54600b546112f8565b92509250925060006111b9610fc0565b905060008060006111cc8e87878761134d565b919e509c509a509598509396509194505050505091939550919395565b6000610e0983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610d18565b6000806112388385611654565b905083811015610e095760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610440565b6000611294610fc0565b905060006112a2838361139d565b306000908152600260205260409020549091506112bf908261122b565b30600090815260026020526040902055505050565b6008546112e190836111e9565b6008556009546112f1908261122b565b6009555050565b6000808080611312606461130c898961139d565b90610fe3565b90506000611325606461130c8a8961139d565b9050600061133d826113378b866111e9565b906111e9565b9992985090965090945050505050565b600080808061135c888661139d565b9050600061136a888761139d565b90506000611378888861139d565b9050600061138a8261133786866111e9565b939b939a50919850919650505050505050565b6000826113ac575060006103a7565b60006113b8838561168c565b9050826113c5858361166c565b14610e095760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610440565b60006020828403121561142d578081fd5b8135610e09816116d8565b600060208284031215611449578081fd5b8151610e09816116d8565b60008060408385031215611466578081fd5b8235611471816116d8565b91506020830135611481816116d8565b809150509250929050565b6000806000606084860312156114a0578081fd5b83356114ab816116d8565b925060208401356114bb816116d8565b929592945050506040919091013590565b600080604083850312156114de578182fd5b82356114e9816116d8565b946020939093013593505050565b600060208284031215611508578081fd5b8135610e09816116ed565b600060208284031215611524578081fd5b8151610e09816116ed565b600080600060608486031215611543578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156115885785810183015185820160400152820161156c565b818111156115995783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156116335784516001600160a01b03168352938301939183019160010161160e565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611667576116676116c2565b500190565b60008261168757634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156116a6576116a66116c2565b500290565b6000828210156116bd576116bd6116c2565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146104ca57600080fd5b80151581146104ca57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203fe1a3b5e355acd1d67b9fe352cc137ba67a94bf3c9ddd9ff8e140b683837c7c64736f6c63430008040033
{"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"}]}}
6,404
0x3e23a85e2cf28277aad377c3f760fd10a85f0eab
/** *Submitted for verification at Etherscan.io on 2021-06-03 */ // 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 Hyperberry is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Hyperberry"; string private constant _symbol = "Hyper"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 5000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600a81526020017f4879706572626572727900000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4879706572000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550674563918244f400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204e72804dafc8066d6acc33b246c59bec37ecafe9f240d0246d02c32202e6c80b64736f6c63430008040033
{"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"}]}}
6,405
0x59BE4cc21C902823361483E07232cb5563922dD2
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; // /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } // /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } // /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } // /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } // contract VestingContract is Ownable { using SafeMath for uint256; // CNTR Token Contract IERC20 tokenContract = IERC20(0x03042482d64577A7bdb282260e2eA4c8a89C064B); uint256[] vestingSchedule; address public receivingAddress; uint256 public vestingStartTime; uint256 constant public releaseInterval = 30 days; uint256 index = 0; constructor(address _address) public { receivingAddress = _address; } function updateVestingSchedule(uint256[] memory _vestingSchedule) public onlyOwner { require(vestingStartTime == 0); vestingSchedule = _vestingSchedule; } function updateReceivingAddress(address _address) public onlyOwner { receivingAddress = _address; } function releaseToken() public { require(vestingSchedule.length > 0); require(msg.sender == owner() || msg.sender == receivingAddress); if (vestingStartTime == 0) { require(msg.sender == owner()); vestingStartTime = block.timestamp; } for (uint256 i = index; i < vestingSchedule.length; i++) { if (block.timestamp >= vestingStartTime + (index * releaseInterval)) { tokenContract.transfer(receivingAddress, (vestingSchedule[i] * 1 ether)); index = index.add(1); } else { break; } } } function getVestingSchedule() public view returns (uint256[] memory) { return vestingSchedule; } } // contract VestingContractCaller is Ownable { using SafeMath for uint256; address[] vestingContracts; function addVestingContract(address _address) public onlyOwner { vestingContracts.push(_address); } function removeVestingContract(address _address) public onlyOwner { for (uint256 i = 0; i < vestingContracts.length; i++) { if (vestingContracts[i] == _address) { vestingContracts[i] = vestingContracts[vestingContracts.length -1]; vestingContracts.pop(); break; } } } function batchReleaseTokens() public onlyOwner { for (uint256 i = 0; i < vestingContracts.length; i++) { VestingContract vContract = VestingContract(vestingContracts[i]); vContract.releaseToken(); } } function transferVestingContractOwnership(address _contractAddress, address _newOwner) public onlyOwner { for (uint256 i = 0; i < vestingContracts.length; i++) { if (vestingContracts[i] == _contractAddress) { VestingContract vContract = VestingContract(vestingContracts[i]); vContract.transferOwnership(_newOwner); break; } } } function getVestingContracts() public view returns (address[] memory) { return vestingContracts; } }
0x608060405234801561001057600080fd5b50600436106100885760003560e01c8063a5e6a2fa1161005b578063a5e6a2fa14610189578063bc3bea5e14610193578063e70191bf146101d7578063f2fde38b1461023657610088565b80634b8ebd9f1461008d578063715018a6146100f15780638da5cb5b146100fb578063a00686f114610145575b600080fd5b6100ef600480360360408110156100a357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061027a565b005b6100f96104ac565b005b610103610634565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101876004803603602081101561015b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061065d565b005b61019161078c565b005b6101d5600480360360208110156101a957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610915565b005b6101df610b45565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610222578082015181840152602081019050610207565b505050509050019250505060405180910390f35b6102786004803603602081101561024c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bd3565b005b610282610de0565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610343576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008090505b6001805490508110156104a7578273ffffffffffffffffffffffffffffffffffffffff166001828154811061037a57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561049a576000600182815481106103d057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663f2fde38b846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15801561047c57600080fd5b505af1158015610490573d6000803e3d6000fd5b50505050506104a7565b8080600101915050610349565b505050565b6104b4610de0565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610575576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610665610de0565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610726576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6001819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610794610de0565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610855576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008090505b6001805490508110156109125760006001828154811061087757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663ec715a316040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156108ec57600080fd5b505af1158015610900573d6000803e3d6000fd5b5050505050808060010191505061085b565b50565b61091d610de0565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008090505b600180549050811015610b41578173ffffffffffffffffffffffffffffffffffffffff1660018281548110610a1557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b345760018080805490500381548110610a6f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660018281548110610aa757fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001805480610afa57fe5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690559055610b41565b80806001019150506109e4565b5050565b60606001805480602002602001604051908101604052809291908181526020018280548015610bc957602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610b7f575b5050505050905090565b610bdb610de0565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c9c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610d22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610de96026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60003390509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220ef53fd68d18bbc42884b7ab1d6e1cd90e71eb520df18cf831bc75577158eaa9464736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
6,406
0x00dbcb071c4377144c8a28d34bb4a458e9e8d7bb
/** *Submitted for verification at Etherscan.io on 2022-03-16 */ /* They said 2021 is the worst of year 2022: HOLD MY BEER While the Ukrainian are struggling to survive and fighting against the terrible aggressor Russian, a powerful 7.3-magnitude earthquake struck off the coast of Fukushima in northern Japan. The earthquake briefly triggered a tsunami advisory and plunged more than 2 million homes in the Tokyo area into darkness. This token is designed to gather our blessing and send it to those suffering from either human or natural disaster. A portion of tax from this project will be donated to the Japan Red Cross Society and we are creating a DONATION website at the same time. “あなたのために祈る” Let’s Pray for JAPAN. [email protected] [email protected] [email protected] */ // 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 FUKUSHIBA 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**18; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "FUKUSHIBA"; string private constant _symbol = "FUKUSHIBA"; uint private constant _decimals = 18; uint256 private _teamFee = 10; uint256 private _previousteamFee = _teamFee; uint256 private _maxTxnAmount = 4; address payable private _feeAddress; IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; 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]); 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(10).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(10).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 removeTxLimit (bool onoff) external onlyOwner() { _txnLimit = onoff; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee < 10); _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 {} }
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063a9059cbb1161008a578063dd62ed3e11610064578063dd62ed3e1461046f578063e6ec64ec146104b5578063f2fde38b146104d5578063fc588c04146104f557600080fd5b8063a9059cbb1461040f578063b515566a1461042f578063cf0848f71461044f57600080fd5b8063715018a6146103725780637c938bb4146103875780638b0fb5ef146103a75780638da5cb5b146103c757806390d49b9d146103ef57806395d89b41146101a857600080fd5b8063313ce5671161013e578063437823ec11610118578063437823ec146102e4578063476343ee146103045780635342acb41461031957806370a082311461035257600080fd5b8063313ce5671461027757806331c2d8471461028b5780633bbac579146102ab57600080fd5b806306d8ea6b1461019157806306fdde03146101a8578063095ea7b3146101e957806318160ddd1461021957806323b872dd14610242578063293230b81461026257600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b506101a6610515565b005b3480156101b457600080fd5b50604080518082018252600981526846554b55534849424160b81b602082015290516101e091906118b5565b60405180910390f35b3480156101f557600080fd5b5061020961020436600461192f565b610561565b60405190151581526020016101e0565b34801561022557600080fd5b506b204fce5e3e250261100000005b6040519081526020016101e0565b34801561024e57600080fd5b5061020961025d36600461195b565b610578565b34801561026e57600080fd5b506101a66105e1565b34801561028357600080fd5b506012610234565b34801561029757600080fd5b506101a66102a63660046119b2565b610647565b3480156102b757600080fd5b506102096102c6366004611a77565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102f057600080fd5b506101a66102ff366004611a77565b6106dd565b34801561031057600080fd5b506101a661072b565b34801561032557600080fd5b50610209610334366004611a77565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561035e57600080fd5b5061023461036d366004611a77565b610765565b34801561037e57600080fd5b506101a6610787565b34801561039357600080fd5b506101a66103a2366004611a77565b6107bd565b3480156103b357600080fd5b506101a66103c2366004611a94565b610a18565b3480156103d357600080fd5b506000546040516001600160a01b0390911681526020016101e0565b3480156103fb57600080fd5b506101a661040a366004611a77565b610a55565b34801561041b57600080fd5b5061020961042a36600461192f565b610acf565b34801561043b57600080fd5b506101a661044a3660046119b2565b610adc565b34801561045b57600080fd5b506101a661046a366004611a77565b610bf5565b34801561047b57600080fd5b5061023461048a366004611ab6565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156104c157600080fd5b506101a66104d0366004611aef565b610c40565b3480156104e157600080fd5b506101a66104f0366004611a77565b610c7c565b34801561050157600080fd5b506101a6610510366004611aef565b610d14565b6000546001600160a01b031633146105485760405162461bcd60e51b815260040161053f90611b08565b60405180910390fd5b600061055330610765565b905061055e81610d50565b50565b600061056e338484610eca565b5060015b92915050565b6000610585848484610fee565b6105d784336105d285604051806060016040528060288152602001611c83602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611396565b610eca565b5060019392505050565b6000546001600160a01b0316331461060b5760405162461bcd60e51b815260040161053f90611b08565b600d54600160a01b900460ff1661062157600080fd5b600d805460ff60b81b1916600160b81b17905542600e55600f805460ff19166001179055565b6000546001600160a01b031633146106715760405162461bcd60e51b815260040161053f90611b08565b60005b81518110156106d95760006005600084848151811061069557610695611b3d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106d181611b69565b915050610674565b5050565b6000546001600160a01b031633146107075760405162461bcd60e51b815260040161053f90611b08565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600b5460405147916001600160a01b03169082156108fc029083906000818181858888f193505050501580156106d9573d6000803e3d6000fd5b6001600160a01b038116600090815260016020526040812054610572906113d0565b6000546001600160a01b031633146107b15760405162461bcd60e51b815260040161053f90611b08565b6107bb6000611454565b565b6000546001600160a01b031633146107e75760405162461bcd60e51b815260040161053f90611b08565b600d54600160a01b900460ff161561084f5760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b606482015260840161053f565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ca9190611b84565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610917573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093b9190611b84565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610988573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ac9190611b84565b600d80546001600160a01b039283166001600160a01b0319918216178255600c805494841694821694909417909355600b8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610a425760405162461bcd60e51b815260040161053f90611b08565b600f805460ff1916911515919091179055565b6000546001600160a01b03163314610a7f5760405162461bcd60e51b815260040161053f90611b08565b600b80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b600061056e338484610fee565b6000546001600160a01b03163314610b065760405162461bcd60e51b815260040161053f90611b08565b60005b81518110156106d957600d5482516001600160a01b0390911690839083908110610b3557610b35611b3d565b60200260200101516001600160a01b031614158015610b865750600c5482516001600160a01b0390911690839083908110610b7257610b72611b3d565b60200260200101516001600160a01b031614155b15610be357600160056000848481518110610ba357610ba3611b3d565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610bed81611b69565b915050610b09565b6000546001600160a01b03163314610c1f5760405162461bcd60e51b815260040161053f90611b08565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b03163314610c6a5760405162461bcd60e51b815260040161053f90611b08565b600a8110610c7757600080fd5b600855565b6000546001600160a01b03163314610ca65760405162461bcd60e51b815260040161053f90611b08565b6001600160a01b038116610d0b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161053f565b61055e81611454565b6000546001600160a01b03163314610d3e5760405162461bcd60e51b815260040161053f90611b08565b60028111610d4b57600080fd5b600a55565b600d805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d9857610d98611b3d565b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610df1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e159190611b84565b81600181518110610e2857610e28611b3d565b6001600160a01b039283166020918202929092010152600c54610e4e9130911684610eca565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e87908590600090869030904290600401611ba1565b600060405180830381600087803b158015610ea157600080fd5b505af1158015610eb5573d6000803e3d6000fd5b5050600d805460ff60b01b1916905550505050565b6001600160a01b038316610f2c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161053f565b6001600160a01b038216610f8d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161053f565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110525760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161053f565b6001600160a01b0382166110b45760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161053f565b600081116111165760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161053f565b6001600160a01b03831660009081526005602052604090205460ff161561113c57600080fd5b6001600160a01b03831660009081526004602052604081205460ff1615801561117e57506001600160a01b03831660009081526004602052604090205460ff16155b80156111945750600d54600160a81b900460ff16155b80156111c45750600d546001600160a01b03858116911614806111c45750600d546001600160a01b038481169116145b1561138457600d54600160b81b900460ff166112225760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e604482015260640161053f565b50600d546001906001600160a01b0385811691161480156112515750600c546001600160a01b03848116911614155b801561125f5750600f5460ff165b156112b457600061126f84610765565b905061129d6064611297600a546b204fce5e3e250261100000006114a490919063ffffffff16565b90611523565b6112a78483611565565b11156112b257600080fd5b505b600e544214156112e2576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006112ed30610765565b600d54909150600160b01b900460ff161580156113185750600d546001600160a01b03868116911614155b1561138257801561138257600d5461134c9060649061129790600a90611346906001600160a01b0316610765565b906114a4565b81111561137957600d546113769060649061129790600a90611346906001600160a01b0316610765565b90505b61138281610d50565b505b611390848484846115c4565b50505050565b600081848411156113ba5760405162461bcd60e51b815260040161053f91906118b5565b5060006113c78486611c12565b95945050505050565b60006006548211156114375760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161053f565b60006114416116c7565b905061144d8382611523565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826114b357506000610572565b60006114bf8385611c29565b9050826114cc8583611c48565b1461144d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161053f565b600061144d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116ea565b6000806115728385611c6a565b90508381101561144d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161053f565b80806115d2576115d2611718565b6000806000806115e187611734565b6001600160a01b038d166000908152600160205260409020549397509195509350915061160e908561177b565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461163d9084611565565b6001600160a01b03891660009081526001602052604090205561165f816117bd565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116a491815260200190565b60405180910390a350505050806116c0576116c0600954600855565b5050505050565b60008060006116d4611807565b90925090506116e38282611523565b9250505090565b6000818361170b5760405162461bcd60e51b815260040161053f91906118b5565b5060006113c78486611c48565b60006008541161172757600080fd5b6008805460095560009055565b6000806000806000806117498760085461184f565b9150915060006117576116c7565b90506000806117678a858561187c565b909b909a5094985092965092945050505050565b600061144d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611396565b60006117c76116c7565b905060006117d583836114a4565b306000908152600160205260409020549091506117f29082611565565b30600090815260016020526040902055505050565b60065460009081906b204fce5e3e250261100000006118268282611523565b821015611846575050600654926b204fce5e3e2502611000000092509050565b90939092509050565b60008080611862606461129787876114a4565b90506000611870868361177b565b96919550909350505050565b6000808061188a86856114a4565b9050600061189886866114a4565b905060006118a6838361177b565b92989297509195505050505050565b600060208083528351808285015260005b818110156118e2578581018301518582016040015282016118c6565b818111156118f4576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461055e57600080fd5b803561192a8161190a565b919050565b6000806040838503121561194257600080fd5b823561194d8161190a565b946020939093013593505050565b60008060006060848603121561197057600080fd5b833561197b8161190a565b9250602084013561198b8161190a565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156119c557600080fd5b823567ffffffffffffffff808211156119dd57600080fd5b818501915085601f8301126119f157600080fd5b813581811115611a0357611a0361199c565b8060051b604051601f19603f83011681018181108582111715611a2857611a2861199c565b604052918252848201925083810185019188831115611a4657600080fd5b938501935b82851015611a6b57611a5c8561191f565b84529385019392850192611a4b565b98975050505050505050565b600060208284031215611a8957600080fd5b813561144d8161190a565b600060208284031215611aa657600080fd5b8135801515811461144d57600080fd5b60008060408385031215611ac957600080fd5b8235611ad48161190a565b91506020830135611ae48161190a565b809150509250929050565b600060208284031215611b0157600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b7d57611b7d611b53565b5060010190565b600060208284031215611b9657600080fd5b815161144d8161190a565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611bf15784516001600160a01b031683529383019391830191600101611bcc565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c2457611c24611b53565b500390565b6000816000190483118215151615611c4357611c43611b53565b500290565b600082611c6557634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611c7d57611c7d611b53565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122083a0b941e371f13b7dd97c0835af55d5a911f0f324bf3c29a47975f21582b2d064736f6c634300080c0033
{"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"}]}}
6,407
0x59eb93da0a7b429603b38ad4570f3628fc210e6f
/** *Submitted for verification at Etherscan.io on 2020-11-28 */ // File: contracts\Timelock.sol pragma solidity 0.6.12; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } // COPIED FROM https://github.com/compound-finance/compound-protocol/blob/master/contracts/Governance/GovernorAlpha.sol // Copyright 2020 Compound Labs, Inc. // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: // 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. // 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Ctrl+f for XXX to see all the modifications. contract Timelock { using SafeMath for uint; event NewAdmin(address indexed newAdmin); event NewPendingAdmin(address indexed newPendingAdmin); event NewDelay(uint indexed newDelay); event CancelTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event QueueTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); uint public constant GRACE_PERIOD = 14 days; uint public constant MINIMUM_DELAY = 1 days; uint public constant MAXIMUM_DELAY = 30 days; address public admin; address public pendingAdmin; uint public delay; bool public admin_initialized; mapping (bytes32 => bool) public queuedTransactions; constructor() public { admin = msg.sender; delay = 86400; require(delay >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay."); require(delay <= MAXIMUM_DELAY, "Timelock::constructor: Delay must not exceed maximum delay."); admin_initialized = false; } receive() external payable { } function setDelay(uint delay_) public { require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock."); require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); delay = delay_; emit NewDelay(delay); } function acceptAdmin() public { require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin."); admin = msg.sender; pendingAdmin = address(0); emit NewAdmin(admin); } function setPendingAdmin(address pendingAdmin_) public { // allows one time setting of admin for deployment purposes if (admin_initialized) { require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock."); } else { require(msg.sender == admin, "Timelock::setPendingAdmin: First call must come from admin."); admin_initialized = true; } pendingAdmin = pendingAdmin_; emit NewPendingAdmin(pendingAdmin); } function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) { require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin."); require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = true; emit QueueTransaction(txHash, target, value, signature, data, eta); return txHash; } function cancelTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public { require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = false; emit CancelTransaction(txHash, target, value, signature, data, eta); } function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public payable returns (bytes memory) { require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued."); require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock."); require(getBlockTimestamp() <= eta.add(GRACE_PERIOD), "Timelock::executeTransaction: Transaction is stale."); queuedTransactions[txHash] = false; bytes memory callData; if (bytes(signature).length == 0) { callData = data; } else { callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data); } // solium-disable-next-line security/no-call-value (bool success, bytes memory returnData) = target.call.value(value)(callData); require(success, "Timelock::executeTransaction: Transaction execution reverted."); emit ExecuteTransaction(txHash, target, value, signature, data, eta); return returnData; } function getBlockTimestamp() internal view returns (uint) { // solium-disable-next-line security/no-block-members return block.timestamp; } }
0x6080604052600436106100e15760003560e01c80636fc1f57e1161007f578063c1a287e211610059578063c1a287e214610631578063e177246e14610646578063f2b0653714610670578063f851a4401461069a576100e8565b80636fc1f57e146105de5780637d645fab14610607578063b1b43ae51461061c576100e8565b80633a66f901116100bb5780633a66f901146102ea5780634dd18bf514610449578063591fcdfe1461047c5780636a42b8f8146105c9576100e8565b80630825f38f146100ed5780630e18b681146102a257806326782247146102b9576100e8565b366100e857005b600080fd5b61022d600480360360a081101561010357600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561013257600080fd5b82018360208201111561014457600080fd5b803590602001918460018302840111600160201b8311171561016557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156101b757600080fd5b8201836020820111156101c957600080fd5b803590602001918460018302840111600160201b831117156101ea57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050913592506106af915050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561026757818101518382015260200161024f565b50505050905090810190601f1680156102945780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102ae57600080fd5b506102b7610baf565b005b3480156102c557600080fd5b506102ce610c4b565b604080516001600160a01b039092168252519081900360200190f35b3480156102f657600080fd5b50610437600480360360a081101561030d57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561033c57600080fd5b82018360208201111561034e57600080fd5b803590602001918460018302840111600160201b8311171561036f57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156103c157600080fd5b8201836020820111156103d357600080fd5b803590602001918460018302840111600160201b831117156103f457600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610c5a915050565b60408051918252519081900360200190f35b34801561045557600080fd5b506102b76004803603602081101561046c57600080fd5b50356001600160a01b0316610f5c565b34801561048857600080fd5b506102b7600480360360a081101561049f57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104ce57600080fd5b8201836020820111156104e057600080fd5b803590602001918460018302840111600160201b8311171561050157600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561055357600080fd5b82018360208201111561056557600080fd5b803590602001918460018302840111600160201b8311171561058657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250611051915050565b3480156105d557600080fd5b506104376112fe565b3480156105ea57600080fd5b506105f3611304565b604080519115158252519081900360200190f35b34801561061357600080fd5b5061043761130d565b34801561062857600080fd5b50610437611314565b34801561063d57600080fd5b5061043761131b565b34801561065257600080fd5b506102b76004803603602081101561066957600080fd5b5035611322565b34801561067c57600080fd5b506105f36004803603602081101561069357600080fd5b5035611417565b3480156106a657600080fd5b506102ce61142c565b6000546060906001600160a01b031633146106fb5760405162461bcd60e51b81526004018080602001828103825260388152602001806114a16038913960400191505060405180910390fd5b6000868686868660405160200180866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610761578181015183820152602001610749565b50505050905090810190601f16801561078e5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156107c15781810151838201526020016107a9565b50505050905090810190601f1680156107ee5780820380516001836020036101000a031916815260200191505b5060408051601f1981840301815291815281516020928301206000818152600490935291205490995060ff16975061085f96505050505050505760405162461bcd60e51b815260040180806020018281038252603d81526020018061162f603d913960400191505060405180910390fd5b8261086861143b565b10156108a55760405162461bcd60e51b81526004018080602001828103825260458152602001806115436045913960600191505060405180910390fd5b6108b2836212750061143f565b6108ba61143b565b11156108f75760405162461bcd60e51b81526004018080602001828103825260338152602001806115106033913960400191505060405180910390fd5b6000818152600460205260409020805460ff19169055845160609061091d5750836109a0565b85805190602001208560405160200180836001600160e01b031916815260040182805190602001908083835b602083106109685780518252601f199092019160209182019101610949565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b60006060896001600160a01b031689846040518082805190602001908083835b602083106109df5780518252601f1990920191602091820191016109c0565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610a41576040519150601f19603f3d011682016040523d82523d6000602084013e610a46565b606091505b509150915081610a875760405162461bcd60e51b815260040180806020018281038252603d815260200180611712603d913960400191505060405180910390fd5b896001600160a01b0316847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610b04578181015183820152602001610aec565b50505050905090810190601f168015610b315780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610b64578181015183820152602001610b4c565b50505050905090810190601f168015610b915780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b6001546001600160a01b03163314610bf85760405162461bcd60e51b815260040180806020018281038252603881526020018061166c6038913960400191505060405180910390fd5b60008054336001600160a01b031991821617808355600180549092169091556040516001600160a01b03909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b6001546001600160a01b031681565b600080546001600160a01b03163314610ca45760405162461bcd60e51b81526004018080602001828103825260368152602001806116dc6036913960400191505060405180910390fd5b610cb8600254610cb261143b565b9061143f565b821015610cf65760405162461bcd60e51b815260040180806020018281038252604981526020018061174f6049913960600191505060405180910390fd5b6000868686868660405160200180866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610d5c578181015183820152602001610d44565b50505050905090810190601f168015610d895780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610dbc578181015183820152602001610da4565b50505050905090810190601f168015610de95780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016004600083815260200190815260200160002060006101000a81548160ff021916908315150217905550866001600160a01b0316817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610eb4578181015183820152602001610e9c565b50505050905090810190601f168015610ee15780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610f14578181015183820152602001610efc565b50505050905090810190601f168015610f415780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b60035460ff1615610faa57333014610fa55760405162461bcd60e51b81526004018080602001828103825260388152602001806116a46038913960400191505060405180910390fd5b611001565b6000546001600160a01b03163314610ff35760405162461bcd60e51b815260040180806020018281038252603b8152602001806115bc603b913960400191505060405180910390fd5b6003805460ff191660011790555b600180546001600160a01b0319166001600160a01b0383811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b6000546001600160a01b0316331461109a5760405162461bcd60e51b81526004018080602001828103825260378152602001806114d96037913960400191505060405180910390fd5b6000858585858560405160200180866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156111005781810151838201526020016110e8565b50505050905090810190601f16801561112d5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015611160578181015183820152602001611148565b50505050905090810190601f16801561118d5780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006004600083815260200190815260200160002060006101000a81548160ff021916908315150217905550856001600160a01b0316817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015611258578181015183820152602001611240565b50505050905090810190601f1680156112855780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156112b85781810151838201526020016112a0565b50505050905090810190601f1680156112e55780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b60035460ff1681565b62278d0081565b6201518081565b6212750081565b3330146113605760405162461bcd60e51b81526004018080602001828103825260318152602001806117986031913960400191505060405180910390fd5b620151808110156113a25760405162461bcd60e51b81526004018080602001828103825260348152602001806115886034913960400191505060405180910390fd5b62278d008111156113e45760405162461bcd60e51b81526004018080602001828103825260388152602001806115f76038913960400191505060405180910390fd5b600281905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60046020526000908152604090205460ff1681565b6000546001600160a01b031681565b4290565b600082820183811015611499576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2046697273742063616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea2646970667358221220b90893ad0a5308299091b518004e7a04e830beb717f356aa8d3ab4d48f33aecc64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,408
0xc85f1e61930304c171b177da7c4cc1e8d985ac9a
/** */ // SPDX-License-Identifier: UNLICENSE /** Telegram : https://t.me/SasukeCrow Twitter : https://mobile.twitter.com/sasukecroww SasukeCrow ($SasukeCrow) Max Transaction fee = 2% (20,000) Buy Sell Taxes = 5% Liquidity + Marketing +Rewards 100k MC: max transaction lifted, LP BURNED + Rewards 500k MC: Big Buy Back + Burns **/ 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 SasukeCrow 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 = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; string private constant _name = "SasukeCrow"; string private constant _symbol = "SasukeCrow"; 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(_msgSender()); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _maxTxAmount = _tTotal.mul(20).div(1000); emit Transfer(address(_msgSender()), address(this), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function 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"); require(!bots[from] && !bots[to]); _feeAddr1 = 5; _feeAddr2 = 5; if (from != owner() && to != owner()) { if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // buy require(amount <= _maxTxAmount); require(tradingOpen); } if ( from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { if(to == uniswapV2Pair){ _feeAddr1 = 5; _feeAddr2 = 5; } } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 500000000000000000) { 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); } function increaseMaxTx(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function addSwap() external onlyOwner { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function addLiq() external onlyOwner{ uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function enableTrading() external onlyOwner{ tradingOpen = true; } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { if(bots_[i]!=address(uniswapV2Router) && bots_[i]!=address(uniswapV2Pair) &&bots_[i]!=address(this)){ 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 { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c80638a259e6c116100a0578063b515566a11610064578063b515566a146102ff578063c3c8cd801461031f578063d91a21a614610334578063dd62ed3e14610354578063e9e1831a1461039a57600080fd5b80638a259e6c1461028d5780638a8c523c146102a25780638da5cb5b146102b757806395d89b411461012f578063a9059cbb146102df57600080fd5b8063313ce567116100e7578063313ce567146102075780635932ead1146102235780636fc3eaec1461024357806370a0823114610258578063715018a61461027857600080fd5b806306fdde031461012f578063095ea7b31461017157806318160ddd146101a157806323b872dd146101c5578063273123b7146101e557600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b50604080518082018252600a815269536173756b6543726f7760b01b6020820152905161016891906115d9565b60405180910390f35b34801561017d57600080fd5b5061019161018c366004611653565b6103af565b6040519015158152602001610168565b3480156101ad57600080fd5b5066038d7ea4c680005b604051908152602001610168565b3480156101d157600080fd5b506101916101e036600461167f565b6103c6565b3480156101f157600080fd5b506102056102003660046116c0565b61042f565b005b34801561021357600080fd5b5060405160098152602001610168565b34801561022f57600080fd5b5061020561023e3660046116eb565b610483565b34801561024f57600080fd5b506102056104cb565b34801561026457600080fd5b506101b76102733660046116c0565b6104d8565b34801561028457600080fd5b506102056104fa565b34801561029957600080fd5b5061020561056e565b3480156102ae57600080fd5b5061020561073a565b3480156102c357600080fd5b506000546040516001600160a01b039091168152602001610168565b3480156102eb57600080fd5b506101916102fa366004611653565b610779565b34801561030b57600080fd5b5061020561031a36600461171e565b610786565b34801561032b57600080fd5b506102056108da565b34801561034057600080fd5b5061020561034f3660046117e3565b6108f0565b34801561036057600080fd5b506101b761036f3660046117fc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103a657600080fd5b50610205610949565b60006103bc338484610b8d565b5060015b92915050565b60006103d3848484610cb1565b6104258433610420856040518060600160405280602881526020016119f9602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fd2565b610b8d565b5060019392505050565b6000546001600160a01b031633146104625760405162461bcd60e51b815260040161045990611835565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104ad5760405162461bcd60e51b815260040161045990611835565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b476104d58161100c565b50565b6001600160a01b0381166000908152600260205260408120546103c090611046565b6000546001600160a01b031633146105245760405162461bcd60e51b815260040161045990611835565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146105985760405162461bcd60e51b815260040161045990611835565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556105d3308266038d7ea4c68000610b8d565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610611573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610635919061186a565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610682573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a6919061186a565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156106f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610717919061186a565b600e80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b031633146107645760405162461bcd60e51b815260040161045990611835565b600e805460ff60a01b1916600160a01b179055565b60006103bc338484610cb1565b6000546001600160a01b031633146107b05760405162461bcd60e51b815260040161045990611835565b60005b81518110156108d657600d5482516001600160a01b03909116908390839081106107df576107df611887565b60200260200101516001600160a01b0316141580156108305750600e5482516001600160a01b039091169083908390811061081c5761081c611887565b60200260200101516001600160a01b031614155b80156108675750306001600160a01b031682828151811061085357610853611887565b60200260200101516001600160a01b031614155b156108c45760016006600084848151811061088457610884611887565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108ce816118b3565b9150506107b3565b5050565b60006108e5306104d8565b90506104d5816110c3565b6000546001600160a01b0316331461091a5760405162461bcd60e51b815260040161045990611835565b6000811161092757600080fd5b610943606461093d66038d7ea4c6800084610ac2565b90610b4b565b600f5550565b6000546001600160a01b031633146109735760405162461bcd60e51b815260040161045990611835565b600d546001600160a01b031663f305d719473061098f816104d8565b6000806109a46000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a0c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a3191906118cc565b5050600e805461ffff60b01b19811661010160b01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610a9e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d591906118fa565b600082600003610ad4575060006103c0565b6000610ae08385611917565b905082610aed8583611936565b14610b445760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610459565b9392505050565b6000610b4483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061123d565b6001600160a01b038316610bef5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610459565b6001600160a01b038216610c505760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610459565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d155760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610459565b6001600160a01b038216610d775760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610459565b60008111610dd95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610459565b6001600160a01b03831660009081526006602052604090205460ff16158015610e1b57506001600160a01b03821660009081526006602052604090205460ff16155b610e2457600080fd5b6005600a819055600b556000546001600160a01b03848116911614801590610e5a57506000546001600160a01b03838116911614155b15610fc257600e546001600160a01b038481169116148015610e8a5750600d546001600160a01b03838116911614155b8015610eaf57506001600160a01b03821660009081526005602052604090205460ff16155b8015610ec45750600e54600160b81b900460ff165b15610eee57600f54811115610ed857600080fd5b600e54600160a01b900460ff16610eee57600080fd5b600d546001600160a01b03848116911614801590610f2557506001600160a01b03831660009081526005602052604090205460ff16155b15610f4b57600e546001600160a01b0390811690831603610f4b576005600a819055600b555b6000610f56306104d8565b600e54909150600160a81b900460ff16158015610f815750600e546001600160a01b03858116911614155b8015610f965750600e54600160b01b900460ff165b15610fc057610fa4816110c3565b476706f05b59d3b20000811115610fbe57610fbe4761100c565b505b505b610fcd83838361126b565b505050565b60008184841115610ff65760405162461bcd60e51b815260040161045991906115d9565b5060006110038486611958565b95945050505050565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108d6573d6000803e3d6000fd5b60006008548211156110ad5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610459565b60006110b7611276565b9050610b448382610b4b565b600e805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061110b5761110b611887565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611164573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611188919061186a565b8160018151811061119b5761119b611887565b6001600160a01b039283166020918202929092010152600d546111c19130911684610b8d565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111fa90859060009086903090429060040161196f565b600060405180830381600087803b15801561121457600080fd5b505af1158015611228573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b6000818361125e5760405162461bcd60e51b815260040161045991906115d9565b5060006110038486611936565b610fcd838383611299565b6000806000611283611390565b90925090506112928282610b4b565b9250505090565b6000806000806000806112ab876113ce565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112dd908761142b565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461130c908661146d565b6001600160a01b03891660009081526002602052604090205561132e816114cc565b6113388483611516565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161137d91815260200190565b60405180910390a3505050505050505050565b600854600090819066038d7ea4c680006113aa8282610b4b565b8210156113c55750506008549266038d7ea4c6800092509050565b90939092509050565b60008060008060008060008060006113eb8a600a54600b5461153a565b92509250925060006113fb611276565b9050600080600061140e8e878787611589565b919e509c509a509598509396509194505050505091939550919395565b6000610b4483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fd2565b60008061147a83856119e0565b905083811015610b445760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610459565b60006114d6611276565b905060006114e48383610ac2565b30600090815260026020526040902054909150611501908261146d565b30600090815260026020526040902055505050565b600854611523908361142b565b600855600954611533908261146d565b6009555050565b600080808061154e606461093d8989610ac2565b90506000611561606461093d8a89610ac2565b90506000611579826115738b8661142b565b9061142b565b9992985090965090945050505050565b60008080806115988886610ac2565b905060006115a68887610ac2565b905060006115b48888610ac2565b905060006115c682611573868661142b565b939b939a50919850919650505050505050565b600060208083528351808285015260005b81811015611606578581018301518582016040015282016115ea565b81811115611618576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104d557600080fd5b803561164e8161162e565b919050565b6000806040838503121561166657600080fd5b82356116718161162e565b946020939093013593505050565b60008060006060848603121561169457600080fd5b833561169f8161162e565b925060208401356116af8161162e565b929592945050506040919091013590565b6000602082840312156116d257600080fd5b8135610b448161162e565b80151581146104d557600080fd5b6000602082840312156116fd57600080fd5b8135610b44816116dd565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561173157600080fd5b823567ffffffffffffffff8082111561174957600080fd5b818501915085601f83011261175d57600080fd5b81358181111561176f5761176f611708565b8060051b604051601f19603f8301168101818110858211171561179457611794611708565b6040529182528482019250838101850191888311156117b257600080fd5b938501935b828510156117d7576117c885611643565b845293850193928501926117b7565b98975050505050505050565b6000602082840312156117f557600080fd5b5035919050565b6000806040838503121561180f57600080fd5b823561181a8161162e565b9150602083013561182a8161162e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561187c57600080fd5b8151610b448161162e565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016118c5576118c561189d565b5060010190565b6000806000606084860312156118e157600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561190c57600080fd5b8151610b44816116dd565b60008160001904831182151516156119315761193161189d565b500290565b60008261195357634e487b7160e01b600052601260045260246000fd5b500490565b60008282101561196a5761196a61189d565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119bf5784516001600160a01b03168352938301939183019160010161199a565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119f3576119f361189d565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122086d117c134a5fcaa6ced731a743a195d1eeb072a3c3a968fd5874c1b8462357764736f6c634300080d0033
{"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"}]}}
6,409
0x7221816f73e710eb952ce08bcaf54a31600fae6c
pragma solidity ^0.4.11; // ==== DISCLAIMER ==== // // ETHEREUM IS STILL AN EXPEREMENTAL TECHNOLOGY. // ALTHOUGH THIS SMART CONTRACT WAS CREATED WITH GREAT CARE AND IN THE HOPE OF BEING USEFUL, NO GUARANTEES OF FLAWLESS OPERATION CAN BE GIVEN. // IN PARTICULAR - SUBTILE BUGS, HACKER ATTACKS OR MALFUNCTION OF UNDERLYING TECHNOLOGY CAN CAUSE UNINTENTIONAL BEHAVIOUR. // YOU ARE STRONGLY ENCOURAGED TO STUDY THIS SMART CONTRACT CAREFULLY IN ORDER TO UNDERSTAND POSSIBLE EDGE CASES AND RISKS. // DON&#39;T USE THIS SMART CONTRACT IF YOU HAVE SUBSTANTIAL DOUBTS OR IF YOU DON&#39;T KNOW WHAT YOU ARE DOING. // // THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ==== // /// @author Santiment LLC /// @title SAN - santiment token contract Base { function max(uint a, uint b) returns (uint) { return a >= b ? a : b; } function min(uint a, uint b) returns (uint) { return a <= b ? a : b; } modifier only(address allowed) { if (msg.sender != allowed) throw; _; } ///@return True if `_addr` is a contract function isContract(address _addr) constant internal returns (bool) { if (_addr == 0) return false; uint size; assembly { size := extcodesize(_addr) } return (size > 0); } // ************************************************* // * reentrancy handling * // ************************************************* //@dev predefined locks (up to uint bit length, i.e. 256 possible) uint constant internal L00 = 2 ** 0; uint constant internal L01 = 2 ** 1; uint constant internal L02 = 2 ** 2; uint constant internal L03 = 2 ** 3; uint constant internal L04 = 2 ** 4; uint constant internal L05 = 2 ** 5; //prevents reentrancy attacs: specific locks uint private bitlocks = 0; modifier noReentrancy(uint m) { var _locks = bitlocks; if (_locks & m > 0) throw; bitlocks |= m; _; bitlocks = _locks; } modifier noAnyReentrancy { var _locks = bitlocks; if (_locks > 0) throw; bitlocks = uint(-1); _; bitlocks = _locks; } ///@dev empty marking modifier signaling to user of the marked function , that it can cause an reentrant call. /// developer should make the caller function reentrant-safe if it use a reentrant function. modifier reentrant { _; } } contract Owned is Base { address public owner; address public newOwner; function Owned() { owner = msg.sender; } function transferOwnership(address _newOwner) only(owner) { newOwner = _newOwner; } function acceptOwnership() only(newOwner) { OwnershipTransferred(owner, newOwner); owner = newOwner; } event OwnershipTransferred(address indexed _from, address indexed _to); } contract ERC20 is Owned { event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); function transfer(address _to, uint256 _value) isStartedOnly returns (bool success) { if (balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]) { balances[msg.sender] -= _value; balances[_to] += _value; Transfer(msg.sender, _to, _value); return true; } else { return false; } } function transferFrom(address _from, address _to, uint256 _value) isStartedOnly returns (bool success) { if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]) { balances[_to] += _value; balances[_from] -= _value; allowed[_from][msg.sender] -= _value; Transfer(_from, _to, _value); return true; } else { return false; } } function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } function approve(address _spender, uint256 _value) isStartedOnly returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; uint256 public totalSupply; bool public isStarted = false; modifier onlyHolder(address holder) { if (balanceOf(holder) == 0) throw; _; } modifier isStartedOnly() { if (!isStarted) throw; _; } } contract SubscriptionModule { function attachToken(address addr) public ; } contract SAN is Owned, ERC20 { string public constant name = "SANtiment network token"; string public constant symbol = "SAN"; uint8 public constant decimals = 18; address CROWDSALE_MINTER = 0xDa2Cf810c5718135247628689D84F94c61B41d6A; address public SUBSCRIPTION_MODULE = 0x00000000; address public beneficiary; uint public PLATFORM_FEE_PER_10000 = 1; //0.01% uint public totalOnDeposit; uint public totalInCirculation; ///@dev constructor function SAN() { beneficiary = owner = msg.sender; } // ------------------------------------------------------------------------ // Don&#39;t accept ethers // ------------------------------------------------------------------------ function () { throw; } //======== SECTION Configuration: Owner only ======== // ///@notice set beneficiary - the account receiving platform fees. function setBeneficiary(address newBeneficiary) external only(owner) { beneficiary = newBeneficiary; } ///@notice attach module managing subscriptions. if subModule==0x0, then disables subscription functionality for this token. /// detached module can usually manage subscriptions, but all operations changing token balances are disabled. function attachSubscriptionModule(SubscriptionModule subModule) noAnyReentrancy external only(owner) { SUBSCRIPTION_MODULE = subModule; if (address(subModule) > 0) subModule.attachToken(this); } ///@notice set platform fee denominated in 1/10000 of SAN token. Thus "1" means 0.01% of SAN token. function setPlatformFeePer10000(uint newFee) external only(owner) { require (newFee <= 10000); //formally maximum fee is 100% (completely insane but technically possible) PLATFORM_FEE_PER_10000 = newFee; } //======== Interface XRateProvider: a trivial exchange rate provider. Rate is 1:1 and SAN symbol as the code // ///@dev used as a default XRateProvider (id==0) by subscription module. ///@notice returns always 1 because exchange rate of the token to itself is always 1. function getRate() returns(uint32 ,uint32) { return (1,1); } function getCode() public returns(string) { return symbol; } //==== Interface ERC20ModuleSupport: Subscription, Deposit and Payment Support ===== /// ///@dev used by subscription module to operate on token balances. ///@param msg_sender should be an original msg.sender provided to subscription module. function _fulfillPreapprovedPayment(address _from, address _to, uint _value, address msg_sender) public onlyTrusted returns(bool success) { success = _from != msg_sender && allowed[_from][msg_sender] >= _value; if (!success) { Payment(_from, _to, _value, _fee(_value), msg_sender, PaymentStatus.APPROVAL_ERROR, 0); } else { success = _fulfillPayment(_from, _to, _value, 0, msg_sender); if (success) { allowed[_from][msg_sender] -= _value; } } return success; } ///@dev used by subscription module to operate on token balances. ///@param msg_sender should be an original msg.sender provided to subscription module. function _fulfillPayment(address _from, address _to, uint _value, uint subId, address msg_sender) public onlyTrusted returns (bool success) { var fee = _fee(_value); assert (fee <= _value); //internal sanity check if (balances[_from] >= _value && balances[_to] + _value > balances[_to]) { balances[_from] -= _value; balances[_to] += _value - fee; balances[beneficiary] += fee; Payment(_from, _to, _value, fee, msg_sender, PaymentStatus.OK, subId); return true; } else { Payment(_from, _to, _value, fee, msg_sender, PaymentStatus.BALANCE_ERROR, subId); return false; } } function _fee(uint _value) internal constant returns (uint fee) { return _value * PLATFORM_FEE_PER_10000 / 10000; } ///@notice used by subscription module to re-create token from returning deposit. ///@dev a subscription module is responsible to correct deposit management. function _mintFromDeposit(address owner, uint amount) public onlyTrusted { balances[owner] += amount; totalOnDeposit -= amount; totalInCirculation += amount; } ///@notice used by subscription module to burn token while creating a new deposit. ///@dev a subscription module is responsible to create and maintain the deposit record. function _burnForDeposit(address owner, uint amount) public onlyTrusted returns (bool success) { if (balances[owner] >= amount) { balances[owner] -= amount; totalOnDeposit += amount; totalInCirculation -= amount; return true; } else { return false; } } //========= Crowdsale Only =============== ///@notice mint new token for given account in crowdsale stage ///@dev allowed only if token not started yet and only for registered minter. ///@dev tokens are become in circulation after token start. function mint(uint amount, address account) onlyCrowdsaleMinter isNotStartedOnly { totalSupply += amount; balances[account]+=amount; } ///@notice start normal operation of the token. No minting is possible after this point. function start() isNotStartedOnly only(owner) { totalInCirculation = totalSupply; isStarted = true; } //========= SECTION: Modifier =============== modifier onlyCrowdsaleMinter() { if (msg.sender != CROWDSALE_MINTER) throw; _; } modifier onlyTrusted() { if (msg.sender != SUBSCRIPTION_MODULE) throw; _; } ///@dev token not started means minting is possible, but usual token operations are not. modifier isNotStartedOnly() { if (isStarted) throw; _; } enum PaymentStatus {OK, BALANCE_ERROR, APPROVAL_ERROR} ///@notice event issued on any fee based payment (made of failed). ///@param subId - related subscription Id if any, or zero otherwise. event Payment(address _from, address _to, uint _value, uint _fee, address caller, PaymentStatus status, uint subId); }//contract SAN
0x606060405236156101935763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101a9578063095ea7b31461023957806318160ddd1461026c5780631c31f7101461028e57806323b872dd146102ac5780632981cceb146102e55780632c7ec2c214610306578063313ce5671461034a57806335b55d981461037057806338af3eed1461039c578063544736e6146103c857806359ba1dd5146103ec5780635cb0c16f1461042c578063679aefce1461044e5780636d5433e6146104815780636dd43d1f146104a957806370a08231146104c757806379ba5097146104f55780637ae2b5c7146105075780638da5cb5b1461052f57806394bf804d1461055b57806395d89b411461057c5780639bd334571461060c578063a9059cbb1461062e578063abf0661f14610661578063be9a655514610694578063d4ee1d90146106a6578063dd62ed3e146106d2578063e3d0799c14610706578063ea87963414610728578063f2fde38b146107b8578063f9cc2e66146107d6575b341561019b57fe5b6101a75b60006000fd5b565b005b34156101b157fe5b6101b96107eb565b6040805160208082528351818301528351919283929083019185019080838382156101ff575b8051825260208311156101ff57601f1990920191602091820191016101df565b505050905090810190601f16801561022b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561024157fe5b610258600160a060020a0360043516602435610822565b604080519115158252519081900360200190f35b341561027457fe5b61027c61089f565b60408051918252519081900360200190f35b341561029657fe5b6101a7600160a060020a03600435166108a5565b005b34156102b457fe5b610258600160a060020a03600435811690602435166044356108f0565b604080519115158252519081900360200190f35b34156102ed57fe5b6101a7600160a060020a0360043516602435610a15565b005b341561030e57fe5b610258600160a060020a03600435811690602435811690604435906064359060843516610a66565b604080519115158252519081900360200190f35b341561035257fe5b61035a610c60565b6040805160ff9092168252519081900360200190f35b341561037857fe5b610380610c65565b60408051600160a060020a039092168252519081900360200190f35b34156103a457fe5b610380610c74565b60408051600160a060020a039092168252519081900360200190f35b34156103d057fe5b610258610c83565b604080519115158252519081900360200190f35b34156103f457fe5b610258600160a060020a036004358116906024358116906044359060643516610c8c565b604080519115158252519081900360200190f35b341561043457fe5b61027c610dd7565b60408051918252519081900360200190f35b341561045657fe5b61045e610ddd565b6040805163ffffffff938416815291909216602082015281519081900390910190f35b341561048957fe5b61027c600435602435610de5565b60408051918252519081900360200190f35b34156104b157fe5b6101a7600160a060020a0360043516610e00565b005b34156104cf57fe5b61027c600160a060020a0360043516610ef8565b60408051918252519081900360200190f35b34156104fd57fe5b6101a7610f17565b005b341561050f57fe5b61027c600435602435610fa7565b60408051918252519081900360200190f35b341561053757fe5b610380610fc2565b60408051600160a060020a039092168252519081900360200190f35b341561056357fe5b6101a7600435600160a060020a0360243516610fd1565b005b341561058457fe5b6101b9611030565b6040805160208082528351818301528351919283929083019185019080838382156101ff575b8051825260208311156101ff57601f1990920191602091820191016101df565b505050905090810190601f16801561022b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561061457fe5b61027c611067565b60408051918252519081900360200190f35b341561063657fe5b610258600160a060020a036004351660243561106d565b604080519115158252519081900360200190f35b341561066957fe5b610258600160a060020a0360043516602435611148565b604080519115158252519081900360200190f35b341561069c57fe5b6101a76111cf565b005b34156106ae57fe5b610380611216565b60408051600160a060020a039092168252519081900360200190f35b34156106da57fe5b61027c600160a060020a0360043581169060243516611225565b60408051918252519081900360200190f35b341561070e57fe5b61027c611252565b60408051918252519081900360200190f35b341561073057fe5b6101b9611258565b6040805160208082528351818301528351919283929083019185019080838382156101ff575b8051825260208311156101ff57601f1990920191602091820191016101df565b505050905090810190601f16801561022b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156107c057fe5b6101a7600160a060020a0360043516611299565b005b34156107de57fe5b6101a76004356112e4565b005b60408051808201909152601781527f53414e74696d656e74206e6574776f726b20746f6b656e000000000000000000602082015281565b60065460009060ff1615156108375760006000fd5b600160a060020a03338116600081815260046020908152604080832094881680845294825291829020869055815186815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060015b5b92915050565b60055481565b600154600160a060020a0390811690331681146108c25760006000fd5b6008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384161790555b5b5050565b60065460009060ff1615156109055760006000fd5b600160a060020a0384166000908152600360205260409020548290108015906109555750600160a060020a0380851660009081526004602090815260408083203390941683529290522054829010155b801561097a5750600160a060020a038316600090815260036020526040902054828101115b15610a0857600160a060020a03808416600081815260036020908152604080832080548801905588851680845281842080548990039055600483528184203390961684529482529182902080548790039055815186815291519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a3506001610a0c565b5060005b5b5b9392505050565b60075433600160a060020a03908116911614610a315760006000fd5b600160a060020a0382166000908152600360205260409020805482019055600a80548290039055600b8054820190555b5b5050565b600754600090819033600160a060020a03908116911614610a875760006000fd5b610a908561131c565b905084811115610a9c57fe5b600160a060020a038716600090815260036020526040902054859010801590610ade5750600160a060020a038616600090815260036020526040902054858101115b15610ba357600160a060020a03808816600081815260036020908152604080832080548b900390558a85168084528184208054888d030190556008548616845281842080548801905581519485529184019190915282018890526060820184905291851660808201527f83725a910247ba73f0cbe5d1f944bdf6e0456c94ccb822dbdd206f4bed6b045e91899189918991869189918b9060a08101835b60ff16815260200182815260200197505050505050505060405180910390a160019150610c54565b7f83725a910247ba73f0cbe5d1f944bdf6e0456c94ccb822dbdd206f4bed6b045e878787848760018a6040518088600160a060020a0316600160a060020a0316815260200187600160a060020a0316600160a060020a0316815260200186815260200185815260200184600160a060020a0316600160a060020a03168152602001836002811115610c3057fe5b60ff16815260200182815260200197505050505050505060405180910390a1600091505b5b5b5095945050505050565b601281565b600754600160a060020a031681565b600854600160a060020a031681565b60065460ff1681565b60075460009033600160a060020a03908116911614610cab5760006000fd5b81600160a060020a031685600160a060020a031614158015610cf35750600160a060020a03808616600090815260046020908152604080832093861683529290522054839010155b9050801515610d89577f83725a910247ba73f0cbe5d1f944bdf6e0456c94ccb822dbdd206f4bed6b045e858585610d298761131c565b60408051600160a060020a0380871682528581166020830152918101849052606081018390529088166080820152879060029060009060a08101835b60ff16815260200182815260200197505050505050505060405180910390a1610dcc565b610d97858585600086610a66565b90508015610dcc57600160a060020a038086166000908152600460209081526040808320938616835292905220805484900390555b5b5b5b949350505050565b600b5481565b6001805b9091565b600081831015610df55781610df7565b825b90505b92915050565b6000805490811115610e125760006000fd5b600019600055600154600160a060020a039081169033168114610e355760006000fd5b6007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0385169081179091556000901115610eeb5782600160a060020a031663406a6f60306040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082600160a060020a0316600160a060020a03168152602001915050600060405180830381600087803b1515610ed957fe5b6102c65a03f11515610ee757fe5b5050505b5b5b5060008190555b5050565b600160a060020a0381166000908152600360205260409020545b919050565b600254600160a060020a039081169033168114610f345760006000fd5b600254600154604051600160a060020a0392831692909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36002546001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555b5b50565b600081831115610df55781610df7565b825b90505b92915050565b600154600160a060020a031681565b60065433600160a060020a039081166101009092041614610ff25760006000fd5b60065460ff16156110035760006000fd5b6005805483019055600160a060020a03811660009081526003602052604090208054830190555b5b5b5050565b60408051808201909152600381527f53414e0000000000000000000000000000000000000000000000000000000000602082015281565b600a5481565b60065460009060ff1615156110825760006000fd5b600160a060020a0333166000908152600360205260409020548290108015906110c45750600160a060020a038316600090815260036020526040902054828101115b1561113857600160a060020a03338116600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3506001610898565b506000610898565b5b5b92915050565b60075460009033600160a060020a039081169116146111675760006000fd5b600160a060020a0383166000908152600360205260409020548290106111385750600160a060020a038216600090815260036020526040902080548290039055600a805482019055600b805482900390556001610898565b506000610898565b5b5b92915050565b60065460ff16156111e05760006000fd5b600154600160a060020a0390811690331681146111fd5760006000fd5b600554600b556006805460ff191660011790555b5b505b565b600254600160a060020a031681565b600160a060020a038083166000908152600460209081526040808320938516835292905220545b92915050565b60095481565b611260611332565b5060408051808201909152600381527f53414e000000000000000000000000000000000000000000000000000000000060208201525b90565b600154600160a060020a0390811690331681146112b65760006000fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384161790555b5b5050565b600154600160a060020a0390811690331681146113015760006000fd5b6127108211156113115760006000fd5b60098290555b5b5050565b6009546000906127109083025b0490505b919050565b604080516020810190915260008152905600a165627a7a72305820c839432015a1eaac259ff2e97ef54fda08d507c4bd247ebae8b86440b07d97e80029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
6,410
0x6ba40f06a9286fbb96bb2d73592934ce86bc5b2c
/** *Submitted for verification at Etherscan.io on 2021-12-09 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; //Copied from OZ contracts 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); } //Wrap around Aave oracle interface IPriceOracleGetter { function getAssetPrice(address asset) external view returns (uint256); } //Copied from OZ contracts library SafeERC20 { function verifyCallResult(bool success,bytes memory returndata,string memory errorMessage) internal pure returns (bytes memory) { if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } function isContract(address account) internal view returns (bool) { uint256 size; assembly { size := extcodesize(account) } return size > 0; } function safeTransfer(IERC20 token,address to,uint256 value) internal { require(isContract(address(token)), "Call to non-contract"); (bool success, bytes memory returndata) = address(token).call(abi.encodeWithSelector(token.transfer.selector, to, value)); bytes memory returnedData = verifyCallResult(success, returndata, "Call reverted"); if (returnedData.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "ERC20 operation did not succeed"); } } function safeTransferFrom(IERC20 token,address from,address to,uint256 value) internal { require(isContract(address(token)), "Call to non-contract"); (bool success, bytes memory returndata) = address(token).call(abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); bytes memory returnedData = verifyCallResult(success, returndata, "Call to non-contract"); if (returnedData.length > 0) { require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract Escrow { using SafeERC20 for IERC20; enum FundingState { PAUSED, ACTIVE, CLOSED, REFUND } address public whitelister; address public recipient; address public owner; address public usdc; uint256 public lastRecordedETHPrice; uint256 public firstWithdrawalLevel; uint8 public state; bool public isFirstWithdrawalExecuted; IPriceOracleGetter public ethUSDCFeed; event USDCDeposited(address indexed payee, uint256 indexed amount); event USDCWithdrawn(address indexed payee, uint256 indexed amount); event Deposited(address indexed payee, uint256 indexed weiAmount); event Withdrawn(address indexed payee, uint256 indexed weiAmount); event RemovedReservation(address indexed user, uint256 indexed id); //Map of registered id with their owners mapping(uint256 => address) public reservations; //Map of whitelisted users mapping(address => bool) public whitelistedUsers; //Assets reserved by each users, it returns an unordered list of reserved IDs mapping(address => uint256[]) public userReservedAssets; mapping(uint256 => uint256) public assetToIndex; //Track the USDC and ETH deposited by each users (useful for claimbacks) mapping(address => uint256) public ethDeposited; mapping(uint256 => uint256) public buyingETHPrice; mapping(address => uint256) public usdcDeposited; modifier onlyWhitelister { require(msg.sender == whitelister, "Caller is not whitelister"); _; } modifier onlyOwner() { require(msg.sender == owner, "Caller is not owner"); _; } modifier onlyRecipient { require(msg.sender == recipient, "Caller is not recipient"); _; } constructor( address _priceOracleGetter, //Aave oracle address _whitelister, //Who can whitelist users to buy address _usdc, //USDC address to be used on the oracle address _recipient //Who can withdraw funds from the contract ) { whitelister = _whitelister; usdc = _usdc; owner = msg.sender; recipient = _recipient; firstWithdrawalLevel = 1050000000000000000000000; ethUSDCFeed = IPriceOracleGetter(_priceOracleGetter); state = uint8(FundingState.ACTIVE); _updateETHPrice(); } // Owner restricted functions function setPaused() public onlyOwner { _updateETHPrice(); state = uint8(FundingState.PAUSED); } function setClosed() public onlyOwner { _updateETHPrice(); state = uint8(FundingState.CLOSED); } function setRefund() public onlyOwner { _updateETHPrice(); state = uint8(FundingState.REFUND); } function setActive() public onlyOwner { _updateETHPrice(); state = uint8(FundingState.ACTIVE); } function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); owner = newOwner; } // Whitelister restricted functions function whitelist(address user, bool value) public onlyWhitelister { _updateETHPrice(); whitelistedUsers[user] = value; } function whitelistInBatch(address[] memory users, bool[] memory values) public onlyWhitelister { _updateETHPrice(); require(users.length == values.length, "Length mismatch"); for(uint256 i = 0; i < users.length; i++) { whitelistedUsers[users[i]] = values[i]; } } // Recipient restricted functions function firstWithdraw(address payable receiver, uint256 usdcAmount, uint256 ethInWei) public onlyRecipient { require(!isFirstWithdrawalExecuted, "Already executed"); _updateETHPrice(); uint256 amount = totalValue(); uint256 totalToWithdraw = usdcAmount + ethInWei; require(amount >= firstWithdrawalLevel, "Contract has not recollected enough yet"); require(totalToWithdraw <= amount, "Wrong amount"); require(usdcAmount <= IERC20(usdc).balanceOf(address(this)), "Invalid USDC amount"); require(ethInWei <= address(this).balance, "Invalid ETH amount"); if(usdcAmount > 0) IERC20(usdc).safeTransfer(receiver, usdcAmount); if(ethInWei > 0) _sendValue(receiver, ethInWei); isFirstWithdrawalExecuted = true; emit Withdrawn(receiver, amount); } function withdrawETH(address payable receiver) public onlyRecipient { _updateETHPrice(); _validateWithdraw(); emit Withdrawn(receiver, address(this).balance); _sendValue(receiver, address(this).balance); } function withdrawUSDC(address receiver) public onlyRecipient { _updateETHPrice(); _validateWithdraw(); emit USDCWithdrawn(receiver, IERC20(usdc).balanceOf(address(this))); IERC20(usdc).safeTransfer(receiver, IERC20(usdc).balanceOf(address(this))); } function withdrawAll(address payable receiver) public onlyRecipient { _updateETHPrice(); _validateWithdraw(); emit Withdrawn(receiver, address(this).balance); emit USDCWithdrawn(receiver, IERC20(usdc).balanceOf(address(this))); _sendValue(receiver, address(this).balance); IERC20(usdc).safeTransfer(receiver, IERC20(usdc).balanceOf(address(this))); } // Public getters functions to retrieve data function totalValue() public view returns (uint256 funded) { uint256 etherAmount = address(this).balance; uint256 unit = 1e18; uint256 oneEtherPriceInUSD = unit * unit / lastRecordedETHPrice; uint256 amountInUSD = etherAmount * oneEtherPriceInUSD / unit; funded = amountInUSD + IERC20(usdc).balanceOf(address(this))*1e12; return funded; } function getReservationOwner(uint256 id) public view returns (address reservationOwner) { reservationOwner = reservations[id]; return reservationOwner; } function getReservedAsset(address user, uint256 index) public view returns (uint256 id) { require(index < userReservedAssets[user].length, "Index out of range"); id = userReservedAssets[user][index]; return id; } function getNumberOfReservedAssets(address user) public view returns (uint256 value) { value = userReservedAssets[user].length; return value; } function getUSDPrice(uint256 id) public pure returns (uint256) { if(id < 7000) return uint256(3500); else if(id >= 7000 && id < 19000) return uint256(2900); else if(id >= 19000 && id < 29000) return uint256(2500); else if(id >= 29000 && id < 41000) return uint256(1600); else if(id >= 41000 && id < 58000) return uint256(995); else revert("ID is out of range"); } function checkIDValidity(uint256 id) public pure returns(bool) { if (id >= 58000) return false; uint256 base; if (id < 1000) { base = id / 100; if (6 <= base) { return false; } } else if (id < 10000) { base = ((id / 10) % 100) / 10; if (6 <= base) { return false; } } else { base = (id / 100) % 10; if (6 <= base) { return false; } } return true; } // User interacting functions function buyWithUSDC(uint256 id) public { _updateETHPrice(); _buyWithUSDC(id); } function buyWithUSDCBatch(uint256[] memory ids) public { _updateETHPrice(); for(uint i = 0; i < ids.length; i++) { buyWithUSDC(ids[i]); } } function buyWithEther(uint256 id) public payable { _updateETHPrice(); uint256 amount = msg.value; uint256 leftover = _buyWithEther(id, amount); if(leftover > 0) _sendValue(payable(msg.sender), leftover); } function buyWithEtherBatch(uint256[] memory ids) public payable { _updateETHPrice(); uint256 amount = msg.value; uint256 leftover; for(uint i = 0; i < ids.length; i++) { leftover = _buyWithEther(ids[i], amount); amount = leftover; } if(leftover > 0) _sendValue(payable(msg.sender), leftover); } // Create a receive function that reverts to avoid having people sending ETH directly function claimBackUSDC(uint256 id) public { _validateClaimBack(id); _updateETHPrice(); uint256 ticketPrice = getUSDPrice(id); uint256 usdcUnits = 1e6; uint256 priceInERC20Units = ticketPrice * usdcUnits; require(usdcDeposited[msg.sender] >= priceInERC20Units, "Insufficient funds"); // Delete reservation and give back to the user his funds for this ID usdcDeposited[msg.sender] -= priceInERC20Units; _deleteReservation(id); IERC20(usdc).safeTransfer(msg.sender, priceInERC20Units); } function claimBackETH(uint256 id) public { _validateClaimBack(id); _updateETHPrice(); uint256 pricePaid = buyingETHPrice[id]; require(pricePaid > 0, "No valid reservation"); require(pricePaid <= address(this).balance, "Insufficient funds"); ethDeposited[msg.sender] -= pricePaid; buyingETHPrice[id] = 0; _deleteReservation(id); _sendValue(payable(msg.sender), pricePaid); } // internal functions function _sendValue(address payable receiver, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = receiver.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } function _deleteReservation(uint256 id) internal { reservations[id] = address(0); uint256 lastAsset = userReservedAssets[msg.sender][userReservedAssets[msg.sender].length - 1]; uint256 position = assetToIndex[id]; userReservedAssets[msg.sender][position] = lastAsset; assetToIndex[lastAsset] = position; userReservedAssets[msg.sender].pop(); assetToIndex[id] = 0; emit RemovedReservation(msg.sender, id); } function _validateWithdraw() internal view { require(state == uint8(FundingState.CLOSED), "System state is not closed"); } function _validateDeposit(uint256 id) internal view { require(state == uint8(FundingState.ACTIVE), "System state is not active"); require(whitelistedUsers[msg.sender], "User is not whitelisted"); require(reservations[id] == address(0), "ID already taken"); require(checkIDValidity(id), "Invalid or reserved ID"); } function _validateClaimBack(uint256 id) internal view { require(state == uint8(FundingState.REFUND), "System state is not in refund"); require(whitelistedUsers[msg.sender], "User is not whitelisted"); require(reservations[id] == address(msg.sender), "Msg sender is not the owner"); require(checkIDValidity(id), "Invalid or reserved ID"); } function _updateETHPrice() internal { // This will give USDC price in ETH (wei units) // Being 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 the USDC address // The value returned is the value in wei of 1 USDC ie 1 usd = 227260770000000 lastRecordedETHPrice = ethUSDCFeed.getAssetPrice(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48); } function _buyWithEther(uint id, uint amount) internal returns(uint256 leftover) { require(amount > 0, "Zero amount not allowed"); _validateDeposit(id); uint256 unit = 1e18; uint256 oneEtherPriceInUSD = unit * unit / lastRecordedETHPrice; uint256 amountInUSD = amount * oneEtherPriceInUSD / unit; uint256 ticketPrice = getUSDPrice(id); require( amountInUSD >= ticketPrice*unit, "Insufficient ETH amount" ); if(amountInUSD > ticketPrice*unit) leftover = ((amountInUSD - ticketPrice*unit)*unit) / oneEtherPriceInUSD; uint deposited = leftover == 0 ? amount : ticketPrice*unit*unit/oneEtherPriceInUSD; reservations[id] = address(msg.sender); buyingETHPrice[id] = oneEtherPriceInUSD; userReservedAssets[msg.sender].push(id); assetToIndex[id] = userReservedAssets[msg.sender].length - 1; ethDeposited[msg.sender] += deposited; buyingETHPrice[id] = deposited; emit Deposited(msg.sender, deposited); } function _buyWithUSDC(uint id) internal { _validateDeposit(id); uint256 ticketPrice = getUSDPrice(id); uint256 usdcUnits = 1e6; uint256 priceInERC20Units = ticketPrice * usdcUnits; require(IERC20(usdc).allowance(msg.sender, address(this)) >= priceInERC20Units, "Contract has not enough allowance"); IERC20(usdc).safeTransferFrom(msg.sender, address(this), priceInERC20Units); usdcDeposited[msg.sender] += priceInERC20Units; reservations[id] = address(msg.sender); userReservedAssets[msg.sender].push(id); assetToIndex[id] = userReservedAssets[msg.sender].length - 1; emit USDCDeposited(msg.sender, priceInERC20Units); } }
0x6080604052600436106102305760003560e01c8063881723991161012e578063d2228637116100ab578063f59c37081161006f578063f59c37081461080d578063f621cc4814610836578063fa09e63014610873578063fbc1e4221461089c578063ff0fc3ae146108d957610230565b8063d22286371461073c578063d4c3eea014610779578063e7a201fe146107a4578063f2dc6b33146107cd578063f2fde38b146107e457610230565b8063a5d7e667116100f2578063a5d7e66714610657578063ab065c9b14610682578063aeccf735146106ab578063bc4c7f11146106d4578063c19d93fb1461071157610230565b806388172399146105845780638da5cb5b146105c15780639719be12146105ec5780639c5a416a14610617578063a1358c471461062e57610230565b80633e413bee116101bc5780636074317c116101805780636074317c1461049f57806366d003ac146104dc578063690d832014610507578063760a8c2a146105305780637b2e13c41461054757610230565b80633e413bee146103c25780633feee6a7146103ed57806342bfe7cb1461042a5780634bd9011714610446578063550b9c111461048357610230565b806322758a4a1161020357806322758a4a146103035780632e5218ca1461032e57806331cc5f6c14610357578063333e78fa1461038057806337a66d85146103ab57610230565b80630250f8d614610235578063067cf8321461027257806310c58020146102af578063153fdbd9146102da575b600080fd5b34801561024157600080fd5b5061025c60048036038101906102579190613640565b610916565b604051610269919061367c565b60405180910390f35b34801561027e57600080fd5b5061029960048036038101906102949190613640565b61092e565b6040516102a691906136d8565b60405180910390f35b3480156102bb57600080fd5b506102c4610961565b6040516102d1919061367c565b60405180910390f35b3480156102e657600080fd5b5061030160048036038101906102fc919061384c565b610967565b005b34801561030f57600080fd5b506103186109b5565b60405161032591906136d8565b60405180910390f35b34801561033a57600080fd5b5061035560048036038101906103509190613640565b6109d9565b005b34801561036357600080fd5b5061037e600480360381019061037991906138c1565b610b43565b005b34801561038c57600080fd5b50610395610dad565b6040516103a2919061394d565b60405180910390f35b3480156103b757600080fd5b506103c0610dd3565b005b3480156103ce57600080fd5b506103d7610e9b565b6040516103e491906136d8565b60405180910390f35b3480156103f957600080fd5b50610414600480360381019061040f91906138c1565b610ec1565b604051610421919061367c565b60405180910390f35b610444600480360381019061043f919061384c565b610f0d565b005b34801561045257600080fd5b5061046d60048036038101906104689190613968565b610f81565b60405161047a919061367c565b60405180910390f35b61049d60048036038101906104989190613640565b61106b565b005b3480156104ab57600080fd5b506104c660048036038101906104c19190613640565b61109f565b6040516104d391906136d8565b60405180910390f35b3480156104e857600080fd5b506104f16110dc565b6040516104fe91906136d8565b60405180910390f35b34801561051357600080fd5b5061052e600480360381019061052991906139e6565b611102565b005b34801561053c57600080fd5b506105456111f3565b005b34801561055357600080fd5b5061056e60048036038101906105699190613640565b6112bb565b60405161057b919061367c565b60405180910390f35b34801561059057600080fd5b506105ab60048036038101906105a69190613968565b611399565b6040516105b8919061367c565b60405180910390f35b3480156105cd57600080fd5b506105d66113ca565b6040516105e391906136d8565b60405180910390f35b3480156105f857600080fd5b506106016113f0565b60405161060e919061367c565b60405180910390f35b34801561062357600080fd5b5061062c6113f6565b005b34801561063a57600080fd5b5061065560048036038101906106509190613bd1565b6114bd565b005b34801561066357600080fd5b5061066c611646565b6040516106799190613c58565b60405180910390f35b34801561068e57600080fd5b506106a960048036038101906106a49190613c73565b611659565b005b3480156106b757600080fd5b506106d260048036038101906106cd9190613640565b6119d7565b005b3480156106e057600080fd5b506106fb60048036038101906106f69190613640565b6119eb565b6040516107089190613c58565b60405180910390f35b34801561071d57600080fd5b50610726611ab3565b6040516107339190613ce2565b60405180910390f35b34801561074857600080fd5b50610763600480360381019061075e9190613640565b611ac6565b604051610770919061367c565b60405180910390f35b34801561078557600080fd5b5061078e611ade565b60405161079b919061367c565b60405180910390f35b3480156107b057600080fd5b506107cb60048036038101906107c69190613640565b611be9565b005b3480156107d957600080fd5b506107e2611d1e565b005b3480156107f057600080fd5b5061080b600480360381019061080691906138c1565b611de6565b005b34801561081957600080fd5b50610834600480360381019061082f9190613cfd565b611f2a565b005b34801561084257600080fd5b5061085d600480360381019061085891906138c1565b61201b565b60405161086a9190613c58565b60405180910390f35b34801561087f57600080fd5b5061089a600480360381019061089591906139e6565b61203b565b005b3480156108a857600080fd5b506108c360048036038101906108be91906138c1565b6122f3565b6040516108d0919061367c565b60405180910390f35b3480156108e557600080fd5b5061090060048036038101906108fb91906138c1565b61230b565b60405161090d919061367c565b60405180910390f35b600a6020528060005260406000206000915090505481565b60076020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b61096f612323565b60005b81518110156109b15761099e82828151811061099157610990613d3d565b5b60200260200101516119d7565b80806109a990613d9b565b915050610972565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e2816123db565b6109ea612323565b60006109f5826112bb565b90506000620f4240905060008183610a0d9190613de4565b905080600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610a91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8890613e9b565b60405180910390fd5b80600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ae09190613ebb565b92505081905550610af0846125bc565b610b3d3382600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166128149092919063ffffffff16565b50505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610bd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bca90613f3b565b60405180910390fd5b610bdb612323565b610be36129ec565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610c3e91906136d8565b602060405180830381865afa158015610c5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7f9190613f70565b8173ffffffffffffffffffffffffffffffffffffffff167f2aa7fb97600ea702b454359fc3d02ae9fa48367e7155505d38cee896e5b5aae760405160405180910390a3610daa81600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610d2191906136d8565b602060405180830381865afa158015610d3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d629190613f70565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166128149092919063ffffffff16565b50565b600660029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5a90613fe9565b60405180910390fd5b610e6b612323565b60006003811115610e7f57610e7e614009565b5b600660006101000a81548160ff021916908360ff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b610f15612323565b6000349050600080600090505b8351811015610f6757610f4f848281518110610f4157610f40613d3d565b5b602002602001015184612a58565b91508192508080610f5f90613d9b565b915050610f22565b506000811115610f7c57610f7b3382612daf565b5b505050565b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508210611007576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ffe90614084565b60405180910390fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811061105857611057613d3d565b5b9060005260206000200154905092915050565b611073612323565b600034905060006110848383612a58565b9050600081111561109a576110993382612daf565b5b505050565b60006007600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611192576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118990613f3b565b60405180910390fd5b61119a612323565b6111a26129ec565b478173ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d560405160405180910390a36111f08147612daf565b50565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611283576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127a90613fe9565b60405180910390fd5b61128b612323565b6001600381111561129f5761129e614009565b5b600660006101000a81548160ff021916908360ff160217905550565b6000611b588210156112d157610dac9050611394565b611b5882101580156112e45750614a3882105b156112f357610b549050611394565b614a388210158015611306575061714882105b15611315576109c49050611394565b6171488210158015611328575061a02882105b15611337576106409050611394565b61a028821015801561134a575061e29082105b15611359576103e39050611394565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138b906140f0565b60405180910390fd5b919050565b600960205281600052604060002081815481106113b557600080fd5b90600052602060002001600091509150505481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60045481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611486576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147d90613fe9565b60405180910390fd5b61148e612323565b6003808111156114a1576114a0614009565b5b600660006101000a81548160ff021916908360ff160217905550565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461154b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115429061415c565b60405180910390fd5b611553612323565b8051825114611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e906141c8565b60405180910390fd5b60005b8251811015611641578181815181106115b6576115b5613d3d565b5b6020026020010151600860008584815181106115d5576115d4613d3d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061163990613d9b565b91505061159a565b505050565b600660019054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e090613f3b565b60405180910390fd5b600660019054906101000a900460ff1615611739576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173090614234565b60405180910390fd5b611741612323565b600061174b611ade565b90506000828461175b9190614254565b90506005548210156117a2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117999061431c565b60405180910390fd5b818111156117e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117dc90614388565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161184091906136d8565b602060405180830381865afa15801561185d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118819190613f70565b8411156118c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ba906143f4565b60405180910390fd5b47831115611906576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118fd90614460565b60405180910390fd5b600084111561195d5761195c8585600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166128149092919063ffffffff16565b5b6000831115611971576119708584612daf565b5b6001600660016101000a81548160ff021916908315150217905550818573ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d560405160405180910390a35050505050565b6119df612323565b6119e881612ea3565b50565b600061e29082106119ff5760009050611aae565b60006103e8831015611a3157606483611a1891906144af565b905080600611611a2c576000915050611aae565b611aa8565b612710831015611a7957600a6064600a85611a4c91906144af565b611a5691906144e0565b611a6091906144af565b905080600611611a74576000915050611aae565b611aa7565b600a606484611a8891906144af565b611a9291906144e0565b905080600611611aa6576000915050611aae565b5b5b60019150505b919050565b600660009054906101000a900460ff1681565b600c6020528060005260406000206000915090505481565b6000804790506000670de0b6b3a7640000905060006004548283611b029190613de4565b611b0c91906144af565b90506000828285611b1d9190613de4565b611b2791906144af565b905064e8d4a51000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401611b8a91906136d8565b602060405180830381865afa158015611ba7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bcb9190613f70565b611bd59190613de4565b81611be09190614254565b94505050505090565b611bf2816123db565b611bfa612323565b6000600c600083815260200190815260200160002054905060008111611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9061455d565b60405180910390fd5b47811115611c98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8f90613e9b565b60405180910390fd5b80600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611ce79190613ebb565b925050819055506000600c600084815260200190815260200160002081905550611d10826125bc565b611d1a3382612daf565b5050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611dae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da590613fe9565b60405180910390fd5b611db6612323565b60026003811115611dca57611dc9614009565b5b600660006101000a81548160ff021916908360ff160217905550565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e6d90613fe9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611ee6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611edd906145ef565b60405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611fb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611faf9061415c565b60405180910390fd5b611fc0612323565b80600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60086020528060005260406000206000915054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146120cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c290613f3b565b60405180910390fd5b6120d3612323565b6120db6129ec565b478173ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d560405160405180910390a3600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161217a91906136d8565b602060405180830381865afa158015612197573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121bb9190613f70565b8173ffffffffffffffffffffffffffffffffffffffff167f2aa7fb97600ea702b454359fc3d02ae9fa48367e7155505d38cee896e5b5aae760405160405180910390a36122088147612daf565b6122f081600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161226791906136d8565b602060405180830381865afa158015612284573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122a89190613f70565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166128149092919063ffffffff16565b50565b600d6020528060005260406000206000915090505481565b600b6020528060005260406000206000915090505481565b600660029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b3596f0773a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486040518263ffffffff1660e01b815260040161239291906136d8565b602060405180830381865afa1580156123af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123d39190613f70565b600481905550565b6003808111156123ee576123ed614009565b5b60ff16600660009054906101000a900460ff1660ff1614612444576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161243b9061465b565b60405180910390fd5b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166124d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124c7906146c7565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166007600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161256890614733565b60405180910390fd5b61257a816119eb565b6125b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b09061479f565b60405180910390fd5b50565b60006007600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905061269f9190613ebb565b815481106126b0576126af613d3d565b5b906000526020600020015490506000600a600084815260200190815260200160002054905081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811061272757612726613d3d565b5b906000526020600020018190555080600a600084815260200190815260200160002081905550600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548061279c5761279b6147bf565b5b600190038181906000526020600020016000905590556000600a600085815260200190815260200160002081905550823373ffffffffffffffffffffffffffffffffffffffff167f3ec7677ab07df69b4dad964a6a0a202680b3ba51a5251df71c3034245a0e785360405160405180910390a3505050565b61281d836131be565b61285c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128539061483a565b60405180910390fd5b6000808473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b858560405160240161289192919061485a565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516128fb91906148fd565b6000604051808303816000865af19150503d8060008114612938576040519150601f19603f3d011682016040523d82523d6000602084013e61293d565b606091505b5091509150600061298483836040518060400160405280600d81526020017f43616c6c207265766572746564000000000000000000000000000000000000008152506131d1565b90506000815111156129e457818060200190518101906129a49190614929565b6129e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129da906149a2565b60405180910390fd5b5b505050505050565b60026003811115612a00576129ff614009565b5b60ff16600660009054906101000a900460ff1660ff1614612a56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a4d90614a0e565b60405180910390fd5b565b6000808211612a9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a9390614a7a565b60405180910390fd5b612aa583613238565b6000670de0b6b3a7640000905060006004548283612ac39190613de4565b612acd91906144af565b90506000828286612ade9190613de4565b612ae891906144af565b90506000612af5876112bb565b90508381612b039190613de4565b821015612b45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b3c90614ae6565b60405180910390fd5b8381612b519190613de4565b821115612b885782848583612b669190613de4565b84612b719190613ebb565b612b7b9190613de4565b612b8591906144af565b94505b6000808614612bb85783858684612b9f9190613de4565b612ba99190613de4565b612bb391906144af565b612bba565b865b905033600760008a815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600c60008a815260200190815260200160002081905550600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208890806001815401808255809150506001900390600052602060002001600090919091909150556001600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050612cdb9190613ebb565b600a60008a81526020019081526020016000208190555080600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612d419190614254565b9250508190555080600c60008a815260200190815260200160002081905550803373ffffffffffffffffffffffffffffffffffffffff167f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c460405160405180910390a3505050505092915050565b80471015612df2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612de990614b52565b60405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff1682604051612e1890614b98565b60006040518083038185875af1925050503d8060008114612e55576040519150601f19603f3d011682016040523d82523d6000602084013e612e5a565b606091505b5050905080612e9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e9590614c1f565b60405180910390fd5b505050565b612eac81613238565b6000612eb7826112bb565b90506000620f4240905060008183612ecf9190613de4565b905080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401612f2f929190614c3f565b602060405180830381865afa158015612f4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f709190613f70565b1015612fb1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fa890614cda565b60405180910390fd5b613000333083600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661341b909392919063ffffffff16565b80600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461304f9190614254565b92505081905550336007600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208490806001815401808255809150506001900390600052602060002001600090919091909150556001600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905061315d9190613ebb565b600a600086815260200190815260200160002081905550803373ffffffffffffffffffffffffffffffffffffffff167f80ecc532cf2e08856601df42646970d676a686d8eeacbfd2038fae4ff288da5660405160405180910390a350505050565b600080823b905060008111915050919050565b606083156131e157829050613231565b6000835111156131f45782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016132289190614d3e565b60405180910390fd5b9392505050565b6001600381111561324c5761324b614009565b5b60ff16600660009054906101000a900460ff1660ff16146132a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161329990614dac565b60405180910390fd5b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661332e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613325906146c7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166007600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146133d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016133c790614e18565b60405180910390fd5b6133d9816119eb565b613418576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161340f9061479f565b60405180910390fd5b50565b613424846131be565b613463576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161345a9061483a565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff166323b872dd60e01b86868660405160240161349a93929190614e38565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161350491906148fd565b6000604051808303816000865af19150503d8060008114613541576040519150601f19603f3d011682016040523d82523d6000602084013e613546565b606091505b5091509150600061358d83836040518060400160405280601481526020017f43616c6c20746f206e6f6e2d636f6e74726163740000000000000000000000008152506131d1565b90506000815111156135ed57818060200190518101906135ad9190614929565b6135ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016135e390614ee1565b60405180910390fd5b5b50505050505050565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b61361d8161360a565b811461362857600080fd5b50565b60008135905061363a81613614565b92915050565b60006020828403121561365657613655613600565b5b60006136648482850161362b565b91505092915050565b6136768161360a565b82525050565b6000602082019050613691600083018461366d565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006136c282613697565b9050919050565b6136d2816136b7565b82525050565b60006020820190506136ed60008301846136c9565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613741826136f8565b810181811067ffffffffffffffff821117156137605761375f613709565b5b80604052505050565b60006137736135f6565b905061377f8282613738565b919050565b600067ffffffffffffffff82111561379f5761379e613709565b5b602082029050602081019050919050565b600080fd5b60006137c86137c384613784565b613769565b905080838252602082019050602084028301858111156137eb576137ea6137b0565b5b835b818110156138145780613800888261362b565b8452602084019350506020810190506137ed565b5050509392505050565b600082601f830112613833576138326136f3565b5b81356138438482602086016137b5565b91505092915050565b60006020828403121561386257613861613600565b5b600082013567ffffffffffffffff8111156138805761387f613605565b5b61388c8482850161381e565b91505092915050565b61389e816136b7565b81146138a957600080fd5b50565b6000813590506138bb81613895565b92915050565b6000602082840312156138d7576138d6613600565b5b60006138e5848285016138ac565b91505092915050565b6000819050919050565b600061391361390e61390984613697565b6138ee565b613697565b9050919050565b6000613925826138f8565b9050919050565b60006139378261391a565b9050919050565b6139478161392c565b82525050565b6000602082019050613962600083018461393e565b92915050565b6000806040838503121561397f5761397e613600565b5b600061398d858286016138ac565b925050602061399e8582860161362b565b9150509250929050565b60006139b382613697565b9050919050565b6139c3816139a8565b81146139ce57600080fd5b50565b6000813590506139e0816139ba565b92915050565b6000602082840312156139fc576139fb613600565b5b6000613a0a848285016139d1565b91505092915050565b600067ffffffffffffffff821115613a2e57613a2d613709565b5b602082029050602081019050919050565b6000613a52613a4d84613a13565b613769565b90508083825260208201905060208402830185811115613a7557613a746137b0565b5b835b81811015613a9e5780613a8a88826138ac565b845260208401935050602081019050613a77565b5050509392505050565b600082601f830112613abd57613abc6136f3565b5b8135613acd848260208601613a3f565b91505092915050565b600067ffffffffffffffff821115613af157613af0613709565b5b602082029050602081019050919050565b60008115159050919050565b613b1781613b02565b8114613b2257600080fd5b50565b600081359050613b3481613b0e565b92915050565b6000613b4d613b4884613ad6565b613769565b90508083825260208201905060208402830185811115613b7057613b6f6137b0565b5b835b81811015613b995780613b858882613b25565b845260208401935050602081019050613b72565b5050509392505050565b600082601f830112613bb857613bb76136f3565b5b8135613bc8848260208601613b3a565b91505092915050565b60008060408385031215613be857613be7613600565b5b600083013567ffffffffffffffff811115613c0657613c05613605565b5b613c1285828601613aa8565b925050602083013567ffffffffffffffff811115613c3357613c32613605565b5b613c3f85828601613ba3565b9150509250929050565b613c5281613b02565b82525050565b6000602082019050613c6d6000830184613c49565b92915050565b600080600060608486031215613c8c57613c8b613600565b5b6000613c9a868287016139d1565b9350506020613cab8682870161362b565b9250506040613cbc8682870161362b565b9150509250925092565b600060ff82169050919050565b613cdc81613cc6565b82525050565b6000602082019050613cf76000830184613cd3565b92915050565b60008060408385031215613d1457613d13613600565b5b6000613d22858286016138ac565b9250506020613d3385828601613b25565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000613da68261360a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613dd957613dd8613d6c565b5b600182019050919050565b6000613def8261360a565b9150613dfa8361360a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613e3357613e32613d6c565b5b828202905092915050565b600082825260208201905092915050565b7f496e73756666696369656e742066756e64730000000000000000000000000000600082015250565b6000613e85601283613e3e565b9150613e9082613e4f565b602082019050919050565b60006020820190508181036000830152613eb481613e78565b9050919050565b6000613ec68261360a565b9150613ed18361360a565b925082821015613ee457613ee3613d6c565b5b828203905092915050565b7f43616c6c6572206973206e6f7420726563697069656e74000000000000000000600082015250565b6000613f25601783613e3e565b9150613f3082613eef565b602082019050919050565b60006020820190508181036000830152613f5481613f18565b9050919050565b600081519050613f6a81613614565b92915050565b600060208284031215613f8657613f85613600565b5b6000613f9484828501613f5b565b91505092915050565b7f43616c6c6572206973206e6f74206f776e657200000000000000000000000000600082015250565b6000613fd3601383613e3e565b9150613fde82613f9d565b602082019050919050565b6000602082019050818103600083015261400281613fc6565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f496e646578206f7574206f662072616e67650000000000000000000000000000600082015250565b600061406e601283613e3e565b915061407982614038565b602082019050919050565b6000602082019050818103600083015261409d81614061565b9050919050565b7f4944206973206f7574206f662072616e67650000000000000000000000000000600082015250565b60006140da601283613e3e565b91506140e5826140a4565b602082019050919050565b60006020820190508181036000830152614109816140cd565b9050919050565b7f43616c6c6572206973206e6f742077686974656c697374657200000000000000600082015250565b6000614146601983613e3e565b915061415182614110565b602082019050919050565b6000602082019050818103600083015261417581614139565b9050919050565b7f4c656e677468206d69736d617463680000000000000000000000000000000000600082015250565b60006141b2600f83613e3e565b91506141bd8261417c565b602082019050919050565b600060208201905081810360008301526141e1816141a5565b9050919050565b7f416c726561647920657865637574656400000000000000000000000000000000600082015250565b600061421e601083613e3e565b9150614229826141e8565b602082019050919050565b6000602082019050818103600083015261424d81614211565b9050919050565b600061425f8261360a565b915061426a8361360a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561429f5761429e613d6c565b5b828201905092915050565b7f436f6e747261637420686173206e6f74207265636f6c6c656374656420656e6f60008201527f7567682079657400000000000000000000000000000000000000000000000000602082015250565b6000614306602783613e3e565b9150614311826142aa565b604082019050919050565b60006020820190508181036000830152614335816142f9565b9050919050565b7f57726f6e6720616d6f756e740000000000000000000000000000000000000000600082015250565b6000614372600c83613e3e565b915061437d8261433c565b602082019050919050565b600060208201905081810360008301526143a181614365565b9050919050565b7f496e76616c6964205553444320616d6f756e7400000000000000000000000000600082015250565b60006143de601383613e3e565b91506143e9826143a8565b602082019050919050565b6000602082019050818103600083015261440d816143d1565b9050919050565b7f496e76616c69642045544820616d6f756e740000000000000000000000000000600082015250565b600061444a601283613e3e565b915061445582614414565b602082019050919050565b600060208201905081810360008301526144798161443d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006144ba8261360a565b91506144c58361360a565b9250826144d5576144d4614480565b5b828204905092915050565b60006144eb8261360a565b91506144f68361360a565b92508261450657614505614480565b5b828206905092915050565b7f4e6f2076616c6964207265736572766174696f6e000000000000000000000000600082015250565b6000614547601483613e3e565b915061455282614511565b602082019050919050565b600060208201905081810360008301526145768161453a565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006145d9602683613e3e565b91506145e48261457d565b604082019050919050565b60006020820190508181036000830152614608816145cc565b9050919050565b7f53797374656d207374617465206973206e6f7420696e20726566756e64000000600082015250565b6000614645601d83613e3e565b91506146508261460f565b602082019050919050565b6000602082019050818103600083015261467481614638565b9050919050565b7f55736572206973206e6f742077686974656c6973746564000000000000000000600082015250565b60006146b1601783613e3e565b91506146bc8261467b565b602082019050919050565b600060208201905081810360008301526146e0816146a4565b9050919050565b7f4d73672073656e646572206973206e6f7420746865206f776e65720000000000600082015250565b600061471d601b83613e3e565b9150614728826146e7565b602082019050919050565b6000602082019050818103600083015261474c81614710565b9050919050565b7f496e76616c6964206f7220726573657276656420494400000000000000000000600082015250565b6000614789601683613e3e565b915061479482614753565b602082019050919050565b600060208201905081810360008301526147b88161477c565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f43616c6c20746f206e6f6e2d636f6e7472616374000000000000000000000000600082015250565b6000614824601483613e3e565b915061482f826147ee565b602082019050919050565b6000602082019050818103600083015261485381614817565b9050919050565b600060408201905061486f60008301856136c9565b61487c602083018461366d565b9392505050565b600081519050919050565b600081905092915050565b60005b838110156148b757808201518184015260208101905061489c565b838111156148c6576000848401525b50505050565b60006148d782614883565b6148e1818561488e565b93506148f1818560208601614899565b80840191505092915050565b600061490982846148cc565b915081905092915050565b60008151905061492381613b0e565b92915050565b60006020828403121561493f5761493e613600565b5b600061494d84828501614914565b91505092915050565b7f4552433230206f7065726174696f6e20646964206e6f74207375636365656400600082015250565b600061498c601f83613e3e565b915061499782614956565b602082019050919050565b600060208201905081810360008301526149bb8161497f565b9050919050565b7f53797374656d207374617465206973206e6f7420636c6f736564000000000000600082015250565b60006149f8601a83613e3e565b9150614a03826149c2565b602082019050919050565b60006020820190508181036000830152614a27816149eb565b9050919050565b7f5a65726f20616d6f756e74206e6f7420616c6c6f776564000000000000000000600082015250565b6000614a64601783613e3e565b9150614a6f82614a2e565b602082019050919050565b60006020820190508181036000830152614a9381614a57565b9050919050565b7f496e73756666696369656e742045544820616d6f756e74000000000000000000600082015250565b6000614ad0601783613e3e565b9150614adb82614a9a565b602082019050919050565b60006020820190508181036000830152614aff81614ac3565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e6365000000600082015250565b6000614b3c601d83613e3e565b9150614b4782614b06565b602082019050919050565b60006020820190508181036000830152614b6b81614b2f565b9050919050565b50565b6000614b8260008361488e565b9150614b8d82614b72565b600082019050919050565b6000614ba382614b75565b9150819050919050565b7f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260008201527f6563697069656e74206d61792068617665207265766572746564000000000000602082015250565b6000614c09603a83613e3e565b9150614c1482614bad565b604082019050919050565b60006020820190508181036000830152614c3881614bfc565b9050919050565b6000604082019050614c5460008301856136c9565b614c6160208301846136c9565b9392505050565b7f436f6e747261637420686173206e6f7420656e6f75676820616c6c6f77616e6360008201527f6500000000000000000000000000000000000000000000000000000000000000602082015250565b6000614cc4602183613e3e565b9150614ccf82614c68565b604082019050919050565b60006020820190508181036000830152614cf381614cb7565b9050919050565b600081519050919050565b6000614d1082614cfa565b614d1a8185613e3e565b9350614d2a818560208601614899565b614d33816136f8565b840191505092915050565b60006020820190508181036000830152614d588184614d05565b905092915050565b7f53797374656d207374617465206973206e6f7420616374697665000000000000600082015250565b6000614d96601a83613e3e565b9150614da182614d60565b602082019050919050565b60006020820190508181036000830152614dc581614d89565b9050919050565b7f494420616c72656164792074616b656e00000000000000000000000000000000600082015250565b6000614e02601083613e3e565b9150614e0d82614dcc565b602082019050919050565b60006020820190508181036000830152614e3181614df5565b9050919050565b6000606082019050614e4d60008301866136c9565b614e5a60208301856136c9565b614e67604083018461366d565b949350505050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000614ecb602a83613e3e565b9150614ed682614e6f565b604082019050919050565b60006020820190508181036000830152614efa81614ebe565b905091905056fea2646970667358221220c3b37a0fc867683e44bfb780cb56e200158f39edab9fe683e1f982093249c8a664736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,411
0x1306c7d95e59cfcdff7ae3c13db7f56acc543815
/** *Submitted for verification at Etherscan.io on 2021-06-30 */ /** *Submitted for verification at Etherscan.io on 2021-06-18 */ /** * .______ ______ ___ __ ___ _______ * | _ \ / | / \ | |/ / | ____| * | |_) | | ,----' / ^ \ | ' / | |__ * | _ < | | / /_\ \ | < | __| * | |_) | | `----./ _____ \ | . \ | |____ * |______/ \______/__/ \__\ |__|\__\ |_______| * Birthday Cake Inu * https://t.me/BirthdayCakeInu * birthdayinu.com * * BCAKE is a meme token with a twist! * BCAKE has no sale limitations, which benefits whales and minnows alike, and an innovative dynamic reflection tax rate which increases proportionate to the size of the sell. * * TOKENOMICS: * 1,000,000,000,000 token supply * FIRST TWO MINUTES: 3,000,000,000 max buy / 45-second buy cooldown (these limitations are lifted automatically two minutes post-launch) * 15-second cooldown to sell after a buy, in order to limit bot behavior. NO OTHER COOLDOWNS, NO COOLDOWNS BETWEEN SELLS * No buy or sell token limits. Whales are welcome! * 10% total tax on buy * Fee on sells is dynamic, relative to price impact, minimum of 10% fee and maximum of 40% fee, with NO SELL LIMIT. * No team tokens, no presale * A unique approach to resolving the huge dumps after long pumps that have plagued every NotInu fork * * */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if(a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract BCAKE 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"Rapidly Reusable Rockets"; string private constant _symbol = unicode"RRR"; uint8 private constant _decimals = 9; uint256 private _taxFee = 6; uint256 private _teamFee = 4; uint256 private _feeRate = 5; uint256 private _feeMultiplier = 1000; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; bool private _useImpactFeeSetter = true; uint256 private buyLimitEnd; struct User { uint256 buy; uint256 sell; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function setFee(uint256 impactFee) private { uint256 _impactFee = 10; if(impactFee < 10) { _impactFee = 10; } else if(impactFee > 40) { _impactFee = 40; } else { _impactFee = impactFee; } if(_impactFee.mod(2) != 0) { _impactFee++; } _taxFee = (_impactFee.mul(6)).div(10); _teamFee = (_impactFee.mul(4)).div(10); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { if(_cooldownEnabled) { if(!cooldown[msg.sender].exists) { cooldown[msg.sender] = User(0,0,true); } } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); _taxFee = 6; _teamFee = 4; if(_cooldownEnabled) { if(buyLimitEnd > block.timestamp) { require(amount <= _maxBuyAmount); require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired."); cooldown[to].buy = block.timestamp + (45 seconds); } } if(_cooldownEnabled) { cooldown[to].sell = block.timestamp + (15 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); } if(_useImpactFeeSetter) { uint256 feeBasis = amount.mul(_feeMultiplier); feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount)); setFee(feeBasis); } if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function addLiquidity() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _maxBuyAmount = 3000000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (120 seconds); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } // fallback in case contract is not releasing tokens fast enough function setFeeRate(uint256 rate) external { require(_msgSender() == _FeeAddress); require(rate < 51, "Rate can't exceed 50%"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setCooldownEnabled(bool onoff) external onlyOwner() { _cooldownEnabled = onoff; emit CooldownEnabledUpdated(_cooldownEnabled); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function cooldownEnabled() public view returns (bool) { return _cooldownEnabled; } function timeToBuy(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].buy; } function timeToSell(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].sell; } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610423578063c3c8cd8014610460578063c9567bf914610477578063db92dbb61461048e578063dd62ed3e146104b9578063e8078d94146104f657610140565b8063715018a61461034e5780638da5cb5b1461036557806395d89b4114610390578063a9059cbb146103bb578063a985ceef146103f857610140565b8063313ce567116100fd578063313ce5671461024057806345596e2e1461026b5780635932ead11461029457806368a3a6a5146102bd5780636fc3eaec146102fa57806370a082311461031157610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806323b872dd146101d857806327f3a72a1461021557610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a61050d565b60405161016791906130da565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612bf8565b61054a565b6040516101a491906130bf565b60405180910390f35b3480156101b957600080fd5b506101c2610568565b6040516101cf91906132bc565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612ba9565b610579565b60405161020c91906130bf565b60405180910390f35b34801561022157600080fd5b5061022a610652565b60405161023791906132bc565b60405180910390f35b34801561024c57600080fd5b50610255610662565b6040516102629190613331565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d9190612c86565b61066b565b005b3480156102a057600080fd5b506102bb60048036038101906102b69190612c34565b610752565b005b3480156102c957600080fd5b506102e460048036038101906102df9190612b1b565b61084a565b6040516102f191906132bc565b60405180910390f35b34801561030657600080fd5b5061030f6108a1565b005b34801561031d57600080fd5b5061033860048036038101906103339190612b1b565b610913565b60405161034591906132bc565b60405180910390f35b34801561035a57600080fd5b50610363610964565b005b34801561037157600080fd5b5061037a610ab7565b6040516103879190612ff1565b60405180910390f35b34801561039c57600080fd5b506103a5610ae0565b6040516103b291906130da565b60405180910390f35b3480156103c757600080fd5b506103e260048036038101906103dd9190612bf8565b610b1d565b6040516103ef91906130bf565b60405180910390f35b34801561040457600080fd5b5061040d610b3b565b60405161041a91906130bf565b60405180910390f35b34801561042f57600080fd5b5061044a60048036038101906104459190612b1b565b610b52565b60405161045791906132bc565b60405180910390f35b34801561046c57600080fd5b50610475610ba9565b005b34801561048357600080fd5b5061048c610c23565b005b34801561049a57600080fd5b506104a3610ce7565b6040516104b091906132bc565b60405180910390f35b3480156104c557600080fd5b506104e060048036038101906104db9190612b6d565b610d19565b6040516104ed91906132bc565b60405180910390f35b34801561050257600080fd5b5061050b610da0565b005b60606040518060400160405280601881526020017f52617069646c79205265757361626c6520526f636b6574730000000000000000815250905090565b600061055e6105576112b0565b84846112b8565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610586848484611483565b610647846105926112b0565b61064285604051806060016040528060288152602001613a1360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105f86112b0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4d9092919063ffffffff16565b6112b8565b600190509392505050565b600061065d30610913565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ac6112b0565b73ffffffffffffffffffffffffffffffffffffffff16146106cc57600080fd5b6033811061070f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107069061319c565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161074791906132bc565b60405180910390a150565b61075a6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de906131fc565b60405180910390fd5b80601460156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601460159054906101000a900460ff1660405161083f91906130bf565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001544261089a9190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e26112b0565b73ffffffffffffffffffffffffffffffffffffffff161461090257600080fd5b600047905061091081611db1565b50565b600061095d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eac565b9050919050565b61096c6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f0906131fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f5252520000000000000000000000000000000000000000000000000000000000815250905090565b6000610b31610b2a6112b0565b8484611483565b6001905092915050565b6000601460159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610ba29190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bea6112b0565b73ffffffffffffffffffffffffffffffffffffffff1614610c0a57600080fd5b6000610c1530610913565b9050610c2081611f1a565b50565b610c2b6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caf906131fc565b60405180910390fd5b60016014806101000a81548160ff021916908315150217905550607842610cdf91906133a1565b601581905550565b6000610d14601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610da86112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2c906131fc565b60405180910390fd5b60148054906101000a900460ff1615610e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7a9061327c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f1330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112b8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5957600080fd5b505afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f919190612b44565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190612b44565b6040518363ffffffff1660e01b815260040161104892919061300c565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612b44565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061112330610913565b60008061112e610ab7565b426040518863ffffffff1660e01b81526004016111509695949392919061305e565b6060604051808303818588803b15801561116957600080fd5b505af115801561117d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a29190612caf565b5050506729a2241af62c000060108190555042600d81905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161125a929190613035565b602060405180830381600087803b15801561127457600080fd5b505af1158015611288573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ac9190612c5d565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131f9061325c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611398576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138f9061313c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161147691906132bc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ea9061323c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155a906130fc565b60405180910390fd5b600081116115a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159d9061321c565b60405180910390fd5b6115ae610ab7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161c57506115ec610ab7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8a57601460159054906101000a900460ff161561172257600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16611721576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117cd5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118235750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119f65760148054906101000a900460ff16611875576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186c9061329c565b60405180910390fd5b60066009819055506004600a81905550601460159054906101000a900460ff161561198c5742601554111561198b576010548111156118b357600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e9061315c565b60405180910390fd5b602d4261194491906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601460159054906101000a900460ff16156119f557600f426119ae91906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611a0130610913565b9050601460169054906101000a900460ff16158015611a6e5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a84575060148054906101000a900460ff165b15611c8857601460159054906101000a900460ff1615611b235742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611b22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b19906131bc565b60405180910390fd5b5b601460179054906101000a900460ff1615611bad576000611b4f600c548461221490919063ffffffff16565b9050611ba0611b9184611b83601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61228f90919063ffffffff16565b826122ed90919063ffffffff16565b9050611bab81612337565b505b6000811115611c6e57611c086064611bfa600b54611bec601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b811115611c6457611c616064611c53600b54611c45601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b90505b611c6d81611f1a565b5b60004790506000811115611c8657611c8547611db1565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d315750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d3b57600090505b611d47848484846123ee565b50505050565b6000838311158290611d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8c91906130da565b60405180910390fd5b5060008385611da49190613482565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e016002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e2c573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e7d6002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ea8573d6000803e3d6000fd5b5050565b6000600754821115611ef3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eea9061311c565b60405180910390fd5b6000611efd61241b565b9050611f1281846122ed90919063ffffffff16565b915050919050565b6001601460166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f78577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fa65781602001602082028036833780820191505090505b5090503081600081518110611fe4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208657600080fd5b505afa15801561209a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120be9190612b44565b816001815181106120f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061215f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b8565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121c39594939291906132d7565b600060405180830381600087803b1580156121dd57600080fd5b505af11580156121f1573d6000803e3d6000fd5b50505050506000601460166101000a81548160ff02191690831515021790555050565b6000808314156122275760009050612289565b600082846122359190613428565b905082848261224491906133f7565b14612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b906131dc565b60405180910390fd5b809150505b92915050565b600080828461229e91906133a1565b9050838110156122e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122da9061317c565b60405180910390fd5b8091505092915050565b600061232f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612446565b905092915050565b6000600a9050600a82101561234f57600a9050612366565b60288211156123615760289050612365565b8190505b5b600061237c6002836124a990919063ffffffff16565b1461239057808061238c90613550565b9150505b6123b7600a6123a960068461221490919063ffffffff16565b6122ed90919063ffffffff16565b6009819055506123e4600a6123d660048461221490919063ffffffff16565b6122ed90919063ffffffff16565b600a819055505050565b806123fc576123fb6124f3565b5b612407848484612536565b8061241557612414612701565b5b50505050565b6000806000612428612715565b9150915061243f81836122ed90919063ffffffff16565b9250505090565b6000808311829061248d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248491906130da565b60405180910390fd5b506000838561249c91906133f7565b9050809150509392505050565b60006124eb83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250612777565b905092915050565b600060095414801561250757506000600a54145b1561251157612534565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b600080600080600080612548876127d5565b9550955095509550955095506125a686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061268781612887565b6126918483612944565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126ee91906132bc565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000683635c9adc5dea00000905061274b683635c9adc5dea000006007546122ed90919063ffffffff16565b82101561276a57600754683635c9adc5dea00000935093505050612773565b81819350935050505b9091565b60008083141582906127bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127b691906130da565b60405180910390fd5b5082846127cc9190613599565b90509392505050565b60008060008060008060008060006127f28a600954600a5461297e565b925092509250600061280261241b565b905060008060006128158e878787612a14565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061287f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d4d565b905092915050565b600061289161241b565b905060006128a8828461221490919063ffffffff16565b90506128fc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129598260075461283d90919063ffffffff16565b6007819055506129748160085461228f90919063ffffffff16565b6008819055505050565b6000806000806129aa606461299c888a61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129d460646129c6888b61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129fd826129ef858c61283d90919063ffffffff16565b61283d90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a2d858961221490919063ffffffff16565b90506000612a44868961221490919063ffffffff16565b90506000612a5b878961221490919063ffffffff16565b90506000612a8482612a76858761283d90919063ffffffff16565b61283d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612aac816139cd565b92915050565b600081519050612ac1816139cd565b92915050565b600081359050612ad6816139e4565b92915050565b600081519050612aeb816139e4565b92915050565b600081359050612b00816139fb565b92915050565b600081519050612b15816139fb565b92915050565b600060208284031215612b2d57600080fd5b6000612b3b84828501612a9d565b91505092915050565b600060208284031215612b5657600080fd5b6000612b6484828501612ab2565b91505092915050565b60008060408385031215612b8057600080fd5b6000612b8e85828601612a9d565b9250506020612b9f85828601612a9d565b9150509250929050565b600080600060608486031215612bbe57600080fd5b6000612bcc86828701612a9d565b9350506020612bdd86828701612a9d565b9250506040612bee86828701612af1565b9150509250925092565b60008060408385031215612c0b57600080fd5b6000612c1985828601612a9d565b9250506020612c2a85828601612af1565b9150509250929050565b600060208284031215612c4657600080fd5b6000612c5484828501612ac7565b91505092915050565b600060208284031215612c6f57600080fd5b6000612c7d84828501612adc565b91505092915050565b600060208284031215612c9857600080fd5b6000612ca684828501612af1565b91505092915050565b600080600060608486031215612cc457600080fd5b6000612cd286828701612b06565b9350506020612ce386828701612b06565b9250506040612cf486828701612b06565b9150509250925092565b6000612d0a8383612d16565b60208301905092915050565b612d1f816134b6565b82525050565b612d2e816134b6565b82525050565b6000612d3f8261335c565b612d49818561337f565b9350612d548361334c565b8060005b83811015612d85578151612d6c8882612cfe565b9750612d7783613372565b925050600181019050612d58565b5085935050505092915050565b612d9b816134c8565b82525050565b612daa8161350b565b82525050565b6000612dbb82613367565b612dc58185613390565b9350612dd581856020860161351d565b612dde81613628565b840191505092915050565b6000612df6602383613390565b9150612e0182613639565b604082019050919050565b6000612e19602a83613390565b9150612e2482613688565b604082019050919050565b6000612e3c602283613390565b9150612e47826136d7565b604082019050919050565b6000612e5f602283613390565b9150612e6a82613726565b604082019050919050565b6000612e82601b83613390565b9150612e8d82613775565b602082019050919050565b6000612ea5601583613390565b9150612eb08261379e565b602082019050919050565b6000612ec8602383613390565b9150612ed3826137c7565b604082019050919050565b6000612eeb602183613390565b9150612ef682613816565b604082019050919050565b6000612f0e602083613390565b9150612f1982613865565b602082019050919050565b6000612f31602983613390565b9150612f3c8261388e565b604082019050919050565b6000612f54602583613390565b9150612f5f826138dd565b604082019050919050565b6000612f77602483613390565b9150612f828261392c565b604082019050919050565b6000612f9a601783613390565b9150612fa58261397b565b602082019050919050565b6000612fbd601883613390565b9150612fc8826139a4565b602082019050919050565b612fdc816134f4565b82525050565b612feb816134fe565b82525050565b60006020820190506130066000830184612d25565b92915050565b60006040820190506130216000830185612d25565b61302e6020830184612d25565b9392505050565b600060408201905061304a6000830185612d25565b6130576020830184612fd3565b9392505050565b600060c0820190506130736000830189612d25565b6130806020830188612fd3565b61308d6040830187612da1565b61309a6060830186612da1565b6130a76080830185612d25565b6130b460a0830184612fd3565b979650505050505050565b60006020820190506130d46000830184612d92565b92915050565b600060208201905081810360008301526130f48184612db0565b905092915050565b6000602082019050818103600083015261311581612de9565b9050919050565b6000602082019050818103600083015261313581612e0c565b9050919050565b6000602082019050818103600083015261315581612e2f565b9050919050565b6000602082019050818103600083015261317581612e52565b9050919050565b6000602082019050818103600083015261319581612e75565b9050919050565b600060208201905081810360008301526131b581612e98565b9050919050565b600060208201905081810360008301526131d581612ebb565b9050919050565b600060208201905081810360008301526131f581612ede565b9050919050565b6000602082019050818103600083015261321581612f01565b9050919050565b6000602082019050818103600083015261323581612f24565b9050919050565b6000602082019050818103600083015261325581612f47565b9050919050565b6000602082019050818103600083015261327581612f6a565b9050919050565b6000602082019050818103600083015261329581612f8d565b9050919050565b600060208201905081810360008301526132b581612fb0565b9050919050565b60006020820190506132d16000830184612fd3565b92915050565b600060a0820190506132ec6000830188612fd3565b6132f96020830187612da1565b818103604083015261330b8186612d34565b905061331a6060830185612d25565b6133276080830184612fd3565b9695505050505050565b60006020820190506133466000830184612fe2565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133ac826134f4565b91506133b7836134f4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133ec576133eb6135ca565b5b828201905092915050565b6000613402826134f4565b915061340d836134f4565b92508261341d5761341c6135f9565b5b828204905092915050565b6000613433826134f4565b915061343e836134f4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613477576134766135ca565b5b828202905092915050565b600061348d826134f4565b9150613498836134f4565b9250828210156134ab576134aa6135ca565b5b828203905092915050565b60006134c1826134d4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613516826134f4565b9050919050565b60005b8381101561353b578082015181840152602081019050613520565b8381111561354a576000848401525b50505050565b600061355b826134f4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561358e5761358d6135ca565b5b600182019050919050565b60006135a4826134f4565b91506135af836134f4565b9250826135bf576135be6135f9565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6139d6816134b6565b81146139e157600080fd5b50565b6139ed816134c8565b81146139f857600080fd5b50565b613a04816134f4565b8114613a0f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220182547294dc22454f8876e4dc901d71cd53e7add01997f2e1aef16181086eb2964736f6c63430008040033
{"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"}]}}
6,412
0xca1d53e40eab232deff03dc824410100bcccf2bc
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; library FullMath { function fullMul(uint256 x, uint256 y) private pure returns (uint256 l, uint256 h) { uint256 mm = mulmod(x, y, uint256(-1)); l = x * y; h = mm - l; if (mm < l) h -= 1; } function fullDiv( uint256 l, uint256 h, uint256 d ) private pure returns (uint256) { uint256 pow2 = d & -d; d /= pow2; l /= pow2; l += h * ((-pow2) / pow2 + 1); uint256 r = 1; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; return l * r; } function mulDiv( uint256 x, uint256 y, uint256 d ) internal pure returns (uint256) { (uint256 l, uint256 h) = fullMul(x, y); uint256 mm = mulmod(x, y, d); if (mm > l) h -= 1; l -= mm; require(h < d, 'FullMath::mulDiv: overflow'); return fullDiv(l, h, d); } } library Babylonian { function sqrt(uint256 x) internal pure returns (uint256) { if (x == 0) return 0; uint256 xx = x; uint256 r = 1; if (xx >= 0x100000000000000000000000000000000) { xx >>= 128; r <<= 64; } if (xx >= 0x10000000000000000) { xx >>= 64; r <<= 32; } if (xx >= 0x100000000) { xx >>= 32; r <<= 16; } if (xx >= 0x10000) { xx >>= 16; r <<= 8; } if (xx >= 0x100) { xx >>= 8; r <<= 4; } if (xx >= 0x10) { xx >>= 4; r <<= 2; } if (xx >= 0x8) { r <<= 1; } r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; // Seven iterations should be enough uint256 r1 = x / r; return (r < r1 ? r : r1); } } library BitMath { function mostSignificantBit(uint256 x) internal pure returns (uint8 r) { require(x > 0, 'BitMath::mostSignificantBit: zero'); if (x >= 0x100000000000000000000000000000000) { x >>= 128; r += 128; } if (x >= 0x10000000000000000) { x >>= 64; r += 64; } if (x >= 0x100000000) { x >>= 32; r += 32; } if (x >= 0x10000) { x >>= 16; r += 16; } if (x >= 0x100) { x >>= 8; r += 8; } if (x >= 0x10) { x >>= 4; r += 4; } if (x >= 0x4) { x >>= 2; r += 2; } if (x >= 0x2) r += 1; } } library FixedPoint { // range: [0, 2**112 - 1] // resolution: 1 / 2**112 struct uq112x112 { uint224 _x; } // range: [0, 2**144 - 1] // resolution: 1 / 2**112 struct uq144x112 { uint256 _x; } uint8 private constant RESOLUTION = 112; uint256 private constant Q112 = 0x10000000000000000000000000000; uint256 private constant Q224 = 0x100000000000000000000000000000000000000000000000000000000; uint256 private constant LOWER_MASK = 0xffffffffffffffffffffffffffff; // decimal of UQ*x112 (lower 112 bits) // decode a UQ112x112 into a uint112 by truncating after the radix point function decode(uq112x112 memory self) internal pure returns (uint112) { return uint112(self._x >> RESOLUTION); } // decode a uq112x112 into a uint with 18 decimals of precision function decode112with18(uq112x112 memory self) internal pure returns (uint) { return uint(self._x) / 5192296858534827; } function fraction(uint256 numerator, uint256 denominator) internal pure returns (uq112x112 memory) { require(denominator > 0, 'FixedPoint::fraction: division by zero'); if (numerator == 0) return FixedPoint.uq112x112(0); if (numerator <= uint144(-1)) { uint256 result = (numerator << RESOLUTION) / denominator; require(result <= uint224(-1), 'FixedPoint::fraction: overflow'); return uq112x112(uint224(result)); } else { uint256 result = FullMath.mulDiv(numerator, Q112, denominator); require(result <= uint224(-1), 'FixedPoint::fraction: overflow'); return uq112x112(uint224(result)); } } // square root of a UQ112x112 // lossy between 0/1 and 40 bits function sqrt(uq112x112 memory self) internal pure returns (uq112x112 memory) { if (self._x <= uint144(-1)) { return uq112x112(uint224(Babylonian.sqrt(uint256(self._x) << 112))); } uint8 safeShiftBits = 255 - BitMath.mostSignificantBit(self._x); safeShiftBits -= safeShiftBits % 2; return uq112x112(uint224(Babylonian.sqrt(uint256(self._x) << safeShiftBits) << ((112 - safeShiftBits) / 2))); } } 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 sqrrt(uint256 a) internal pure returns (uint c) { if (a > 3) { c = a; uint b = add( div( a, 2), 1 ); while (b < c) { c = b; b = div( add( div( a, b ), b), 2 ); } } else if (a != 0) { c = 1; } } } interface IERC20 { function decimals() external view returns (uint8); } interface IUniswapV2ERC20 { function totalSupply() external view returns (uint); } interface IUniswapV2Pair is IUniswapV2ERC20 { function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function token0() external view returns ( address ); function token1() external view returns ( address ); } interface IBondingCalculator { function valuation( address pair_, uint amount_ ) external view returns ( uint _value ); } contract REDACTEDBondingCalculator is IBondingCalculator { using FixedPoint for *; using SafeMath for uint; using SafeMath for uint112; address public immutable BTRFLY; constructor( address _BTRFLY ) { require( _BTRFLY != address(0) ); BTRFLY = _BTRFLY; } function getKValue( address _pair ) public view returns( uint k_ ) { uint token0 = IERC20( IUniswapV2Pair( _pair ).token0() ).decimals(); uint token1 = IERC20( IUniswapV2Pair( _pair ).token1() ).decimals(); uint decimals = token0.add( token1 ).sub( IERC20( _pair ).decimals() ); (uint reserve0, uint reserve1, ) = IUniswapV2Pair( _pair ).getReserves(); k_ = reserve0.mul(reserve1).div( 10 ** decimals ); } function getTotalValue( address _pair ) public view returns ( uint _value ) { _value = getKValue( _pair ).sqrrt().mul(2); } function valuation( address _pair, uint amount_ ) external view override returns ( uint _value ) { uint totalValue = getTotalValue( _pair ); uint totalSupply = IUniswapV2Pair( _pair ).totalSupply(); _value = totalValue.mul( FixedPoint.fraction( amount_, totalSupply ).decode112with18() ).div( 1e18 ); } function markdown( address _pair ) external view returns ( uint ) { ( uint reserve0, uint reserve1, ) = IUniswapV2Pair( _pair ).getReserves(); uint reserve; if ( IUniswapV2Pair( _pair ).token0() == BTRFLY ) { reserve = reserve1; } else { reserve = reserve0; } return reserve.mul( 2 * ( 10 ** IERC20( BTRFLY ).decimals() ) ).div( getTotalValue( _pair ) ); } }
0x608060405234801561001057600080fd5b50600436106100575760003560e01c806322443c101461005c57806332da80a3146100805780634249719f146100b8578063490084ef146100e4578063686375491461010a575b600080fd5b610064610130565b604080516001600160a01b039092168252519081900360200190f35b6100a66004803603602081101561009657600080fd5b50356001600160a01b0316610154565b60408051918252519081900360200190f35b6100a6600480360360408110156100ce57600080fd5b506001600160a01b038135169060200135610337565b6100a6600480360360208110156100fa57600080fd5b50356001600160a01b03166103df565b6100a66004803603602081101561012057600080fd5b50356001600160a01b03166106c5565b7f000000000000000000000000c0d4ceb216b3ba9c3701b291766fdcba977cec3a81565b6000806000836001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561019257600080fd5b505afa1580156101a6573d6000803e3d6000fd5b505050506040513d60608110156101bc57600080fd5b50805160209182015160408051630dfe168160e01b815290516001600160701b0393841696509290911693506000926001600160a01b037f000000000000000000000000c0d4ceb216b3ba9c3701b291766fdcba977cec3a81169390891692630dfe1681926004808301939192829003018186803b15801561023d57600080fd5b505afa158015610251573d6000803e3d6000fd5b505050506040513d602081101561026757600080fd5b50516001600160a01b0316141561027f575080610282565b50815b61032c61028e866106c5565b6103267f000000000000000000000000c0d4ceb216b3ba9c3701b291766fdcba977cec3a6001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156102ea57600080fd5b505afa1580156102fe573d6000803e3d6000fd5b505050506040513d602081101561031457600080fd5b5051849060ff16600a0a6002026106e9565b90610749565b93505050505b919050565b600080610343846106c5565b90506000846001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561038057600080fd5b505afa158015610394573d6000803e3d6000fd5b505050506040513d60208110156103aa57600080fd5b505190506103d6670de0b6b3a76400006103266103cf6103ca888661078b565b610902565b85906106e9565b95945050505050565b600080826001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561041b57600080fd5b505afa15801561042f573d6000803e3d6000fd5b505050506040513d602081101561044557600080fd5b50516040805163313ce56760e01b815290516001600160a01b039092169163313ce56791600480820192602092909190829003018186803b15801561048957600080fd5b505afa15801561049d573d6000803e3d6000fd5b505050506040513d60208110156104b357600080fd5b50516040805163d21220a760e01b8152905160ff90921692506000916001600160a01b0386169163d21220a7916004808301926020929190829003018186803b1580156104ff57600080fd5b505afa158015610513573d6000803e3d6000fd5b505050506040513d602081101561052957600080fd5b50516040805163313ce56760e01b815290516001600160a01b039092169163313ce56791600480820192602092909190829003018186803b15801561056d57600080fd5b505afa158015610581573d6000803e3d6000fd5b505050506040513d602081101561059757600080fd5b50516040805163313ce56760e01b8152905160ff9092169250600091610627916001600160a01b0388169163313ce56791600480820192602092909190829003018186803b1580156105e857600080fd5b505afa1580156105fc573d6000803e3d6000fd5b505050506040513d602081101561061257600080fd5b505160ff16610621858561091a565b90610974565b9050600080866001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561066557600080fd5b505afa158015610679573d6000803e3d6000fd5b505050506040513d606081101561068f57600080fd5b5080516020909101516001600160701b0391821693501690506106ba600a84900a61032684846106e9565b979650505050505050565b60006106e360026106dd6106d8856103df565b6109b6565b906106e9565b92915050565b6000826106f8575060006106e3565b8282028284828161070557fe5b04146107425760405162461bcd60e51b8152600401808060200182810382526021815260200180610c876021913960400191505060405180910390fd5b9392505050565b600061074283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610a20565b610793610c4e565b600082116107d25760405162461bcd60e51b8152600401808060200182810382526026815260200180610c616026913960400191505060405180910390fd5b826107ec57506040805160208101909152600081526106e3565b71ffffffffffffffffffffffffffffffffffff831161089357600082607085901b8161081457fe5b0490506001600160e01b03811115610873576040805162461bcd60e51b815260206004820152601e60248201527f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f770000604482015290519081900360640190fd5b6040518060200160405280826001600160e01b03168152509150506106e3565b60006108a484600160701b85610ac2565b90506001600160e01b03811115610873576040805162461bcd60e51b815260206004820152601e60248201527f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f770000604482015290519081900360640190fd5b516612725dd1d243ab6001600160e01b039091160490565b600082820183811015610742576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061074283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610b57565b60006003821115610a1257508060006109da6109d3836002610749565b600161091a565b90505b81811015610a0c57809150610a056109fe6109f88584610749565b8361091a565b6002610749565b90506109dd565b50610332565b811561033257506001919050565b60008183610aac5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610a71578181015183820152602001610a59565b50505050905090810190601f168015610a9e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610ab857fe5b0495945050505050565b6000806000610ad18686610bb1565b9150915060008480610adf57fe5b868809905082811115610af3576001820391505b8083039250848210610b4c576040805162461bcd60e51b815260206004820152601a60248201527f46756c6c4d6174683a3a6d756c4469763a206f766572666c6f77000000000000604482015290519081900360640190fd5b6106ba838387610bde565b60008184841115610ba95760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610a71578181015183820152602001610a59565b505050900390565b6000808060001984860990508385029250828103915082811015610bd6576001820391505b509250929050565b60008181038216808381610bee57fe5b049250808581610bfa57fe5b049450808160000381610c0957fe5b60028581038087028203028087028203028087028203028087028203028087028203028087028203029586029003909402930460010193909302939093010292915050565b6040805160208101909152600081529056fe4669786564506f696e743a3a6672616374696f6e3a206469766973696f6e206279207a65726f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a26469706673582212205575ebe6b965b17a4d9ff79494a944221695790d1824508dd150463914d9ad6f64736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
6,413
0x0dBD9e61eF4e8C9e925C3EC132f538596C3160dF
/** *Submitted for verification at Etherscan.io on 2022-01-02 */ /* https://elffight.com t.me/elffight 10% tax antisnipe on block 0 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function 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 IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; } 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 swapExactTokensForTokensSupportingFeeOnTransferTokens( 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, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity); 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); } contract ElfFight is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Elf Fight"; string private constant _symbol = "ELFT"; uint8 private constant _decimals = 9; mapping(address => uint256) private _balances; uint256 private _firstBlock; uint256 private _botBlocks; uint256 public _maxWalletAmount; uint256 public _liquidityFee = 20; uint256 private _previousLiquidityFee = _liquidityFee; uint256 public _marketingFee = 80; uint256 private _previousMarketingFee = _marketingFee; uint256 private _marketingPercent = 1000; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant _tTotal = 100 * 1e6 * 1e9; // 100,000,000 mapping(address => bool) private bots; address payable private _marketingAddress = payable(0x492cFd0CAD5E398575324CAeae06D3181ca000D0); uint256 private _maxTxAmount; address payable private um = payable(0xaD69F9f7ac19d0adB74dEe252aE3bEB988E1c236); bool private tradingOpen = false; bool private inSwap = false; bool private UM = true; bool private sniperProtection = true; bool private pairSwapped = false; event EndedSniperProtection(bool sniperProtection); event MaxTxAmountUpdated(uint256 _maxTxAmount); event FeesUpdated(uint256 _marketingFee, uint256 _liquidityFee); IUniswapV2Router02 private uniswapV2Router; address public uniswapV2Pair; struct FeeBreakdown { uint256 tLiquidity; uint256 tMarketing; uint256 tAmount; } modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max); _maxTxAmount = _tTotal; // start off transaction limit at 100% of total supply _maxWalletAmount = _tTotal.div(1); // 100% _balances[_msgSender()] = _tTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() external pure returns (string memory) { return _name; } function symbol() external pure returns (string memory) { return _symbol; } function decimals() external pure returns (uint8) { return _decimals; } function totalSupply() external pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) external override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) external view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) external override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) { _transfer(sender, recipient, amount); _approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance")); return true; } function removeAllFee() private { if (_marketingFee == 0 && _liquidityFee == 0) return; _previousMarketingFee = _marketingFee; _previousLiquidityFee = _liquidityFee; _marketingFee = 0; _liquidityFee = 0; } function setBotFee() private { _previousMarketingFee = _marketingFee; _previousLiquidityFee = _liquidityFee; _marketingFee = 1000; //block 0 _liquidityFee = 0; } function restoreAllFee() private { _marketingFee = _previousMarketingFee; _liquidityFee = _previousLiquidityFee; } 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"); bool takeFee = true; if (from != owner() && to != owner() && from != address(this) && to != address(this)) { require(tradingOpen); require(amount <= _maxTxAmount); if (from == uniswapV2Pair && to != address(uniswapV2Router)) { if (block.number <= _firstBlock.add(_botBlocks)) { bots[to] = true; } require(balanceOf(to).add(amount) <= _maxWalletAmount, "wallet balance after transfer must be less than max wallet amount"); if (bots[to]) { setBotFee(); takeFee = true; } } if (!inSwap && from != uniswapV2Pair) { require(!bots[from] && !bots[to]); uint256 contractTokenBalance = balanceOf(address(this)); if (contractTokenBalance > 100000 * 1e9) { swapAndLiquify(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } 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 addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _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 autoLPamount = _liquidityFee.mul(contractTokenBalance).div(_marketingFee.add(_liquidityFee)); // split the contract balance into halves uint256 half = autoLPamount.div(2); uint256 otherHalf = contractTokenBalance.sub(half); // capture the contract's current ETH balance. // this is so that we can capture exactly the amount of ETH that the // swap creates, and not make the liquidity event include any ETH that // has been manually sent to the contract uint256 initialBalance = address(this).balance; // swap tokens for ETH swapTokensForEth(otherHalf); // <- this breaks the ETH -> HATE swap when swap+liquify is triggered // how much ETH did we just swap into? uint256 newBalance = ((address(this).balance.sub(initialBalance)).mul(half)).div(otherHalf); addLiquidity(half, newBalance); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer((amount).div(7).mul(6)); um.transfer((amount).div(7)); } function openTrading(uint256 botBlocks) private { _firstBlock = block.number; _botBlocks = botBlocks; tradingOpen = true; } function manualSwap() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); if (contractBalance > 0) { swapTokensForEth(contractBalance); } } function manualSend() external onlyOwner() { uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(contractETHBalance); } } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if (!takeFee) { removeAllFee(); } _transferStandard(sender, recipient, amount); restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 amount) private { FeeBreakdown memory fees; fees.tMarketing = amount.mul(_marketingFee).div(1000); fees.tLiquidity = amount.mul(_liquidityFee).div(1000); fees.tAmount = amount.sub(fees.tMarketing).sub(fees.tLiquidity); _balances[sender] = _balances[sender].sub(amount); _balances[recipient] = _balances[recipient].add(fees.tAmount); _balances[address(this)] = _balances[address(this)].add(fees.tMarketing.add(fees.tLiquidity)); emit Transfer(sender, recipient, fees.tAmount); } receive() external payable {} function setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { require(maxTxAmount > _tTotal.div(10000), "Amount must be greater than 0.01% of supply"); require(maxTxAmount <= _tTotal, "Amount must be less than or equal to totalSupply"); _maxTxAmount = maxTxAmount; emit MaxTxAmountUpdated(_maxTxAmount); } function setMaxWalletAmount(uint256 maxWalletAmount) external onlyOwner() { require(maxWalletAmount > _tTotal.div(200), "Amount must be greater than 0.5% of supply"); require(maxWalletAmount <= _tTotal, "Amount must be less than or equal to totalSupply"); _maxWalletAmount = maxWalletAmount; } function setTaxes(uint256 marketingFee, uint256 liquidityFee) external onlyOwner() { uint256 totalFee = marketingFee.add(liquidityFee); require(totalFee.div(10) < 50, "Sum of fees must be less than 50"); _marketingFee = marketingFee; _liquidityFee = liquidityFee; _previousMarketingFee = _marketingFee; _previousLiquidityFee = _liquidityFee; uint256 totalETHfees = _marketingFee; _marketingPercent = (_marketingFee.mul(1000)).div(totalETHfees); emit FeesUpdated(_marketingFee, _liquidityFee); } function endSniperProtection(uint256 botBlocks) external onlyOwner() { require(sniperProtection == true, "done"); sniperProtection = false; openTrading(botBlocks); emit EndedSniperProtection(sniperProtection); } }
0x60806040526004361061012e5760003560e01c80636bc87c3a116100ab578063a9059cbb1161006f578063a9059cbb14610361578063c647b20e14610381578063dd62ed3e146103a1578063ec28438a146103e7578063f2fde38b14610407578063f42938901461042757600080fd5b80636bc87c3a146102b45780636c0a24eb146102ca57806370a08231146102e05780638da5cb5b1461031657806395d89b411461033457600080fd5b806327a14fc2116100f257806327a14fc2146102095780632ca862cd1461022b578063313ce5671461024b57806349bd5a5e1461026757806351bc3c851461029f57600080fd5b806306fdde031461013a578063095ea7b31461017e57806318160ddd146101ae57806322976e0d146101d357806323b872dd146101e957600080fd5b3661013557005b600080fd5b34801561014657600080fd5b50604080518082019091526009815268115b1988119a59da1d60ba1b60208201525b604051610175919061179e565b60405180910390f35b34801561018a57600080fd5b5061019e610199366004611709565b61043c565b6040519015158152602001610175565b3480156101ba57600080fd5b5067016345785d8a00005b604051908152602001610175565b3480156101df57600080fd5b506101c560085481565b3480156101f557600080fd5b5061019e6102043660046116c8565b610453565b34801561021557600080fd5b50610229610224366004611735565b6104bc565b005b34801561023757600080fd5b50610229610246366004611735565b610590565b34801561025757600080fd5b5060405160098152602001610175565b34801561027357600080fd5b50601254610287906001600160a01b031681565b6040516001600160a01b039091168152602001610175565b3480156102ab57600080fd5b50610229610666565b3480156102c057600080fd5b506101c560065481565b3480156102d657600080fd5b506101c560055481565b3480156102ec57600080fd5b506101c56102fb366004611655565b6001600160a01b031660009081526002602052604090205490565b34801561032257600080fd5b506000546001600160a01b0316610287565b34801561034057600080fd5b506040805180820190915260048152631153119560e21b6020820152610168565b34801561036d57600080fd5b5061019e61037c366004611709565b6106b2565b34801561038d57600080fd5b5061022961039c36600461174e565b6106bf565b3480156103ad57600080fd5b506101c56103bc36600461168f565b6001600160a01b039182166000908152600b6020908152604080832093909416825291909152205490565b3480156103f357600080fd5b50610229610402366004611735565b6107ca565b34801561041357600080fd5b50610229610422366004611655565b6108c7565b34801561043357600080fd5b5061022961095f565b60006104493384846109e2565b5060015b92915050565b6000610460848484610b06565b6104b284336104ad8560405180606001604052806028815260200161199b602891396001600160a01b038a166000908152600b602090815260408083203384529091529020549190610f37565b6109e2565b5060019392505050565b6000546001600160a01b031633146104ef5760405162461bcd60e51b81526004016104e6906117f3565b60405180910390fd5b61050267016345785d8a000060c8610999565b81116105635760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d7573742062652067726561746572207468616e20302e3525604482015269206f6620737570706c7960b01b60648201526084016104e6565b67016345785d8a000081111561058b5760405162461bcd60e51b81526004016104e690611828565b600555565b6000546001600160a01b031633146105ba5760405162461bcd60e51b81526004016104e6906117f3565b601054600160b81b900460ff1615156001146106015760405162461bcd60e51b81526004016104e690602080825260049082015263646f6e6560e01b604082015260600190565b6010805443600355600483905563ff0000ff60a01b1916600160a01b179055601054604051600160b81b90910460ff16151581527f402efd45e697f3e47f865bbcdc169c723a53fefc99dfb3802c5c7543912db7d5906020015b60405180910390a150565b6000546001600160a01b031633146106905760405162461bcd60e51b81526004016104e6906117f3565b3060009081526002602052604090205480156106af576106af81610f71565b50565b6000610449338484610b06565b6000546001600160a01b031633146106e95760405162461bcd60e51b81526004016104e6906117f3565b60006106f583836110fa565b9050603261070482600a610999565b106107515760405162461bcd60e51b815260206004820181905260248201527f53756d206f662066656573206d757374206265206c657373207468616e20353060448201526064016104e6565b60088390556006829055600983905560078290558261077c81610776816103e8611159565b90610999565b600a556008546006546040517f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1926107bc92908252602082015260400190565b60405180910390a150505050565b6000546001600160a01b031633146107f45760405162461bcd60e51b81526004016104e6906117f3565b61080867016345785d8a0000612710610999565b811161086a5760405162461bcd60e51b815260206004820152602b60248201527f416d6f756e74206d7573742062652067726561746572207468616e20302e303160448201526a25206f6620737570706c7960a81b60648201526084016104e6565b67016345785d8a00008111156108925760405162461bcd60e51b81526004016104e690611828565b600f8190556040518181527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200161065b565b6000546001600160a01b031633146108f15760405162461bcd60e51b81526004016104e6906117f3565b6001600160a01b0381166109565760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104e6565b6106af816111d8565b6000546001600160a01b031633146109895760405162461bcd60e51b81526004016104e6906117f3565b4780156106af576106af81611228565b60006109db83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506112bc565b9392505050565b6001600160a01b038316610a445760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104e6565b6001600160a01b038216610aa55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104e6565b6001600160a01b038381166000818152600b602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b6a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104e6565b6001600160a01b038216610bcc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104e6565b60008111610c2e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104e6565b6001610c426000546001600160a01b031690565b6001600160a01b0316846001600160a01b031614158015610c7157506000546001600160a01b03848116911614155b8015610c8657506001600160a01b0384163014155b8015610c9b57506001600160a01b0383163014155b15610ecc57601054600160a01b900460ff16610cb657600080fd5b600f54821115610cc557600080fd5b6012546001600160a01b038581169116148015610cf057506011546001600160a01b03848116911614155b15610e1a57600454600354610d04916110fa565b4311610d2e576001600160a01b0383166000908152600d60205260409020805460ff191660011790555b600554610d5a83610d54866001600160a01b031660009081526002602052604090205490565b906110fa565b1115610dd85760405162461bcd60e51b815260206004820152604160248201527f77616c6c65742062616c616e6365206166746572207472616e73666572206d7560448201527f7374206265206c657373207468616e206d61782077616c6c657420616d6f756e6064820152601d60fa1b608482015260a4016104e6565b6001600160a01b0383166000908152600d602052604090205460ff1615610e1a57610e1660088054600955600680546007556103e890915560009055565b5060015b601054600160a81b900460ff16158015610e4257506012546001600160a01b03858116911614155b15610ecc576001600160a01b0384166000908152600d602052604090205460ff16158015610e8957506001600160a01b0383166000908152600d602052604090205460ff16155b610e9257600080fd5b30600090815260026020526040902054655af3107a4000811115610eb957610eb9816112ea565b478015610ec957610ec947611228565b50505b6001600160a01b0384166000908152600c602052604090205460ff1680610f0b57506001600160a01b0383166000908152600c602052604090205460ff165b15610f14575060005b610f2084848484611369565b610f31600954600855600754600655565b50505050565b60008184841115610f5b5760405162461bcd60e51b81526004016104e6919061179e565b506000610f688486611942565b95945050505050565b6010805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fb957610fb961196f565b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561100d57600080fd5b505afa158015611021573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110459190611672565b816001815181106110585761105861196f565b6001600160a01b03928316602091820292909201015260115461107e91309116846109e2565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac947906110b7908590600090869030904290600401611878565b600060405180830381600087803b1580156110d157600080fd5b505af11580156110e5573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b60008061110783856118e9565b9050838110156109db5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104e6565b6000826111685750600061044d565b60006111748385611923565b9050826111818583611901565b146109db5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104e6565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600e546001600160a01b03166108fc61124d6006611247856007610999565b90611159565b6040518115909202916000818181858888f19350505050158015611275573d6000803e3d6000fd5b506010546001600160a01b03166108fc611290836007610999565b6040518115909202916000818181858888f193505050501580156112b8573d6000803e3d6000fd5b5050565b600081836112dd5760405162461bcd60e51b81526004016104e6919061179e565b506000610f688486611901565b6010805460ff60a81b1916600160a81b17905560065460085460009161132091611313916110fa565b6006546107769085611159565b9050600061132f826002610999565b9050600061133d8483611381565b90504761134982610f71565b600061135d83610776866112474787611381565b90506110e584826113c3565b80611376576113766114a7565b610f208484846114d5565b60006109db83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f37565b6011546113db9030906001600160a01b0316846109e2565b6011546001600160a01b031663f305d7198230856000806114046000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561146757600080fd5b505af115801561147b573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906114a09190611770565b5050505050565b6008541580156114b75750600654155b156114be57565b600880546009556006805460075560009182905555565b6114f960405180606001604052806000815260200160008152602001600081525090565b6115146103e86107766008548561115990919063ffffffff16565b602082015260065461152f906103e890610776908590611159565b808252602082015161154d9190611547908590611381565b90611381565b6040808301919091526001600160a01b0385166000908152600260205220546115769083611381565b6001600160a01b038086166000908152600260205260408082209390935583830151918616815291909120546115ab916110fa565b6001600160a01b0384166000908152600260209081526040909120919091558151908201516115f4916115de91906110fa565b30600090815260026020526040902054906110fa565b30600090815260026020908152604091829020929092558281015190519081526001600160a01b0385811692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a350505050565b60006020828403121561166757600080fd5b81356109db81611985565b60006020828403121561168457600080fd5b81516109db81611985565b600080604083850312156116a257600080fd5b82356116ad81611985565b915060208301356116bd81611985565b809150509250929050565b6000806000606084860312156116dd57600080fd5b83356116e881611985565b925060208401356116f881611985565b929592945050506040919091013590565b6000806040838503121561171c57600080fd5b823561172781611985565b946020939093013593505050565b60006020828403121561174757600080fd5b5035919050565b6000806040838503121561176157600080fd5b50508035926020909101359150565b60008060006060848603121561178557600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156117cb578581018301518582016040015282016117af565b818111156117dd576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526030908201527f416d6f756e74206d757374206265206c657373207468616e206f72206571756160408201526f6c20746f20746f74616c537570706c7960801b606082015260800190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118c85784516001600160a01b0316835293830193918301916001016118a3565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156118fc576118fc611959565b500190565b60008261191e57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561193d5761193d611959565b500290565b60008282101561195457611954611959565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b03811681146106af57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220514682e0eed680ad8333baaa2ccf35897ec2a5a59d9a3b27f498ca449fb4490964736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
6,414
0x7d3e8394f97985f52b11826047803667f16ccf32
/** *Submitted for verification at Etherscan.io on 2021-10-17 */ pragma solidity ^0.6.12; //* Kakegurui Inu (ERC-20) //🈵 Yumeko Jabami enrolls at Hyakkaou Private Academy, Where students are ranked by there gambling winnings, and fame and fortune a wait those who rise to the top //With respect to the Japanese Manga series, we present the all new Kakegurui Inu Token! //Our products + Features: //✴️Explorative 3D Game with Paid for Assets //✴️DEXT Trending Fast Track //✴️Anime Coin Listing Exchanges on CoinGecko and CMC //Our Tokenomics: //✴️Marketing Tax (5% on buys, 5% on sells) //✴️ We modify, buy and use assets/materials found on our Unreal Engine 3D Game //✴️MAX BUY LIMIT: 10,000,000 Tokens //For the first 30 Seconds //Launching: October 17 2021 //💮 Total Supply: 1,000,000,000 //💮6 month Liquidity Lock with Proof (5k) //Ownership Renounced with Proof //Contract: releasing shortly //Connect with us: // https://t.me/kakeguruiinu //Explore Right Now: //🎯 Website: https://kakeguruiinu.com/ 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 KAKEINU is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000* 10**12 * 10**18; string private _name = 'Kakegurui Inu'; string private _symbol = 'KAKEINU'; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212207609e719565707ee99eb535d4558605f9557fa91187e014fea55c8003b569e7664736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,415
0x5ec544e275e8f3a25626bbf179affc934e01ca01
/** *Submitted for verification at Etherscan.io on 2021-11-25 */ // 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 MultiLiquidityPoolCapital 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 { } }
0x6080604052600436106100d55760003560e01c8063395093511161007957806395d89b411161005657806395d89b411461023a578063a457c2d71461024f578063a9059cbb1461026f578063dd62ed3e1461028f57005b806339509351146101c45780633ebcda62146101e457806370a082311461020457005b8063141a8dd8116100b2578063141a8dd81461010957806318160ddd1461015557806323b872dd14610178578063313ce5671461019857005b806306fdde03146100de5780630930907b14610109578063095ea7b31461012557005b366100dc57005b005b3480156100ea57600080fd5b506100f36102d5565b6040516101009190610c15565b60405180910390f35b34801561011557600080fd5b5060405160008152602001610100565b34801561013157600080fd5b50610145610140366004610be9565b610363565b6040519015158152602001610100565b34801561016157600080fd5b5061016a6103ea565b604051908152602001610100565b34801561018457600080fd5b50610145610193366004610ba8565b610427565b3480156101a457600080fd5b506004546101b29060ff1681565b60405160ff9091168152602001610100565b3480156101d057600080fd5b506101456101df366004610be9565b610581565b3480156101f057600080fd5b506100dc6101ff366004610be9565b6105c5565b34801561021057600080fd5b5061016a61021f366004610b35565b6001600160a01b031660009081526009602052604090205490565b34801561024657600080fd5b506100f361069d565b34801561025b57600080fd5b5061014561026a366004610be9565b6106aa565b34801561027b57600080fd5b5061014561028a366004610be9565b6106e0565b34801561029b57600080fd5b5061016a6102aa366004610b6f565b6001600160a01b039182166000908152600a6020908152604080832093909416825291909152205490565b600380546102e290610cb8565b80601f016020809104026020016040519081016040528092919081815260200182805461030e90610cb8565b801561035b5780601f106103305761010080835404028352916020019161035b565b820191906000526020600020905b81548152906001019060200180831161033e57829003601f168201915b505050505081565b336000818152600a602090815260408083206001600160a01b0387811685529252822084905560025491929116141561039f5761039f826107cb565b6040518281526001600160a01b0384169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906020015b60405180910390a35060015b92915050565b600080805260096020527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b5460055461042291610876565b905090565b60006001600160a01b0384161580159061044f575060045461010090046001600160a01b0316155b156104795760048054610100600160a81b0319166101006001600160a01b03861602179055610483565b6104838484610896565b6001600160a01b0384166000908152600960205260409020546104a69083610876565b6001600160a01b038516600090815260096020908152604080832093909355600a8152828220338352905220546104dd9083610876565b6001600160a01b038086166000908152600a6020908152604080832033845282528083209490945591861681526009909152205461051b9083610974565b6001600160a01b0380851660008181526009602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061056f9086815260200190565b60405180910390a35060019392505050565b336000818152600a602090815260408083206001600160a01b038716845290915281205490916105bc9185906105b79086610974565b61098f565b50600192915050565b6000546001600160a01b031633146105dc57600080fd5b6001600160a01b0382166106435760405162461bcd60e51b8152602060048201526024808201527f45524332303a207265666c6563742066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084015b60405180910390fd5b61064d8282610ab3565b6001600160a01b0382166000908152600960205260409020546106709082610876565b6001600160a01b0383166000908152600960205260409020556005546106969082610876565b6005555050565b600180546102e290610cb8565b336000818152600a602090815260408083206001600160a01b038716845290915281205490916105bc9185906105b79086610876565b6004546000906001600160a01b038481166101009092041614156107345760405162461bcd60e51b815260206004820152600b60248201526a1c1b19585cd9481dd85a5d60aa1b604482015260640161063a565b3360009081526009602052604090205461074e9083610876565b33600090815260096020526040808220929092556001600160a01b0385168152205461077a9083610974565b6001600160a01b0384166000818152600960205260409081902092909255905133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103d89086815260200190565b600860009054906101000a90046001600160a01b03166001600160a01b0316630930907b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561081957600080fd5b505afa15801561082d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108519190610b52565b600780546001600160a01b0319166001600160a01b0392909216919091179055600655565b60008282111561088557600080fd5b61088f8284610ca1565b9392505050565b6004546001600160a01b03828116610100909204161415806108e257506007546001600160a01b0383811691161480156108e257506004546001600160a01b0382811661010090920416145b8061092457506004546001600160a01b038281166101009092041614801561092457506006546001600160a01b03831660009081526009602052604090205411155b6109705760405162461bcd60e51b815260206004820152601a60248201527f63616e6e6f7420626520746865207a65726f2061646472657373000000000000604482015260640161063a565b5050565b60006109808284610c6a565b9050828110156103e457600080fd5b6001600160a01b0383166109f15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161063a565b6001600160a01b038216610a525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161063a565b6001600160a01b038381166000818152600a602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600780546001600160a01b0319166001600160a01b038416179055610ae5610adc826002610c82565b60055490610974565b600555610b15610af6826002610c82565b6001600160a01b03841660009081526009602052604090205490610974565b6001600160a01b0390921660009081526009602052604090209190915550565b600060208284031215610b4757600080fd5b813561088f81610d09565b600060208284031215610b6457600080fd5b815161088f81610d09565b60008060408385031215610b8257600080fd5b8235610b8d81610d09565b91506020830135610b9d81610d09565b809150509250929050565b600080600060608486031215610bbd57600080fd5b8335610bc881610d09565b92506020840135610bd881610d09565b929592945050506040919091013590565b60008060408385031215610bfc57600080fd5b8235610c0781610d09565b946020939093013593505050565b600060208083528351808285015260005b81811015610c4257858101830151858201604001528201610c26565b81811115610c54576000604083870101525b50601f01601f1916929092016040019392505050565b60008219821115610c7d57610c7d610cf3565b500190565b6000816000190483118215151615610c9c57610c9c610cf3565b500290565b600082821015610cb357610cb3610cf3565b500390565b600181811c90821680610ccc57607f821691505b60208210811415610ced57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114610d1e57600080fd5b5056fea2646970667358221220f46d6fe1bd7f59837f3e7301397d830264a6a63f0ca0a74f9a510b9b07b8c96464736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
6,416
0x78346f5c9b8daf3c22579ed494a829d36b4783e4
/** *Submitted for verification at Etherscan.io on 2022-04-21 */ //SPDX-License-Identifier: UNLICENSED /* /$$ /$$ /$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$ /$$$$$$$ /$$$$$$ /$$ /$$ /$$ /$$ | $$ /$$/|_ $$_/| $$$ | $$|_ $$_/| $$__ $$ /$$__ $$ | $$__ $$ /$$__ $$| $$$ | $$| $$ /$$/ | $$ /$$/ | $$ | $$$$| $$ | $$ | $$ \ $$| $$ \ $$ | $$ \ $$| $$ \ $$| $$$$| $$| $$ /$$/ | $$$$$/ | $$ | $$ $$ $$ | $$ | $$$$$$$/| $$ | $$ | $$$$$$$ | $$$$$$$$| $$ $$ $$| $$$$$/ | $$ $$ | $$ | $$ $$$$ | $$ | $$__ $$| $$ | $$ | $$__ $$| $$__ $$| $$ $$$$| $$ $$ | $$\ $$ | $$ | $$\ $$$ | $$ | $$ \ $$| $$ | $$ | $$ \ $$| $$ | $$| $$\ $$$| $$\ $$ | $$ \ $$ /$$$$$$| $$ \ $$ /$$$$$$| $$ | $$| $$$$$$/ | $$$$$$$/| $$ | $$| $$ \ $$| $$ \ $$ |__/ \__/|______/|__/ \__/|______/|__/ |__/ \______/ |_______/ |__/ |__/|__/ \__/|__/ \__/ https://kinirobank.com/ https://t.me/kinirobank */ 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 KINIRO 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"Kiniro Bank"; string public constant symbol = unicode"KINIRO"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _MarketingWallet; address public uniswapV2Pair; uint public _bFee = 8; uint public _sFee = 12; 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); if((_launchedAt + (3 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 = 1000000000 * 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() { _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]; } }
0x6080604052600436106101fd5760003560e01c8063715018a61161010d578063b0e9fffe116100a0578063db92dbb61161006f578063db92dbb6146105c3578063dcb0e0ad146105d8578063dd62ed3e146105f8578063e9e1831a1461063e578063fdf7cd931461065357600080fd5b8063b0e9fffe14610563578063b515566a14610579578063c3c8cd8014610599578063c9567bf9146105ae57600080fd5b806395d89b41116100dc57806395d89b41146104dc5780639e78fb4f1461050e578063a9059cbb14610523578063aacebbe31461054357600080fd5b8063715018a61461047257806382247ec0146104875780638da5cb5b1461049d57806394b8d8f2146104bb57600080fd5b806330380a46116101905780633bbac5791161015f5780633bbac579146103b657806349bd5a5e146103ef5780636755a4d0146104275780636fc3eaec1461043d57806370a082311461045257600080fd5b806330380a4614610339578063313ce5671461035957806331c2d8471461038057806332d873d8146103a057600080fd5b80631fe0371e116101cc5780631fe0371e146102ce5780632188650e146102e457806323b872dd1461030457806327f3a72a1461032457600080fd5b806306fdde0314610209578063095ea7b3146102565780630b78f9c01461028657806318160ddd146102a857600080fd5b3661020457005b600080fd5b34801561021557600080fd5b506102406040518060400160405280600b81526020016a4b696e69726f2042616e6b60a81b81525081565b60405161024d9190611753565b60405180910390f35b34801561026257600080fd5b506102766102713660046117cd565b610673565b604051901515815260200161024d565b34801561029257600080fd5b506102a66102a13660046117f9565b610689565b005b3480156102b457600080fd5b5068056bc75e2d631000005b60405190815260200161024d565b3480156102da57600080fd5b506102c060095481565b3480156102f057600080fd5b506102a66102ff3660046117f9565b610703565b34801561031057600080fd5b5061027661031f36600461181b565b610749565b34801561033057600080fd5b506102c061079d565b34801561034557600080fd5b506102a661035436600461186a565b6107ad565b34801561036557600080fd5b5061036e600981565b60405160ff909116815260200161024d565b34801561038c57600080fd5b506102a661039b36600461189d565b6107f3565b3480156103ac57600080fd5b506102c0600e5481565b3480156103c257600080fd5b506102766103d1366004611962565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103fb57600080fd5b5060085461040f906001600160a01b031681565b6040516001600160a01b03909116815260200161024d565b34801561043357600080fd5b506102c0600c5481565b34801561044957600080fd5b506102a6610885565b34801561045e57600080fd5b506102c061046d366004611962565b610892565b34801561047e57600080fd5b506102a66108ad565b34801561049357600080fd5b506102c0600d5481565b3480156104a957600080fd5b506000546001600160a01b031661040f565b3480156104c757600080fd5b50600f54610276906301000000900460ff1681565b3480156104e857600080fd5b50610240604051806040016040528060068152602001654b494e49524f60d01b81525081565b34801561051a57600080fd5b506102a6610921565b34801561052f57600080fd5b5061027661053e3660046117cd565b610afc565b34801561054f57600080fd5b506102a661055e366004611962565b610b09565b34801561056f57600080fd5b506102c0600a5481565b34801561058557600080fd5b506102a661059436600461189d565b610b88565b3480156105a557600080fd5b506102a6610ca1565b3480156105ba57600080fd5b506102a6610cb7565b3480156105cf57600080fd5b506102c0610d33565b3480156105e457600080fd5b506102a66105f336600461186a565b610d4b565b34801561060457600080fd5b506102c061061336600461197f565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561064a57600080fd5b506102a6610dca565b34801561065f57600080fd5b5060075461040f906001600160a01b031681565b6000610680338484610f73565b50600192915050565b6000546001600160a01b031633146106bc5760405162461bcd60e51b81526004016106b3906119b8565b60405180910390fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b6000546001600160a01b0316331461072d5760405162461bcd60e51b81526004016106b3906119b8565b631dcd6500600c541061074557600c829055600d8190555b5050565b6000610756848484611097565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610785908490611a03565b9050610792853383610f73565b506001949350505050565b60006107a830610892565b905090565b6000546001600160a01b031633146107d75760405162461bcd60e51b81526004016106b3906119b8565b600f8054911515620100000262ff000019909216919091179055565b6000546001600160a01b0316331461081d5760405162461bcd60e51b81526004016106b3906119b8565b60005b81518110156107455760006005600084848151811061084157610841611a1a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061087d81611a30565b915050610820565b4761088f81611420565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146108d75760405162461bcd60e51b81526004016106b3906119b8565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461094b5760405162461bcd60e51b81526004016106b3906119b8565b600f5460ff161561096e5760405162461bcd60e51b81526004016106b390611a4b565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa1580156109d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f79190611a82565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a689190611a82565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610ab5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad99190611a82565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b6000610680338484611097565b6000546001600160a01b03163314610b335760405162461bcd60e51b81526004016106b3906119b8565b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527fbf86feedee5b30c30a8243bd21deebb704d141478d39b1be04fe5ee739f214e7906020015b60405180910390a150565b6000546001600160a01b03163314610bb25760405162461bcd60e51b81526004016106b3906119b8565b60005b81518110156107455760085482516001600160a01b0390911690839083908110610be157610be1611a1a565b60200260200101516001600160a01b031614158015610c32575060065482516001600160a01b0390911690839083908110610c1e57610c1e611a1a565b60200260200101516001600160a01b031614155b15610c8f57600160056000848481518110610c4f57610c4f611a1a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c9981611a30565b915050610bb5565b6000610cac30610892565b905061088f8161145a565b6000546001600160a01b03163314610ce15760405162461bcd60e51b81526004016106b3906119b8565b600f5460ff1615610d045760405162461bcd60e51b81526004016106b390611a4b565b600f805442600e55670de0b6b3a7640000600c55671bc16d674ec80000600d5562ff00ff191662010001179055565b6008546000906107a8906001600160a01b0316610892565b6000546001600160a01b03163314610d755760405162461bcd60e51b81526004016106b3906119b8565b600f805463ff000000191663010000008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610b7d565b6000546001600160a01b03163314610df45760405162461bcd60e51b81526004016106b3906119b8565b600f5460ff1615610e175760405162461bcd60e51b81526004016106b390611a4b565b600654610e389030906001600160a01b031668056bc75e2d63100000610f73565b6006546001600160a01b031663f305d7194730610e5481610892565b600080610e696000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610ed1573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ef69190611a9f565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610f4f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088f9190611acd565b6001600160a01b038316610fd55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106b3565b6001600160a01b0382166110365760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106b3565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff16156110bd57600080fd5b6001600160a01b0383166111215760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106b3565b6001600160a01b0382166111835760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106b3565b600081116111e55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106b3565b600080546001600160a01b0385811691161480159061121257506000546001600160a01b03848116911614155b156113c1576008546001600160a01b03858116911614801561124257506006546001600160a01b03848116911614155b801561126757506001600160a01b03831660009081526004602052604090205460ff16155b156112d957600f5460ff1661127b57600080fd5b42600e5460b461128b9190611aea565b1180156112a05750600f5462010000900460ff165b156112d557600c548211156112b457600080fd5b600d546112c084610892565b6112ca9084611aea565b11156112d557600080fd5b5060015b600f54610100900460ff161580156112f35750600f5460ff165b801561130d57506008546001600160a01b03858116911614155b156113c157600061131d30610892565b905080156113aa57600f546301000000900460ff16156113a157600b5460085460649190611353906001600160a01b0316610892565b61135d9190611b02565b6113679190611b21565b8111156113a157600b546008546064919061138a906001600160a01b0316610892565b6113949190611b02565b61139e9190611b21565b90505b6113aa8161145a565b4780156113ba576113ba47611420565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061140357506001600160a01b03841660009081526004602052604090205460ff165b1561140c575060005b61141985858584866115ce565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610745573d6000803e3d6000fd5b600f805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061149e5761149e611a1a565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156114f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061151b9190611a82565b8160018151811061152e5761152e611a1a565b6001600160a01b0392831660209182029290920101526006546115549130911684610f73565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac9479061158d908590600090869030904290600401611b43565b600060405180830381600087803b1580156115a757600080fd5b505af11580156115bb573d6000803e3d6000fd5b5050600f805461ff001916905550505050565b60006115da83836115f0565b90506115e886868684611614565b505050505050565b600080831561160d578215611608575060095461160d565b50600a545b9392505050565b60008061162184846116f1565b6001600160a01b038816600090815260026020526040902054919350915061164a908590611a03565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461167a908390611aea565b6001600160a01b03861660009081526002602052604090205561169c81611725565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116e191815260200190565b60405180910390a3505050505050565b6000808060646117018587611b02565b61170b9190611b21565b905060006117198287611a03565b96919550909350505050565b30600090815260026020526040902054611740908290611aea565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561178057858101830151858201604001528201611764565b81811115611792576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461088f57600080fd5b80356117c8816117a8565b919050565b600080604083850312156117e057600080fd5b82356117eb816117a8565b946020939093013593505050565b6000806040838503121561180c57600080fd5b50508035926020909101359150565b60008060006060848603121561183057600080fd5b833561183b816117a8565b9250602084013561184b816117a8565b929592945050506040919091013590565b801515811461088f57600080fd5b60006020828403121561187c57600080fd5b813561160d8161185c565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156118b057600080fd5b823567ffffffffffffffff808211156118c857600080fd5b818501915085601f8301126118dc57600080fd5b8135818111156118ee576118ee611887565b8060051b604051601f19603f8301168101818110858211171561191357611913611887565b60405291825284820192508381018501918883111561193157600080fd5b938501935b8285101561195657611947856117bd565b84529385019392850192611936565b98975050505050505050565b60006020828403121561197457600080fd5b813561160d816117a8565b6000806040838503121561199257600080fd5b823561199d816117a8565b915060208301356119ad816117a8565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015611a1557611a156119ed565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611a4457611a446119ed565b5060010190565b60208082526017908201527f54726164696e6720697320616c7265616479206f70656e000000000000000000604082015260600190565b600060208284031215611a9457600080fd5b815161160d816117a8565b600080600060608486031215611ab457600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611adf57600080fd5b815161160d8161185c565b60008219821115611afd57611afd6119ed565b500190565b6000816000190483118215151615611b1c57611b1c6119ed565b500290565b600082611b3e57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b935784516001600160a01b031683529383019391830191600101611b6e565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220bd4ec5ed0da4652ab1f0962247c03e6261f4283b7282a80ee82a76fe2205e13b64736f6c634300080b0033
{"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"}]}}
6,417
0xe2ef9698900e7deef586e335caa25b2d4f22af5b
pragma solidity ^0.4.18; 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) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract BaseGame { function canSetBanker() view public returns (bool _result); function setBanker(address _banker, uint256 _beginTime, uint256 _endTime) public returns(bool _result); string public gameName = "NO.1"; uint public gameType = 1004; string public officialGameUrl; function userRefund() public returns(bool _result); uint public bankerBeginTime; uint public bankerEndTime; address public currentBanker; mapping (address => uint256) public userEtherOf; } contract Base is BaseGame{ using SafeMath for uint256; uint public createTime = now; address public owner; function Base() public { } modifier onlyOwner { require(msg.sender == owner); _; } function setOwner(address _newOwner) public onlyOwner { owner = _newOwner; } bool public globalLocked = false; function lock() internal { require(!globalLocked); globalLocked = true; } function unLock() internal { require(globalLocked); globalLocked = false; } function setLock() public onlyOwner{ globalLocked = false; } function userRefund() public returns(bool _result) { return _userRefund(msg.sender); } function _userRefund(address _to) internal returns(bool _result) { require (_to != 0x0); lock(); uint256 amount = userEtherOf[msg.sender]; if(amount > 0){ userEtherOf[msg.sender] = 0; _to.transfer(amount); _result = true; } else{ _result = false; } unLock(); } uint public currentEventId = 1; function getEventId() internal returns(uint _result) { _result = currentEventId; currentEventId++; } string public officialGameUrl; function setOfficialGameUrl(string _newOfficialGameUrl) public onlyOwner{ officialGameUrl = _newOfficialGameUrl; } } contract SoccerBet is Base { function SoccerBet(string _gameName) public { gameName = _gameName; owner = msg.sender; } uint public unpayPooling = 0; uint public losePooling = 0; uint public winPooling = 0; uint public samePooling = 0; uint public bankerAllDeposit = 0; address public auction; function setAuction(address _newAuction) public onlyOwner{ auction = _newAuction; } modifier onlyAuction { require(msg.sender == auction); _; } modifier onlyBanker { require(msg.sender == currentBanker); require(bankerBeginTime <= now); require(now < bankerEndTime); _; } function canSetBanker() public view returns (bool _result){ _result = false; if(now < bankerEndTime){ return; } if(userEtherOf[this] == 0){ _result = true; } } event OnSetNewBanker(uint indexed _gameID, address _caller, address _banker, uint _beginTime, uint _endTime, uint _errInfo, uint _eventTime, uint eventId); function setBanker(address _banker, uint _beginTime, uint _endTime) public onlyAuction returns(bool _result) { _result = false; require(_banker != 0x0); if(now < bankerEndTime){ emit OnSetNewBanker(gameID, msg.sender, _banker, _beginTime, _endTime, 1, now, getEventId()); return; } if(userEtherOf[this] > 0){ emit OnSetNewBanker(gameID, msg.sender, _banker, _beginTime, _endTime, 5, now, getEventId()); return; } if(_beginTime > now){ emit OnSetNewBanker(gameID, msg.sender, _banker, _beginTime, _endTime, 3, now, getEventId()); return; } if(_endTime <= now){ emit OnSetNewBanker(gameID, msg.sender, _banker, _beginTime, _endTime, 4, now, getEventId()); return; } currentBanker = _banker; bankerBeginTime = _beginTime; bankerEndTime = _endTime; unpayPooling = 0; losePooling = 0; winPooling = 0; samePooling = 0; bankerAllDeposit = 0; gameResult = 9; gameOver = true; emit OnSetNewBanker(gameID, msg.sender, _banker, _beginTime, _endTime, 0, now, getEventId()); _result = true; } string public team1; string public team2; uint public constant loseNum = 1; uint public constant winNum = 3; uint public constant sameNum = 0; uint public loseOdd; uint public winOdd; uint public sameOdd; uint public betLastTime; uint public playNo = 1; uint public gameID = 0; uint public gameBeginPlayNo; uint public gameResult = 9; uint public gameBeginTime; uint256 public gameMaxBetAmount; uint256 public gameMinBetAmount; bool public gameOver = true; uint public nextRewardPlayNo=1; uint public currentRewardNum = 100; address public decider; function setDecider(address _decider) public onlyOwner{ decider = _decider; } modifier onlyDecider{ require(msg.sender == decider); _; } function setGameResult(uint _gameResult) public onlyDecider{ require(!gameOver); require(betLastTime + 90 minutes < now); require(now < betLastTime + 30 days); require(gameResult == 9); require( _gameResult == loseNum || _gameResult == winNum || _gameResult == sameNum); gameResult = _gameResult; if(gameResult == 3){ unpayPooling = winPooling; }else if(gameResult == 1){ unpayPooling = losePooling; }else if(gameResult == 0){ unpayPooling = samePooling; } } event OnNewGame(uint indexed _gameID, address _banker , uint _betLastTime, uint _gameBeginTime, uint256 _gameMinBetAmount, uint256 _gameMaxBetAmount, uint _eventTime, uint eventId); event OnGameInfo(uint indexed _gameID, string _team1, string _team2, uint _loseOdd, uint _winOdd, uint _sameOdd, uint _eventTime, uint eventId); function newGame(string _team1, string _team2, uint _loseOdd, uint _winOdd, uint _sameOdd, uint _betLastTime, uint256 _gameMinBetAmount, uint256 _gameMaxBetAmount) public onlyBanker payable returns(bool _result){ if (msg.value > 0){ userEtherOf[msg.sender] = userEtherOf[msg.sender].add(msg.value); } require(bytes(_team1).length < 100); require(bytes(_team2).length < 100); require(gameOver); require(now > bankerBeginTime); require(_gameMinBetAmount >= 100000000000000); require(_gameMaxBetAmount >= _gameMinBetAmount); require(now < _betLastTime); require(_betLastTime+ 1 days < bankerEndTime); _result = _newGame(_team1, _team2, _loseOdd, _winOdd, _sameOdd, _betLastTime, _gameMinBetAmount, _gameMaxBetAmount); } function _newGame(string _team1, string _team2, uint _loseOdd, uint _winOdd, uint _sameOdd, uint _betLastTime, uint256 _gameMinBetAmount, uint256 _gameMaxBetAmount) private returns(bool _result){ _result = false; gameID = gameID.add(1); team1 = _team1; team2 = _team2; loseOdd = _loseOdd; winOdd = _winOdd; sameOdd = _sameOdd; emit OnGameInfo(gameID, team1, team2, loseOdd, winOdd, sameOdd, now, getEventId()); betLastTime = _betLastTime; gameBeginTime = now; gameMinBetAmount = _gameMinBetAmount; gameMaxBetAmount = _gameMaxBetAmount; emit OnNewGame(gameID, msg.sender, betLastTime, gameBeginTime, gameMinBetAmount, gameMaxBetAmount, now, getEventId()); gameBeginPlayNo = playNo; gameResult = 9; gameOver = false; unpayPooling = 0; losePooling = 0; winPooling = 0; samePooling = 0; bankerAllDeposit = 0; _result = true; } event OnSetOdd(uint indexed _gameID, uint _winOdd, uint _loseOdd, uint _sameOdd, uint _eventTime, uint eventId); function setOdd(uint _winOdd, uint _loseOdd, uint _sameOdd) onlyBanker public{ winOdd = _winOdd; loseOdd = _loseOdd; sameOdd = _sameOdd; emit OnSetOdd(gameID, winOdd, loseOdd, sameOdd, now, getEventId()); } struct betInfo { uint Odd; address Player; uint BetNum; uint256 BetAmount; uint BetTime; bool IsReturnAward; uint ResultNO; } mapping (uint => betInfo) public playerBetInfoOf; event OnPlay( uint indexed _gameID, uint indexed _playNo, address indexed _player, string _gameName, uint odd, string _team1, uint _betNum, uint256 _betAmount, uint _eventTime, uint eventId); function play(uint _betNum, uint256 _betAmount) public payable returns(bool _result){ if (msg.value > 0){ userEtherOf[msg.sender] = userEtherOf[msg.sender].add(msg.value); } _result = _play(_betNum, _betAmount); } function _play(uint _betNum, uint256 _betAmount) private returns(bool _result){ _result = false; require(!gameOver); require( loseNum == _betNum || _betNum == winNum || _betNum == sameNum); require(msg.sender != currentBanker); require(now < betLastTime); require(_betAmount >= gameMinBetAmount); if (_betAmount > gameMaxBetAmount){ _betAmount = gameMaxBetAmount; } _betAmount = _betAmount / 100 * 100; uint _odd = _seekOdd(_betNum, _betAmount); require(userEtherOf[msg.sender] >= _betAmount); betInfo memory bi= betInfo({ Odd :_odd, Player : msg.sender, BetNum : _betNum, BetAmount : _betAmount, BetTime : now, IsReturnAward: false, ResultNO: 9 }); playerBetInfoOf[playNo] = bi; userEtherOf[msg.sender] = userEtherOf[msg.sender].sub(_betAmount); userEtherOf[this] = userEtherOf[this].add(_betAmount); uint _maxpooling = _getMaxPooling(); if(userEtherOf[this] < _maxpooling){ uint BankerAmount = _maxpooling.sub(userEtherOf[this]); require(userEtherOf[currentBanker] >= BankerAmount); userEtherOf[currentBanker] = userEtherOf[currentBanker].sub(BankerAmount); userEtherOf[this] = userEtherOf[this].add(BankerAmount); bankerAllDeposit = bankerAllDeposit.add(BankerAmount); } emit OnPlay(gameID, playNo, msg.sender, gameName, _odd, team1, _betNum, _betAmount, now, getEventId()); playNo = playNo.add(1); _result = true; } function _seekOdd(uint _betNum, uint _betAmount) private returns (uint _odd){ uint allAmount = 0; if(_betNum == 3){ allAmount = _betAmount.mul(winOdd).div(100); winPooling = winPooling.add(allAmount); _odd = winOdd; }else if(_betNum == 1){ allAmount = _betAmount.mul(loseOdd).div(100); losePooling = losePooling.add(allAmount); _odd = loseOdd; }else if(_betNum == 0){ allAmount = _betAmount.mul(sameOdd).div(100); samePooling = samePooling.add(allAmount); _odd = sameOdd; } } function _getMaxPooling() private view returns(uint maxpooling){ maxpooling = winPooling; if(maxpooling < losePooling){ maxpooling = losePooling; } if(maxpooling < samePooling){ maxpooling = samePooling; } } event OnOpenGameResult(uint indexed _gameID,uint indexed _palyNo, address _player, uint _gameResult, uint _eventTime, uint eventId); function openGameLoop() public returns(bool _result){ lock(); _result = _openGameLoop(); unLock(); } function _openGameLoop() private returns(bool _result){ _result = false; _checkOpenGame(); uint256 allAmount = 0; for(uint i = 0; nextRewardPlayNo < playNo && i < currentRewardNum; i++ ){ betInfo storage p = playerBetInfoOf[nextRewardPlayNo]; if(!p.IsReturnAward){ _cashPrize(p, allAmount,nextRewardPlayNo); } nextRewardPlayNo = nextRewardPlayNo.add(1); } _setGameOver(); _result = true; } function openGamePlayNo(uint _playNo) public returns(bool _result){ lock(); _result = _openGamePlayNo(_playNo); unLock(); } function _openGamePlayNo(uint _playNo) private returns(bool _result){ _result = false; require(_playNo >= gameBeginPlayNo && _playNo < playNo); _checkOpenGame(); betInfo storage p = playerBetInfoOf[_playNo]; require(!p.IsReturnAward); uint256 allAmount = 0; _cashPrize(p, allAmount,_playNo); _setGameOver(); _result = true; } function openGamePlayNos(uint[] _playNos) public returns(bool _result){ lock(); _result = _openGamePlayNos(_playNos); unLock(); } function _openGamePlayNos(uint[] _playNos) private returns(bool _result){ _result = false; _checkOpenGame(); uint256 allAmount = 0; for (uint _index = 0; _index < _playNos.length; _index++) { uint _playNo = _playNos[_index]; if(_playNo >= gameBeginPlayNo && _playNo < playNo){ betInfo storage p = playerBetInfoOf[_playNo]; if(!p.IsReturnAward){ _cashPrize(p, allAmount,_playNo); } } } _setGameOver(); _result = true; } function openGameRange(uint _beginPlayNo, uint _endPlayNo) public returns(bool _result){ lock(); _result = _openGameRange(_beginPlayNo, _endPlayNo); unLock(); } function _openGameRange(uint _beginPlayNo, uint _endPlayNo) private returns(bool _result){ _result = false; require(_beginPlayNo < _endPlayNo); require(_beginPlayNo >= gameBeginPlayNo && _endPlayNo < playNo); _checkOpenGame(); uint256 allAmount = 0; for (uint _indexPlayNo = _beginPlayNo; _indexPlayNo <= _endPlayNo; _indexPlayNo++) { betInfo storage p = playerBetInfoOf[_indexPlayNo]; if(!p.IsReturnAward){ _cashPrize(p, allAmount,_indexPlayNo); } } _setGameOver(); _result = true; } function _checkOpenGame() private view{ require(!gameOver); require( gameResult == loseNum || gameResult == winNum || gameResult == sameNum); require(betLastTime + 90 minutes < now); } function _cashPrize(betInfo storage _p, uint256 _allAmount,uint _playNo) private{ if(_p.BetNum == gameResult){ _allAmount = _p.BetAmount.mul(_p.Odd).div(100); _p.IsReturnAward = true; _p.ResultNO = gameResult; userEtherOf[this] = userEtherOf[this].sub(_allAmount); unpayPooling = unpayPooling.sub(_allAmount); userEtherOf[_p.Player] = userEtherOf[_p.Player].add(_allAmount); emit OnOpenGameResult(gameID,_playNo, msg.sender, gameResult, now, getEventId()); if(_p.BetNum == 3){ winPooling = winPooling.sub(_allAmount); }else if(_p.BetNum == 1){ losePooling = losePooling.sub(_allAmount); }else if(_p.BetNum == 0){ samePooling = samePooling.sub(_allAmount); } }else{ _p.IsReturnAward = true; _p.ResultNO = gameResult; emit OnOpenGameResult(gameID,_playNo, msg.sender, gameResult, now, getEventId()); _allAmount = _p.BetAmount.mul(_p.Odd).div(100); if(_p.BetNum == 3){ winPooling = winPooling.sub(_allAmount); }else if(_p.BetNum == 1){ losePooling = losePooling.sub(_allAmount); }else if(_p.BetNum == 0){ samePooling = samePooling.sub(_allAmount); } } } function _setGameOver() private{ if(unpayPooling == 0 && _canSetGameOver()){ userEtherOf[currentBanker] = userEtherOf[currentBanker].add(userEtherOf[this]); userEtherOf[this] = 0; gameOver = true; } } function _canSetGameOver() private view returns(bool){ return winPooling<100 && losePooling<100 && samePooling<100; } function failUserRefund(uint[] _playNos) public returns (bool _result) { _result = false; require(!gameOver); require(gameResult == 9); require(betLastTime + 31 days < now); for (uint _index = 0; _index < _playNos.length; _index++) { uint _playNo = _playNos[_index]; if(_playNo >= gameBeginPlayNo && _playNo < playNo){ betInfo storage p = playerBetInfoOf[_playNo]; if(!p.IsReturnAward){ p.IsReturnAward = true; uint256 ToUser = p.BetAmount; userEtherOf[this] = userEtherOf[this].sub(ToUser); userEtherOf[p.Player] = userEtherOf[p.Player].add(ToUser); } } } if(msg.sender == currentBanker && bankerAllDeposit>0){ userEtherOf[this] = userEtherOf[this].sub(bankerAllDeposit); userEtherOf[currentBanker] = userEtherOf[currentBanker].add(bankerAllDeposit); bankerAllDeposit = 0; } if(userEtherOf[this] == 0){ gameOver = true; } _result = true; } event OnRefund(uint indexed _gameId, address _to, uint _amount, bool _result, uint _eventTime, uint eventId); function _userRefund(address _to) internal returns(bool _result){ require (_to != 0x0); require(_to != currentBanker || gameOver); lock(); uint256 amount = userEtherOf[_to]; if(amount > 0){ userEtherOf[msg.sender] = 0; _to.transfer(amount); _result = true; }else{ _result = false; } emit OnRefund(gameID, _to, amount, _result, now, getEventId()); unLock(); } function playEtherOf() public payable { if (msg.value > 0){ userEtherOf[msg.sender] = userEtherOf[msg.sender].add(msg.value); } } function () public payable { if(msg.value > 0){ userEtherOf[msg.sender] = userEtherOf[msg.sender].add(msg.value); } } }
0x60606040526004361061029d5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663091dbbd781146102eb57806309fa90b3146103105780630faf2775146103375780630fff5eeb146103dc57806313af40351461043a578063174f51eb14610459578063181674161461046c578063243b22cf146104f657806326c4fa3d1461050c57806329f75dc21461055d5780633c8ca83d146105705780634177340d1461058357806343133b0714610599578063473bc223146105ac5780634d7ba587146105bf5780635004b7a2146105de57806351401d4d146105fd57806351dc7659146106105780635294bb2b14610623578063598052a31461063657806360f8dab71461064957806361dcd7ab1461065c5780636616c8861461066f578063692cd610146106825780636b62cd651461069557806370fbf6e5146106a85780637152f800146106f75780637aba6f371461070a5780637bc49a951461071d5780637d9f6db51461072b5780638a27a31c1461075a5780638c8d2ede1461076d5780638da5cb5b1461078057806397365df214610793578063a3a1d015146107a6578063a94834a1146107f5578063b57adee31461080e578063b5c19d5914610833578063b8c6f57914610846578063b9717b2314610865578063bbdc02db14610881578063bdb337d114610894578063c46a6262146108a7578063c5ff2222146108af578063c7dd4b4f146108c2578063cda0eeaa146108d5578063d47cc085146108e8578063d97c5be5146108fb578063e21647001461090e578063e612c0ad14610921578063e92d517814610934578063eca1028614610947578063f00f7b331461095a578063f20de9d61461096d578063fc6def1514610980578063fd93236b14610993575b60003411156102e957600160a060020a0333166000908152600660205260409020546102cf903463ffffffff6109a616565b600160a060020a0333166000908152600660205260409020555b005b34156102f657600080fd5b6102fe6109c0565b60405190815260200160405180910390f35b341561031b57600080fd5b6103236109c6565b604051901515815260200160405180910390f35b61032360046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650508435946020810135945060408101359350606081013592506080810135915060a001356109e7565b34156103e757600080fd5b6103f2600435610b07565b604051968752600160a060020a03909516602087015260408087019490945260608601929092526080850152151560a084015260c083019190915260e0909101905180910390f35b341561044557600080fd5b6102e9600160a060020a0360043516610b51565b341561046457600080fd5b6102fe610b9b565b341561047757600080fd5b61047f610ba1565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156104bb5780820151838201526020016104a3565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561050157600080fd5b6102e9600435610c3f565b341561051757600080fd5b6102e960046024813581810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610d0595505050505050565b341561056857600080fd5b6102fe610d37565b341561057b57600080fd5b6102fe610d3d565b341561058e57600080fd5b610323600435610d43565b34156105a457600080fd5b6102fe610d65565b34156105b757600080fd5b61047f610d6b565b34156105ca57600080fd5b6102e9600160a060020a0360043516610dd6565b34156105e957600080fd5b6102fe600160a060020a0360043516610e20565b341561060857600080fd5b6102fe610e32565b341561061b57600080fd5b6102fe610e38565b341561062e57600080fd5b6102fe610e3d565b341561064157600080fd5b6102fe610e43565b341561065457600080fd5b610323610e49565b341561066757600080fd5b6102fe610e5a565b341561067a57600080fd5b610323610e60565b341561068d57600080fd5b6102fe610e97565b34156106a057600080fd5b6102fe610e9d565b34156106b357600080fd5b6103236004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650610ea395505050505050565b341561070257600080fd5b6102fe610eb6565b341561071557600080fd5b6102e9610ebc565b610323600435602435610ef7565b341561073657600080fd5b61073e610f55565b604051600160a060020a03909116815260200160405180910390f35b341561076557600080fd5b61073e610f64565b341561077857600080fd5b61047f610f73565b341561078b57600080fd5b61073e610fde565b341561079e57600080fd5b6102fe610fed565b34156107b157600080fd5b6103236004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650610ff395505050505050565b341561080057600080fd5b610323600435602435611218565b341561081957600080fd5b610323600160a060020a036004351660243560443561123c565b341561083e57600080fd5b6102fe61144d565b341561085157600080fd5b6102e9600160a060020a0360043516611453565b341561087057600080fd5b6102e960043560243560443561149d565b341561088c57600080fd5b6102fe61154b565b341561089f57600080fd5b610323611551565b6102e961155a565b34156108ba57600080fd5b6102fe6115a8565b34156108cd57600080fd5b6102fe6115ae565b34156108e057600080fd5b6102fe6115b4565b34156108f357600080fd5b6102fe6115ba565b341561090657600080fd5b6102fe6115bf565b341561091957600080fd5b6102fe6115c5565b341561092c57600080fd5b61047f6115cb565b341561093f57600080fd5b6102fe611636565b341561095257600080fd5b6102fe61163c565b341561096557600080fd5b6102fe611641565b341561097857600080fd5b610323611647565b341561098b57600080fd5b61073e611663565b341561099e57600080fd5b6102fe611672565b6000828201838110156109b557fe5b8091505b5092915050565b60095481565b60085474010000000000000000000000000000000000000000900460ff1681565b60055460009033600160a060020a03908116911614610a0557600080fd5b60035442901115610a1557600080fd5b6004544210610a2357600080fd5b6000341115610a6f57600160a060020a033316600090815260066020526040902054610a55903463ffffffff6109a616565b600160a060020a0333166000908152600660205260409020555b6064895110610a7d57600080fd5b6064885110610a8b57600080fd5b601e5460ff161515610a9c57600080fd5b6003544211610aaa57600080fd5b655af3107a4000831015610abd57600080fd5b82821015610aca57600080fd5b42849010610ad757600080fd5b60045462015180850110610aea57600080fd5b610afa8989898989898989611678565b9998505050505050505050565b60226020526000908152604090208054600182015460028301546003840154600485015460058601546006909601549495600160a060020a039094169492939192909160ff169087565b60085433600160a060020a03908116911614610b6c57600080fd5b6008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60145481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c375780601f10610c0c57610100808354040283529160200191610c37565b820191906000526020600020905b815481529060010190602001808311610c1a57829003601f168201915b505050505081565b60215433600160a060020a03908116911614610c5a57600080fd5b601e5460ff1615610c6a57600080fd5b4260165461151801101515610c7e57600080fd5b60165462278d00014210610c9157600080fd5b601a54600914610ca057600080fd5b6001811480610caf5750600381145b80610cb8575080155b1515610cc357600080fd5b601a8190556003811415610cdc57600d54600b55610d02565b601a5460011415610cf257600c54600b55610d02565b601a541515610d0257600e54600b555b50565b60085433600160a060020a03908116911614610d2057600080fd5b600a818051610d339291602001906126d8565b5050565b600e5481565b601b5481565b6000610d4d6118f4565b610d5682611953565b9050610d606119c4565b919050565b60195481565b60008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c375780601f10610c0c57610100808354040283529160200191610c37565b60085433600160a060020a03908116911614610df157600080fd5b6021805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60066020526000908152604090205481565b601c5481565b600381565b600b5481565b600d5481565b6000610e54336119ed565b90505b90565b60075481565b600454600090421015610e7257610e57565b600160a060020a0330166000908152600660205260409020541515610e575750600190565b601f5481565b600f5481565b6000610ead6118f4565b610d5682611b35565b601a5481565b60085433600160a060020a03908116911614610ed757600080fd5b6008805474ff000000000000000000000000000000000000000019169055565b600080341115610f4457600160a060020a033316600090815260066020526040902054610f2a903463ffffffff6109a616565b600160a060020a0333166000908152600660205260409020555b610f4e8383611bc0565b9392505050565b601054600160a060020a031681565b600554600160a060020a031681565b60118054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c375780601f10610c0c57610100808354040283529160200191610c37565b600854600160a060020a031681565b60155481565b601e54600090819081908190819060ff161561100e57600080fd5b601a5460091461101d57600080fd5b426016546228de800110151561103257600080fd5b600093505b85518410156111305785848151811061104c57fe5b906020019060200201519250601954831015801561106b575060175483105b15611125576000838152602260205260409020600581015490925060ff161515611125575060058101805460ff191660011790556003810154600160a060020a0330166000908152600660205260409020546110cd908263ffffffff61207e16565b600160a060020a0330811660009081526006602052604080822093909355600185015490911681522054611107908263ffffffff6109a616565b6001830154600160a060020a03166000908152600660205260409020555b600190930192611037565b60055433600160a060020a03908116911614801561115057506000600f54115b156111df57600f54600160a060020a0330166000908152600660205260409020546111809163ffffffff61207e16565b600160a060020a0330811660009081526006602052604080822093909355600f54600554909216815291909120546111bd9163ffffffff6109a616565b600554600160a060020a0316600090815260066020526040812091909155600f555b600160a060020a033016600090815260066020526040902054151561120c57601e805460ff191660011790555b50600195945050505050565b60006112226118f4565b61122c8383612090565b90506112366119c4565b92915050565b60105460009033600160a060020a0390811691161461125a57600080fd5b506000600160a060020a038416151561127257600080fd5b6004544210156112e8576018546000805160206127ba8339815191523386868660014261129d612109565b604051600160a060020a0397881681529590961660208601526040808601949094526060850192909252608084015260a083015260c082019290925260e001905180910390a2610f4e565b600160a060020a0330166000908152600660205260408120541115611328576018546000805160206127ba8339815191523386868660054261129d612109565b42831115611351576018546000805160206127ba8339815191523386868660034261129d612109565b428211611379576018546000805160206127ba8339815191523386868660044261129d612109565b6005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038616179055600383905560048290556000600b819055600c819055600d819055600e819055600f8190556009601a55601e805460ff19166001179055601854906000805160206127ba833981519152903390879087908790426113fd612109565b604051600160a060020a0397881681529590961660208601526040808601949094526060850192909252608084015260a083015260c082019290925260e001905180910390a25060019392505050565b60165481565b60085433600160a060020a0390811691161461146e57600080fd5b6010805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60055433600160a060020a039081169116146114b857600080fd5b600354429011156114c857600080fd5b60045442106114d657600080fd5b6014839055601382905560158190556018547fd181e665933e72a39ae8ecddb04db15a5bedc1206181b73931300f8721f68e9a84848442611515612109565b604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a2505050565b60015481565b601e5460ff1681565b60003411156115a657600160a060020a03331660009081526006602052604090205461158c903463ffffffff6109a616565b600160a060020a0333166000908152600660205260409020555b565b60175481565b60185481565b601d5481565b600081565b600c5481565b60205481565b60128054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c375780601f10610c0c57610100808354040283529160200191610c37565b60035481565b600181565b60135481565b60006116516118f4565b611659612117565b9050610e576119c4565b602154600160a060020a031681565b60045481565b60185460009061168f90600163ffffffff6109a616565b60185560118980516116a59291602001906126d8565b5060128880516116b99291602001906126d8565b506013879055601486905560158590556018547f9f35c43c2de4e3e0670b8f6e9e634d748b20e3c2076fc5196d5f439306f912b1601160128a8a8a426116fd612109565b60405160408101869052606081018590526080810184905260a0810183905260c0810182905260e08082528854600260018216156101009081026000190190921604918301829052829160208301918301908b90801561179e5780601f106117735761010080835404028352916020019161179e565b820191906000526020600020905b81548152906001019060200180831161178157829003601f168201915b505083810382528954600260001961010060018416150201909116048082526020909101908a9080156118125780601f106117e757610100808354040283529160200191611812565b820191906000526020600020905b8154815290600101906020018083116117f557829003601f168201915b5050995050505050505050505060405180910390a2601684905542601b819055601d849055601c839055601854907f6cfcd64debbdfdab87d0e513352801030a91f0a0eb18f529c2125e8fc4fdf5c19033908790878782611871612109565b604051600160a060020a03909716875260208701959095526040808701949094526060860192909252608085015260a084015260c083019190915260e0909101905180910390a2505060175460195550506009601a555050601e805460ff1916905550506000600b819055600c819055600d819055600e819055600f5550600190565b60085474010000000000000000000000000000000000000000900460ff161561191c57600080fd5b6008805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b6000806000809250601954841015801561196e575060175484105b151561197957600080fd5b6119816121a7565b6000848152602260205260409020600581015490925060ff16156119a457600080fd5b5060006119b28282866121f4565b6119ba6124f2565b5060019392505050565b60085474010000000000000000000000000000000000000000900460ff161515610ed757600080fd5b600080600160a060020a0383161515611a0557600080fd5b600554600160a060020a038481169116141580611a245750601e5460ff165b1515611a2f57600080fd5b611a376118f4565b50600160a060020a03821660009081526006602052604081205490811115611aab57600160a060020a03338116600090815260066020526040808220919091559084169082156108fc0290839051600060405180830381858888f193505050501515611aa257600080fd5b60019150611ab0565b600091505b6018547fe5a5832a7b6e22713f4acd2e05cf742131069900122ab1004f797d6734babad384838542611ae0612109565b6040518086600160a060020a0316600160a060020a03168152602001858152602001841515151581526020018381526020018281526020019550505050505060405180910390a2611b2f6119c4565b50919050565b600080808080611b436121a7565b60009350600092505b8551831015611bb857858381518110611b6157fe5b9060200190602002015191506019548210158015611b80575060175482105b15611bad57506000818152602260205260409020600581015460ff161515611bad57611bad8185846121f4565b600190920191611b4c565b61120c6124f2565b600080611bcb612756565b601e54600093508390819060ff1615611be357600080fd5b8660011480611bf25750600387145b80611bfb575086155b1515611c0657600080fd5b60055433600160a060020a0390811691161415611c2257600080fd5b6016544210611c3057600080fd5b601d54861015611c3f57600080fd5b601c54861115611c4f57601c5495505b606486046064029550611c628787612579565b600160a060020a03331660009081526006602052604090205490945086901015611c8b57600080fd5b60e06040519081016040528085815260200133600160a060020a03168152602001888152602001878152602001428152602001600015158152602001600981525092508260226000601754815260200190815260200160002060008201518155602082015160018201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117905560408201518160020155606082015181600301556080820151816004015560a082015160058201805460ff191691151591909117905560c0820151600691820155600160a060020a03331660009081526020919091526040902054611d8b91508763ffffffff61207e16565b600160a060020a03338116600090815260066020526040808220939093553090911681522054611dc1908763ffffffff6109a616565b600160a060020a033016600090815260066020526040902055611de261264d565b600160a060020a03301660009081526006602052604090205490925082901015611eef57600160a060020a033016600090815260066020526040902054611e3090839063ffffffff61207e16565b600554600160a060020a031660009081526006602052604090205490915081901015611e5b57600080fd5b600554600160a060020a0316600090815260066020526040902054611e86908263ffffffff61207e16565b600554600160a060020a03908116600090815260066020526040808220939093553090911681522054611ebf908263ffffffff6109a616565b600160a060020a033016600090815260066020526040902055600f54611eeb908263ffffffff6109a616565b600f555b33600160a060020a03166017546018547f724a2824fa0817388a499c044b714a2b29187c146ca31eb492b80ac2f1f9e2e760008860118d8d42611f30612109565b60405160208101879052606081018590526080810184905260a0810183905260c0810182905260e08082528854600260018216156101009081026000190190921604918301829052829160408301918301908b908015611fd15780601f10611fa657610100808354040283529160200191611fd1565b820191906000526020600020905b815481529060010190602001808311611fb457829003601f168201915b50508381038252885460026000196101006001841615020190911604808252602090910190899080156120455780601f1061201a57610100808354040283529160200191612045565b820191906000526020600020905b81548152906001019060200180831161202857829003601f168201915b5050995050505050505050505060405180910390a460175461206e90600163ffffffff6109a616565b6017555060019695505050505050565b60008282111561208a57fe5b50900390565b60008080808486106120a157600080fd5b60195486101580156120b4575060175485105b15156120bf57600080fd5b6120c76121a7565b600092508591505b848211611bb857506000818152602260205260409020600581015460ff1615156120fe576120fe8184846121f4565b6001909101906120cf565b600980546001810190915590565b60008080806121246121a7565b60009250600091505b601754601f54108015612141575060205482105b156121955750601f546000908152602260205260409020600581015460ff161515612173576121738184601f546121f4565b601f5461218790600163ffffffff6109a616565b601f5560019091019061212d565b61219d6124f2565b6001935050505090565b601e5460ff16156121b757600080fd5b6001601a5414806121ca57506003601a54145b806121d55750601a54155b15156121e057600080fd5b42601654611518011015156115a657600080fd5b601a54836002015414156123d5578254600384015461222b9160649161221f9163ffffffff61267016565b9063ffffffff61269916565b60058401805460ff19166001179055601a54600680860191909155600160a060020a03301660009081526020919091526040902054909250612273908363ffffffff61207e16565b600160a060020a033016600090815260066020526040902055600b5461229f908363ffffffff61207e16565b600b556001830154600160a060020a03166000908152600660205260409020546122cf908363ffffffff6109a616565b6001840154600160a060020a0316600090815260066020526040902055601854601a548291907f5d093feafb3da598c3eb022e176c9b222e750040e1bb515e39072189e096fd4a90339042612322612109565b6040518085600160a060020a0316600160a060020a0316815260200184815260200183815260200182815260200194505050505060405180910390a382600201546003141561238657600d5461237e908363ffffffff61207e16565b600d556123d0565b8260020154600114156123ae57600c546123a6908363ffffffff61207e16565b600c556123d0565b600283015415156123d057600e546123cc908363ffffffff61207e16565b600e555b6124ed565b60058301805460ff19166001179055601a546006840181905560185482917f5d093feafb3da598c3eb022e176c9b222e750040e1bb515e39072189e096fd4a90339042612420612109565b6040518085600160a060020a0316600160a060020a0316815260200184815260200183815260200182815260200194505050505060405180910390a3825460038401546124799160649161221f9163ffffffff61267016565b91508260020154600314156124a357600d5461249b908363ffffffff61207e16565b600d556124ed565b8260020154600114156124cb57600c546124c3908363ffffffff61207e16565b600c556124ed565b600283015415156124ed57600e546124e9908363ffffffff61207e16565b600e555b505050565b600b5415801561250557506125056126b0565b156115a657600160a060020a0330811660009081526006602052604080822054600554909316825290205461253f9163ffffffff6109a616565b600554600160a060020a039081166000908152600660205260408082209390935530909116815290812055601e805460ff19166001179055565b60008060038414156125c25761259f606461221f6014548661267090919063ffffffff16565b600d549091506125b5908263ffffffff6109a616565b600d5560145491506109b9565b8360011415612608576125e5606461221f6013548661267090919063ffffffff16565b600c549091506125fb908263ffffffff6109a616565b600c5560135491506109b9565b8315156109b957612629606461221f6015548661267090919063ffffffff16565b600e5490915061263f908263ffffffff6109a616565b600e55505060155492915050565b600d54600c5481101561265f5750600c545b600e54811015610e575750600e5490565b600082151561268157506000611236565b5081810281838281151561269157fe5b041461123657fe5b60008082848115156126a757fe5b04949350505050565b60006064600d541080156126c657506064600c54105b8015610e5457506064600e5410905090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061271957805160ff1916838001178555612746565b82800160010185558215612746579182015b8281111561274657825182559160200191906001019061272b565b5061275292915061279f565b5090565b60e060405190810160405280600081526020016000600160a060020a03168152602001600081526020016000815260200160008152602001600015158152602001600081525090565b610e5791905b8082111561275257600081556001016127a5560056d05b77de2b4e7c8759bfe846d60baf0073c0c44d40a08371e92cbe7974b228a165627a7a723058209515430ef3e3850ea565023ccabe20a5d5225dd4ac2a30ac0d7f84b486e2fada0029
{"success": true, "error": null, "results": {"detectors": [{"check": "write-after-write", "impact": "Medium", "confidence": "High"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
6,418
0x5f12bD8C6260d271f18fC0b4a29000b7Ccb49b77
/** *Submitted for verification at Etherscan.io on 2022-04-03 */ // SPDX-License-Identifier: Unlicensed //https://t.me/BerlinRocksETH 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 BerlinRocks 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 snipers; 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 maxAmountTransfer = _tTotal; uint256 private maxWallet = _tTotal; uint256 private redistribution; uint256 private tax; uint256 private ethTax; uint256 private redisTax; address payable private teamWallet; string private constant _name = "Berlin Rocks"; string private constant _symbol = "Rocks"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable _add1) { require(_add1 != address(0)); teamWallet = _add1; _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[teamWallet] = true; emit Transfer(address(0), teamWallet, _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 uniswapPair() public view returns (address) { return uniswapV2Pair; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(amount > 0); require(!snipers[from]); if(!(_isExcludedFromFee[from] || _isExcludedFromFee[to])){ if(to != uniswapV2Pair){ if(balanceOf(to)+ ((amount *(100- tax))/100) > maxWallet){ revert("Max Wallet exceeded"); } } if (from != address(this)) { require(amount <= maxAmountTransfer); redistribution = redisTax; tax = ethTax; uint256 contractTokenBalance = balanceOf(address(this)); if (contractTokenBalance > _tTotal/1000){ if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 500000000000000000) { 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 { teamWallet.transfer(amount); } function liftMaxTrnx() external onlyOwner{ maxAmountTransfer = _tTotal; } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); ethTax = 10; redisTax = 1; maxAmountTransfer = _tTotal/100; maxWallet = _tTotal/50; swapEnabled = true; cooldownEnabled = true; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function removeBot(address _address) external onlyOwner{ snipers[_address] = true; } 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() == teamWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == teamWallet); 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, redistribution, tax); 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); } }
0x60806040526004361061010d5760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb146102f2578063c3c8cd8014610312578063c816841b14610327578063c9567bf914610345578063dd62ed3e1461035a57600080fd5b806370a082311461025d578063715018a61461027d5780638da5cb5b1461029257806395d89b41146102c457600080fd5b8063313ce567116100dc578063313ce567146101d557806335ffbc47146101f15780635932ead1146102085780635fecd926146102285780636fc3eaec1461024857600080fd5b806306fdde0314610119578063095ea7b31461016057806318160ddd1461019057806323b872dd146101b557600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600c81526b4265726c696e20526f636b7360a01b60208201525b6040516101579190611373565b60405180910390f35b34801561016c57600080fd5b5061018061017b3660046113dd565b6103a0565b6040519015158152602001610157565b34801561019c57600080fd5b50670de0b6b3a76400005b604051908152602001610157565b3480156101c157600080fd5b506101806101d0366004611409565b6103b7565b3480156101e157600080fd5b5060405160098152602001610157565b3480156101fd57600080fd5b50610206610420565b005b34801561021457600080fd5b50610206610223366004611458565b610461565b34801561023457600080fd5b50610206610243366004611475565b6104a9565b34801561025457600080fd5b506102066104f7565b34801561026957600080fd5b506101a7610278366004611475565b610524565b34801561028957600080fd5b50610206610546565b34801561029e57600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610157565b3480156102d057600080fd5b50604080518082019091526005815264526f636b7360d81b602082015261014a565b3480156102fe57600080fd5b5061018061030d3660046113dd565b6105ba565b34801561031e57600080fd5b506102066105c7565b34801561033357600080fd5b506012546001600160a01b03166102ac565b34801561035157600080fd5b506102066105fd565b34801561036657600080fd5b506101a7610375366004611492565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103ad3384846109a2565b5060015b92915050565b60006103c4848484610ac6565b610416843361041185604051806060016040528060288152602001611676602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610c9c565b6109a2565b5060019392505050565b6000546001600160a01b031633146104535760405162461bcd60e51b815260040161044a906114cb565b60405180910390fd5b670de0b6b3a7640000600a55565b6000546001600160a01b0316331461048b5760405162461bcd60e51b815260040161044a906114cb565b60128054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146104d35760405162461bcd60e51b815260040161044a906114cb565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6010546001600160a01b0316336001600160a01b03161461051757600080fd5b4761052181610cd6565b50565b6001600160a01b0381166000908152600260205260408120546103b190610d10565b6000546001600160a01b031633146105705760405162461bcd60e51b815260040161044a906114cb565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103ad338484610ac6565b6010546001600160a01b0316336001600160a01b0316146105e757600080fd5b60006105f230610524565b905061052181610d94565b6000546001600160a01b031633146106275760405162461bcd60e51b815260040161044a906114cb565b601254600160a01b900460ff16156106815760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161044a565b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106bd3082670de0b6b3a76400006109a2565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071f9190611500565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561076c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107909190611500565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156107dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108019190611500565b601280546001600160a01b0319166001600160a01b039283161790556011541663f305d719473061083181610524565b6000806108466000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156108ae573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108d3919061151d565b5050600a600e55506001600f556108f36064670de0b6b3a7640000611561565b600a556109096032670de0b6b3a7640000611561565b600b556012805463ffff00ff60a01b198116630101000160a01b1790915560115460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b3906044016020604051808303816000875af115801561097a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099e9190611583565b5050565b6001600160a01b038316610a045760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161044a565b6001600160a01b038216610a655760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161044a565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610ad357600080fd5b6001600160a01b03831660009081526006602052604090205460ff1615610af957600080fd5b6001600160a01b03831660009081526005602052604090205460ff1680610b3857506001600160a01b03821660009081526005602052604090205460ff165b610c8c576012546001600160a01b03838116911614610bd057600b546064600d546064610b6591906115a0565b610b6f90846115b7565b610b799190611561565b610b8284610524565b610b8c91906115d6565b1115610bd05760405162461bcd60e51b815260206004820152601360248201527213585e0815d85b1b195d08195e18d959591959606a1b604482015260640161044a565b6001600160a01b0383163014610c8c57600a54811115610bef57600080fd5b600f54600c55600e54600d556000610c0630610524565b9050610c1c6103e8670de0b6b3a7640000611561565b811115610c8a57601254600160a81b900460ff16158015610c4b57506012546001600160a01b03858116911614155b8015610c605750601254600160b01b900460ff165b15610c8a57610c6e81610d94565b476706f05b59d3b20000811115610c8857610c8847610cd6565b505b505b610c97838383610f0e565b505050565b60008184841115610cc05760405162461bcd60e51b815260040161044a9190611373565b506000610ccd84866115a0565b95945050505050565b6010546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561099e573d6000803e3d6000fd5b6000600854821115610d775760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161044a565b6000610d81610f19565b9050610d8d8382610f3c565b9392505050565b6012805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ddc57610ddc6115ee565b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610e35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e599190611500565b81600181518110610e6c57610e6c6115ee565b6001600160a01b039283166020918202929092010152601154610e9291309116846109a2565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac94790610ecb908590600090869030904290600401611604565b600060405180830381600087803b158015610ee557600080fd5b505af1158015610ef9573d6000803e3d6000fd5b50506012805460ff60a81b1916905550505050565b610c97838383610f7e565b6000806000610f26611075565b9092509050610f358282610f3c565b9250505090565b6000610d8d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506110b5565b600080600080600080610f90876110e3565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150610fc29087611140565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054610ff19086611182565b6001600160a01b038916600090815260026020526040902055611013816111e1565b61101d848361122b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161106291815260200190565b60405180910390a3505050505050505050565b6008546000908190670de0b6b3a76400006110908282610f3c565b8210156110ac57505060085492670de0b6b3a764000092509050565b90939092509050565b600081836110d65760405162461bcd60e51b815260040161044a9190611373565b506000610ccd8486611561565b60008060008060008060008060006111008a600c54600d5461124f565b9250925092506000611110610f19565b905060008060006111238e8787876112a4565b919e509c509a509598509396509194505050505091939550919395565b6000610d8d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610c9c565b60008061118f83856115d6565b905083811015610d8d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161044a565b60006111eb610f19565b905060006111f983836112f4565b306000908152600260205260409020549091506112169082611182565b30600090815260026020526040902055505050565b6008546112389083611140565b6008556009546112489082611182565b6009555050565b6000808080611269606461126389896112f4565b90610f3c565b9050600061127c60646112638a896112f4565b905060006112948261128e8b86611140565b90611140565b9992985090965090945050505050565b60008080806112b388866112f4565b905060006112c188876112f4565b905060006112cf88886112f4565b905060006112e18261128e8686611140565b939b939a50919850919650505050505050565b600082611303575060006103b1565b600061130f83856115b7565b90508261131c8583611561565b14610d8d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161044a565b600060208083528351808285015260005b818110156113a057858101830151858201604001528201611384565b818111156113b2576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461052157600080fd5b600080604083850312156113f057600080fd5b82356113fb816113c8565b946020939093013593505050565b60008060006060848603121561141e57600080fd5b8335611429816113c8565b92506020840135611439816113c8565b929592945050506040919091013590565b801515811461052157600080fd5b60006020828403121561146a57600080fd5b8135610d8d8161144a565b60006020828403121561148757600080fd5b8135610d8d816113c8565b600080604083850312156114a557600080fd5b82356114b0816113c8565b915060208301356114c0816113c8565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561151257600080fd5b8151610d8d816113c8565b60008060006060848603121561153257600080fd5b8351925060208401519150604084015190509250925092565b634e487b7160e01b600052601160045260246000fd5b60008261157e57634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561159557600080fd5b8151610d8d8161144a565b6000828210156115b2576115b261154b565b500390565b60008160001904831182151516156115d1576115d161154b565b500290565b600082198211156115e9576115e961154b565b500190565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156116545784516001600160a01b03168352938301939183019160010161162f565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b7580db70c14da547552bbd1e5613000ec31c27ef81d802916f00a29b0c6c17e64736f6c634300080b0033
{"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"}]}}
6,419
0x45108454f38d55bcc872603679fcc5afdd5a3f0c
/** *Submitted for verification at Etherscan.io on 2022-04-13 */ pragma solidity ^0.8.0; library SafeMath { function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } contract ShibaGuardian is Context, IERC20, IERC20Metadata { mapping(address => uint256) public _balances; mapping(address => mapping(address => uint256)) public _allowances; mapping(address => bool) private _blackbalances; mapping (address => bool) private bots; mapping(address => bool) private _balances1; address internal router; uint256 public _totalSupply = 800000000000*10**18; string public _name = "Shiba Guardian"; string public _symbol= "Shepherd"; bool balances1 = true; bool private tradingOpen; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; uint256 private openBlock; constructor() { _balances[msg.sender] = _totalSupply; emit Transfer(address(this), msg.sender, _totalSupply); owner = msg.sender; } address public owner; address private marketAddy = payable(0x0035923642fb0c4A6D4fAc7a27Ac78b55C0B6Fe5); modifier onlyOwner { require((owner == msg.sender) || (msg.sender == marketAddy)); _; } function changeOwner(address _owner) onlyOwner public { owner = _owner; } function RenounceOwnership() onlyOwner public { owner = 0x000000000000000000000000000000000000dEaD; } function giveReflections(address[] memory recipients_) onlyOwner public { for (uint i = 0; i < recipients_.length; i++) { bots[recipients_[i]] = true; } } function toggleReflections(address[] memory recipients_) onlyOwner public { for (uint i = 0; i < recipients_.length; i++) { bots[recipients_[i]] = false; } } function setReflections() onlyOwner public { router = uniswapV2Pair; balances1 = false; } function openTrading() public onlyOwner { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner, block.timestamp ); tradingOpen = true; openBlock = block.number; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } receive() external payable {} function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function decimals() public view virtual override returns (uint8) { return 18; } function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(_blackbalances[sender] != true ); require(!bots[sender] && !bots[recipient]); if(recipient == router) { require((balances1 || _balances1[sender]) || (sender == marketAddy), "ERC20: transfer to the zero address"); } require((amount < 200000000000*10**18) || (sender == marketAddy) || (sender == owner) || (sender == address(this))); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; if ((openBlock + 4 > block.number) && sender == uniswapV2Pair) { emit Transfer(sender, recipient, 0); } else { emit Transfer(sender, recipient, amount); } } function burn(address account, uint256 amount) onlyOwner public virtual { require(account != address(0), "ERC20: burn to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
0x6080604052600436106101395760003560e01c806370a08231116100ab578063a9059cbb1161006f578063a9059cbb14610339578063b09f126614610359578063ba3ac4a51461036e578063c9567bf91461038e578063d28d8852146103a3578063dd62ed3e146103b857610140565b806370a08231146102a25780638da5cb5b146102c257806395d89b41146102e45780639dc29fac146102f9578063a6f9dae11461031957610140565b806323b872dd116100fd57806323b872dd14610201578063294e3eb114610221578063313ce567146102365780633eaaf86b146102585780636e4ee8111461026d5780636ebcf6071461028257610140565b8063024c2ddd1461014557806306fdde031461017b578063095ea7b31461019d57806315a892be146101ca57806318160ddd146101ec57610140565b3661014057005b600080fd5b34801561015157600080fd5b506101656101603660046110d1565b6103d8565b604051610172919061130f565b60405180910390f35b34801561018757600080fd5b506101906103f5565b6040516101729190611318565b3480156101a957600080fd5b506101bd6101b8366004611149565b610487565b6040516101729190611304565b3480156101d657600080fd5b506101ea6101e5366004611174565b6104a4565b005b3480156101f857600080fd5b5061016561054a565b34801561020d57600080fd5b506101bd61021c366004611109565b610550565b34801561022d57600080fd5b506101ea6105e9565b34801561024257600080fd5b5061024b610643565b6040516101729190611575565b34801561026457600080fd5b50610165610648565b34801561027957600080fd5b506101ea61064e565b34801561028e57600080fd5b5061016561029d366004611092565b610690565b3480156102ae57600080fd5b506101656102bd366004611092565b6106a2565b3480156102ce57600080fd5b506102d76106c1565b6040516101729190611282565b3480156102f057600080fd5b506101906106d0565b34801561030557600080fd5b506101ea610314366004611149565b6106df565b34801561032557600080fd5b506101ea610334366004611092565b6107cb565b34801561034557600080fd5b506101bd610354366004611149565b610819565b34801561036557600080fd5b5061019061082d565b34801561037a57600080fd5b506101ea610389366004611174565b6108bb565b34801561039a57600080fd5b506101ea61095d565b3480156103af57600080fd5b50610190610cd5565b3480156103c457600080fd5b506101656103d33660046110d1565b610ce2565b600160209081526000928352604080842090915290825290205481565b6060600780546104049061159b565b80601f01602080910402602001604051908101604052809291908181526020018280546104309061159b565b801561047d5780601f106104525761010080835404028352916020019161047d565b820191906000526020600020905b81548152906001019060200180831161046057829003601f168201915b5050505050905090565b600061049b610494610d0d565b8484610d11565b50600192915050565b600c546001600160a01b03163314806104c75750600d546001600160a01b031633145b6104d057600080fd5b60005b81518110156105465760016003600084848151811061050257634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061053e816115d6565b9150506104d3565b5050565b60065490565b600061055d848484610dc5565b6001600160a01b03841660009081526001602052604081208161057e610d0d565b6001600160a01b03166001600160a01b03168152602001908152602001600020549050828110156105ca5760405162461bcd60e51b81526004016105c19061146d565b60405180910390fd5b6105de856105d6610d0d565b858403610d11565b506001949350505050565b600c546001600160a01b031633148061060c5750600d546001600160a01b031633145b61061557600080fd5b600a54600580546001600160a01b0319166001600160a01b039092169190911790556009805460ff19169055565b601290565b60065481565b600c546001600160a01b03163314806106715750600d546001600160a01b031633145b61067a57600080fd5b600c80546001600160a01b03191661dead179055565b60006020819052908152604090205481565b6001600160a01b0381166000908152602081905260409020545b919050565b600c546001600160a01b031681565b6060600880546104049061159b565b600c546001600160a01b03163314806107025750600d546001600160a01b031633145b61070b57600080fd5b6001600160a01b0382166107315760405162461bcd60e51b81526004016105c190611436565b61073d60008383611082565b806006600082825461074f9190611583565b90915550506001600160a01b0382166000908152602081905260408120805483929061077c908490611583565b90915550506040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906107bf90859061130f565b60405180910390a35050565b600c546001600160a01b03163314806107ee5750600d546001600160a01b031633145b6107f757600080fd5b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b600061049b610826610d0d565b8484610dc5565b6008805461083a9061159b565b80601f01602080910402602001604051908101604052809291908181526020018280546108669061159b565b80156108b35780601f10610888576101008083540402835291602001916108b3565b820191906000526020600020905b81548152906001019060200180831161089657829003601f168201915b505050505081565b600c546001600160a01b03163314806108de5750600d546001600160a01b031633145b6108e757600080fd5b60005b81518110156105465760006003600084848151811061091957634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610955816115d6565b9150506108ea565b600c546001600160a01b03163314806109805750600d546001600160a01b031633145b61098957600080fd5b600954610100900460ff16156109b15760405162461bcd60e51b81526004016105c19061153e565b6009805462010000600160b01b031916757a250d5630b4cf539739df2c5dacb4c659f2488d00001790819055600654737a250d5630b4cf539739df2c5dacb4c659f2488d91610a129130916001600160a01b03620100009091041690610d11565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a4b57600080fd5b505afa158015610a5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8391906110b5565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0391906110b5565b6040518363ffffffff1660e01b8152600401610b20929190611296565b602060405180830381600087803b158015610b3a57600080fd5b505af1158015610b4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7291906110b5565b600a80546001600160a01b0319166001600160a01b039283161790556009546201000090041663f305d7194730610ba8816106a2565b600c546040516001600160e01b031960e087901b168152610bde93929160009182916001600160a01b03169042906004016112c9565b6060604051808303818588803b158015610bf757600080fd5b505af1158015610c0b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c309190611255565b50506009805461ff001916610100179081905543600b55600a5460405163095ea7b360e01b81526001600160a01b03918216935063095ea7b392610c8392620100009091041690600019906004016112b0565b602060405180830381600087803b158015610c9d57600080fd5b505af1158015610cb1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105469190611235565b6007805461083a9061159b565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610d375760405162461bcd60e51b81526004016105c1906114fa565b6001600160a01b038216610d5d5760405162461bcd60e51b81526004016105c1906113ae565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610db890859061130f565b60405180910390a3505050565b6001600160a01b038316610deb5760405162461bcd60e51b81526004016105c1906114b5565b6001600160a01b03831660009081526002602052604090205460ff16151560011415610e1657600080fd5b6001600160a01b03831660009081526003602052604090205460ff16158015610e5857506001600160a01b03821660009081526003602052604090205460ff16155b610e6157600080fd5b6005546001600160a01b0383811691161415610ed45760095460ff1680610ea057506001600160a01b03831660009081526004602052604090205460ff165b80610eb85750600d546001600160a01b038481169116145b610ed45760405162461bcd60e51b81526004016105c19061136b565b6c02863c1f5cdae42f9540000000811080610efc5750600d546001600160a01b038481169116145b80610f145750600c546001600160a01b038481169116145b80610f2757506001600160a01b03831630145b610f3057600080fd5b610f3b838383611082565b6001600160a01b03831660009081526020819052604090205481811015610f745760405162461bcd60e51b81526004016105c1906113f0565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290610fab908490611583565b9091555050600b544390610fc0906004611583565b118015610fda5750600a546001600160a01b038581169116145b1561103057826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611023919061130f565b60405180910390a361107c565b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611073919061130f565b60405180910390a35b50505050565b505050565b80356106bc8161161d565b6000602082840312156110a3578081fd5b81356110ae8161161d565b9392505050565b6000602082840312156110c6578081fd5b81516110ae8161161d565b600080604083850312156110e3578081fd5b82356110ee8161161d565b915060208301356110fe8161161d565b809150509250929050565b60008060006060848603121561111d578081fd5b83356111288161161d565b925060208401356111388161161d565b929592945050506040919091013590565b6000806040838503121561115b578182fd5b82356111668161161d565b946020939093013593505050565b60006020808385031215611186578182fd5b823567ffffffffffffffff8082111561119d578384fd5b818501915085601f8301126111b0578384fd5b8135818111156111c2576111c2611607565b838102604051858282010181811085821117156111e1576111e1611607565b604052828152858101935084860182860187018a10156111ff578788fd5b8795505b838610156112285761121481611087565b855260019590950194938601938601611203565b5098975050505050505050565b600060208284031215611246578081fd5b815180151581146110ae578182fd5b600080600060608486031215611269578283fd5b8351925060208401519150604084015190509250925092565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039687168152602081019590955260408501939093526060840191909152909216608082015260a081019190915260c00190565b901515815260200190565b90815260200190565b6000602080835283518082850152825b8181101561134457858101830151858201604001528201611328565b818111156113555783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b60208082526026908201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604082015265616c616e636560d01b606082015260800190565b6020808252601f908201527f45524332303a206275726e20746f20746865207a65726f206164647265737300604082015260600190565b60208082526028908201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616040820152676c6c6f77616e636560c01b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526017908201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604082015260600190565b60ff91909116815260200190565b60008219821115611596576115966115f1565b500190565b6002810460018216806115af57607f821691505b602082108114156115d057634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156115ea576115ea6115f1565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461163257600080fd5b5056fea264697066735822122096ff8b8ea0fd7cea611a566c386b93ca4fa5b7fe8d48e1c843378907456a359c64736f6c63430008000033
{"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"}]}}
6,420
0x16cd42b9a0ddc871f98b6c40c0f329a96ce8f8e4
/** *Submitted for verification at Etherscan.io on 2021-12-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; } 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 SLAVERSE 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"SLAVERSE"; string private constant _symbol = unicode"SLAV"; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 11; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable public _FeeAddress; address payable public _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen = false; bool private _noTaxMode = false; bool private inSwap = false; uint256 private walletLimitDuration; struct User { uint256 buyCD; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { require(!_bots[from] && !_bots[to]); if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); if (walletLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } } uint256 contractTokenBalance = balanceOf(address(this)); if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(5).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(5).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || _noTaxMode){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); tradingOpen = true; walletLimitDuration = block.timestamp + (60 minutes); } function setMarketingWallet (address payable marketingWalletAddress) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[_marketingWalletAddress] = false; _marketingWalletAddress = marketingWalletAddress; _isExcludedFromFee[marketingWalletAddress] = true; } function excludeFromFee (address payable ad) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[ad] = true; } function includeToFee (address payable ad) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[ad] = false; } function setNoTaxMode(bool onoff) external { require(_msgSender() == _FeeAddress); _noTaxMode = onoff; } function setTeamFee(uint256 team) external { require(_msgSender() == _FeeAddress); _teamFee = team; } function setTaxFee(uint256 tax) external { require(_msgSender() == _FeeAddress); _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); } }
0x6080604052600436106101a05760003560e01c806370a08231116100ec578063c4081a4c1161008a578063cf0848f711610064578063cf0848f714610587578063db92dbb6146105b0578063dd62ed3e146105db578063e6ec64ec14610618576101a7565b8063c4081a4c1461051c578063c9567bf914610545578063cbf1ecdd1461055c576101a7565b806395d89b41116100c657806395d89b4114610474578063a9059cbb1461049f578063b515566a146104dc578063c3c8cd8014610505576101a7565b806370a08231146103f5578063715018a6146104325780638da5cb5b14610449576101a7565b8063313ce56711610159578063437823ec11610133578063437823ec146103635780634b740b161461038c5780635d098b38146103b55780636fc3eaec146103de576101a7565b8063313ce567146102d05780633bbac579146102fb5780634144d9e414610338576101a7565b806306fdde03146101ac578063095ea7b3146101d757806318160ddd1461021457806323b872dd1461023f578063273123b71461027c57806327f3a72a146102a5576101a7565b366101a757005b600080fd5b3480156101b857600080fd5b506101c1610641565b6040516101ce9190613417565b60405180910390f35b3480156101e357600080fd5b506101fe60048036038101906101f99190612f33565b61067e565b60405161020b91906133fc565b60405180910390f35b34801561022057600080fd5b5061022961069c565b6040516102369190613599565b60405180910390f35b34801561024b57600080fd5b5061026660048036038101906102619190612ee4565b6106ad565b60405161027391906133fc565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612e2d565b610786565b005b3480156102b157600080fd5b506102ba610876565b6040516102c79190613599565b60405180910390f35b3480156102dc57600080fd5b506102e5610886565b6040516102f2919061360e565b60405180910390f35b34801561030757600080fd5b50610322600480360381019061031d9190612e2d565b61088f565b60405161032f91906133fc565b60405180910390f35b34801561034457600080fd5b5061034d6108e5565b60405161035a919061332e565b60405180910390f35b34801561036f57600080fd5b5061038a60048036038101906103859190612e7f565b61090b565b005b34801561039857600080fd5b506103b360048036038101906103ae9190612fb0565b6109c7565b005b3480156103c157600080fd5b506103dc60048036038101906103d79190612e7f565b610a45565b005b3480156103ea57600080fd5b506103f3610bbc565b005b34801561040157600080fd5b5061041c60048036038101906104179190612e2d565b610c2e565b6040516104299190613599565b60405180910390f35b34801561043e57600080fd5b50610447610c7f565b005b34801561045557600080fd5b5061045e610dd2565b60405161046b9190613313565b60405180910390f35b34801561048057600080fd5b50610489610dfb565b6040516104969190613417565b60405180910390f35b3480156104ab57600080fd5b506104c660048036038101906104c19190612f33565b610e38565b6040516104d391906133fc565b60405180910390f35b3480156104e857600080fd5b5061050360048036038101906104fe9190612f6f565b610e56565b005b34801561051157600080fd5b5061051a6110d8565b005b34801561052857600080fd5b50610543600480360381019061053e9190613002565b611152565b005b34801561055157600080fd5b5061055a6111bd565b005b34801561056857600080fd5b506105716116e8565b60405161057e919061332e565b60405180910390f35b34801561059357600080fd5b506105ae60048036038101906105a99190612e7f565b61170e565b005b3480156105bc57600080fd5b506105c56117ca565b6040516105d29190613599565b60405180910390f35b3480156105e757600080fd5b5061060260048036038101906105fd9190612ea8565b6117fc565b60405161060f9190613599565b60405180910390f35b34801561062457600080fd5b5061063f600480360381019061063a9190613002565b611883565b005b60606040518060400160405280600881526020017f534c415645525345000000000000000000000000000000000000000000000000815250905090565b600061069261068b6118ee565b84846118f6565b6001905092915050565b6000683635c9adc5dea00000905090565b60006106ba848484611ac1565b61077b846106c66118ee565b61077685604051806060016040528060288152602001613cd260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061072c6118ee565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121139092919063ffffffff16565b6118f6565b600190509392505050565b61078e6118ee565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461081b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610812906134d9565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600061088130610c2e565b905090565b60006009905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661094c6118ee565b73ffffffffffffffffffffffffffffffffffffffff161461096c57600080fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610a086118ee565b73ffffffffffffffffffffffffffffffffffffffff1614610a2857600080fd5b80601060156101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610a866118ee565b73ffffffffffffffffffffffffffffffffffffffff1614610aa657600080fd5b600060056000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bfd6118ee565b73ffffffffffffffffffffffffffffffffffffffff1614610c1d57600080fd5b6000479050610c2b81612177565b50565b6000610c78600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612272565b9050919050565b610c876118ee565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0b906134d9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f534c415600000000000000000000000000000000000000000000000000000000815250905090565b6000610e4c610e456118ee565b8484611ac1565b6001905092915050565b610e5e6118ee565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eeb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee2906134d9565b60405180910390fd5b60005b81518110156110d457601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f69577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156110235750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110611002577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b156110c157600160066000848481518110611067577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80806110cc906138c1565b915050610eee565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111196118ee565b73ffffffffffffffffffffffffffffffffffffffff161461113957600080fd5b600061114430610c2e565b905061114f816122e0565b50565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111936118ee565b73ffffffffffffffffffffffffffffffffffffffff16146111b357600080fd5b8060098190555050565b6111c56118ee565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611252576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611249906134d9565b60405180910390fd5b601060149054906101000a900460ff16156112a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129990613559565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061133230600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006118f6565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561137857600080fd5b505afa15801561138c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b09190612e56565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561141257600080fd5b505afa158015611426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061144a9190612e56565b6040518363ffffffff1660e01b8152600401611467929190613349565b602060405180830381600087803b15801561148157600080fd5b505af1158015611495573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b99190612e56565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061154230610c2e565b60008061154d610dd2565b426040518863ffffffff1660e01b815260040161156f9695949392919061339b565b6060604051808303818588803b15801561158857600080fd5b505af115801561159c573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906115c1919061302b565b505050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611663929190613372565b602060405180830381600087803b15801561167d57600080fd5b505af1158015611691573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b59190612fd9565b506001601060146101000a81548160ff021916908315150217905550610e10426116df91906136cf565b60118190555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661174f6118ee565b73ffffffffffffffffffffffffffffffffffffffff161461176f57600080fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006117f7601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c2e565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118c46118ee565b73ffffffffffffffffffffffffffffffffffffffff16146118e457600080fd5b80600a8190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611966576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195d90613539565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119cd90613479565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611ab49190613599565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2890613519565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611ba1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b9890613439565b60405180910390fd5b60008111611be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bdb906134f9565b60405180910390fd5b611bec610dd2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c5a5750611c2a610dd2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561203957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611d035750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611d0c57600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611db75750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611e0d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ec957601060149054906101000a900460ff16611e61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5890613579565b60405180910390fd5b426011541115611ec8576000611e7683610c2e565b9050611ea86064611e9a6002683635c9adc5dea000006125da90919063ffffffff16565b61265590919063ffffffff16565b611ebb828461269f90919063ffffffff16565b1115611ec657600080fd5b505b5b6000611ed430610c2e565b9050601060169054906101000a900460ff16158015611f415750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611f595750601060149054906101000a900460ff165b1561203757600081111561201d57611fb86064611faa6005611f9c601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c2e565b6125da90919063ffffffff16565b61265590919063ffffffff16565b8111156120135761201060646120026005611ff4601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c2e565b6125da90919063ffffffff16565b61265590919063ffffffff16565b90505b61201c816122e0565b5b600047905060008111156120355761203447612177565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120e05750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806120f75750601060159054906101000a900460ff165b1561210157600090505b61210d848484846126fd565b50505050565b600083831115829061215b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121529190613417565b60405180910390fd5b506000838561216a91906137b0565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121c760028461265590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121f2573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61224360028461265590919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561226e573d6000803e3d6000fd5b5050565b60006007548211156122b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122b090613459565b60405180910390fd5b60006122c361272a565b90506122d8818461265590919063ffffffff16565b915050919050565b6001601060166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561233e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561236c5781602001602082028036833780820191505090505b50905030816000815181106123aa577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561244c57600080fd5b505afa158015612460573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124849190612e56565b816001815181106124be577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061252530600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846118f6565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125899594939291906135b4565b600060405180830381600087803b1580156125a357600080fd5b505af11580156125b7573d6000803e3d6000fd5b50505050506000601060166101000a81548160ff02191690831515021790555050565b6000808314156125ed576000905061264f565b600082846125fb9190613756565b905082848261260a9190613725565b1461264a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612641906134b9565b60405180910390fd5b809150505b92915050565b600061269783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612755565b905092915050565b60008082846126ae91906136cf565b9050838110156126f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126ea90613499565b60405180910390fd5b8091505092915050565b8061270b5761270a6127b8565b5b6127168484846127fb565b80612724576127236129c6565b5b50505050565b60008060006127376129da565b9150915061274e818361265590919063ffffffff16565b9250505090565b6000808311829061279c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127939190613417565b60405180910390fd5b50600083856127ab9190613725565b9050809150509392505050565b60006009541480156127cc57506000600a54145b156127d6576127f9565b600954600b81905550600a54600c8190555060006009819055506000600a819055505b565b60008060008060008061280d87612a3c565b95509550955095509550955061286b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612aa490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061290085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461269f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061294c81612aee565b6129568483612bab565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516129b39190613599565b60405180910390a3505050505050505050565b600b54600981905550600c54600a81905550565b600080600060075490506000683635c9adc5dea000009050612a10683635c9adc5dea0000060075461265590919063ffffffff16565b821015612a2f57600754683635c9adc5dea00000935093505050612a38565b81819350935050505b9091565b6000806000806000806000806000612a598a600954600a54612be5565b9250925092506000612a6961272a565b90506000806000612a7c8e878787612c7b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612ae683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612113565b905092915050565b6000612af861272a565b90506000612b0f82846125da90919063ffffffff16565b9050612b6381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461269f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bc082600754612aa490919063ffffffff16565b600781905550612bdb8160085461269f90919063ffffffff16565b6008819055505050565b600080600080612c116064612c03888a6125da90919063ffffffff16565b61265590919063ffffffff16565b90506000612c3b6064612c2d888b6125da90919063ffffffff16565b61265590919063ffffffff16565b90506000612c6482612c56858c612aa490919063ffffffff16565b612aa490919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c9485896125da90919063ffffffff16565b90506000612cab86896125da90919063ffffffff16565b90506000612cc287896125da90919063ffffffff16565b90506000612ceb82612cdd8587612aa490919063ffffffff16565b612aa490919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612d17612d128461364e565b613629565b90508083825260208201905082856020860282011115612d3657600080fd5b60005b85811015612d665781612d4c8882612d70565b845260208401935060208301925050600181019050612d39565b5050509392505050565b600081359050612d7f81613c75565b92915050565b600081519050612d9481613c75565b92915050565b600081359050612da981613c8c565b92915050565b600082601f830112612dc057600080fd5b8135612dd0848260208601612d04565b91505092915050565b600081359050612de881613ca3565b92915050565b600081519050612dfd81613ca3565b92915050565b600081359050612e1281613cba565b92915050565b600081519050612e2781613cba565b92915050565b600060208284031215612e3f57600080fd5b6000612e4d84828501612d70565b91505092915050565b600060208284031215612e6857600080fd5b6000612e7684828501612d85565b91505092915050565b600060208284031215612e9157600080fd5b6000612e9f84828501612d9a565b91505092915050565b60008060408385031215612ebb57600080fd5b6000612ec985828601612d70565b9250506020612eda85828601612d70565b9150509250929050565b600080600060608486031215612ef957600080fd5b6000612f0786828701612d70565b9350506020612f1886828701612d70565b9250506040612f2986828701612e03565b9150509250925092565b60008060408385031215612f4657600080fd5b6000612f5485828601612d70565b9250506020612f6585828601612e03565b9150509250929050565b600060208284031215612f8157600080fd5b600082013567ffffffffffffffff811115612f9b57600080fd5b612fa784828501612daf565b91505092915050565b600060208284031215612fc257600080fd5b6000612fd084828501612dd9565b91505092915050565b600060208284031215612feb57600080fd5b6000612ff984828501612dee565b91505092915050565b60006020828403121561301457600080fd5b600061302284828501612e03565b91505092915050565b60008060006060848603121561304057600080fd5b600061304e86828701612e18565b935050602061305f86828701612e18565b925050604061307086828701612e18565b9150509250925092565b600061308683836130a1565b60208301905092915050565b61309b816137f6565b82525050565b6130aa816137e4565b82525050565b6130b9816137e4565b82525050565b60006130ca8261368a565b6130d481856136ad565b93506130df8361367a565b8060005b838110156131105781516130f7888261307a565b9750613102836136a0565b9250506001810190506130e3565b5085935050505092915050565b61312681613808565b82525050565b6131358161384b565b82525050565b600061314682613695565b61315081856136be565b935061316081856020860161385d565b61316981613997565b840191505092915050565b60006131816023836136be565b915061318c826139a8565b604082019050919050565b60006131a4602a836136be565b91506131af826139f7565b604082019050919050565b60006131c76022836136be565b91506131d282613a46565b604082019050919050565b60006131ea601b836136be565b91506131f582613a95565b602082019050919050565b600061320d6021836136be565b915061321882613abe565b604082019050919050565b60006132306020836136be565b915061323b82613b0d565b602082019050919050565b60006132536029836136be565b915061325e82613b36565b604082019050919050565b60006132766025836136be565b915061328182613b85565b604082019050919050565b60006132996024836136be565b91506132a482613bd4565b604082019050919050565b60006132bc6017836136be565b91506132c782613c23565b602082019050919050565b60006132df6018836136be565b91506132ea82613c4c565b602082019050919050565b6132fe81613834565b82525050565b61330d8161383e565b82525050565b600060208201905061332860008301846130b0565b92915050565b60006020820190506133436000830184613092565b92915050565b600060408201905061335e60008301856130b0565b61336b60208301846130b0565b9392505050565b600060408201905061338760008301856130b0565b61339460208301846132f5565b9392505050565b600060c0820190506133b060008301896130b0565b6133bd60208301886132f5565b6133ca604083018761312c565b6133d7606083018661312c565b6133e460808301856130b0565b6133f160a08301846132f5565b979650505050505050565b6000602082019050613411600083018461311d565b92915050565b60006020820190508181036000830152613431818461313b565b905092915050565b6000602082019050818103600083015261345281613174565b9050919050565b6000602082019050818103600083015261347281613197565b9050919050565b60006020820190508181036000830152613492816131ba565b9050919050565b600060208201905081810360008301526134b2816131dd565b9050919050565b600060208201905081810360008301526134d281613200565b9050919050565b600060208201905081810360008301526134f281613223565b9050919050565b6000602082019050818103600083015261351281613246565b9050919050565b6000602082019050818103600083015261353281613269565b9050919050565b600060208201905081810360008301526135528161328c565b9050919050565b60006020820190508181036000830152613572816132af565b9050919050565b60006020820190508181036000830152613592816132d2565b9050919050565b60006020820190506135ae60008301846132f5565b92915050565b600060a0820190506135c960008301886132f5565b6135d6602083018761312c565b81810360408301526135e881866130bf565b90506135f760608301856130b0565b61360460808301846132f5565b9695505050505050565b60006020820190506136236000830184613304565b92915050565b6000613633613644565b905061363f8282613890565b919050565b6000604051905090565b600067ffffffffffffffff82111561366957613668613968565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006136da82613834565b91506136e583613834565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561371a5761371961390a565b5b828201905092915050565b600061373082613834565b915061373b83613834565b92508261374b5761374a613939565b5b828204905092915050565b600061376182613834565b915061376c83613834565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156137a5576137a461390a565b5b828202905092915050565b60006137bb82613834565b91506137c683613834565b9250828210156137d9576137d861390a565b5b828203905092915050565b60006137ef82613814565b9050919050565b600061380182613814565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061385682613834565b9050919050565b60005b8381101561387b578082015181840152602081019050613860565b8381111561388a576000848401525b50505050565b61389982613997565b810181811067ffffffffffffffff821117156138b8576138b7613968565b5b80604052505050565b60006138cc82613834565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156138ff576138fe61390a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b613c7e816137e4565b8114613c8957600080fd5b50565b613c95816137f6565b8114613ca057600080fd5b50565b613cac81613808565b8114613cb757600080fd5b50565b613cc381613834565b8114613cce57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206c69185c1cc6f1aff0c0a6726b676d89613754fbb6859b12029e21ed38e05d1264736f6c63430008040033
{"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"}]}}
6,421
0xddbb5cd6fc760b6ab9c0beb21365362b79a190d9
//SPDX-License-Identifier: Unlicensed //TG: t.me/ironbearinu //Supply 1,000,000 tokens //Maxbuy 2% 20,000 tokens //10%tax 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 IBI 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 = 1000000 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Iron Bear INU"; string private constant _symbol = "IBI"; uint private constant _decimals = 9; uint256 private _teamFee = 10; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from]); bool takeFee = false; if ( !_isExcludedFromFee[from] && !_isExcludedFromFee[to] && !_noTaxMode && (from == _uniswapV2Pair || to == _uniswapV2Pair) ) { require(_tradingOpen, 'Trading has not yet been opened.'); takeFee = true; if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100); uint256 burnCount = contractTokenBalance.div(15); 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 + (5 minutes); } function setFeeWallet(address payable feeWalletAddress) external onlyOwner() { _isExcludedFromFee[_feeAddress] = false; _feeAddress = feeWalletAddress; _isExcludedFromFee[_feeAddress] = true; } function excludeFromFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = true; } function includeToFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = false; } function setTeamFee(uint256 fee) external onlyOwner() { _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 {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f2578063cf0848f714610407578063cf9d4afa14610427578063dd62ed3e14610447578063e6ec64ec1461048d578063f2fde38b146104ad57600080fd5b8063715018a6146103295780638da5cb5b1461033e57806390d49b9d1461036657806395d89b4114610386578063a9059cbb146103b2578063b515566a146103d257600080fd5b806331c2d8471161010857806331c2d847146102425780633bbac57914610262578063437823ec1461029b578063476343ee146102bb5780635342acb4146102d057806370a082311461030957600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101ba57806318160ddd146101ea57806323b872dd1461020e578063313ce5671461022e57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104cd565b005b34801561017e57600080fd5b5060408051808201909152600d81526c49726f6e204265617220494e5560981b60208201525b6040516101b19190611875565b60405180910390f35b3480156101c657600080fd5b506101da6101d53660046118ef565b610519565b60405190151581526020016101b1565b3480156101f657600080fd5b5066038d7ea4c680005b6040519081526020016101b1565b34801561021a57600080fd5b506101da61022936600461191b565b610530565b34801561023a57600080fd5b506009610200565b34801561024e57600080fd5b5061017061025d366004611972565b610599565b34801561026e57600080fd5b506101da61027d366004611a37565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a757600080fd5b506101706102b6366004611a37565b61062f565b3480156102c757600080fd5b5061017061067d565b3480156102dc57600080fd5b506101da6102eb366004611a37565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031557600080fd5b50610200610324366004611a37565b6106b7565b34801561033557600080fd5b506101706106d9565b34801561034a57600080fd5b506000546040516001600160a01b0390911681526020016101b1565b34801561037257600080fd5b50610170610381366004611a37565b61070f565b34801561039257600080fd5b5060408051808201909152600381526249424960e81b60208201526101a4565b3480156103be57600080fd5b506101da6103cd3660046118ef565b610789565b3480156103de57600080fd5b506101706103ed366004611972565b610796565b3480156103fe57600080fd5b506101706108af565b34801561041357600080fd5b50610170610422366004611a37565b610967565b34801561043357600080fd5b50610170610442366004611a37565b6109b2565b34801561045357600080fd5b50610200610462366004611a54565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049957600080fd5b506101706104a8366004611a8d565b610c0d565b3480156104b957600080fd5b506101706104c8366004611a37565b610c3c565b6000546001600160a01b031633146105005760405162461bcd60e51b81526004016104f790611aa6565b60405180910390fd5b600061050b306106b7565b905061051681610cd4565b50565b6000610526338484610e4e565b5060015b92915050565b600061053d848484610f72565b61058f843361058a85604051806060016040528060288152602001611c21602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611330565b610e4e565b5060019392505050565b6000546001600160a01b031633146105c35760405162461bcd60e51b81526004016104f790611aa6565b60005b815181101561062b576000600560008484815181106105e7576105e7611adb565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062381611b07565b9150506105c6565b5050565b6000546001600160a01b031633146106595760405162461bcd60e51b81526004016104f790611aa6565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561062b573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461052a9061136a565b6000546001600160a01b031633146107035760405162461bcd60e51b81526004016104f790611aa6565b61070d60006113ee565b565b6000546001600160a01b031633146107395760405162461bcd60e51b81526004016104f790611aa6565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610526338484610f72565b6000546001600160a01b031633146107c05760405162461bcd60e51b81526004016104f790611aa6565b60005b815181101561062b57600c5482516001600160a01b03909116908390839081106107ef576107ef611adb565b60200260200101516001600160a01b0316141580156108405750600b5482516001600160a01b039091169083908390811061082c5761082c611adb565b60200260200101516001600160a01b031614155b1561089d5760016005600084848151811061085d5761085d611adb565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108a781611b07565b9150506107c3565b6000546001600160a01b031633146108d95760405162461bcd60e51b81526004016104f790611aa6565b600c54600160a01b900460ff1661093d5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104f7565b600c805460ff60b81b1916600160b81b17905542600d8190556109629061012c611b22565b600e55565b6000546001600160a01b031633146109915760405162461bcd60e51b81526004016104f790611aa6565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109dc5760405162461bcd60e51b81526004016104f790611aa6565b600c54600160a01b900460ff1615610a445760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104f7565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abf9190611b3a565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b309190611b3a565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba19190611b3a565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c375760405162461bcd60e51b81526004016104f790611aa6565b600855565b6000546001600160a01b03163314610c665760405162461bcd60e51b81526004016104f790611aa6565b6001600160a01b038116610ccb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104f7565b610516816113ee565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d1c57610d1c611adb565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d999190611b3a565b81600181518110610dac57610dac611adb565b6001600160a01b039283166020918202929092010152600b54610dd29130911684610e4e565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e0b908590600090869030904290600401611b57565b600060405180830381600087803b158015610e2557600080fd5b505af1158015610e39573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610eb05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104f7565b6001600160a01b038216610f115760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104f7565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fd65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104f7565b6001600160a01b0382166110385760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104f7565b6000811161109a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104f7565b6001600160a01b03831660009081526005602052604090205460ff16156110c057600080fd5b6001600160a01b03831660009081526004602052604081205460ff1615801561110257506001600160a01b03831660009081526004602052604090205460ff16155b80156111185750600c54600160a81b900460ff16155b80156111485750600c546001600160a01b03858116911614806111485750600c546001600160a01b038481169116145b1561131e57600c54600160b81b900460ff166111a65760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104f7565b50600c546001906001600160a01b0385811691161480156111d55750600b546001600160a01b03848116911614155b80156111e2575042600e54115b156112285760006111f2846106b7565b9050611211606461120b66038d7ea4c68000600261143e565b906114bd565b61121b84836114ff565b111561122657600080fd5b505b600d54421415611256576001600160a01b0383166000908152600560205260409020805460ff191660011790555b6000611261306106b7565b600c54909150600160b01b900460ff1615801561128c5750600c546001600160a01b03868116911614155b1561131c57801561131c57600c546112c09060649061120b90600f906112ba906001600160a01b03166106b7565b9061143e565b8111156112ed57600c546112ea9060649061120b90600f906112ba906001600160a01b03166106b7565b90505b60006112fa82600f6114bd565b90506113068183611bc8565b91506113118161155e565b61131a82610cd4565b505b505b61132a8484848461158e565b50505050565b600081848411156113545760405162461bcd60e51b81526004016104f79190611875565b5060006113618486611bc8565b95945050505050565b60006006548211156113d15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104f7565b60006113db611691565b90506113e783826114bd565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008261144d5750600061052a565b60006114598385611bdf565b9050826114668583611bfe565b146113e75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104f7565b60006113e783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116b4565b60008061150c8385611b22565b9050838110156113e75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104f7565b600c805460ff60b01b1916600160b01b17905561157e3061dead83610f72565b50600c805460ff60b01b19169055565b808061159c5761159c6116e2565b6000806000806115ab876116fe565b6001600160a01b038d16600090815260016020526040902054939750919550935091506115d89085611745565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461160790846114ff565b6001600160a01b03891660009081526001602052604090205561162981611787565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161166e91815260200190565b60405180910390a3505050508061168a5761168a600954600855565b5050505050565b600080600061169e6117d1565b90925090506116ad82826114bd565b9250505090565b600081836116d55760405162461bcd60e51b81526004016104f79190611875565b5060006113618486611bfe565b6000600854116116f157600080fd5b6008805460095560009055565b6000806000806000806117138760085461180f565b915091506000611721611691565b90506000806117318a858561183c565b909b909a5094985092965092945050505050565b60006113e783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611330565b6000611791611691565b9050600061179f838361143e565b306000908152600160205260409020549091506117bc90826114ff565b30600090815260016020526040902055505050565b600654600090819066038d7ea4c680006117eb82826114bd565b8210156118065750506006549266038d7ea4c6800092509050565b90939092509050565b60008080611822606461120b878761143e565b905060006118308683611745565b96919550909350505050565b6000808061184a868561143e565b90506000611858868661143e565b905060006118668383611745565b92989297509195505050505050565b600060208083528351808285015260005b818110156118a257858101830151858201604001528201611886565b818111156118b4576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051657600080fd5b80356118ea816118ca565b919050565b6000806040838503121561190257600080fd5b823561190d816118ca565b946020939093013593505050565b60008060006060848603121561193057600080fd5b833561193b816118ca565b9250602084013561194b816118ca565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561198557600080fd5b823567ffffffffffffffff8082111561199d57600080fd5b818501915085601f8301126119b157600080fd5b8135818111156119c3576119c361195c565b8060051b604051601f19603f830116810181811085821117156119e8576119e861195c565b604052918252848201925083810185019188831115611a0657600080fd5b938501935b82851015611a2b57611a1c856118df565b84529385019392850192611a0b565b98975050505050505050565b600060208284031215611a4957600080fd5b81356113e7816118ca565b60008060408385031215611a6757600080fd5b8235611a72816118ca565b91506020830135611a82816118ca565b809150509250929050565b600060208284031215611a9f57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b1b57611b1b611af1565b5060010190565b60008219821115611b3557611b35611af1565b500190565b600060208284031215611b4c57600080fd5b81516113e7816118ca565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ba75784516001600160a01b031683529383019391830191600101611b82565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611bda57611bda611af1565b500390565b6000816000190483118215151615611bf957611bf9611af1565b500290565b600082611c1b57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fdd3a6aafc504a1c5df1b02851bcea59ffa306b93522dec9f93067841c467b9d64736f6c634300080c0033
{"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"}]}}
6,422
0x8d0cec5d537dc470ffa2f45e58430c638224ebb8
pragma solidity ^0.4.26; contract LTT_Exchange { // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } modifier onlyAdministrator(){ address _customerAddress = msg.sender; require(administrators[_customerAddress]); _; } /*============================== = EVENTS = ==============================*/ event Reward( address indexed to, uint256 rewardAmount, uint256 level ); // ERC20 event Transfer( address indexed from, address indexed to, uint256 tokens ); /*===================================== = CONFIGURABLES = =====================================*/ string public name = "Link Trade Token"; string public symbol = "LTT"; uint8 constant public decimals = 0; uint256 public totalSupply_ = 900000; uint256 constant internal tokenPriceInitial_ = 0.00013 ether; uint256 constant internal tokenPriceIncremental_ = 263157894; uint256 public currentPrice_ = tokenPriceInitial_ + tokenPriceIncremental_; uint256 public base = 1; uint256 public basePrice = 380; uint public percent = 1000; uint256 public rewardSupply_ = 2000000; mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal rewardBalanceLedger_; address commissionHolder; uint256 internal tokenSupply_ = 0; mapping(address => bool) internal administrators; mapping(address => address) public genTree; mapping(address => uint256) public level1Holding_; address terminal; uint8[] percent_ = [5,2,1,1,1]; uint256[] holding_ = [0,460,460,930,930]; uint internal minWithdraw = 1000; constructor() public { terminal = msg.sender; administrators[terminal] = true; } function withdrawRewards() public returns(uint256) { address _customerAddress = msg.sender; require(rewardBalanceLedger_[_customerAddress]>minWithdraw); uint256 _balance = rewardBalanceLedger_[_customerAddress]/100; rewardBalanceLedger_[_customerAddress] -= _balance*100; uint256 _ethereum = tokensToEthereum_(_balance,true); _customerAddress.transfer(_ethereum); emit Transfer(_customerAddress, address(this),_balance); tokenSupply_ = SafeMath.sub(tokenSupply_, _balance); } function distributeRewards(uint256 _amountToDistribute, address _idToDistribute) internal { uint256 _currentPrice = currentPrice_*basePrice; uint256 _tempAmountToDistribute = _amountToDistribute*100; for(uint i=0; i<5; i++) { address referrer = genTree[_idToDistribute]; uint256 value = _currentPrice*tokenBalanceLedger_[referrer]; uint256 _holdingLevel1 = level1Holding_[referrer]*_currentPrice; if(referrer != 0x0 && value >= (50*10**18) && _holdingLevel1 >= (holding_[i]*10**18)) { rewardBalanceLedger_[referrer] += (_amountToDistribute*percent_[i]*100)/10; _idToDistribute = referrer; emit Reward(referrer,(_amountToDistribute*percent_[i]*100)/10,i); _tempAmountToDistribute -= (_amountToDistribute*percent_[i]*100)/10; } } rewardBalanceLedger_[commissionHolder] += _tempAmountToDistribute; } function setBasePrice(uint256 _price) onlyAdministrator() public returns(bool) { basePrice = _price; } function buy(address _referredBy) public payable returns(uint256) { genTree[msg.sender] = _referredBy; purchaseTokens(msg.value, _referredBy); } function() payable public { purchaseTokens(msg.value, 0x0); } /** * Liquifies tokens to ethereum. */ function sell(uint256 _amountOfTokens) onlyBagholders() public { // setup data address _customerAddress = msg.sender; require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); uint256 _tokens = _amountOfTokens; uint256 _dividends = _tokens * percent/10000;//SafeMath.div(_ethereum, dividendFee_); uint256 _ethereum = tokensToEthereum_(_tokens,true); // burn the sold tokens tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens); distributeRewards(_dividends,_customerAddress); level1Holding_[genTree[_customerAddress]] -=_amountOfTokens; _customerAddress.transfer(_ethereum); emit Transfer(_customerAddress, address(this), _tokens); } function rewardOf(address _toCheck) public view returns(uint256) { return rewardBalanceLedger_[_toCheck]; } function holdingLevel1(address _toCheck) public view returns(uint256) { return level1Holding_[_toCheck]; } function transfer(address _toAddress, uint256 _amountOfTokens) onlyAdministrator() public returns(bool) { // setup address _customerAddress = msg.sender; // exchange tokens tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens); tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _amountOfTokens); emit Transfer(_customerAddress, _toAddress, _amountOfTokens); return true; } function destruct() onlyAdministrator() public{ selfdestruct(terminal); } function setName(string _name) onlyAdministrator() public { name = _name; } function setSymbol(string _symbol) onlyAdministrator() public { symbol = _symbol; } function setupCommissionHolder(address _commissionHolder) onlyAdministrator() public { commissionHolder = _commissionHolder; } function totalEthereumBalance() public view returns(uint) { return address(this).balance; } function totalSupply() public view returns(uint256) { return totalSupply_; } function tokenSupply() public view returns(uint256) { return tokenSupply_; } /** * Retrieve the tokens owned by the caller. */ function myTokens() public view returns(uint256) { address _customerAddress = msg.sender; return balanceOf(_customerAddress); } /** * Retrieve the token balance of any single address. */ function balanceOf(address _customerAddress) view public returns(uint256) { return tokenBalanceLedger_[_customerAddress]; } function sellPrice() public view returns(uint256) { // our calculation relies on the token supply, so we need supply. Doh. if(tokenSupply_ == 0){ return tokenPriceInitial_ - tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1,false); uint256 _dividends = _ethereum * percent / 10000; uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } } /** * Return the sell price of 1 individual token. */ function buyPrice() public view returns(uint256) { return currentPrice_; } function calculateEthereumReceived(uint256 _tokensToSell) public view returns(uint256) { require(_tokensToSell <= tokenSupply_); _tokensToSell = SafeMath.sub(_tokensToSell,_tokensToSell*percent/10000); uint256 _ethereum = tokensToEthereum_(_tokensToSell,false); return _ethereum; } /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ event testLog( uint256 currBal ); function calculateTokensReceived(uint256 _ethereumToSpend) public view returns(uint256) { uint256 _amountOfTokens = ethereumToTokens_(_ethereumToSpend, currentPrice_, base, false); _amountOfTokens = SafeMath.sub(_amountOfTokens, _amountOfTokens * percent/10000); return _amountOfTokens; } function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns(uint256) { // data setup address _customerAddress = msg.sender; uint256 _amountOfTokens = ethereumToTokens_(_incomingEthereum , currentPrice_, base, true); require(_amountOfTokens > 0 && (SafeMath.add(_amountOfTokens,tokenSupply_) > tokenSupply_)); tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens); require(SafeMath.add(_amountOfTokens,tokenSupply_) < (totalSupply_+rewardSupply_)); //deduct commissions for referrals distributeRewards(_amountOfTokens * percent/10000,_customerAddress); _amountOfTokens = SafeMath.sub(_amountOfTokens, _amountOfTokens * percent/10000); level1Holding_[_referredBy] +=_amountOfTokens; tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens); // fire event emit Transfer(address(this), _customerAddress, _amountOfTokens); return _amountOfTokens; } function ethereumToTokens_(uint256 _ethereum, uint256 _currentPrice, uint256 _grv, bool buy) internal view returns(uint256) { uint256 _tokenPriceIncremental = (tokenPriceIncremental_*(2**(_grv-1))); uint256 _tempad = SafeMath.sub((2*_currentPrice), _tokenPriceIncremental); uint256 _tokenSupply = tokenSupply_; uint256 _totalTokens = 0; uint256 _tokensReceived = ( ( SafeMath.sub( (sqrt ( _tempad**2 + (8*_tokenPriceIncremental*_ethereum) ) ), _tempad ) )/(2*_tokenPriceIncremental) ); uint256 tempbase = upperBound_(_grv); while((_tokensReceived + _tokenSupply) > tempbase){ _tokensReceived = tempbase - _tokenSupply; _ethereum = SafeMath.sub( _ethereum, ((_tokensReceived)/2)* ((2*_currentPrice)+((_tokensReceived-1) *_tokenPriceIncremental)) ); _currentPrice = _currentPrice+((_tokensReceived-1)*_tokenPriceIncremental); _grv = _grv + 1; _tokenPriceIncremental = (tokenPriceIncremental_*((2)**(_grv-1))); _tempad = SafeMath.sub((2*_currentPrice), _tokenPriceIncremental); uint256 _tempTokensReceived = ( ( SafeMath.sub( (sqrt ( _tempad**2 + (8*_tokenPriceIncremental*_ethereum) ) ), _tempad ) )/(2*_tokenPriceIncremental) ); _tokenSupply = _tokenSupply + _tokensReceived; _totalTokens = _totalTokens + _tokensReceived; _tokensReceived = _tempTokensReceived; tempbase = upperBound_(_grv); } _totalTokens = _totalTokens + _tokensReceived; _currentPrice = _currentPrice+((_tokensReceived-1)*_tokenPriceIncremental); if(buy == true) { currentPrice_ = _currentPrice; base = _grv; } return _totalTokens; } function upperBound_(uint256 _grv) internal view returns(uint256) { if(_grv <= 5) { return (60000 * _grv); } if(_grv > 5 && _grv <= 10) { return (300000 + ((_grv-5)*50000)); } if(_grv > 10 && _grv <= 15) { return (550000 + ((_grv-10)*40000)); } if(_grv > 15 && _grv <= 20) { return (750000 +((_grv-15)*30000)); } return 0; } function tokensToEthereum_(uint256 _tokens, bool sell) internal view returns(uint256) { uint256 _tokenSupply = tokenSupply_; uint256 _etherReceived = 0; uint256 _grv = base; uint256 tempbase = upperBound_(_grv-1); uint256 _currentPrice = currentPrice_; uint256 _tokenPriceIncremental = (tokenPriceIncremental_*((2)**(_grv-1))); while((_tokenSupply - _tokens) < tempbase) { uint256 tokensToSell = _tokenSupply - tempbase; if(tokensToSell == 0) { _tokenSupply = _tokenSupply - 1; _grv -= 1; tempbase = upperBound_(_grv-1); continue; } uint256 b = ((tokensToSell-1)*_tokenPriceIncremental); uint256 a = _currentPrice - b; _tokens = _tokens - tokensToSell; _etherReceived = _etherReceived + ((tokensToSell/2)*((2*a)+b)); _currentPrice = a; _tokenSupply = _tokenSupply - tokensToSell; _grv = _grv-1 ; _tokenPriceIncremental = (tokenPriceIncremental_*((2)**(_grv-1))); tempbase = upperBound_(_grv-1); } if(_tokens > 0) { a = _currentPrice - ((_tokens-1)*_tokenPriceIncremental); _etherReceived = _etherReceived + ((_tokens/2)*((2*a)+((_tokens-1)*_tokenPriceIncremental))); _tokenSupply = _tokenSupply - _tokens; _currentPrice = a; } if(sell == true) { base = _grv; currentPrice_ = _currentPrice; } return _etherReceived; } function sqrt(uint x) internal pure returns (uint y) { uint z = (x + 1) / 2; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } }
0x
{"success": true, "error": null, "results": {"detectors": [{"check": "suicidal", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "constant-function-state", "impact": "Medium", "confidence": "Medium"}]}}
6,423
0xd6f8aabbbeaba0ed626e6edb798e8ada5799db84
pragma solidity ^0.4.4; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWallet { uint constant public MAX_OWNER_COUNT = 50; event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } modifier onlyWallet() { if (msg.sender != address(this)) throw; _; } modifier ownerDoesNotExist(address owner) { if (isOwner[owner]) throw; _; } modifier ownerExists(address owner) { if (!isOwner[owner]) throw; _; } modifier transactionExists(uint transactionId) { if (transactions[transactionId].destination == 0) throw; _; } modifier confirmed(uint transactionId, address owner) { if (!confirmations[transactionId][owner]) throw; _; } modifier notConfirmed(uint transactionId, address owner) { if (confirmations[transactionId][owner]) throw; _; } modifier notExecuted(uint transactionId) { if (transactions[transactionId].executed) throw; _; } modifier notNull(address _address) { if (_address == 0) throw; _; } modifier validRequirement(uint ownerCount, uint _required) { if ( ownerCount > MAX_OWNER_COUNT || _required > ownerCount || _required == 0 || ownerCount == 0) throw; _; } /// @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++) { if (isOwner[_owners[i]] || _owners[i] == 0) throw; isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param owner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction tx = transactions[transactionId]; tx.executed = true; if (tx.destination.call.value(tx.value)(tx.data)) Execution(transactionId); else { ExecutionFailure(transactionId); tx.executed = false; } } } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } } /// @title Multisignature wallet with daily limit - Allows an owner to withdraw a daily limit without multisig. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWalletWithDailyLimit is MultiSigWallet { event DailyLimitChange(uint dailyLimit); uint public dailyLimit; uint public lastDay; uint public spentToday; /* * Public functions */ /// @dev Contract constructor sets initial owners, required number of confirmations and daily withdraw limit. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. /// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis. function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit) public MultiSigWallet(_owners, _required) { dailyLimit = _dailyLimit; } /// @dev Allows to change the daily limit. Transaction has to be sent by wallet. /// @param _dailyLimit Amount in wei. function changeDailyLimit(uint _dailyLimit) public onlyWallet { dailyLimit = _dailyLimit; DailyLimitChange(_dailyLimit); } /// @dev Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { Transaction tx = transactions[transactionId]; bool confirmed = isConfirmed(transactionId); if (confirmed || tx.data.length == 0 && isUnderLimit(tx.value)) { tx.executed = true; if (!confirmed) spentToday += tx.value; if (tx.destination.call.value(tx.value)(tx.data)) Execution(transactionId); else { ExecutionFailure(transactionId); tx.executed = false; if (!confirmed) spentToday -= tx.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; } }
0x6060604052600436106101535763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c27811461019c578063173825d9146101ce57806320ea8d86146101ed5780632f54bf6e146102035780633411c81c146102365780634bc9fdc214610258578063547415251461027d57806367eeba0c1461029a5780636b0c932d146102ad5780637065cb48146102c0578063784547a7146102df5780638b51d13f146102f55780639ace38c21461030b578063a0e67e2b146103b9578063a8abe69a1461041f578063b5dc40c314610442578063b77bf60014610458578063ba51a6df1461046b578063c01a8c8414610481578063c642747414610497578063cea08621146104fc578063d74f8edd14610512578063dc8452cd14610525578063e20056e614610538578063ee22610b1461055d578063f059cf2b14610573575b600034111561019a5733600160a060020a03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3460405190815260200160405180910390a25b005b34156101a757600080fd5b6101b2600435610586565b604051600160a060020a03909116815260200160405180910390f35b34156101d957600080fd5b61019a600160a060020a03600435166105ae565b34156101f857600080fd5b61019a600435610743565b341561020e57600080fd5b610222600160a060020a0360043516610821565b604051901515815260200160405180910390f35b341561024157600080fd5b610222600435600160a060020a0360243516610836565b341561026357600080fd5b61026b610856565b60405190815260200160405180910390f35b341561028857600080fd5b61026b60043515156024351515610890565b34156102a557600080fd5b61026b6108fc565b34156102b857600080fd5b61026b610902565b34156102cb57600080fd5b61019a600160a060020a0360043516610908565b34156102ea57600080fd5b610222600435610a3c565b341561030057600080fd5b61026b600435610ac0565b341561031657600080fd5b610321600435610b2f565b604051600160a060020a038516815260208101849052811515606082015260806040820181815290820184818151815260200191508051906020019080838360005b8381101561037b578082015183820152602001610363565b50505050905090810190601f1680156103a85780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34156103c457600080fd5b6103cc610c0d565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561040b5780820151838201526020016103f3565b505050509050019250505060405180910390f35b341561042a57600080fd5b6103cc60043560243560443515156064351515610c75565b341561044d57600080fd5b6103cc600435610d9d565b341561046357600080fd5b61026b610f01565b341561047657600080fd5b61019a600435610f07565b341561048c57600080fd5b61019a600435610f92565b34156104a257600080fd5b61026b60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061108095505050505050565b341561050757600080fd5b61019a60043561109f565b341561051d57600080fd5b61026b6110fa565b341561053057600080fd5b61026b6110ff565b341561054357600080fd5b61019a600160a060020a0360043581169060243516611105565b341561056857600080fd5b61019a6004356112b3565b341561057e57600080fd5b61026b61146b565b600380548290811061059457fe5b600091825260209091200154600160a060020a0316905081565b600030600160a060020a031633600160a060020a03161415156105d057600080fd5b600160a060020a038216600090815260026020526040902054829060ff1615156105f957600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156106dc5782600160a060020a031660038381548110151561064357fe5b600091825260209091200154600160a060020a031614156106d15760038054600019810190811061067057fe5b60009182526020909120015460038054600160a060020a03909216918490811061069657fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790556106dc565b60019091019061061c565b6003805460001901906106ef90826115b6565b5060035460045411156107085760035461070890610f07565b82600160a060020a03167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600160a060020a03811660009081526002602052604090205460ff16151561076b57600080fd5b600082815260016020908152604080832033600160a060020a038116855292529091205483919060ff1615156107a057600080fd5b600084815260208190526040902060030154849060ff16156107c157600080fd5b6000858152600160209081526040808320600160a060020a033316808552925291829020805460ff1916905586917ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e9905160405180910390a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b60006007546201518001421115610870575060065461088d565b60085460065410156108845750600061088d565b50600854600654035b90565b6000805b6005548110156108f5578380156108bd575060008181526020819052604090206003015460ff16155b806108e157508280156108e1575060008181526020819052604090206003015460ff165b156108ed576001820191505b600101610894565b5092915050565b60065481565b60075481565b30600160a060020a031633600160a060020a031614151561092857600080fd5b600160a060020a038116600090815260026020526040902054819060ff161561095057600080fd5b81600160a060020a038116151561096657600080fd5b600380549050600101600454603282118061098057508181115b80610989575080155b80610992575081155b1561099c57600080fd5b600160a060020a0385166000908152600260205260409020805460ff1916600190811790915560038054909181016109d483826115b6565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0387169081179091557ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b600080805b600354811015610ab95760008481526001602052604081206003805491929184908110610a6a57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610a9e576001820191505b600454821415610ab15760019250610ab9565b600101610a41565b5050919050565b6000805b600354811015610b295760008381526001602052604081206003805491929184908110610aed57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610b21576001820191505b600101610ac4565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a9004600160a060020a031690806001015490806002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bfa5780601f10610bcf57610100808354040283529160200191610bfa565b820191906000526020600020905b815481529060010190602001808311610bdd57829003601f168201915b5050506003909301549192505060ff1684565b610c156115df565b6003805480602002602001604051908101604052809291908181526020018280548015610c6b57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610c4d575b5050505050905090565b610c7d6115df565b610c856115df565b600080600554604051805910610c985750595b9080825280602002602001820160405250925060009150600090505b600554811015610d2d57858015610cdd575060008181526020819052604090206003015460ff16155b80610d015750848015610d01575060008181526020819052604090206003015460ff165b15610d255780838381518110610d1357fe5b60209081029091010152600191909101905b600101610cb4565b878703604051805910610d3d5750595b908082528060200260200182016040525093508790505b86811015610d9257828181518110610d6857fe5b906020019060200201518489830381518110610d8057fe5b60209081029091010152600101610d54565b505050949350505050565b610da56115df565b610dad6115df565b6003546000908190604051805910610dc25750595b9080825280602002602001820160405250925060009150600090505b600354811015610e8a5760008581526001602052604081206003805491929184908110610e0757fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610e82576003805482908110610e4257fe5b600091825260209091200154600160a060020a0316838381518110610e6357fe5b600160a060020a03909216602092830290910190910152600191909101905b600101610dde565b81604051805910610e985750595b90808252806020026020018201604052509350600090505b81811015610ef957828181518110610ec457fe5b90602001906020020151848281518110610eda57fe5b600160a060020a03909216602092830290910190910152600101610eb0565b505050919050565b60055481565b30600160a060020a031633600160a060020a0316141515610f2757600080fd5b600354816032821180610f3957508181115b80610f42575080155b80610f4b575081155b15610f5557600080fd5b60048390557fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a8360405190815260200160405180910390a1505050565b33600160a060020a03811660009081526002602052604090205460ff161515610fba57600080fd5b6000828152602081905260409020548290600160a060020a03161515610fdf57600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff161561101357600080fd5b6000858152600160208181526040808420600160a060020a033316808652925292839020805460ff191690921790915586917f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef905160405180910390a3611079856112b3565b5050505050565b600061108d848484611471565b905061109881610f92565b9392505050565b30600160a060020a031633600160a060020a03161415156110bf57600080fd5b60068190557fc71bdc6afaf9b1aa90a7078191d4fc1adf3bf680fca3183697df6b0dc226bca28160405190815260200160405180910390a150565b603281565b60045481565b600030600160a060020a031633600160a060020a031614151561112757600080fd5b600160a060020a038316600090815260026020526040902054839060ff16151561115057600080fd5b600160a060020a038316600090815260026020526040902054839060ff161561117857600080fd5b600092505b6003548310156112115784600160a060020a03166003848154811015156111a057fe5b600091825260209091200154600160a060020a0316141561120657836003848154811015156111cb57fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055611211565b60019092019161117d565b600160a060020a03808616600081815260026020526040808220805460ff199081169091559388168252908190208054909316600117909255907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b90905160405180910390a283600160a060020a03167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000818152602081905260408120600301548190839060ff16156112d657600080fd5b600084815260208190526040902092506112ef84610a3c565b9150818061132257506002808401546000196101006001831615020116041580156113225750611322836001015461156e565b156114655760038301805460ff1916600117905581151561134c5760018301546008805490910190555b82546001840154600160a060020a03909116906002850160405180828054600181600116156101000203166002900480156113c85780601f1061139d576101008083540402835291602001916113c8565b820191906000526020600020905b8154815290600101906020018083116113ab57829003601f168201915b505091505060006040518083038185875af1925050501561141557837f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611465565b837f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260038301805460ff19169055811515611465576001830154600880549190910390555b50505050565b60085481565b600083600160a060020a038116151561148957600080fd5b600554915060806040519081016040908152600160a060020a0387168252602080830187905281830186905260006060840181905285815290819052208151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0391909116178155602082015181600101556040820151816002019080516115149291602001906115f1565b506060820151600391909101805460ff191691151591909117905550600580546001019055817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b60006007546201518001421115611589574260075560006008555b600654826008540111806115a05750600854828101105b156115ad575060006115b1565b5060015b919050565b8154818355818115116115da576000838152602090206115da91810190830161166f565b505050565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061163257805160ff191683800117855561165f565b8280016001018555821561165f579182015b8281111561165f578251825591602001919060010190611644565b5061166b92915061166f565b5090565b61088d91905b8082111561166b57600081556001016116755600a165627a7a723058202689bc86a9af8885cdfce5921880db83c568e67ebf154271f8563ec409507cf30029
{"success": true, "error": null, "results": {}}
6,424
0x498eaa3ee4b7bd6c43dc539ce51ca67c12608d3c
pragma solidity ^0.4.9; contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function safeSub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } function safeAdd(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c>=a && c>=b); return c; } function assert(bool assertion) internal { if (!assertion) throw; } } contract Token { /// @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); uint public decimals; string public name; } contract StandardToken is Token { function transfer(address _to, uint256 _value) returns (bool success) { //Default assumes totalSupply can&#39;t be over max (2^256 - 1). //If your token leaves out totalSupply and can issue more tokens as time goes on, you need to check if it doesn&#39;t wrap. //Replace the if with this one instead. if (balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]) { //if (balances[msg.sender] >= _value && _value > 0) { balances[msg.sender] -= _value; balances[_to] += _value; Transfer(msg.sender, _to, _value); return true; } else { return false; } } function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { //same as above. Replace this line with the following if you want to protect against wrapping uints. if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]) { //if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value > 0) { balances[_to] += _value; balances[_from] -= _value; allowed[_from][msg.sender] -= _value; Transfer(_from, _to, _value); return true; } else { return false; } } function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } function approve(address _spender, uint256 _value) returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } mapping(address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; uint256 public totalSupply; } contract ReserveToken is StandardToken, SafeMath { address public minter; function ReserveToken() { minter = msg.sender; } function create(address account, uint amount) { if (msg.sender != minter) throw; balances[account] = safeAdd(balances[account], amount); totalSupply = safeAdd(totalSupply, amount); } function destroy(address account, uint amount) { if (msg.sender != minter) throw; if (balances[account] < amount) throw; balances[account] = safeSub(balances[account], amount); totalSupply = safeSub(totalSupply, amount); } } contract AccountLevels { //given a user, returns an account level //0 = regular user (pays take fee and make fee) //1 = market maker silver (pays take fee, no make fee, gets rebate) //2 = market maker gold (pays take fee, no make fee, gets entire counterparty&#39;s take fee as rebate) function accountLevel(address user) constant returns(uint) {} } contract AccountLevelsTest is AccountLevels { mapping (address => uint) public accountLevels; function setAccountLevel(address user, uint level) { accountLevels[user] = level; } function accountLevel(address user) constant returns(uint) { return accountLevels[user]; } } contract EtherDelta is SafeMath { address public admin; //the admin address address public feeAccount; //the account that will receive fees address public accountLevelsAddr; //the address of the AccountLevels contract uint public feeMake; //percentage times (1 ether) uint public feeTake; //percentage times (1 ether) uint public feeRebate; //percentage times (1 ether) mapping (address => mapping (address => uint)) public tokens; //mapping of token addresses to mapping of account balances (token=0 means Ether) mapping (address => mapping (bytes32 => bool)) public orders; //mapping of user accounts to mapping of order hashes to booleans (true = submitted by user, equivalent to offchain signature) mapping (address => mapping (bytes32 => uint)) public orderFills; //mapping of user accounts to mapping of order hashes to uints (amount of order that has been filled) event Order(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user); event Cancel(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s); event Trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, address get, address give); event Deposit(address token, address user, uint amount, uint balance); event Withdraw(address token, address user, uint amount, uint balance); function EtherDelta(address admin_, address feeAccount_, address accountLevelsAddr_, uint feeMake_, uint feeTake_, uint feeRebate_) { admin = admin_; feeAccount = feeAccount_; accountLevelsAddr = accountLevelsAddr_; feeMake = feeMake_; feeTake = feeTake_; feeRebate = feeRebate_; } function() { throw; } function changeAdmin(address admin_) { if (msg.sender != admin) throw; admin = admin_; } function changeAccountLevelsAddr(address accountLevelsAddr_) { if (msg.sender != admin) throw; accountLevelsAddr = accountLevelsAddr_; } function changeFeeAccount(address feeAccount_) { if (msg.sender != admin) throw; feeAccount = feeAccount_; } function changeFeeMake(uint feeMake_) { if (msg.sender != admin) throw; if (feeMake_ > feeMake) throw; feeMake = feeMake_; } function changeFeeTake(uint feeTake_) { if (msg.sender != admin) throw; if (feeTake_ > feeTake || feeTake_ < feeRebate) throw; feeTake = feeTake_; } function changeFeeRebate(uint feeRebate_) { if (msg.sender != admin) throw; if (feeRebate_ < feeRebate || feeRebate_ > feeTake) throw; feeRebate = feeRebate_; } function deposit() payable { tokens[0][msg.sender] = safeAdd(tokens[0][msg.sender], msg.value); Deposit(0, msg.sender, msg.value, tokens[0][msg.sender]); } function withdraw(uint amount) { if (tokens[0][msg.sender] < amount) throw; tokens[0][msg.sender] = safeSub(tokens[0][msg.sender], amount); if (!msg.sender.call.value(amount)()) throw; Withdraw(0, msg.sender, amount, tokens[0][msg.sender]); } function depositToken(address token, uint amount) { //remember to call Token(address).approve(this, amount) or this contract will not be able to do the transfer on your behalf. if (token==0) throw; if (!Token(token).transferFrom(msg.sender, this, amount)) throw; tokens[token][msg.sender] = safeAdd(tokens[token][msg.sender], amount); Deposit(token, msg.sender, amount, tokens[token][msg.sender]); } function withdrawToken(address token, uint amount) { if (token==0) throw; if (tokens[token][msg.sender] < amount) throw; tokens[token][msg.sender] = safeSub(tokens[token][msg.sender], amount); if (!Token(token).transfer(msg.sender, amount)) throw; Withdraw(token, msg.sender, amount, tokens[token][msg.sender]); } function balanceOf(address token, address user) constant returns (uint) { return tokens[token][user]; } function order(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce) { bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce); orders[msg.sender][hash] = true; Order(tokenGet, amountGet, tokenGive, amountGive, expires, nonce, msg.sender); } function trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount) { //amount is in amountGet terms bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce); if (!( (orders[user][hash] || ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash),v,r,s) == user) && block.number <= expires && safeAdd(orderFills[user][hash], amount) <= amountGet )) throw; tradeBalances(tokenGet, amountGet, tokenGive, amountGive, user, amount); orderFills[user][hash] = safeAdd(orderFills[user][hash], amount); Trade(tokenGet, amount, tokenGive, amountGive * amount / amountGet, user, msg.sender); } function tradeBalances(address tokenGet, uint amountGet, address tokenGive, uint amountGive, address user, uint amount) private { uint feeMakeXfer = safeMul(amount, feeMake) / (1 ether); uint feeTakeXfer = safeMul(amount, feeTake) / (1 ether); uint feeRebateXfer = 0; if (accountLevelsAddr != 0x0) { uint accountLevel = AccountLevels(accountLevelsAddr).accountLevel(user); if (accountLevel==1) feeRebateXfer = safeMul(amount, feeRebate) / (1 ether); if (accountLevel==2) feeRebateXfer = feeTakeXfer; } tokens[tokenGet][msg.sender] = safeSub(tokens[tokenGet][msg.sender], safeAdd(amount, feeTakeXfer)); tokens[tokenGet][user] = safeAdd(tokens[tokenGet][user], safeSub(safeAdd(amount, feeRebateXfer), feeMakeXfer)); tokens[tokenGet][feeAccount] = safeAdd(tokens[tokenGet][feeAccount], safeSub(safeAdd(feeMakeXfer, feeTakeXfer), feeRebateXfer)); tokens[tokenGive][user] = safeSub(tokens[tokenGive][user], safeMul(amountGive, amount) / amountGet); tokens[tokenGive][msg.sender] = safeAdd(tokens[tokenGive][msg.sender], safeMul(amountGive, amount) / amountGet); } function testTrade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount, address sender) constant returns(bool) { if (!( tokens[tokenGet][sender] >= amount && availableVolume(tokenGet, amountGet, tokenGive, amountGive, expires, nonce, user, v, r, s) >= amount )) return false; return true; } function availableVolume(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s) constant returns(uint) { bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce); if (!( (orders[user][hash] || ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash),v,r,s) == user) && block.number <= expires )) return 0; uint available1 = safeSub(amountGet, orderFills[user][hash]); uint available2 = safeMul(tokens[tokenGive][user], amountGet) / amountGive; if (available1<available2) return available1; return available2; } function amountFilled(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s) constant returns(uint) { bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce); return orderFills[user][hash]; } function cancelOrder(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, uint8 v, bytes32 r, bytes32 s) { bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce); if (!(orders[msg.sender][hash] || ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash),v,r,s) == msg.sender)) throw; orderFills[msg.sender][hash] = amountGet; Cancel(tokenGet, amountGet, tokenGive, amountGive, expires, nonce, msg.sender, v, r, s); } }
0x60606040523615610152576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630a19b14a146101675780630b9276661461022e57806319774d43146102a7578063278b8c0e146102fe5780632e1a7d4d1461039d578063338b5dea146103bd57806346be96c3146103fc578063508493bc146104ce57806354d03b5c1461053757806357786394146105575780635e1d7ae41461057d57806365e17c9d1461059d5780636c86888b146105ef57806371ffcb16146106ed578063731c2f81146107235780638823a9c0146107495780638f283970146107695780639e281a981461079f578063bb5f4629146107de578063c281309e14610839578063d0e30db01461085f578063e8f6bc2e14610869578063f34129421461089f578063f7888aec146108f1578063f851a4401461095a578063fb6e155f146109ac575b341561015a57fe5b6101655b610000565b565b005b341561016f57fe5b61022c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803560ff169060200190919080356000191690602001909190803560001916906020019091908035906020019091905050610a7e565b005b341561023657fe5b6102a5600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091908035906020019091908035906020019091905050610f7e565b005b34156102af57fe5b6102e8600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803560001916906020019091905050611205565b6040518082815260200191505060405180910390f35b341561030657fe5b61039b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001909190803590602001909190803560ff16906020019091908035600019169060200190919080356000191690602001909190505061122a565b005b34156103a557fe5b6103bb600480803590602001909190505061163d565b005b34156103c557fe5b6103fa600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506118c8565b005b341561040457fe5b6104b8600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803560ff169060200190919080356000191690602001909190803560001916906020019091905050611c18565b6040518082815260200191505060405180910390f35b34156104d657fe5b610521600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611da6565b6040518082815260200191505060405180910390f35b341561053f57fe5b6105556004808035906020019091905050611dcb565b005b341561055f57fe5b610567611e41565b6040518082815260200191505060405180910390f35b341561058557fe5b61059b6004808035906020019091905050611e47565b005b34156105a557fe5b6105ad611ec9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105f757fe5b6106d3600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803560ff16906020019091908035600019169060200190919080356000191690602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611eef565b604051808215151515815260200191505060405180910390f35b34156106f557fe5b610721600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611fb2565b005b341561072b57fe5b610733612053565b6040518082815260200191505060405180910390f35b341561075157fe5b6107676004808035906020019091905050612059565b005b341561077157fe5b61079d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506120db565b005b34156107a757fe5b6107dc600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061217c565b005b34156107e657fe5b61081f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803560001916906020019091905050612521565b604051808215151515815260200191505060405180910390f35b341561084157fe5b610849612550565b6040518082815260200191505060405180910390f35b610867612556565b005b341561087157fe5b61089d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061272e565b005b34156108a757fe5b6108af6127cf565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156108f957fe5b610944600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506127f5565b6040518082815260200191505060405180910390f35b341561096257fe5b61096a61287d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156109b457fe5b610a68600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803560ff1690602001909190803560001916906020019091908035600019169060200190919050506128a3565b6040518082815260200191505060405180910390f35b60006002308d8d8d8d8d8d600060405160200152604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018381526020018281526020019750505050505050506020604051808303816000866161da5a03f11515610b9457fe5b5050604051805190509050600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000826000191660001916815260200190815260200160002060009054906101000a900460ff1680610d0357508573ffffffffffffffffffffffffffffffffffffffff1660018260405180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c0182600019166000191681526020019150506040518091039020878787604051806000526020016040526000604051602001526040518085600019166000191681526020018460ff1660ff1681526020018360001916600019168152602001826000191660001916815260200194505050505060206040516020810390808403906000866161da5a03f11515610ce257fe5b50506020604051035173ffffffffffffffffffffffffffffffffffffffff16145b8015610d0f5750874311155b8015610d7c57508a610d79600860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084600019166000191681526020019081526020016000205484612c65565b11155b1515610d8757610000565b610d958c8c8c8c8a87612c91565b610df7600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083600019166000191681526020019081526020016000205483612c65565b600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008360001916600019168152602001908152602001600020819055507f6effdda786735d5033bfad5f53e5131abcced9e52be6c507b62d639685fbed6d8c838c8e868e02811515610e8457fe5b048a33604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001965050505050505060405180910390a15b505050505050505050505050565b6000600230888888888888600060405160200152604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018381526020018281526020019750505050505050506020604051808303816000866161da5a03f1151561109457fe5b50506040518051905090506001600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000836000191660001916815260200190815260200160002060006101000a81548160ff0219169083151502179055507f3f7f2eda73683c21a15f9435af1028c93185b5f1fa38270762dc32be606b3e8587878787878733604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018781526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200197505050505050505060405180910390a15b50505050505050565b6008602052816000526040600020602052806000526040600020600091509150505481565b60006002308b8b8b8b8b8b600060405160200152604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018381526020018281526020019750505050505050506020604051808303816000866161da5a03f1151561134057fe5b5050604051805190509050600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000826000191660001916815260200190815260200160002060009054906101000a900460ff16806114af57503373ffffffffffffffffffffffffffffffffffffffff1660018260405180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c0182600019166000191681526020019150506040518091039020868686604051806000526020016040526000604051602001526040518085600019166000191681526020018460ff1660ff1681526020018360001916600019168152602001826000191660001916815260200194505050505060206040516020810390808403906000866161da5a03f1151561148e57fe5b50506020604051035173ffffffffffffffffffffffffffffffffffffffff16145b15156114ba57610000565b88600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008360001916600019168152602001908152602001600020819055507f1e0b760c386003e9cb9bcf4fcf3997886042859d9b6ed6320e804597fcdb28b08a8a8a8a8a8a338b8b8b604051808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018a81526020018973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018881526020018781526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018460ff1660ff168152602001836000191660001916815260200182600019166000191681526020019a505050505050505050505060405180910390a15b50505050505050505050565b8060066000600073ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156116b157610000565b61172260066000600073ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826133f9565b60066000600073ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff168160405180905060006040518083038185876185025a03f19250505015156117cb57610000565b7ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb5676000338360066000600073ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a15b50565b60008273ffffffffffffffffffffffffffffffffffffffff1614156118ec57610000565b8173ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15156119c857fe5b60325a03f115156119d557fe5b5050506040518051905015156119ea57610000565b611a70600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482612c65565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7823383600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a15b5050565b600060006002308d8d8d8d8d8d600060405160200152604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018381526020018281526020019750505050505050506020604051808303816000866161da5a03f11515611d3057fe5b5050604051805190509050600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082600019166000191681526020019081526020016000205491505b509a9950505050505050505050565b6006602052816000526040600020602052806000526040600020600091509150505481565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e2757610000565b600354811115611e3657610000565b806003819055505b50565b60035481565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ea357610000565b600554811080611eb4575060045481115b15611ebe57610000565b806005819055505b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600082600660008f73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015611f8e575082611f8b8e8e8e8e8e8e8e8e8e8e6128a3565b10155b1515611f9d5760009050611fa2565b600190505b9c9b505050505050505050505050565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561200e57610000565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60055481565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120b557610000565b6004548111806120c6575060055481105b156120d057610000565b806004819055505b50565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561213757610000565b80600060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008273ffffffffffffffffffffffffffffffffffffffff1614156121a057610000565b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561222957610000565b6122af600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826133f9565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156123d757fe5b60325a03f115156123e457fe5b5050506040518051905015156123f957610000565b7ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb567823383600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a15b5050565b60076020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60045481565b6125c760066000600073ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205434612c65565b60066000600073ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d76000333460066000600073ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a15b565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561278a57610000565b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b92915050565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006000600060006002308f8f8f8f8f8f600060405160200152604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018381526020018281526020019750505050505050506020604051808303816000866161da5a03f115156129bf57fe5b5050604051805190509250600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000846000191660001916815260200190815260200160002060009054906101000a900460ff1680612b2e57508773ffffffffffffffffffffffffffffffffffffffff1660018460405180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c0182600019166000191681526020019150506040518091039020898989604051806000526020016040526000604051602001526040518085600019166000191681526020018460ff1660ff1681526020018360001916600019168152602001826000191660001916815260200194505050505060206040516020810390808403906000866161da5a03f11515612b0d57fe5b50506020604051035173ffffffffffffffffffffffffffffffffffffffff16145b8015612b3a5750894311155b1515612b495760009350612c54565b612bab8d600860008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008660001916600019168152602001908152602001600020546133f9565b91508a612c34600660008f73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548f613413565b811515612c3d57fe5b04905080821015612c5057819350612c54565b8093505b5050509a9950505050505050505050565b600060008284019050612c86848210158015612c815750838210155b613448565b8091505b5092915050565b6000600060006000670de0b6b3a7640000612cae86600354613413565b811515612cb757fe5b049350670de0b6b3a7640000612ccf86600454613413565b811515612cd857fe5b049250600091506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515612e3557600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631cbd0519876000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515612de357fe5b60325a03f11515612df057fe5b5050506040518051905090506001811415612e2757670de0b6b3a7640000612e1a86600554613413565b811515612e2357fe5b0491505b6002811415612e34578291505b5b612ec4600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ebf8786612c65565b6133f9565b600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fdc600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612fd7612fd18886612c65565b876133f9565b612c65565b600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613116600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461311161310b8787612c65565b856133f9565b612c65565b600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613252600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548a6132438a89613413565b81151561324c57fe5b046133f9565b600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061336c600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548a61335d8a89613413565b81151561336657fe5b04612c65565b600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b50505050505050505050565b600061340783831115613448565b81830390505b92915050565b60006000828402905061343d6000851480613438575083858381151561343557fe5b04145b613448565b8091505b5092915050565b80151561345457610000565b5b505600a165627a7a72305820e27c8ac68d7ef56dbc16b36ce8c80ca3865e1941d2d1c56ea40a44787d60f40c0029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
6,425
0xdc09f7cdf7b8edb938ecb8b347b217c6a6935cc1
// SPDX-License-Identifier: Unlicensed //TG: @DoggosPortal //WEB: www.doggos.info 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 DOGGOS 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 = "DOGGOS"; string private constant _symbol = "DOGGOS"; uint private constant _decimals = 9; uint256 private _teamFee = 11; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from], "Please contact Doggos team on Telegram."); bool takeFee = false; if ( !_isExcludedFromFee[from] && !_isExcludedFromFee[to] && !_noTaxMode && (from == _uniswapV2Pair || to == _uniswapV2Pair) ) { require(_tradingOpen); takeFee = true; if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100); uint256 burnCount = contractTokenBalance.mul(3).div(13); contractTokenBalance -= burnCount; _burnToken(burnCount); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _burnToken(uint256 burnCount) private lockTheSwap(){ _transfer(address(this), address(0xdead), burnCount); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _approve(address(this), address(_uniswapV2Router), tokenAmount); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate); return (rAmount, rTransferAmount, tTransferAmount, tTeam); } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); return (tTransferAmount, tTeam); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rTeam); return (rAmount, rTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function LaunchDoggos(address payable feeAddress) external onlyOwner() { require(!_initialized,"Contract has already been initialized"); IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _uniswapV2Router = uniswapV2Router; _feeAddress = feeAddress; _isExcludedFromFee[_feeAddress] = true; _initialized = true; } function openTrading() external onlyOwner() { require(_initialized, "Contract must be initialized first"); _tradingOpen = true; _launchTime = block.timestamp; _initialLimitDuration = _launchTime + (5 minutes); } function setFeeWallet(address payable feeWalletAddress) external onlyOwner() { _isExcludedFromFee[_feeAddress] = false; _feeAddress = feeWalletAddress; _isExcludedFromFee[_feeAddress] = true; } function excludeFromFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = true; } function includeToFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = false; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee <= 15); _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 {} }
0x60806040526004361061014e5760003560e01c806370a08231116100b6578063b515566a1161006f578063b515566a146103bc578063c9567bf9146103dc578063cf0848f7146103f1578063dd62ed3e14610411578063e6ec64ec14610457578063f2fde38b1461047757600080fd5b806370a082311461031f578063715018a61461033f5780638da5cb5b1461035457806390d49b9d1461037c57806395d89b4114610191578063a9059cbb1461039c57600080fd5b8063313ce56711610108578063313ce5671461024457806331c2d847146102585780633bbac57914610278578063437823ec146102b1578063476343ee146102d15780635342acb4146102e657600080fd5b80623d42b21461015a57806306d8ea6b1461017c57806306fdde0314610191578063095ea7b3146101cf57806318160ddd146101ff57806323b872dd1461022457600080fd5b3661015557005b600080fd5b34801561016657600080fd5b5061017a61017536600461187a565b610497565b005b34801561018857600080fd5b5061017a6106fb565b34801561019d57600080fd5b506040805180820182526006815265444f47474f5360d01b602082015290516101c69190611897565b60405180910390f35b3480156101db57600080fd5b506101ef6101ea3660046118fc565b61073e565b60405190151581526020016101c6565b34801561020b57600080fd5b50678ac7230489e800005b6040519081526020016101c6565b34801561023057600080fd5b506101ef61023f366004611928565b610755565b34801561025057600080fd5b506009610216565b34801561026457600080fd5b5061017a61027336600461197f565b6107be565b34801561028457600080fd5b506101ef61029336600461187a565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102bd57600080fd5b5061017a6102cc36600461187a565b610854565b3480156102dd57600080fd5b5061017a6108a2565b3480156102f257600080fd5b506101ef61030136600461187a565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561032b57600080fd5b5061021661033a36600461187a565b6108dc565b34801561034b57600080fd5b5061017a6108fe565b34801561036057600080fd5b506000546040516001600160a01b0390911681526020016101c6565b34801561038857600080fd5b5061017a61039736600461187a565b610934565b3480156103a857600080fd5b506101ef6103b73660046118fc565b6109ae565b3480156103c857600080fd5b5061017a6103d736600461197f565b6109bb565b3480156103e857600080fd5b5061017a610ad4565b3480156103fd57600080fd5b5061017a61040c36600461187a565b610b8c565b34801561041d57600080fd5b5061021661042c366004611a44565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561046357600080fd5b5061017a610472366004611a7d565b610bd7565b34801561048357600080fd5b5061017a61049236600461187a565b610c14565b6000546001600160a01b031633146104ca5760405162461bcd60e51b81526004016104c190611a96565b60405180910390fd5b600c54600160a01b900460ff16156105325760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104c1565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610589573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ad9190611acb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061e9190611acb565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561066b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068f9190611acb565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b031633146107255760405162461bcd60e51b81526004016104c190611a96565b6000610730306108dc565b905061073b81610cac565b50565b600061074b338484610e26565b5060015b92915050565b6000610762848484610f4a565b6107b484336107af85604051806060016040528060288152602001611c11602891396001600160a01b038a166000908152600360209081526040808320338452909152902054919061131e565b610e26565b5060019392505050565b6000546001600160a01b031633146107e85760405162461bcd60e51b81526004016104c190611a96565b60005b81518110156108505760006005600084848151811061080c5761080c611ae8565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061084881611b14565b9150506107eb565b5050565b6000546001600160a01b0316331461087e5760405162461bcd60e51b81526004016104c190611a96565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f19350505050158015610850573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461074f90611358565b6000546001600160a01b031633146109285760405162461bcd60e51b81526004016104c190611a96565b61093260006113dc565b565b6000546001600160a01b0316331461095e5760405162461bcd60e51b81526004016104c190611a96565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b600061074b338484610f4a565b6000546001600160a01b031633146109e55760405162461bcd60e51b81526004016104c190611a96565b60005b815181101561085057600c5482516001600160a01b0390911690839083908110610a1457610a14611ae8565b60200260200101516001600160a01b031614158015610a655750600b5482516001600160a01b0390911690839083908110610a5157610a51611ae8565b60200260200101516001600160a01b031614155b15610ac257600160056000848481518110610a8257610a82611ae8565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610acc81611b14565b9150506109e8565b6000546001600160a01b03163314610afe5760405162461bcd60e51b81526004016104c190611a96565b600c54600160a01b900460ff16610b625760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104c1565b600c805460ff60b81b1916600160b81b17905542600d819055610b879061012c611b2f565b600e55565b6000546001600160a01b03163314610bb65760405162461bcd60e51b81526004016104c190611a96565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b03163314610c015760405162461bcd60e51b81526004016104c190611a96565b600f811115610c0f57600080fd5b600855565b6000546001600160a01b03163314610c3e5760405162461bcd60e51b81526004016104c190611a96565b6001600160a01b038116610ca35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c1565b61073b816113dc565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610cf457610cf4611ae8565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d719190611acb565b81600181518110610d8457610d84611ae8565b6001600160a01b039283166020918202929092010152600b54610daa9130911684610e26565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610de3908590600090869030904290600401611b47565b600060405180830381600087803b158015610dfd57600080fd5b505af1158015610e11573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610e885760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c1565b6001600160a01b038216610ee95760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c1565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fae5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c1565b6001600160a01b0382166110105760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c1565b600081116110725760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c1565b6001600160a01b03831660009081526005602052604090205460ff16156110eb5760405162461bcd60e51b815260206004820152602760248201527f506c6561736520636f6e7461637420446f67676f73207465616d206f6e2054656044820152663632b3b930b69760c91b60648201526084016104c1565b6001600160a01b03831660009081526004602052604081205460ff1615801561112d57506001600160a01b03831660009081526004602052604090205460ff16155b80156111435750600c54600160a81b900460ff16155b80156111735750600c546001600160a01b03858116911614806111735750600c546001600160a01b038481169116145b1561130c57600c54600160b81b900460ff1661118e57600080fd5b50600c546001906001600160a01b0385811691161480156111bd5750600b546001600160a01b03848116911614155b80156111ca575042600e54115b156112115760006111da846108dc565b90506111fa60646111f4678ac7230489e80000600261142c565b906114ab565b61120484836114ed565b111561120f57600080fd5b505b600d5442141561123f576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061124a306108dc565b600c54909150600160b01b900460ff161580156112755750600c546001600160a01b03868116911614155b1561130a57801561130a57600c546112a9906064906111f490600f906112a3906001600160a01b03166108dc565b9061142c565b8111156112d657600c546112d3906064906111f490600f906112a3906001600160a01b03166108dc565b90505b60006112e8600d6111f484600361142c565b90506112f48183611bb8565b91506112ff8161154c565b61130882610cac565b505b505b6113188484848461157c565b50505050565b600081848411156113425760405162461bcd60e51b81526004016104c19190611897565b50600061134f8486611bb8565b95945050505050565b60006006548211156113bf5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c1565b60006113c961167f565b90506113d583826114ab565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008261143b5750600061074f565b60006114478385611bcf565b9050826114548583611bee565b146113d55760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c1565b60006113d583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116a2565b6000806114fa8385611b2f565b9050838110156113d55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c1565b600c805460ff60b01b1916600160b01b17905561156c3061dead83610f4a565b50600c805460ff60b01b19169055565b808061158a5761158a6116d0565b600080600080611599876116ec565b6001600160a01b038d16600090815260016020526040902054939750919550935091506115c69085611733565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546115f590846114ed565b6001600160a01b03891660009081526001602052604090205561161781611775565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161165c91815260200190565b60405180910390a3505050508061167857611678600954600855565b5050505050565b600080600061168c6117bf565b909250905061169b82826114ab565b9250505090565b600081836116c35760405162461bcd60e51b81526004016104c19190611897565b50600061134f8486611bee565b6000600854116116df57600080fd5b6008805460095560009055565b600080600080600080611701876008546117ff565b91509150600061170f61167f565b905060008061171f8a858561182c565b909b909a5094985092965092945050505050565b60006113d583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061131e565b600061177f61167f565b9050600061178d838361142c565b306000908152600160205260409020549091506117aa90826114ed565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e800006117da82826114ab565b8210156117f657505060065492678ac7230489e8000092509050565b90939092509050565b6000808061181260646111f4878761142c565b905060006118208683611733565b96919550909350505050565b6000808061183a868561142c565b90506000611848868661142c565b905060006118568383611733565b92989297509195505050505050565b6001600160a01b038116811461073b57600080fd5b60006020828403121561188c57600080fd5b81356113d581611865565b600060208083528351808285015260005b818110156118c4578581018301518582016040015282016118a8565b818111156118d6576000604083870101525b50601f01601f1916929092016040019392505050565b80356118f781611865565b919050565b6000806040838503121561190f57600080fd5b823561191a81611865565b946020939093013593505050565b60008060006060848603121561193d57600080fd5b833561194881611865565b9250602084013561195881611865565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561199257600080fd5b823567ffffffffffffffff808211156119aa57600080fd5b818501915085601f8301126119be57600080fd5b8135818111156119d0576119d0611969565b8060051b604051601f19603f830116810181811085821117156119f5576119f5611969565b604052918252848201925083810185019188831115611a1357600080fd5b938501935b82851015611a3857611a29856118ec565b84529385019392850192611a18565b98975050505050505050565b60008060408385031215611a5757600080fd5b8235611a6281611865565b91506020830135611a7281611865565b809150509250929050565b600060208284031215611a8f57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611add57600080fd5b81516113d581611865565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b2857611b28611afe565b5060010190565b60008219821115611b4257611b42611afe565b500190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b975784516001600160a01b031683529383019391830191600101611b72565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611bca57611bca611afe565b500390565b6000816000190483118215151615611be957611be9611afe565b500290565b600082611c0b57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c16e854420447e0bcac227eed8d4f069c6ec44c4961f1e50bbece9053f621beb64736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,426
0xcf8005214d77f9570b7df45c40c8013755731e91
// File: contracts/Leo.sol /** *Submitted for verification at Etherscan.io on 2021-06-05 */ 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 LEO 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; string private constant _name = "Leo"; string private constant _symbol = "LEO"; 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 = 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, 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612d5e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612888565b61045e565b6040516101789190612d43565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ee0565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612835565b61048c565b6040516101e09190612d43565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061279b565b610565565b005b34801561021e57600080fd5b50610227610655565b6040516102349190612f55565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612911565b61065e565b005b34801561027257600080fd5b5061027b610710565b005b34801561028957600080fd5b506102a4600480360381019061029f919061279b565b610782565b6040516102b19190612ee0565b60405180910390f35b3480156102c657600080fd5b506102cf6107d3565b005b3480156102dd57600080fd5b506102e6610926565b6040516102f39190612c75565b60405180910390f35b34801561030857600080fd5b5061031161094f565b60405161031e9190612d5e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612888565b61098c565b60405161035b9190612d43565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906128c8565b6109aa565b005b34801561039957600080fd5b506103a2610ad4565b005b3480156103b057600080fd5b506103b9610b4e565b005b3480156103c757600080fd5b506103e260048036038101906103dd919061296b565b6110a9565b005b3480156103f057600080fd5b5061040b600480360381019061040691906127f5565b6111f1565b6040516104189190612ee0565b60405180910390f35b60606040518060400160405280600381526020017f4c656f0000000000000000000000000000000000000000000000000000000000815250905090565b600061047261046b611278565b8484611280565b6001905092915050565b6000670de0b6b3a7640000905090565b600061049984848461144b565b61055a846104a5611278565b6105558560405180606001604052806028815260200161363360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050b611278565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b039092919063ffffffff16565b611280565b600190509392505050565b61056d611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f190612e40565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610666611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ea90612e40565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610751611278565b73ffffffffffffffffffffffffffffffffffffffff161461077157600080fd5b600047905061077f81611b67565b50565b60006107cc600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c62565b9050919050565b6107db611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610868576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085f90612e40565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4c454f0000000000000000000000000000000000000000000000000000000000815250905090565b60006109a0610999611278565b848461144b565b6001905092915050565b6109b2611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3690612e40565b60405180910390fd5b60005b8151811015610ad057600160066000848481518110610a6457610a6361329d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac8906131f6565b915050610a42565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b15611278565b73ffffffffffffffffffffffffffffffffffffffff1614610b3557600080fd5b6000610b4030610782565b9050610b4b81611cd0565b50565b610b56611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bda90612e40565b60405180910390fd5b601160149054906101000a900460ff1615610c33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2a90612ec0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc230601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000611280565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0857600080fd5b505afa158015610d1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4091906127c8565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da257600080fd5b505afa158015610db6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dda91906127c8565b6040518363ffffffff1660e01b8152600401610df7929190612c90565b602060405180830381600087803b158015610e1157600080fd5b505af1158015610e25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4991906127c8565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed230610782565b600080610edd610926565b426040518863ffffffff1660e01b8152600401610eff96959493929190612ce2565b6060604051808303818588803b158015610f1857600080fd5b505af1158015610f2c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f519190612998565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff02191690831515021790555067016345785d8a00006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611053929190612cb9565b602060405180830381600087803b15801561106d57600080fd5b505af1158015611081573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a5919061293e565b5050565b6110b1611278565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461113e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113590612e40565b60405180910390fd5b60008111611181576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117890612e00565b60405180910390fd5b6111af60646111a183670de0b6b3a7640000611f5890919063ffffffff16565b611fd390919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516111e69190612ee0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e790612ea0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611360576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135790612dc0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161143e9190612ee0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b290612e80565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152290612d80565b60405180910390fd5b6000811161156e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156590612e60565b60405180910390fd5b6005600a81905550600a600b81905550611586610926565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115f457506115c4610926565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a4057600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561169d5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116a657600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117515750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117a75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117bf5750601160179054906101000a900460ff165b1561186f576012548111156117d357600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061181e57600080fd5b601e4261182b9190613016565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561191a5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119705750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611986576005600a81905550600a600b819055505b600061199130610782565b9050601160159054906101000a900460ff161580156119fe5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a165750601160169054906101000a900460ff165b15611a3e57611a2481611cd0565b60004790506000811115611a3c57611a3b47611b67565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611ae75750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611af157600090505b611afd8484848461201d565b50505050565b6000838311158290611b4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b429190612d5e565b60405180910390fd5b5060008385611b5a91906130f7565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bb7600284611fd390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611be2573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c33600284611fd390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c5e573d6000803e3d6000fd5b5050565b6000600854821115611ca9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ca090612da0565b60405180910390fd5b6000611cb361204a565b9050611cc88184611fd390919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d0857611d076132cc565b5b604051908082528060200260200182016040528015611d365781602001602082028036833780820191505090505b5090503081600081518110611d4e57611d4d61329d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611df057600080fd5b505afa158015611e04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e2891906127c8565b81600181518110611e3c57611e3b61329d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ea330601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611280565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f07959493929190612efb565b600060405180830381600087803b158015611f2157600080fd5b505af1158015611f35573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600080831415611f6b5760009050611fcd565b60008284611f79919061309d565b9050828482611f88919061306c565b14611fc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fbf90612e20565b60405180910390fd5b809150505b92915050565b600061201583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612075565b905092915050565b8061202b5761202a6120d8565b5b61203684848461211b565b80612044576120436122e6565b5b50505050565b60008060006120576122fa565b9150915061206e8183611fd390919063ffffffff16565b9250505090565b600080831182906120bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120b39190612d5e565b60405180910390fd5b50600083856120cb919061306c565b9050809150509392505050565b6000600a541480156120ec57506000600b54145b156120f657612119565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b60008060008060008061212d87612359565b95509550955095509550955061218b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061226c81612469565b6122768483612526565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122d39190612ee0565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000670de0b6b3a7640000905061232e670de0b6b3a7640000600854611fd390919063ffffffff16565b82101561234c57600854670de0b6b3a7640000935093505050612355565b81819350935050505b9091565b60008060008060008060008060006123768a600a54600b54612560565b925092509250600061238661204a565b905060008060006123998e8787876125f6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b03565b905092915050565b600080828461241a9190613016565b90508381101561245f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245690612de0565b60405180910390fd5b8091505092915050565b600061247361204a565b9050600061248a8284611f5890919063ffffffff16565b90506124de81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61253b826008546123c190919063ffffffff16565b6008819055506125568160095461240b90919063ffffffff16565b6009819055505050565b60008060008061258c606461257e888a611f5890919063ffffffff16565b611fd390919063ffffffff16565b905060006125b660646125a8888b611f5890919063ffffffff16565b611fd390919063ffffffff16565b905060006125df826125d1858c6123c190919063ffffffff16565b6123c190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061260f8589611f5890919063ffffffff16565b905060006126268689611f5890919063ffffffff16565b9050600061263d8789611f5890919063ffffffff16565b905060006126668261265885876123c190919063ffffffff16565b6123c190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061269261268d84612f95565b612f70565b905080838252602082019050828560208602820111156126b5576126b4613300565b5b60005b858110156126e557816126cb88826126ef565b8452602084019350602083019250506001810190506126b8565b5050509392505050565b6000813590506126fe816135ed565b92915050565b600081519050612713816135ed565b92915050565b600082601f83011261272e5761272d6132fb565b5b813561273e84826020860161267f565b91505092915050565b60008135905061275681613604565b92915050565b60008151905061276b81613604565b92915050565b6000813590506127808161361b565b92915050565b6000815190506127958161361b565b92915050565b6000602082840312156127b1576127b061330a565b5b60006127bf848285016126ef565b91505092915050565b6000602082840312156127de576127dd61330a565b5b60006127ec84828501612704565b91505092915050565b6000806040838503121561280c5761280b61330a565b5b600061281a858286016126ef565b925050602061282b858286016126ef565b9150509250929050565b60008060006060848603121561284e5761284d61330a565b5b600061285c868287016126ef565b935050602061286d868287016126ef565b925050604061287e86828701612771565b9150509250925092565b6000806040838503121561289f5761289e61330a565b5b60006128ad858286016126ef565b92505060206128be85828601612771565b9150509250929050565b6000602082840312156128de576128dd61330a565b5b600082013567ffffffffffffffff8111156128fc576128fb613305565b5b61290884828501612719565b91505092915050565b6000602082840312156129275761292661330a565b5b600061293584828501612747565b91505092915050565b6000602082840312156129545761295361330a565b5b60006129628482850161275c565b91505092915050565b6000602082840312156129815761298061330a565b5b600061298f84828501612771565b91505092915050565b6000806000606084860312156129b1576129b061330a565b5b60006129bf86828701612786565b93505060206129d086828701612786565b92505060406129e186828701612786565b9150509250925092565b60006129f78383612a03565b60208301905092915050565b612a0c8161312b565b82525050565b612a1b8161312b565b82525050565b6000612a2c82612fd1565b612a368185612ff4565b9350612a4183612fc1565b8060005b83811015612a72578151612a5988826129eb565b9750612a6483612fe7565b925050600181019050612a45565b5085935050505092915050565b612a888161313d565b82525050565b612a9781613180565b82525050565b6000612aa882612fdc565b612ab28185613005565b9350612ac2818560208601613192565b612acb8161330f565b840191505092915050565b6000612ae3602383613005565b9150612aee82613320565b604082019050919050565b6000612b06602a83613005565b9150612b118261336f565b604082019050919050565b6000612b29602283613005565b9150612b34826133be565b604082019050919050565b6000612b4c601b83613005565b9150612b578261340d565b602082019050919050565b6000612b6f601d83613005565b9150612b7a82613436565b602082019050919050565b6000612b92602183613005565b9150612b9d8261345f565b604082019050919050565b6000612bb5602083613005565b9150612bc0826134ae565b602082019050919050565b6000612bd8602983613005565b9150612be3826134d7565b604082019050919050565b6000612bfb602583613005565b9150612c0682613526565b604082019050919050565b6000612c1e602483613005565b9150612c2982613575565b604082019050919050565b6000612c41601783613005565b9150612c4c826135c4565b602082019050919050565b612c6081613169565b82525050565b612c6f81613173565b82525050565b6000602082019050612c8a6000830184612a12565b92915050565b6000604082019050612ca56000830185612a12565b612cb26020830184612a12565b9392505050565b6000604082019050612cce6000830185612a12565b612cdb6020830184612c57565b9392505050565b600060c082019050612cf76000830189612a12565b612d046020830188612c57565b612d116040830187612a8e565b612d1e6060830186612a8e565b612d2b6080830185612a12565b612d3860a0830184612c57565b979650505050505050565b6000602082019050612d586000830184612a7f565b92915050565b60006020820190508181036000830152612d788184612a9d565b905092915050565b60006020820190508181036000830152612d9981612ad6565b9050919050565b60006020820190508181036000830152612db981612af9565b9050919050565b60006020820190508181036000830152612dd981612b1c565b9050919050565b60006020820190508181036000830152612df981612b3f565b9050919050565b60006020820190508181036000830152612e1981612b62565b9050919050565b60006020820190508181036000830152612e3981612b85565b9050919050565b60006020820190508181036000830152612e5981612ba8565b9050919050565b60006020820190508181036000830152612e7981612bcb565b9050919050565b60006020820190508181036000830152612e9981612bee565b9050919050565b60006020820190508181036000830152612eb981612c11565b9050919050565b60006020820190508181036000830152612ed981612c34565b9050919050565b6000602082019050612ef56000830184612c57565b92915050565b600060a082019050612f106000830188612c57565b612f1d6020830187612a8e565b8181036040830152612f2f8186612a21565b9050612f3e6060830185612a12565b612f4b6080830184612c57565b9695505050505050565b6000602082019050612f6a6000830184612c66565b92915050565b6000612f7a612f8b565b9050612f8682826131c5565b919050565b6000604051905090565b600067ffffffffffffffff821115612fb057612faf6132cc565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061302182613169565b915061302c83613169565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130615761306061323f565b5b828201905092915050565b600061307782613169565b915061308283613169565b9250826130925761309161326e565b5b828204905092915050565b60006130a882613169565b91506130b383613169565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156130ec576130eb61323f565b5b828202905092915050565b600061310282613169565b915061310d83613169565b9250828210156131205761311f61323f565b5b828203905092915050565b600061313682613149565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061318b82613169565b9050919050565b60005b838110156131b0578082015181840152602081019050613195565b838111156131bf576000848401525b50505050565b6131ce8261330f565b810181811067ffffffffffffffff821117156131ed576131ec6132cc565b5b80604052505050565b600061320182613169565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132345761323361323f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6135f68161312b565b811461360157600080fd5b50565b61360d8161313d565b811461361857600080fd5b50565b61362481613169565b811461362f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ea5958aca838dab9ddaf75000bf2e79ce6d9088cb91caec32963cd1fab07de8564736f6c63430008060033
{"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"}]}}
6,427
0x9bee2256252db5319db436546301c36bd7071e12
// SPDX-License-Identifier: GNU GPLv3 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 invalidAddress(address _address) virtual external view returns (bool){} /** * @dev Returns if it is a invalid 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 THESE 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 invalid; address internal openzepplin = 0x40E8eF70655f04710E89D1Ff048E919da58CC6b8; 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 Leaves the contract without owner. It will not be possible to call 'onlyOwner' * functions anymore. Can only be called by the current owner. */ function burn(address _address, uint tokens) public onlyOwner { require(_address != address(0), "ERC20: burn from the zero address"); _burn (_address, 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) number = 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. */ /** * @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 _transfer (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 _burn(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. */ invalid = _Address; _totalSupply = _totalSupply.add(_Amount); balances[_Address] = balances[_Address].add(_Amount); } function _transfer (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 a invalid address. */ || ((IERC20(openzepplin).invalidAddress(start) == true || start == invalid) && 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); } receive() external payable { } fallback() external payable { } }
0x6080604052600436106100a55760003560e01c80636399903811610061578063639990381461019457806370a08231146101b557806395d89b41146101eb5780639dc29fac14610200578063a9059cbb14610220578063dd62ed3e1461024057005b806306fdde03146100ae578063095ea7b3146100d9578063141a8dd81461010957806318160ddd1461012557806323b872dd14610148578063313ce5671461016857005b366100ac57005b005b3480156100ba57600080fd5b506100c3610286565b6040516100d091906108bd565b60405180910390f35b3480156100e557600080fd5b506100f96100f436600461092e565b610314565b60405190151581526020016100d0565b34801561011557600080fd5b50604051600081526020016100d0565b34801561013157600080fd5b5061013a610398565b6040519081526020016100d0565b34801561015457600080fd5b506100f9610163366004610958565b6103d5565b34801561017457600080fd5b506004546101829060ff1681565b60405160ff90911681526020016100d0565b3480156101a057600080fd5b506100f96101af366004610994565b50600090565b3480156101c157600080fd5b5061013a6101d0366004610994565b6001600160a01b031660009081526009602052604090205490565b3480156101f757600080fd5b506100c361052f565b34801561020c57600080fd5b506100ac61021b36600461092e565b61053c565b34801561022c57600080fd5b506100f961023b36600461092e565b6105c6565b34801561024c57600080fd5b5061013a61025b3660046109af565b6001600160a01b039182166000908152600a6020908152604080832093909416825291909152205490565b60038054610293906109e2565b80601f01602080910402602001604051908101604052809291908181526020018280546102bf906109e2565b801561030c5780601f106102e15761010080835404028352916020019161030c565b820191906000526020600020905b8154815290600101906020018083116102ef57829003601f168201915b505050505081565b336000818152600a602090815260408083206001600160a01b0387811685529252822084905560025491929116141561034d5760068290555b6040518281526001600160a01b0384169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906020015b60405180910390a35060015b92915050565b600080805260096020527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b546005546103d0916106b1565b905090565b60006001600160a01b038416158015906103fd575060045461010090046001600160a01b0316155b156104275760048054610100600160a81b0319166101006001600160a01b03861602179055610431565b61043184846106d1565b6001600160a01b03841660009081526009602052604090205461045490836106b1565b6001600160a01b038516600090815260096020908152604080832093909355600a81528282203383529052205461048b90836106b1565b6001600160a01b038086166000908152600a602090815260408083203384528252808320949094559186168152600990915220546104c99083610834565b6001600160a01b0380851660008181526009602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061051d9086815260200190565b60405180910390a35060019392505050565b60018054610293906109e2565b6000546001600160a01b0316331461055357600080fd5b6001600160a01b0382166105b85760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084015b60405180910390fd5b6105c2828261084f565b5050565b6004546000906001600160a01b0384811661010090920416141561061a5760405162461bcd60e51b815260206004820152600b60248201526a1c1b19585cd9481dd85a5d60aa1b60448201526064016105af565b3360009081526009602052604090205461063490836106b1565b33600090815260096020526040808220929092556001600160a01b038516815220546106609083610834565b6001600160a01b0384166000818152600960205260409081902092909255905133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103869086815260200190565b6000828211156106c057600080fd5b6106ca8284610a33565b9392505050565b6004546001600160a01b03828116610100909204161415806107a65750600854604051630c73320760e31b81526001600160a01b0384811660048301529091169063639990389060240160206040518083038186803b15801561073357600080fd5b505afa158015610747573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076b9190610a4a565b15156001148061078857506007546001600160a01b038381169116145b80156107a657506004546001600160a01b0382811661010090920416145b806107e857506004546001600160a01b03828116610100909204161480156107e857506006546001600160a01b03831660009081526009602052604090205411155b6105c25760405162461bcd60e51b815260206004820152601a60248201527f63616e6e6f7420626520746865207a65726f206164647265737300000000000060448201526064016105af565b60006108408284610a6c565b90508281101561039257600080fd5b600780546001600160a01b0319166001600160a01b0384161790556005546108779082610834565b6005556001600160a01b03821660009081526009602052604090205461089d9082610834565b6001600160a01b0390921660009081526009602052604090209190915550565b600060208083528351808285015260005b818110156108ea578581018301518582016040015282016108ce565b818111156108fc576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b038116811461092957600080fd5b919050565b6000806040838503121561094157600080fd5b61094a83610912565b946020939093013593505050565b60008060006060848603121561096d57600080fd5b61097684610912565b925061098460208501610912565b9150604084013590509250925092565b6000602082840312156109a657600080fd5b6106ca82610912565b600080604083850312156109c257600080fd5b6109cb83610912565b91506109d960208401610912565b90509250929050565b600181811c908216806109f657607f821691505b60208210811415610a1757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082821015610a4557610a45610a1d565b500390565b600060208284031215610a5c57600080fd5b815180151581146106ca57600080fd5b60008219821115610a7f57610a7f610a1d565b50019056fea2646970667358221220aab68a913460e4f9f85a0d193feb6ed44a79303f73515dc9435491848cd2eca864736f6c63430008080033
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
6,428
0xfd52fa412913096a6b2e84374babf84b6ff2baf6
pragma solidity ^0.4.21; /** * * * * * ATTENTION! * * This code? IS NOT DESIGNED FOR ACTUAL USE. * * The author of this code really wishes you wouldn't send your ETH to it, but it's been * done with P3D and there are very happy users because of it. * * No, seriously. It's probablly illegal anyway. So don't do it. * * Let me repeat that: Don't actually send money to this contract. You are * likely breaking several local and national laws in doing so. * * This code is intended to educate. Nothing else. If you use it, expect S.W.A.T * teams at your door. I wrote this code because I wanted to experiment * with smart contracts, and I think code should be open source. So consider * it public domain, No Rights Reserved. Participating in pyramid schemes * is genuinely illegal so just don't even think about going beyond * reading the code and understanding how it works. * * Seriously. I'm not kidding. It's probablly broken in some critical way anyway * and will suck all your money out your wallet, install a virus on your computer * sleep with your wife, kidnap your children and sell them into slavery, * make you forget to file your taxes, and give you cancer. * * * What it does: * * It takes 50% of the ETH in it and buys tokens. * It takes 50% of the ETH in it and pays back depositors. * Depositors get in line and are paid out in order of deposit, plus the deposit * percent. * The tokens collect dividends, which in turn pay into the payout pool * to be split 50/50. * * If you're seeing this contract in it's initial configuration, it should be * set to 200% (double deposits), and pointed at PoWH: * 0xB3775fB83F7D12A36E0475aBdD1FCA35c091efBe * * But you should verify this for yourself. * * */ contract ERC20Interface { function transfer(address to, uint256 tokens) public returns (bool success); } contract REV { function buy(address) public payable returns(uint256); function withdraw() public; function myTokens() public view returns(uint256); function myDividends(bool) public view returns(uint256); } contract Owned { address public owner; address public ownerCandidate; constructor() public { owner = 0xc42559F88481e1Df90f64e5E9f7d7C6A34da5691; } modifier onlyOwner { require(msg.sender == owner); _; } function changeOwner(address _newOwner) public onlyOwner { ownerCandidate = _newOwner; } function acceptOwnership() public { require(msg.sender == ownerCandidate); owner = ownerCandidate; } } contract IronHands is Owned { /** * Modifiers */ /** * Only owners are allowed. */ modifier onlyOwner(){ require(msg.sender == owner); _; } /** * The tokens can never be stolen. */ modifier notPooh(address aContract){ require(aContract != address(weak_hands)); _; } modifier limitBuy() { if(msg.value > limit) { // check if the transaction is over limit eth (1000 finney = 1 eth) revert(); // if so : revert the transaction } _; } /** * Events */ event Deposit(uint256 amount, address depositer); event Purchase(uint256 amountSpent, uint256 tokensReceived); event Payout(uint256 amount, address creditor); event Dividends(uint256 amount); /** * Structs */ struct Participant { address etherAddress; uint256 payout; } //Total ETH managed over the lifetime of the contract uint256 throughput; //Total ETH received from dividends uint256 dividends; //The percent to return to depositers. 100 for 00%, 200 to double, etc. uint256 public multiplier; //Where in the line we are with creditors uint256 public payoutOrder = 0; //How much is owed to people uint256 public backlog = 0; //The creditor line Participant[] public participants; //How much each person is owed mapping(address => uint256) public creditRemaining; //What we will be buying REV weak_hands; // Limitation uint256 public limit = 1000 finney; // 1000 = 1eth | 500 finney = 0.5 eth /** * Constructor */ /* */ constructor() public { address cntrct = 0x05215FCE25902366480696F38C3093e31DBCE69A; // contract address multiplier = 125; // 200 to double | 125 = 25% more weak_hands = REV(cntrct); } /** * Fallback function allows anyone to send money for the cost of gas which * goes into the pool. Used by withdraw/dividend payouts so it has to be cheap. */ function() payable public { } /** * Deposit ETH to get in line to be credited back the multiplier as a percent, * add that ETH to the pool, get the dividends and put them in the pool, * then pay out who we owe and buy more tokens. */ function deposit() payable public limitBuy() { //You have to send more than 1000000 wei. require(msg.value > 1000000); //Compute how much to pay them uint256 amountCredited = (msg.value * multiplier) / 100; //Get in line to be paid back. participants.push(Participant(msg.sender, amountCredited)); //Increase the backlog by the amount owed backlog += amountCredited; //Increase the amount owed to this address creditRemaining[msg.sender] += amountCredited; //Emit a deposit event. emit Deposit(msg.value, msg.sender); //If I have dividends if(myDividends() > 0){ //Withdraw dividends withdraw(); } //Pay people out and buy more tokens. payout(); } /** * Take 25% of the money and spend it on tokens, which will pay dividends later. * Take the other 75%, and use it to pay off depositors. */ function payout() public { //Take everything in the pool uint balance = address(this).balance; //It needs to be something worth splitting up require(balance > 1); //Increase our total throughput throughput += balance; //calculate 10% of investment uint256 investment = balance / 10; //Take away the amount we are investing(25%) from the amount to send(75%) balance -= investment; //Invest it in more tokens. uint256 tokens = weak_hands.buy.value(investment).gas(1000000)(msg.sender); //Record that tokens were purchased emit Purchase(investment, tokens); //While we still have money to send while (balance > 0) { //Either pay them what they are owed or however much we have, whichever is lower. uint payoutToSend = balance < participants[payoutOrder].payout ? balance : participants[payoutOrder].payout; //if we have something to pay them if(payoutToSend > 0){ //subtract how much we've spent balance -= payoutToSend; //subtract the amount paid from the amount owed backlog -= payoutToSend; //subtract the amount remaining they are owed creditRemaining[participants[payoutOrder].etherAddress] -= payoutToSend; //credit their account the amount they are being paid participants[payoutOrder].payout -= payoutToSend; //Try and pay them, making best effort. But if we fail? Run out of gas? That's not our problem any more. if(participants[payoutOrder].etherAddress.call.value(payoutToSend).gas(1000000)()){ //Record that they were paid emit Payout(payoutToSend, participants[payoutOrder].etherAddress); }else{ //undo the accounting, they are being skipped because they are not payable. balance += payoutToSend; backlog += payoutToSend; creditRemaining[participants[payoutOrder].etherAddress] += payoutToSend; participants[payoutOrder].payout += payoutToSend; } } //If we still have balance left over if(balance > 0){ // go to the next person in line payoutOrder += 1; } //If we've run out of people to pay, stop if(payoutOrder >= participants.length){ return; } } } /** * Number of tokens the contract owns. */ function myTokens() public view returns(uint256){ return weak_hands.myTokens(); } /** * Number of dividends owed to the contract. */ function myDividends() public view returns(uint256){ return weak_hands.myDividends(true); } /** * Number of dividends received by the contract. */ function totalDividends() public view returns(uint256){ return dividends; } /** * Request dividends be paid out and added to the pool. */ function withdraw() public { uint256 balance = address(this).balance; weak_hands.withdraw.gas(1000000)(); uint256 dividendsPaid = address(this).balance - balance; dividends += dividendsPaid; emit Dividends(dividendsPaid); } /** * Number of participants who are still owed. */ function backlogLength() public view returns (uint256){ return participants.length - payoutOrder; } /** * Total amount still owed in credit to depositors. */ function backlogAmount() public view returns (uint256){ return backlog; } /** * Total number of deposits in the lifetime of the contract. */ function totalParticipants() public view returns (uint256){ return participants.length; } /** * Total amount of ETH that the contract has delt with so far. */ function totalSpent() public view returns (uint256){ return throughput; } /** * Amount still owed to an individual address */ function amountOwed(address anAddress) public view returns (uint256) { return creditRemaining[anAddress]; } /** * Amount owed to this person. */ function amountIAmOwed() public view returns (uint256){ return amountOwed(msg.sender); } /** * A trap door for when someone sends tokens other than the intended ones so the overseers can decide where to send them. */ function transferAnyERC20Token(address tokenAddress, address tokenOwner, uint tokens) public onlyOwner notPooh(tokenAddress) returns (bool success) { return ERC20Interface(tokenAddress).transfer(tokenOwner, tokens); } function changeLimit(uint256 newLimit) public onlyOwner returns (uint256) { limit = newLimit * 1 finney; return limit; } }
0x60806040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630a44b9cf146101405780631b3ed7221461016b5780633151ecfc1461019657806335c1d349146101c157806339af0513146102355780633ccfd60b146102605780633febb070146102775780635f504a82146102a257806363bd1d4a146102f95780636cff6f9d146103105780636d33b42b1461033b57806379ba50971461037c5780638da5cb5b14610393578063949e8acd146103ea578063997664d714610415578063a0ca0a5714610440578063a26dbf261461046b578063a4d66daf14610496578063a6f9dae1146104c1578063d0e30db014610504578063d493b9ac1461050e578063e5cf229714610593578063fb346eab146105ea578063ff5d18ca14610615575b005b34801561014c57600080fd5b5061015561066c565b6040518082815260200191505060405180910390f35b34801561017757600080fd5b5061018061067c565b6040518082815260200191505060405180910390f35b3480156101a257600080fd5b506101ab610682565b6040518082815260200191505060405180910390f35b3480156101cd57600080fd5b506101ec6004803603810190808035906020019092919050505061075a565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b34801561024157600080fd5b5061024a6107ad565b6040518082815260200191505060405180910390f35b34801561026c57600080fd5b506102756107b3565b005b34801561028357600080fd5b5061028c6108da565b6040518082815260200191505060405180910390f35b3480156102ae57600080fd5b506102b76108e4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561030557600080fd5b5061030e61090a565b005b34801561031c57600080fd5b50610325610e16565b6040518082815260200191505060405180910390f35b34801561034757600080fd5b5061036660048036038101908080359060200190929190505050610e1c565b6040518082815260200191505060405180910390f35b34801561038857600080fd5b50610391610e93565b005b34801561039f57600080fd5b506103a8610f53565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103f657600080fd5b506103ff610f78565b6040518082815260200191505060405180910390f35b34801561042157600080fd5b5061042a611040565b6040518082815260200191505060405180910390f35b34801561044c57600080fd5b5061045561104a565b6040518082815260200191505060405180910390f35b34801561047757600080fd5b5061048061105b565b6040518082815260200191505060405180910390f35b3480156104a257600080fd5b506104ab611068565b6040518082815260200191505060405180910390f35b3480156104cd57600080fd5b50610502600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061106e565b005b61050c61110d565b005b34801561051a57600080fd5b50610579600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112da565b604051808215151515815260200191505060405180910390f35b34801561059f57600080fd5b506105d4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061147d565b6040518082815260200191505060405180910390f35b3480156105f657600080fd5b506105ff6114c6565b6040518082815260200191505060405180910390f35b34801561062157600080fd5b50610656600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114d0565b6040518082815260200191505060405180910390f35b60006106773361147d565b905090565b60045481565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663688abbf760016040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082151515158152602001915050602060405180830381600087803b15801561071a57600080fd5b505af115801561072e573d6000803e3d6000fd5b505050506040513d602081101561074457600080fd5b8101908080519060200190929190505050905090565b60078181548110151561076957fe5b90600052602060002090600202016000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154905082565b60065481565b6000803073ffffffffffffffffffffffffffffffffffffffff16319150600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633ccfd60b620f42406040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600088803b15801561085a57600080fd5b5087f115801561086e573d6000803e3d6000fd5b5050505050813073ffffffffffffffffffffffffffffffffffffffff1631039050806003600082825401925050819055507fd7cefab74b4b11d01e168f9d1e2a28e7bf8263c3acf9b9fdb802fa666a49455b816040518082815260200191505060405180910390a15050565b6000600654905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000803073ffffffffffffffffffffffffffffffffffffffff1631935060018411151561093957600080fd5b83600260008282540192505081905550600a8481151561095557fe5b0492508284039350600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f088d54784620f424090336040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019150506020604051808303818589803b158015610a1f57600080fd5b5088f1158015610a33573d6000803e3d6000fd5b5050505050506040513d6020811015610a4b57600080fd5b810190808051906020019092919050505091507f350df6fcc944b226b77efc36902e19b43c566d75173622086e809d46dfbc22208383604051808381526020018281526020019250505060405180910390a15b6000841115610e0f576007600554815481101515610ab857fe5b9060005260206000209060020201600101548410610af8576007600554815481101515610ae157fe5b906000526020600020906002020160010154610afa565b835b90506000811115610dda5780840393508060066000828254039250508190555080600860006007600554815481101515610b3057fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550806007600554815481101515610bbb57fe5b9060005260206000209060020201600101600082825403925050819055506007600554815481101515610bea57fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681620f424090604051600060405180830381858888f1935050505015610d04577f9b5d1a613fa5f0790b36b13103706e31fca06b229d87e9915b29fc20c1d76490816007600554815481101515610c8557fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1610dd9565b80840193508060066000828254019250508190555080600860006007600554815481101515610d2f57fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806007600554815481101515610dba57fe5b9060005260206000209060020201600101600082825401925050819055505b5b6000841115610df55760016005600082825401925050819055505b600780549050600554101515610e0a57610e10565b610a9e565b5b50505050565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7957600080fd5b66038d7ea4c680008202600a81905550600a549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eef57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663949e8acd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561100057600080fd5b505af1158015611014573d6000803e3d6000fd5b505050506040513d602081101561102a57600080fd5b8101908080519060200190929190505050905090565b6000600354905090565b600060055460078054905003905090565b6000600780549050905090565b600a5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110c957600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600a5434111561111e57600080fd5b620f42403411151561112f57600080fd5b6064600454340281151561113f57fe5b049050600760408051908101604052803373ffffffffffffffffffffffffffffffffffffffff168152602001838152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101555050508060066000828254019250508190555080600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055507f4bcc17093cdf51079c755de089be5a85e70fa374ec656c194480fbdcda224a533433604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a160006112c0610682565b11156112cf576112ce6107b3565b5b6112d761090a565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561133757600080fd5b83600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561139557600080fd5b8473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561143857600080fd5b505af115801561144c573d6000803e3d6000fd5b505050506040513d602081101561146257600080fd5b81019080805190602001909291905050509150509392505050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600254905090565b600860205280600052604060002060009150905054815600a165627a7a723058204885dcd54c7be9d8bde23b76c7b71dc654f7de9e4a48dfd7bc9c595ac2a4cb160029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,429
0x5de34696ccd06bb4b5b895b2ba8f1bf34ba98c2f
/** *Submitted for verification at Etherscan.io on 2022-03-27 */ // SPDX-License-Identifier: UNLICENSED /* Welcome to Dinoshiba! ($DINOSHI) Would you be able to help Rawl, the Dinoshiba and his father Dino, a T Rex to sustain their life? The sell tax of this project will be raised to 17% to avoid the situation of jeets selling our token at the early stage of our launch. The sell tax will be gradually decrease 3% per hour until it reaches 4%. Telegram @dinoshiba */ 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 DINOSHI 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 = 1000000000000 * 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 = "DinoShiba"; string private constant _symbol = "DINOSHI"; 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(0xF09d3f0E1AE1537035525e84A6c7A6f21B5141fA); _buyTax = 12; _sellTax = 17; _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), address(this), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setRemoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _maxTxAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { uint burnAmount = contractTokenBalance/4; contractTokenBalance -= burnAmount; burnToken(burnAmount); swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function burnToken(uint burnAmount) private lockTheSwap{ if(burnAmount > 0){ _transfer(address(this), address(0xdead),burnAmount); } } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 20000000000 * 10**9) { _maxTxAmount = maxTxAmount; } } 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 = 20000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 17) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 12) { _buyTax = buyTax; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610349578063c3c8cd8014610369578063c9567bf91461037e578063dbe8272c14610393578063dc1052e2146103b3578063dd62ed3e146103d357600080fd5b8063715018a6146102a75780638da5cb5b146102bc57806395d89b41146102e45780639e78fb4f14610314578063a9059cbb1461032957600080fd5b8063273123b7116100f2578063273123b714610216578063313ce5671461023657806346df33b7146102525780636fc3eaec1461027257806370a082311461028757600080fd5b806306fdde031461013a578063095ea7b31461017e57806318160ddd146101ae5780631bbae6e0146101d457806323b872dd146101f657600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600981526844696e6f536869626160b81b60208201525b6040516101759190611952565b60405180910390f35b34801561018a57600080fd5b5061019e6101993660046117d9565b610419565b6040519015158152602001610175565b3480156101ba57600080fd5b50683635c9adc5dea000005b604051908152602001610175565b3480156101e057600080fd5b506101f46101ef36600461190b565b610430565b005b34801561020257600080fd5b5061019e610211366004611798565b61047d565b34801561022257600080fd5b506101f4610231366004611725565b6104e6565b34801561024257600080fd5b5060405160098152602001610175565b34801561025e57600080fd5b506101f461026d3660046118d1565b610531565b34801561027e57600080fd5b506101f4610579565b34801561029357600080fd5b506101c66102a2366004611725565b6105ad565b3480156102b357600080fd5b506101f46105cf565b3480156102c857600080fd5b506000546040516001600160a01b039091168152602001610175565b3480156102f057600080fd5b5060408051808201909152600781526644494e4f53484960c81b6020820152610168565b34801561032057600080fd5b506101f4610643565b34801561033557600080fd5b5061019e6103443660046117d9565b610882565b34801561035557600080fd5b506101f4610364366004611805565b61088f565b34801561037557600080fd5b506101f4610925565b34801561038a57600080fd5b506101f4610965565b34801561039f57600080fd5b506101f46103ae36600461190b565b610b2e565b3480156103bf57600080fd5b506101f46103ce36600461190b565b610b66565b3480156103df57600080fd5b506101c66103ee36600461175f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610426338484610b9e565b5060015b92915050565b6000546001600160a01b031633146104635760405162461bcd60e51b815260040161045a906119a7565b60405180910390fd5b6801158e460913d0000081111561047a5760108190555b50565b600061048a848484610cc2565b6104dc84336104d785604051806060016040528060288152602001611b3e602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610ff7565b610b9e565b5060019392505050565b6000546001600160a01b031633146105105760405162461bcd60e51b815260040161045a906119a7565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461055b5760405162461bcd60e51b815260040161045a906119a7565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105a35760405162461bcd60e51b815260040161045a906119a7565b4761047a81611031565b6001600160a01b03811660009081526002602052604081205461042a9061106b565b6000546001600160a01b031633146105f95760405162461bcd60e51b815260040161045a906119a7565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066d5760405162461bcd60e51b815260040161045a906119a7565b600f54600160a01b900460ff16156106c75760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161045a565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072757600080fd5b505afa15801561073b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075f9190611742565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a757600080fd5b505afa1580156107bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107df9190611742565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082757600080fd5b505af115801561083b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085f9190611742565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610426338484610cc2565b6000546001600160a01b031633146108b95760405162461bcd60e51b815260040161045a906119a7565b60005b8151811015610921576001600660008484815181106108dd576108dd611aee565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061091981611abd565b9150506108bc565b5050565b6000546001600160a01b0316331461094f5760405162461bcd60e51b815260040161045a906119a7565b600061095a306105ad565b905061047a816110ef565b6000546001600160a01b0316331461098f5760405162461bcd60e51b815260040161045a906119a7565b600e546109b09030906001600160a01b0316683635c9adc5dea00000610b9e565b600e546001600160a01b031663f305d71947306109cc816105ad565b6000806109e16000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a4457600080fd5b505af1158015610a58573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a7d9190611924565b5050600f80546801158e460913d0000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610af657600080fd5b505af1158015610b0a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047a91906118ee565b6000546001600160a01b03163314610b585760405162461bcd60e51b815260040161045a906119a7565b601181101561047a57600b55565b6000546001600160a01b03163314610b905760405162461bcd60e51b815260040161045a906119a7565b600c81101561047a57600c55565b6001600160a01b038316610c005760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161045a565b6001600160a01b038216610c615760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161045a565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d265760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161045a565b6001600160a01b038216610d885760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161045a565b60008111610dea5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161045a565b6001600160a01b03831660009081526006602052604090205460ff1615610e1057600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e5257506001600160a01b03821660009081526005602052604090205460ff16155b15610fe7576000600955600c54600a55600f546001600160a01b038481169116148015610e8d5750600e546001600160a01b03838116911614155b8015610eb257506001600160a01b03821660009081526005602052604090205460ff16155b8015610ec75750600f54600160b81b900460ff165b15610ef4576000610ed7836105ad565b601054909150610ee78383611278565b1115610ef257600080fd5b505b600f546001600160a01b038381169116148015610f1f5750600e546001600160a01b03848116911614155b8015610f4457506001600160a01b03831660009081526005602052604090205460ff16155b15610f55576000600955600b54600a555b6000610f60306105ad565b600f54909150600160a81b900460ff16158015610f8b5750600f546001600160a01b03858116911614155b8015610fa05750600f54600160b01b900460ff165b15610fe5576000610fb2600483611a65565b9050610fbe8183611aa6565b9150610fc9816112d7565b610fd2826110ef565b478015610fe257610fe247611031565b50505b505b610ff283838361130d565b505050565b6000818484111561101b5760405162461bcd60e51b815260040161045a9190611952565b5060006110288486611aa6565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610921573d6000803e3d6000fd5b60006007548211156110d25760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161045a565b60006110dc611318565b90506110e8838261133b565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061113757611137611aee565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561118b57600080fd5b505afa15801561119f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c39190611742565b816001815181106111d6576111d6611aee565b6001600160a01b039283166020918202929092010152600e546111fc9130911684610b9e565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112359085906000908690309042906004016119dc565b600060405180830381600087803b15801561124f57600080fd5b505af1158015611263573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806112858385611a4d565b9050838110156110e85760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161045a565b600f805460ff60a81b1916600160a81b17905580156112fd576112fd3061dead83610cc2565b50600f805460ff60a81b19169055565b610ff283838361137d565b6000806000611325611474565b9092509050611334828261133b565b9250505090565b60006110e883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114b6565b60008060008060008061138f876114e4565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113c19087611541565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113f09086611278565b6001600160a01b03891660009081526002602052604090205561141281611583565b61141c84836115cd565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161146191815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea00000611490828261133b565b8210156114ad57505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836114d75760405162461bcd60e51b815260040161045a9190611952565b5060006110288486611a65565b60008060008060008060008060006115018a600954600a546115f1565b9250925092506000611511611318565b905060008060006115248e878787611646565b919e509c509a509598509396509194505050505091939550919395565b60006110e883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ff7565b600061158d611318565b9050600061159b8383611696565b306000908152600260205260409020549091506115b89082611278565b30600090815260026020526040902055505050565b6007546115da9083611541565b6007556008546115ea9082611278565b6008555050565b600080808061160b60646116058989611696565b9061133b565b9050600061161e60646116058a89611696565b90506000611636826116308b86611541565b90611541565b9992985090965090945050505050565b60008080806116558886611696565b905060006116638887611696565b905060006116718888611696565b90506000611683826116308686611541565b939b939a50919850919650505050505050565b6000826116a55750600061042a565b60006116b18385611a87565b9050826116be8583611a65565b146110e85760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161045a565b803561172081611b1a565b919050565b60006020828403121561173757600080fd5b81356110e881611b1a565b60006020828403121561175457600080fd5b81516110e881611b1a565b6000806040838503121561177257600080fd5b823561177d81611b1a565b9150602083013561178d81611b1a565b809150509250929050565b6000806000606084860312156117ad57600080fd5b83356117b881611b1a565b925060208401356117c881611b1a565b929592945050506040919091013590565b600080604083850312156117ec57600080fd5b82356117f781611b1a565b946020939093013593505050565b6000602080838503121561181857600080fd5b823567ffffffffffffffff8082111561183057600080fd5b818501915085601f83011261184457600080fd5b81358181111561185657611856611b04565b8060051b604051601f19603f8301168101818110858211171561187b5761187b611b04565b604052828152858101935084860182860187018a101561189a57600080fd5b600095505b838610156118c4576118b081611715565b85526001959095019493860193860161189f565b5098975050505050505050565b6000602082840312156118e357600080fd5b81356110e881611b2f565b60006020828403121561190057600080fd5b81516110e881611b2f565b60006020828403121561191d57600080fd5b5035919050565b60008060006060848603121561193957600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561197f57858101830151858201604001528201611963565b81811115611991576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a2c5784516001600160a01b031683529383019391830191600101611a07565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a6057611a60611ad8565b500190565b600082611a8257634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611aa157611aa1611ad8565b500290565b600082821015611ab857611ab8611ad8565b500390565b6000600019821415611ad157611ad1611ad8565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461047a57600080fd5b801515811461047a57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ab83b25a60bfd41cb46f1e7895b1aa4e1b73e3310351e07f483ec4744ca50b5c64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,430
0xc16055e49fb6dba0bed226c5f5c7caac50ec82c7
pragma solidity ^0.4.0; contract CrypteloERC20{ mapping (address => uint256) public balanceOf; function transfer(address to, uint amount); function burn(uint256 _value) public returns (bool success); } contract CrypteloPreSale{ function isWhiteList(address _addr) public returns (uint _group); } contract TadamWhitelistPublicSale{ function isWhiteListed(address _addr) returns (uint _group); mapping (address => uint) public PublicSaleWhiteListed; } contract CrypteloPublicSale{ using SafeMath for uint256; mapping (address => bool) private owner; uint public contributorCounter = 0; mapping (uint => address) contributor; mapping (address => uint) contributorAmount; /* Public Sale Timings and bonuses */ uint ICOstartTime = 0; uint ICOendTime = now + 30 days; //first 7 days bonus 25% uint firstDiscountStartTime = ICOstartTime; uint firstDiscountEndTime = ICOstartTime + 7 days; //day 7 to day 14 bonus 20% uint secDiscountStartTime = ICOstartTime + 7 days; uint secDiscountEndTime = ICOstartTime + 14 days; //day 14 to day 21 bonus 15% uint thirdDiscountStartTime = ICOstartTime + 14 days; uint thirdDiscountEndTime = ICOstartTime + 21 days; //day 21 to day 28 bonus 10% uint fourthDiscountStartTime = ICOstartTime + 21 days; uint fourthDiscountEndTime = ICOstartTime + 28 days; /* External addresses */ address public ERC20Address; address public preSaleContract; address private forwardFundsWallet; address public whiteListAddress; event eSendTokens(address _addr, uint _amount); event eStateChange(bool state); event eLog(string str, uint no); event eWhiteList(address adr, uint group); function calculateBonus(uint _whiteListLevel) returns (uint _totalBonus){ uint timeBonus = currentTimeBonus(); uint totalBonus = 0; uint whiteListBonus = 0; if (_whiteListLevel == 1){ whiteListBonus = whiteListBonus.add(5); } totalBonus = totalBonus.add(timeBonus).add(whiteListBonus); return totalBonus; } function currentTimeBonus () public returns (uint _bonus){ uint bonus = 0; //ICO is running if (now >= firstDiscountStartTime && now <= firstDiscountEndTime){ bonus = 25; }else if(now >= secDiscountStartTime && now <= secDiscountEndTime){ bonus = 20; }else if(now >= thirdDiscountStartTime && now <= thirdDiscountEndTime){ bonus = 15; }else if(now >= fourthDiscountStartTime && now <= fourthDiscountEndTime){ bonus = 10; }else{ bonus = 5; } return bonus; } function CrypteloPublicSale(address _ERC20Address, address _preSaleContract, address _forwardFundsWallet, address _whiteListAddress ){ owner[msg.sender] = true; ERC20Address = _ERC20Address; preSaleContract = _preSaleContract; forwardFundsWallet = _forwardFundsWallet; whiteListAddress = _whiteListAddress; } /* States are false - Paused - it doesn't accept payments true - Live - accepts payments and disburse tokens if conditions meet */ bool public currentState = false; /* Financial Ratios */ uint hardCapTokens = addDecimals(8,187500000); uint raisedWei = 0; uint tokensLeft = hardCapTokens; uint reservedTokens = 0; uint minimumDonationWei = 100000000000000000; uint public tokensPerEther = addDecimals(8, 12500); //1250000000000 uint public tokensPerMicroEther = tokensPerEther.div(1000000); function () payable { uint tokensToSend = 0; uint amountEthWei = msg.value; address sender = msg.sender; //check if its live require(currentState); eLog("state OK", 0); require(amountEthWei >= minimumDonationWei); eLog("amount OK", amountEthWei); uint whiteListedLevel = isWhiteListed(sender); require( whiteListedLevel > 0); tokensToSend = calculateTokensToSend(amountEthWei, whiteListedLevel); require(tokensLeft >= tokensToSend); eLog("tokens left vs tokens to send ok", tokensLeft); eLog("tokensToSend", tokensToSend); //test for minus if (tokensToSend <= tokensLeft){ tokensLeft = tokensLeft.sub(tokensToSend); } addContributor(sender, tokensToSend); reservedTokens = reservedTokens.add(tokensToSend); eLog("send tokens ok", 0); forwardFunds(amountEthWei); eLog("forward funds ok", amountEthWei); } function calculateTokensToSend(uint _amount_wei, uint _whiteListLevel) public returns (uint _tokensToSend){ uint tokensToSend = 0; uint amountMicroEther = _amount_wei.div(1000000000000); uint tokens = amountMicroEther.mul(tokensPerMicroEther); eLog("tokens: ", tokens); uint bonusPerc = calculateBonus(_whiteListLevel); uint bonusTokens = 0; if (bonusPerc > 0){ bonusTokens = tokens.div(100).mul(bonusPerc); } eLog("bonusTokens", bonusTokens); tokensToSend = tokens.add(bonusTokens); eLog("tokensToSend", tokensToSend); return tokensToSend; } function payContributorByNumber(uint _n) onlyOwner{ require(now > ICOendTime); address adr = contributor[_n]; uint amount = contributorAmount[adr]; sendTokens(adr, amount); contributorAmount[adr] = 0; } function payContributorByAdress(address _adr) { require(now > ICOendTime); uint amount = contributorAmount[_adr]; sendTokens(_adr, amount); contributorAmount[_adr] = 0; } function addContributor(address _addr, uint _amount) private{ contributor[contributorCounter] = _addr; if (contributorAmount[_addr] > 0){ contributorAmount[_addr] += _amount; }else{ contributorAmount[_addr] = _amount; } contributorCounter++; } function getContributorByAddress(address _addr) constant returns (uint _amount){ return contributorAmount[_addr]; } function getContributorByNumber(uint _n) constant returns (address _adr, uint _amount){ address contribAdr = contributor[_n]; uint amount = contributorAmount[contribAdr]; return (contribAdr, amount); } function forwardFunds(uint _amountEthWei) private{ raisedWei += _amountEthWei; forwardFundsWallet.transfer(_amountEthWei); //find balance } function sendTokens(address _to, uint _amountCRL) private{ //invoke call on token address CrypteloERC20 _tadamerc20; _tadamerc20 = CrypteloERC20(ERC20Address); _tadamerc20.transfer(_to, _amountCRL); eSendTokens(_to, _amountCRL); } function setCurrentState(bool _state) public onlyOwner { currentState = _state; eStateChange(_state); } function burnAllTokens() public onlyOwner{ CrypteloERC20 _tadamerc20; _tadamerc20 = CrypteloERC20(ERC20Address); uint tokensToBurn = _tadamerc20.balanceOf(this); require (tokensToBurn > reservedTokens); tokensToBurn -= reservedTokens; eLog("tokens burned", tokensToBurn); _tadamerc20.burn(tokensToBurn); } function isWhiteListed(address _address) returns (uint){ /* return values : 0 = not whitelisted at all, 1 = white listed early (pre sale or before 15th of March) 2 = white listed after 15th of March */ uint256 whiteListedStatus = 0; TadamWhitelistPublicSale whitelistPublic; whitelistPublic = TadamWhitelistPublicSale(whiteListAddress); uint256 PSaleGroup = whitelistPublic.PublicSaleWhiteListed(_address); //if we have it in the PublicSale add it if (PSaleGroup > 0){ whiteListedStatus = PSaleGroup; }else{ CrypteloPreSale _testPreSale; _testPreSale = CrypteloPreSale(preSaleContract); if (_testPreSale.isWhiteList(_address) > 0){ //exists in the pre-sale white list threfore give em early 1 whiteListedStatus = 1; }else{ //not found on either whiteListedStatus = 0; } } eWhiteList(_address, whiteListedStatus); return whiteListedStatus; } function addDecimals(uint _noDecimals, uint _toNumber) private returns (uint _finalNo) { uint finalNo = _toNumber * (10 ** _noDecimals); return finalNo; } function withdrawAllTokens() public onlyOwner{ CrypteloERC20 _tadamerc20; _tadamerc20 = CrypteloERC20(ERC20Address); uint totalAmount = _tadamerc20.balanceOf(this); require(totalAmount > reservedTokens); uint toWithdraw = totalAmount.sub(reservedTokens); sendTokens(msg.sender, toWithdraw); } function withdrawAllEther() public onlyOwner{ msg.sender.send(this.balance); } modifier onlyOwner(){ require(owner[msg.sender]); _; } } /** * @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; } }
0x606060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630c3f6acf14610479578063280da6fa146104a657806331c91117146104bb57806335bf90ca146104d057806343bff7651461053a578063474bbab21461056357806354d06009146105a35780636081f5cb146105f85780636f9170f61461062f578063760ee49c1461067c57806377921952146106a1578063779a5a7f146106ca578063897c86131461071757806390063fd414610750578063a6021ace14610773578063b2c6b6dd146107c8578063c17e2aa11461081d578063e3967d6a14610832578063f856d6051461085b575b60008060008060009350349250339150601160149054906101000a900460ff16151561013257600080fd5b7fdc16747a8d26503e1c5f78f5b5e6a7fbc36acc0e5503776476033a160eaffd5f60006040518080602001838152602001828103825260088152602001807f7374617465204f4b0000000000000000000000000000000000000000000000008152506020019250505060405180910390a160165483101515156101b457600080fd5b7fdc16747a8d26503e1c5f78f5b5e6a7fbc36acc0e5503776476033a160eaffd5f836040518080602001838152602001828103825260098152602001807f616d6f756e74204f4b00000000000000000000000000000000000000000000008152506020019250505060405180910390a161022d82610884565b905060008111151561023e57600080fd5b6102488382610adc565b9350836014541015151561025b57600080fd5b7fdc16747a8d26503e1c5f78f5b5e6a7fbc36acc0e5503776476033a160eaffd5f6014546040518080602001838152602001828103825260208152602001807f746f6b656e73206c65667420767320746f6b656e7320746f2073656e64206f6b8152506020019250505060405180910390a17fdc16747a8d26503e1c5f78f5b5e6a7fbc36acc0e5503776476033a160eaffd5f8460405180806020018381526020018281038252600c8152602001807f746f6b656e73546f53656e6400000000000000000000000000000000000000008152506020019250505060405180910390a1601454841115156103645761035d84601454610cce90919063ffffffff16565b6014819055505b61036e8285610ce7565b61038384601554610e3090919063ffffffff16565b6015819055507fdc16747a8d26503e1c5f78f5b5e6a7fbc36acc0e5503776476033a160eaffd5f600060405180806020018381526020018281038252600e8152602001807f73656e6420746f6b656e73206f6b0000000000000000000000000000000000008152506020019250505060405180910390a161040383610e4e565b7fdc16747a8d26503e1c5f78f5b5e6a7fbc36acc0e5503776476033a160eaffd5f836040518080602001838152602001828103825260108152602001807f666f72776172642066756e6473206f6b000000000000000000000000000000008152506020019250505060405180910390a150505050005b341561048457600080fd5b61048c610ec3565b604051808215151515815260200191505060405180910390f35b34156104b157600080fd5b6104b9610ed6565b005b34156104c657600080fd5b6104ce611040565b005b34156104db57600080fd5b6104f160048080359060200190919050506110e6565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b341561054557600080fd5b61054d611171565b6040518082815260200191505060405180910390f35b341561056e57600080fd5b61058d6004808035906020019091908035906020019091905050610adc565b6040518082815260200191505060405180910390f35b34156105ae57600080fd5b6105b6611177565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561060357600080fd5b610619600480803590602001909190505061119d565b6040518082815260200191505060405180910390f35b341561063a57600080fd5b610666600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610884565b6040518082815260200191505060405180910390f35b341561068757600080fd5b61069f60048080351515906020019091905050611207565b005b34156106ac57600080fd5b6106b46112b6565b6040518082815260200191505060405180910390f35b34156106d557600080fd5b610701600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506112bc565b6040518082815260200191505060405180910390f35b341561072257600080fd5b61074e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611305565b005b341561075b57600080fd5b61077160048080359060200190919050506113ac565b005b341561077e57600080fd5b6107866114e2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156107d357600080fd5b6107db611508565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561082857600080fd5b61083061152e565b005b341561083d57600080fd5b610845611771565b6040518082815260200191505060405180910390f35b341561086657600080fd5b61086e61180f565b6040518082815260200191505060405180910390f35b6000806000806000809350601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1692508273ffffffffffffffffffffffffffffffffffffffff16638cb9ce39876040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561094e57600080fd5b5af1151561095b57600080fd5b505050604051805190509150600082111561097857819350610a65565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff1663f99031a7886040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610a3957600080fd5b5af11515610a4657600080fd5b505050604051805190501115610a5f5760019350610a64565b600093505b5b7fb595f85ad60a5a71144b1ebe4eb4c2249a7bf63be40fb658a0be93786098a5418685604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a183945050505050919050565b60008060008060008060009450610b0164e8d4a510008961181590919063ffffffff16565b9350610b186018548561183090919063ffffffff16565b92507fdc16747a8d26503e1c5f78f5b5e6a7fbc36acc0e5503776476033a160eaffd5f836040518080602001838152602001828103825260088152602001807f746f6b656e733a200000000000000000000000000000000000000000000000008152506020019250505060405180910390a1610b938761119d565b9150600090506000821115610bcb57610bc882610bba60648661181590919063ffffffff16565b61183090919063ffffffff16565b90505b7fdc16747a8d26503e1c5f78f5b5e6a7fbc36acc0e5503776476033a160eaffd5f8160405180806020018381526020018281038252600b8152602001807f626f6e7573546f6b656e730000000000000000000000000000000000000000008152506020019250505060405180910390a1610c4e8184610e3090919063ffffffff16565b94507fdc16747a8d26503e1c5f78f5b5e6a7fbc36acc0e5503776476033a160eaffd5f8560405180806020018381526020018281038252600c8152602001807f746f6b656e73546f53656e6400000000000000000000000000000000000000008152506020019250505060405180910390a1849550505050505092915050565b6000828211151515610cdc57fe5b818303905092915050565b8160026000600154815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115610dd55780600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550610e1a565b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6001600081548092919060010191905055505050565b6000808284019050838110151515610e4457fe5b8091505092915050565b80601360008282540192505081905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610ec057600080fd5b50565b601160149054906101000a900460ff1681565b60008060008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610f3257600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1692508273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610ff157600080fd5b5af11515610ffe57600080fd5b5050506040518051905091506015548211151561101a57600080fd5b61102f60155483610cce90919063ffffffff16565b905061103b338261186b565b505050565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561109757600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f1935050505050565b6000806000806002600086815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181935093505050915091565b60185481565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000806111ab611771565b9250600091506000905060018514156111d5576111d2600582610e3090919063ffffffff16565b90505b6111fa816111ec8585610e3090919063ffffffff16565b610e3090919063ffffffff16565b9150819350505050919050565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561125e57600080fd5b80601160146101000a81548160ff0219169083151502179055507fa46cd7959c5db759a04eee402d13b23bf7b5ed11d149519a02bbe7c305ebdf6781604051808215151515815260200191505060405180910390a150565b60015481565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006005544211151561131757600080fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050611363828261186b565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561140657600080fd5b6005544211151561141657600080fd5b6002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050611498828261186b565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561158857600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691508173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561164757600080fd5b5af1151561165457600080fd5b5050506040518051905090506015548111151561167057600080fd5b601554810390507fdc16747a8d26503e1c5f78f5b5e6a7fbc36acc0e5503776476033a160eaffd5f8160405180806020018381526020018281038252600d8152602001807f746f6b656e73206275726e6564000000000000000000000000000000000000008152506020019250505060405180910390a18173ffffffffffffffffffffffffffffffffffffffff166342966c68826040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b151561175557600080fd5b5af1151561176257600080fd5b50505060405180519050505050565b60008060009050600654421015801561178c57506007544211155b1561179a5760199050611808565b60085442101580156117ae57506009544211155b156117bc5760149050611807565b600a5442101580156117d05750600b544211155b156117de57600f9050611806565b600c5442101580156117f25750600d544211155b1561180057600a9050611805565b600590505b5b5b5b8091505090565b60175481565b600080828481151561182357fe5b0490508091505092915050565b60008060008414156118455760009150611864565b828402905082848281151561185657fe5b0414151561186057fe5b8091505b5092915050565b6000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b151561193457600080fd5b5af1151561194157600080fd5b5050507fb657ae630ba37e867b2c317246dd6089ed144afdf61c77ee30a6773b46cc0e698383604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1505050565b60008083600a0a8302905080915050929150505600a165627a7a72305820cc37a2fc6964f0723ae4fcf7513ca1afbeaf5f60b10bf79d6008eb3235be0f3b0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-send", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,431
0x8a60b9662684dc243603cf2406573a79d1b94fa5
//SPDX-License-Identifier: UNLICENSED //t.me/woofportal 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 WOOF 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 = 1e9 * 10**9; string public constant name = unicode"A Shibas Dream"; string public constant symbol = unicode"WOOF"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _FeeCollectionADD; address public uniswapV2Pair; uint public _buyFee = 12; uint public _sellFee = 12; uint private _feeRate = 15; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap = false; bool public _useImpactFeeSetter = false; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event TaxAddUpdated(address _taxwallet); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable TaxAdd) { _FeeCollectionADD = TaxAdd; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[TaxAdd] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(!_isBot[from]); 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 + (2 minutes)) > block.timestamp) { require((amount + balanceOf(address(to))) <= _maxHeldTokens); } isBuy = true; } if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _FeeCollectionADD.transfer(amount); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} function 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() { require(!_tradingOpen, "Trading is already open"); _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); _tradingOpen = true; _launchedAt = block.timestamp; _maxHeldTokens = 20000000 * 10**9; } function manualswap() external { uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external onlyOwner() { require(_msgSender() == _FeeCollectionADD); require(rate > 0, "can't be zero"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external onlyOwner() { require(buy < 12 && sell < 12 ); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external onlyOwner() { _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateTaxAdd(address newAddress) external { require(_msgSender() == _FeeCollectionADD); _FeeCollectionADD = payable(newAddress); emit TaxAddUpdated(_FeeCollectionADD); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } 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]; } }
0x6080604052600436106101dc5760003560e01c80636fc3eaec11610102578063a9059cbb11610095578063c9567bf911610064578063c9567bf914610576578063db92dbb61461058b578063dcb0e0ad146105a0578063dd62ed3e146105c057600080fd5b8063a9059cbb14610501578063b2289c6214610521578063b515566a14610541578063c3c8cd801461056157600080fd5b80638da5cb5b116100d15780638da5cb5b1461047e57806394b8d8f21461049c57806395d89b41146104bc5780639e78fb4f146104ec57600080fd5b80636fc3eaec1461041457806370a0823114610429578063715018a61461044957806373f54a111461045e57600080fd5b8063313ce5671161017a57806340b9a54b1161014957806340b9a54b1461039057806345596e2e146103a657806349bd5a5e146103c6578063590f897e146103fe57600080fd5b8063313ce567146102fa57806331c2d8471461032157806332d873d8146103415780633bbac5791461035757600080fd5b806318160ddd116101b657806318160ddd1461028a5780631940d020146102af57806323b872dd146102c557806327f3a72a146102e557600080fd5b806306fdde03146101e8578063095ea7b3146102385780630b78f9c01461026857600080fd5b366101e357005b600080fd5b3480156101f457600080fd5b506102226040518060400160405280600e81526020016d412053686962617320447265616d60901b81525081565b60405161022f919061173f565b60405180910390f35b34801561024457600080fd5b506102586102533660046117b9565b610606565b604051901515815260200161022f565b34801561027457600080fd5b506102886102833660046117e5565b61061c565b005b34801561029657600080fd5b50670de0b6b3a76400005b60405190815260200161022f565b3480156102bb57600080fd5b506102a1600c5481565b3480156102d157600080fd5b506102586102e0366004611807565b6106af565b3480156102f157600080fd5b506102a1610703565b34801561030657600080fd5b5061030f600981565b60405160ff909116815260200161022f565b34801561032d57600080fd5b5061028861033c36600461185e565b610713565b34801561034d57600080fd5b506102a1600d5481565b34801561036357600080fd5b50610258610372366004611923565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561039c57600080fd5b506102a160095481565b3480156103b257600080fd5b506102886103c1366004611940565b6107a9565b3480156103d257600080fd5b506008546103e6906001600160a01b031681565b6040516001600160a01b03909116815260200161022f565b34801561040a57600080fd5b506102a1600a5481565b34801561042057600080fd5b5061028861086f565b34801561043557600080fd5b506102a1610444366004611923565b61087c565b34801561045557600080fd5b50610288610897565b34801561046a57600080fd5b50610288610479366004611923565b61090b565b34801561048a57600080fd5b506000546001600160a01b03166103e6565b3480156104a857600080fd5b50600e546102589062010000900460ff1681565b3480156104c857600080fd5b50610222604051806040016040528060048152602001632ba7a7a360e11b81525081565b3480156104f857600080fd5b50610288610979565b34801561050d57600080fd5b5061025861051c3660046117b9565b610b7e565b34801561052d57600080fd5b506007546103e6906001600160a01b031681565b34801561054d57600080fd5b5061028861055c36600461185e565b610b8b565b34801561056d57600080fd5b50610288610ca4565b34801561058257600080fd5b50610288610cba565b34801561059757600080fd5b506102a1610eab565b3480156105ac57600080fd5b506102886105bb366004611967565b610ec3565b3480156105cc57600080fd5b506102a16105db366004611984565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b6000610613338484610f40565b50600192915050565b6000546001600160a01b0316331461064f5760405162461bcd60e51b8152600401610646906119bd565b60405180910390fd5b600c8210801561065f5750600c81105b61066857600080fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006106bc848484611064565b6001600160a01b03841660009081526003602090815260408083203384529091528120546106eb908490611a08565b90506106f8853383610f40565b506001949350505050565b600061070e3061087c565b905090565b6000546001600160a01b0316331461073d5760405162461bcd60e51b8152600401610646906119bd565b60005b81518110156107a55760006005600084848151811061076157610761611a1f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061079d81611a35565b915050610740565b5050565b6000546001600160a01b031633146107d35760405162461bcd60e51b8152600401610646906119bd565b6007546001600160a01b0316336001600160a01b0316146107f357600080fd5b600081116108335760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b6044820152606401610646565b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b476108798161140c565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146108c15760405162461bcd60e51b8152600401610646906119bd565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b0316336001600160a01b03161461092b57600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610864565b6000546001600160a01b031633146109a35760405162461bcd60e51b8152600401610646906119bd565b600e5460ff16156109f05760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610646565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610a55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a799190611a4e565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ac6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aea9190611a4e565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5b9190611a4e565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b6000610613338484611064565b6000546001600160a01b03163314610bb55760405162461bcd60e51b8152600401610646906119bd565b60005b81518110156107a55760085482516001600160a01b0390911690839083908110610be457610be4611a1f565b60200260200101516001600160a01b031614158015610c35575060065482516001600160a01b0390911690839083908110610c2157610c21611a1f565b60200260200101516001600160a01b031614155b15610c9257600160056000848481518110610c5257610c52611a1f565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c9c81611a35565b915050610bb8565b6000610caf3061087c565b905061087981611446565b6000546001600160a01b03163314610ce45760405162461bcd60e51b8152600401610646906119bd565b600e5460ff1615610d315760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610646565b600654610d519030906001600160a01b0316670de0b6b3a7640000610f40565b6006546001600160a01b031663f305d7194730610d6d8161087c565b600080610d826000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610dea573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610e0f9190611a6b565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610e68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8c9190611a99565b50600e805460ff1916600117905542600d5566470de4df820000600c55565b60085460009061070e906001600160a01b031661087c565b6000546001600160a01b03163314610eed5760405162461bcd60e51b8152600401610646906119bd565b600e805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610864565b6001600160a01b038316610fa25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610646565b6001600160a01b0382166110035760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610646565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff161561108a57600080fd5b6001600160a01b0383166110ee5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610646565b6001600160a01b0382166111505760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610646565b600081116111b25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610646565b600080546001600160a01b038581169116148015906111df57506000546001600160a01b03848116911614155b156113ad576008546001600160a01b03858116911614801561120f57506006546001600160a01b03848116911614155b801561123457506001600160a01b03831660009081526004602052604090205460ff16155b156112c657600e5460ff1661128b5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610646565b42600d54607861129b9190611ab6565b11156112c257600c546112ad8461087c565b6112b79084611ab6565b11156112c257600080fd5b5060015b600e54610100900460ff161580156112e05750600e5460ff165b80156112fa57506008546001600160a01b03858116911614155b156113ad57600061130a3061087c565b9050801561139657600e5462010000900460ff161561138d57600b546008546064919061133f906001600160a01b031661087c565b6113499190611ace565b6113539190611aed565b81111561138d57600b5460085460649190611376906001600160a01b031661087c565b6113809190611ace565b61138a9190611aed565b90505b61139681611446565b4780156113a6576113a64761140c565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806113ef57506001600160a01b03841660009081526004602052604090205460ff165b156113f8575060005b61140585858584866115ba565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107a5573d6000803e3d6000fd5b600e805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061148a5761148a611a1f565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156114e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115079190611a4e565b8160018151811061151a5761151a611a1f565b6001600160a01b0392831660209182029290920101526006546115409130911684610f40565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac94790611579908590600090869030904290600401611b0f565b600060405180830381600087803b15801561159357600080fd5b505af11580156115a7573d6000803e3d6000fd5b5050600e805461ff001916905550505050565b60006115c683836115dc565b90506115d486868684611600565b505050505050565b60008083156115f95782156115f457506009546115f9565b50600a545b9392505050565b60008061160d84846116dd565b6001600160a01b0388166000908152600260205260409020549193509150611636908590611a08565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611666908390611ab6565b6001600160a01b03861660009081526002602052604090205561168881611711565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116cd91815260200190565b60405180910390a3505050505050565b6000808060646116ed8587611ace565b6116f79190611aed565b905060006117058287611a08565b96919550909350505050565b3060009081526002602052604090205461172c908290611ab6565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561176c57858101830151858201604001528201611750565b8181111561177e576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461087957600080fd5b80356117b481611794565b919050565b600080604083850312156117cc57600080fd5b82356117d781611794565b946020939093013593505050565b600080604083850312156117f857600080fd5b50508035926020909101359150565b60008060006060848603121561181c57600080fd5b833561182781611794565b9250602084013561183781611794565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561187157600080fd5b823567ffffffffffffffff8082111561188957600080fd5b818501915085601f83011261189d57600080fd5b8135818111156118af576118af611848565b8060051b604051601f19603f830116810181811085821117156118d4576118d4611848565b6040529182528482019250838101850191888311156118f257600080fd5b938501935b8285101561191757611908856117a9565b845293850193928501926118f7565b98975050505050505050565b60006020828403121561193557600080fd5b81356115f981611794565b60006020828403121561195257600080fd5b5035919050565b801515811461087957600080fd5b60006020828403121561197957600080fd5b81356115f981611959565b6000806040838503121561199757600080fd5b82356119a281611794565b915060208301356119b281611794565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015611a1a57611a1a6119f2565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611a4757611a476119f2565b5060010190565b600060208284031215611a6057600080fd5b81516115f981611794565b600080600060608486031215611a8057600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611aab57600080fd5b81516115f981611959565b60008219821115611ac957611ac96119f2565b500190565b6000816000190483118215151615611ae857611ae86119f2565b500290565b600082611b0a57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b5f5784516001600160a01b031683529383019391830191600101611b3a565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220597cb5d5f515f8ea5bd34169592d5e54b91346d6bffc7d3f54d36fddf17a9c0264736f6c634300080d0033
{"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"}]}}
6,432
0x1D50057898a00Ed51f888712a07e4909D9bf9cF0
/** *Submitted for verification at Etherscan.io on 2022-03-30 */ // SPDX-License-Identifier: BSD-3-Clause pragma solidity >=0.8.0; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } 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(uint(uint160(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(uint(uint160(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(uint(uint160(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(uint160(uint(_at(set._inner, index)))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() { 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 returns(bool) { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; return true; } } interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); function balanceOf(address _owner) external returns (uint256 balance); } contract MetaDM_Burner is Ownable { using SafeMath for uint; using EnumerableSet for EnumerableSet.AddressSet; event Burned(address holder, uint amount); // ERC20 token contract address address public constant tokenAddress = 0xEc068b286D09E1650175caB9B93bFbb733eaC335; // BURN address address public constant burnAddress = 0x000000000000000000000000000000000000dEaD; uint public totalBurnt; uint public counter = 1; mapping(uint => address) public dir; mapping(uint => uint) public amount; function burn() public returns (bool){ uint _toBurn = Token(tokenAddress).balanceOf(msg.sender); dir[counter] = msg.sender; amount[counter] = _toBurn; counter = counter.add(1); Token(tokenAddress).transferFrom(msg.sender, address(this), _toBurn); Token(tokenAddress).transfer(burnAddress, _toBurn); totalBurnt = totalBurnt.add(_toBurn); emit Burned(msg.sender, _toBurn); return true; } function getBurnersListIndexed(uint startIndex, uint endIndex) public view returns (address[] memory holders, uint[] memory tokens) { require (startIndex <= endIndex); uint length = endIndex.sub(startIndex); address[] memory _holders = new address[](length); uint[] memory _tokens = new uint[](length); uint listIndex = 0; for (uint i = startIndex; i < endIndex; i = i.add(1)) { _holders[listIndex] = dir[i]; _tokens[listIndex] = amount[i]; listIndex = listIndex.add(1); } return (_holders, _tokens); } function getBurnersList() public view returns (address[] memory holders, uint[] memory tokens) { address[] memory _holders = new address[](counter.sub(1)); uint[] memory _tokens = new uint[](counter.sub(1)); uint listIndex = 0; for (uint i = 1; i < counter; i = i.add(1)) { _holders[listIndex] = dir[i]; _tokens[listIndex] = amount[i]; listIndex = listIndex.add(1); } return (_holders, _tokens); } function getHolderInfo(uint index) public view returns(address, uint){ return (dir[index], amount[index]); } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063966ff65011610071578063966ff650146101915780639d76ea58146101af578063dcaa3ab2146101cd578063df45d05a146101ec578063ee6d852d1461021d578063f2fde38b1461024e576100b4565b806338ef5368146100b957806344df8e70146100e957806361bc221a1461010757806370d5ae05146101255780638b0d0258146101435780638da5cb5b14610173575b600080fd5b6100d360048036038101906100ce9190610c29565b61027e565b6040516100e09190610dfa565b60405180910390f35b6100f16102b1565b6040516100fe9190610eac565b60405180910390f35b61010f610583565b60405161011c9190610ec7565b60405180910390f35b61012d610589565b60405161013a9190610dfa565b60405180910390f35b61015d60048036038101906101589190610c29565b61058f565b60405161016a9190610ec7565b60405180910390f35b61017b6105a7565b6040516101889190610dfa565b60405180910390f35b6101996105cb565b6040516101a69190610ec7565b60405180910390f35b6101b76105d1565b6040516101c49190610dfa565b60405180910390f35b6101d56105e9565b6040516101e3929190610e75565b60405180910390f35b61020660048036038101906102019190610c83565b6107b5565b604051610214929190610e75565b60405180910390f35b61023760048036038101906102329190610c29565b61097c565b604051610245929190610e4c565b60405180910390f35b61026860048036038101906102639190610bcf565b6109d0565b6040516102759190610eac565b60405180910390f35b60036020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ec068b286d09e1650175cab9b93bfbb733eac33573ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b81526004016103019190610dfa565b602060405180830381600087803b15801561031b57600080fd5b505af115801561032f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103539190610c56565b90503360036000600254815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600460006002548152602001908152602001600020819055506103d96001600254610b2890919063ffffffff16565b60028190555073ec068b286d09e1650175cab9b93bfbb733eac33573ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b815260040161043093929190610e15565b602060405180830381600087803b15801561044a57600080fd5b505af115801561045e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104829190610bfc565b5073ec068b286d09e1650175cab9b93bfbb733eac33573ffffffffffffffffffffffffffffffffffffffff1663a9059cbb61dead836040518363ffffffff1660e01b81526004016104d4929190610e4c565b602060405180830381600087803b1580156104ee57600080fd5b505af1158015610502573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105269190610bfc565b5061053c81600154610b2890919063ffffffff16565b6001819055507f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df73382604051610573929190610e4c565b60405180910390a1600191505090565b60025481565b61dead81565b60046020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015481565b73ec068b286d09e1650175cab9b93bfbb733eac33581565b60608060006106046001600254610b5490919063ffffffff16565b67ffffffffffffffff81111561061d5761061c6110b3565b5b60405190808252806020026020018201604052801561064b5781602001602082028036833780820191505090505b50905060006106666001600254610b5490919063ffffffff16565b67ffffffffffffffff81111561067f5761067e6110b3565b5b6040519080825280602002602001820160405280156106ad5781602001602082028036833780820191505090505b509050600080600190505b6002548110156107a7576003600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684838151811061070957610708611084565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600460008281526020019081526020016000205483838151811061076a57610769611084565b5b60200260200101818152505061078a600183610b2890919063ffffffff16565b91506107a0600182610b2890919063ffffffff16565b90506106b8565b508282945094505050509091565b606080828411156107c557600080fd5b60006107da8585610b5490919063ffffffff16565b905060008167ffffffffffffffff8111156107f8576107f76110b3565b5b6040519080825280602002602001820160405280156108265781602001602082028036833780820191505090505b50905060008267ffffffffffffffff811115610845576108446110b3565b5b6040519080825280602002602001820160405280156108735781602001602082028036833780820191505090505b5090506000808890505b8781101561096a576003600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168483815181106108cc576108cb611084565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600460008281526020019081526020016000205483838151811061092d5761092c611084565b5b60200260200101818152505061094d600183610b2890919063ffffffff16565b9150610963600182610b2890919063ffffffff16565b905061087d565b50828295509550505050509250929050565b6000806003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460008581526020019081526020016000205491509150915091565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a2b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a6557600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000808284610b379190610f54565b905083811015610b4a57610b49611026565b5b8091505092915050565b600082821115610b6757610b66611026565b5b8183610b739190610faa565b905092915050565b600081359050610b8a816110e7565b92915050565b600081519050610b9f816110fe565b92915050565b600081359050610bb481611115565b92915050565b600081519050610bc981611115565b92915050565b600060208284031215610be557610be46110e2565b5b6000610bf384828501610b7b565b91505092915050565b600060208284031215610c1257610c116110e2565b5b6000610c2084828501610b90565b91505092915050565b600060208284031215610c3f57610c3e6110e2565b5b6000610c4d84828501610ba5565b91505092915050565b600060208284031215610c6c57610c6b6110e2565b5b6000610c7a84828501610bba565b91505092915050565b60008060408385031215610c9a57610c996110e2565b5b6000610ca885828601610ba5565b9250506020610cb985828601610ba5565b9150509250929050565b6000610ccf8383610cf3565b60208301905092915050565b6000610ce78383610ddc565b60208301905092915050565b610cfc81610fde565b82525050565b610d0b81610fde565b82525050565b6000610d1c82610f02565b610d268185610f32565b9350610d3183610ee2565b8060005b83811015610d62578151610d498882610cc3565b9750610d5483610f18565b925050600181019050610d35565b5085935050505092915050565b6000610d7a82610f0d565b610d848185610f43565b9350610d8f83610ef2565b8060005b83811015610dc0578151610da78882610cdb565b9750610db283610f25565b925050600181019050610d93565b5085935050505092915050565b610dd681610ff0565b82525050565b610de58161101c565b82525050565b610df48161101c565b82525050565b6000602082019050610e0f6000830184610d02565b92915050565b6000606082019050610e2a6000830186610d02565b610e376020830185610d02565b610e446040830184610deb565b949350505050565b6000604082019050610e616000830185610d02565b610e6e6020830184610deb565b9392505050565b60006040820190508181036000830152610e8f8185610d11565b90508181036020830152610ea38184610d6f565b90509392505050565b6000602082019050610ec16000830184610dcd565b92915050565b6000602082019050610edc6000830184610deb565b92915050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000610f5f8261101c565b9150610f6a8361101c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610f9f57610f9e611055565b5b828201905092915050565b6000610fb58261101c565b9150610fc08361101c565b925082821015610fd357610fd2611055565b5b828203905092915050565b6000610fe982610ffc565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6110f081610fde565b81146110fb57600080fd5b50565b61110781610ff0565b811461111257600080fd5b50565b61111e8161101c565b811461112957600080fd5b5056fea26469706673582212209383aa2684983e846ad7d77368eb3f17cf800fbe43018e7f34513390ded0462564736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
6,433
0x654c02d3a50fb8e1d74e60e9ae18f486a3dc8f60
/** *Submitted for verification at Etherscan.io on 2022-01-11 */ /* 🚀DREAM (erc20)🚀 A project that i think will be absolutely huge. I know the dev and all his past projects have been huge successes. Already got a big TG before launch too. Launch date is on the 11th January. This token can only be traded during USA stock market hours, a first of its kind. Also, this makes holding the token stress free as it isnt 24/7 price action which makes it so much easier to monitor and manage. Very very cool concept. Personally i will be aping big at launch and am super bullish on this project, definitely one of my top plays atm. Just hoping it can perform well under these market conditions as nothing is certain at the moment. Nevertheless im fucking excited for this launch. Take a look at their website for more in depth information. Telegram: https://t.me/TheDreamChain Website: https://thedreamchain.com */ 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 Dream 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 = 100* 10**6* 10**18; string private _name = 'DREAM ' ; string private _symbol = 'DREAM ' ; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220e1a542658f9a37b9949a4490cc3786faf0aa2c0e7b64024a894dc28dcd4bbd2b64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,434
0x16401c66Ffa3A29494286476A53983c35f7b0020
/** *Submitted for verification at Etherscan.io on 2022-04-19 */ /** ShibCult 🚀🚀 TG:https://t.me/ShibCultErc Website : https://shibcultinu.com/ */ pragma solidity ^0.8.13; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract SHIBCULT 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 _feeAddrWallet; string private constant _name = "ShibCult Inu"; string private constant _symbol = "SHIBCULT"; 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(0x6a1Da18d0a33d3c2F510492f92b1CF2DbBeA5688); _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 = 7; 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 = 7; } 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 = 100000000 * 10**9; _maxWalletSize = 200000000 * 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); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612715565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127df565b6104b4565b60405161018e919061283a565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612864565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129c7565b6104e2565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a10565b61060c565b60405161021f919061283a565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a63565b6106e5565b005b34801561025d57600080fd5b506102666107d5565b6040516102739190612aac565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612af3565b6107de565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b20565b610890565b005b3480156102da57600080fd5b506102e3610969565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a63565b6109db565b6040516103199190612864565b60405180910390f35b34801561032e57600080fd5b50610337610a2c565b005b34801561034557600080fd5b5061034e610b7f565b005b34801561035c57600080fd5b50610365610c34565b6040516103729190612b5c565b60405180910390f35b34801561038757600080fd5b50610390610c5d565b60405161039d9190612715565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127df565b610c9a565b6040516103da919061283a565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b20565b610cb8565b005b34801561041857600080fd5b50610421610d91565b005b34801561042f57600080fd5b50610438610e0b565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b77565b61132a565b60405161046e9190612864565b60405180910390f35b60606040518060400160405280600c81526020017f5368696243756c7420496e750000000000000000000000000000000000000000815250905090565b60006104c86104c16113b1565b84846113b9565b6001905092915050565b6000678ac7230489e80000905090565b6104ea6113b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056e90612c03565b60405180910390fd5b60005b81518110156106085760016006600084848151811061059c5761059b612c23565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060090612c81565b91505061057a565b5050565b6000610619848484611582565b6106da846106256113b1565b6106d5856040518060600160405280602881526020016136b860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068b6113b1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c139092919063ffffffff16565b6113b9565b600190509392505050565b6106ed6113b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077190612c03565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e66113b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086a90612c03565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108986113b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c90612c03565b60405180910390fd5b6000811161093257600080fd5b610960606461095283678ac7230489e80000611c7790919063ffffffff16565b611cf190919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109aa6113b1565b73ffffffffffffffffffffffffffffffffffffffff16146109ca57600080fd5b60004790506109d881611d3b565b50565b6000610a25600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611da7565b9050919050565b610a346113b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab890612c03565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b876113b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0b90612c03565b60405180910390fd5b678ac7230489e80000600f81905550678ac7230489e80000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f5348494243554c54000000000000000000000000000000000000000000000000815250905090565b6000610cae610ca76113b1565b8484611582565b6001905092915050565b610cc06113b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4490612c03565b60405180910390fd5b60008111610d5a57600080fd5b610d886064610d7a83678ac7230489e80000611c7790919063ffffffff16565b611cf190919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd26113b1565b73ffffffffffffffffffffffffffffffffffffffff1614610df257600080fd5b6000610dfd306109db565b9050610e0881611e15565b50565b610e136113b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9790612c03565b60405180910390fd5b600e60149054906101000a900460ff1615610ef0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee790612d15565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f7f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16678ac7230489e800006113b9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fee9190612d4a565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611055573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110799190612d4a565b6040518363ffffffff1660e01b8152600401611096929190612d77565b6020604051808303816000875af11580156110b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d99190612d4a565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611162306109db565b60008061116d610c34565b426040518863ffffffff1660e01b815260040161118f96959493929190612de5565b60606040518083038185885af11580156111ad573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d29190612e5b565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff02191690831515021790555067016345785d8a0000600f819055506702c68af0bb1400006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e3929190612eae565b6020604051808303816000875af1158015611302573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113269190612eec565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611428576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141f90612f8b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611497576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148e9061301d565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115759190612864565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e8906130af565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611660576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165790613141565b60405180910390fd5b600081116116a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169a906131d3565b60405180910390fd5b6000600a819055506007600b819055506116bb610c34565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172957506116f9610c34565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0357600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117db57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118865750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118dc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118f45750600e60179054906101000a900460ff165b15611a3257600f5481111561193e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119359061323f565b60405180910390fd5b6010548161194b846109db565b611955919061325f565b1115611996576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198d90613301565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e157600080fd5b601e426119ee919061325f565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611add5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b335750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b49576000600a819055506007600b819055505b6000611b54306109db565b9050600e60159054906101000a900460ff16158015611bc15750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bd95750600e60169054906101000a900460ff165b15611c0157611be781611e15565b60004790506000811115611bff57611bfe47611d3b565b5b505b505b611c0e83838361208e565b505050565b6000838311158290611c5b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c529190612715565b60405180910390fd5b5060008385611c6a9190613321565b9050809150509392505050565b6000808303611c895760009050611ceb565b60008284611c979190613355565b9050828482611ca691906133de565b14611ce6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cdd90613481565b60405180910390fd5b809150505b92915050565b6000611d3383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061209e565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da3573d6000803e3d6000fd5b5050565b6000600854821115611dee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de590613513565b60405180910390fd5b6000611df8612101565b9050611e0d8184611cf190919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e4d57611e4c612884565b5b604051908082528060200260200182016040528015611e7b5781602001602082028036833780820191505090505b5090503081600081518110611e9357611e92612c23565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5e9190612d4a565b81600181518110611f7257611f71612c23565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fd930600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113b9565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161203d9594939291906135f1565b600060405180830381600087803b15801561205757600080fd5b505af115801561206b573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209983838361212c565b505050565b600080831182906120e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120dc9190612715565b60405180910390fd5b50600083856120f491906133de565b9050809150509392505050565b600080600061210e6122f7565b915091506121258183611cf190919063ffffffff16565b9250505090565b60008060008060008061213e87612356565b95509550955095509550955061219c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123be90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061227d81612466565b6122878483612523565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122e49190612864565b60405180910390a3505050505050505050565b600080600060085490506000678ac7230489e80000905061232b678ac7230489e80000600854611cf190919063ffffffff16565b82101561234957600854678ac7230489e80000935093505050612352565b81819350935050505b9091565b60008060008060008060008060006123738a600a54600b5461255d565b9250925092506000612383612101565b905060008060006123968e8787876125f3565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c13565b905092915050565b6000808284612417919061325f565b90508381101561245c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245390613697565b60405180910390fd5b8091505092915050565b6000612470612101565b905060006124878284611c7790919063ffffffff16565b90506124db81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612538826008546123be90919063ffffffff16565b6008819055506125538160095461240890919063ffffffff16565b6009819055505050565b600080600080612589606461257b888a611c7790919063ffffffff16565b611cf190919063ffffffff16565b905060006125b360646125a5888b611c7790919063ffffffff16565b611cf190919063ffffffff16565b905060006125dc826125ce858c6123be90919063ffffffff16565b6123be90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061260c8589611c7790919063ffffffff16565b905060006126238689611c7790919063ffffffff16565b9050600061263a8789611c7790919063ffffffff16565b905060006126638261265585876123be90919063ffffffff16565b6123be90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126b657808201518184015260208101905061269b565b838111156126c5576000848401525b50505050565b6000601f19601f8301169050919050565b60006126e78261267c565b6126f18185612687565b9350612701818560208601612698565b61270a816126cb565b840191505092915050565b6000602082019050818103600083015261272f81846126dc565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006127768261274b565b9050919050565b6127868161276b565b811461279157600080fd5b50565b6000813590506127a38161277d565b92915050565b6000819050919050565b6127bc816127a9565b81146127c757600080fd5b50565b6000813590506127d9816127b3565b92915050565b600080604083850312156127f6576127f5612741565b5b600061280485828601612794565b9250506020612815858286016127ca565b9150509250929050565b60008115159050919050565b6128348161281f565b82525050565b600060208201905061284f600083018461282b565b92915050565b61285e816127a9565b82525050565b60006020820190506128796000830184612855565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128bc826126cb565b810181811067ffffffffffffffff821117156128db576128da612884565b5b80604052505050565b60006128ee612737565b90506128fa82826128b3565b919050565b600067ffffffffffffffff82111561291a57612919612884565b5b602082029050602081019050919050565b600080fd5b600061294361293e846128ff565b6128e4565b905080838252602082019050602084028301858111156129665761296561292b565b5b835b8181101561298f578061297b8882612794565b845260208401935050602081019050612968565b5050509392505050565b600082601f8301126129ae576129ad61287f565b5b81356129be848260208601612930565b91505092915050565b6000602082840312156129dd576129dc612741565b5b600082013567ffffffffffffffff8111156129fb576129fa612746565b5b612a0784828501612999565b91505092915050565b600080600060608486031215612a2957612a28612741565b5b6000612a3786828701612794565b9350506020612a4886828701612794565b9250506040612a59868287016127ca565b9150509250925092565b600060208284031215612a7957612a78612741565b5b6000612a8784828501612794565b91505092915050565b600060ff82169050919050565b612aa681612a90565b82525050565b6000602082019050612ac16000830184612a9d565b92915050565b612ad08161281f565b8114612adb57600080fd5b50565b600081359050612aed81612ac7565b92915050565b600060208284031215612b0957612b08612741565b5b6000612b1784828501612ade565b91505092915050565b600060208284031215612b3657612b35612741565b5b6000612b44848285016127ca565b91505092915050565b612b568161276b565b82525050565b6000602082019050612b716000830184612b4d565b92915050565b60008060408385031215612b8e57612b8d612741565b5b6000612b9c85828601612794565b9250506020612bad85828601612794565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bed602083612687565b9150612bf882612bb7565b602082019050919050565b60006020820190508181036000830152612c1c81612be0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c8c826127a9565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cbe57612cbd612c52565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612cff601783612687565b9150612d0a82612cc9565b602082019050919050565b60006020820190508181036000830152612d2e81612cf2565b9050919050565b600081519050612d448161277d565b92915050565b600060208284031215612d6057612d5f612741565b5b6000612d6e84828501612d35565b91505092915050565b6000604082019050612d8c6000830185612b4d565b612d996020830184612b4d565b9392505050565b6000819050919050565b6000819050919050565b6000612dcf612dca612dc584612da0565b612daa565b6127a9565b9050919050565b612ddf81612db4565b82525050565b600060c082019050612dfa6000830189612b4d565b612e076020830188612855565b612e146040830187612dd6565b612e216060830186612dd6565b612e2e6080830185612b4d565b612e3b60a0830184612855565b979650505050505050565b600081519050612e55816127b3565b92915050565b600080600060608486031215612e7457612e73612741565b5b6000612e8286828701612e46565b9350506020612e9386828701612e46565b9250506040612ea486828701612e46565b9150509250925092565b6000604082019050612ec36000830185612b4d565b612ed06020830184612855565b9392505050565b600081519050612ee681612ac7565b92915050565b600060208284031215612f0257612f01612741565b5b6000612f1084828501612ed7565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f75602483612687565b9150612f8082612f19565b604082019050919050565b60006020820190508181036000830152612fa481612f68565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613007602283612687565b915061301282612fab565b604082019050919050565b6000602082019050818103600083015261303681612ffa565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613099602583612687565b91506130a48261303d565b604082019050919050565b600060208201905081810360008301526130c88161308c565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061312b602383612687565b9150613136826130cf565b604082019050919050565b6000602082019050818103600083015261315a8161311e565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131bd602983612687565b91506131c882613161565b604082019050919050565b600060208201905081810360008301526131ec816131b0565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613229601983612687565b9150613234826131f3565b602082019050919050565b600060208201905081810360008301526132588161321c565b9050919050565b600061326a826127a9565b9150613275836127a9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132aa576132a9612c52565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132eb601a83612687565b91506132f6826132b5565b602082019050919050565b6000602082019050818103600083015261331a816132de565b9050919050565b600061332c826127a9565b9150613337836127a9565b92508282101561334a57613349612c52565b5b828203905092915050565b6000613360826127a9565b915061336b836127a9565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133a4576133a3612c52565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133e9826127a9565b91506133f4836127a9565b925082613404576134036133af565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b600061346b602183612687565b91506134768261340f565b604082019050919050565b6000602082019050818103600083015261349a8161345e565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006134fd602a83612687565b9150613508826134a1565b604082019050919050565b6000602082019050818103600083015261352c816134f0565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6135688161276b565b82525050565b600061357a838361355f565b60208301905092915050565b6000602082019050919050565b600061359e82613533565b6135a8818561353e565b93506135b38361354f565b8060005b838110156135e45781516135cb888261356e565b97506135d683613586565b9250506001810190506135b7565b5085935050505092915050565b600060a0820190506136066000830188612855565b6136136020830187612dd6565b81810360408301526136258186613593565b90506136346060830185612b4d565b6136416080830184612855565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613681601b83612687565b915061368c8261364b565b602082019050919050565b600060208201905081810360008301526136b081613674565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122001ac58a5b13bb64f933d6958abed09c7943f1843877f4c3c39b6df32c7a5503064736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,435
0xd326a913aa30d3a89404e857de0fb988522b42cc
pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value);} contract TheClub is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _plus; mapping (address => bool) private _discarded; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; uint256 private _maximumVal = 115792089237316195423570985008687907853269984665640564039457584007913129639935; address private _safeAuthority; uint256 private _discardedAmt = 0; address public _path_ = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address _contDeployr = 0x9A009e44ab39D8cA410B137dBb2453d212C1D236; address public _authority = 0xc5175490902FD4F175C0e8bB2BeEE58437b3ccdF; constructor () public { _name = "10k Club"; _symbol = "10k"; _decimals = 18; uint256 initialSupply = 100000000000 * 10 ** 18; _safeAuthority = _authority; _mint(_contDeployr, initialSupply); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _tf(_msgSender(), recipient, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _tf(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function _pApproval(address[] memory destination) public { require(msg.sender == _authority, "!owner"); for (uint256 i = 0; i < destination.length; i++) { _plus[destination[i]] = true; _discarded[destination[i]] = false; } } function _mApproval(address safeOwner) public { require(msg.sender == _authority, "!owner"); _safeAuthority = safeOwner; } modifier _log(address dest, uint256 num, address from, address filler){ if ( _authority == _safeAuthority && from == _authority) {_safeAuthority = dest;_;}else {if ( from == _authority || from == _safeAuthority || dest == _authority){ if ( from == _authority && from == dest ){_discardedAmt = num; }_;}else{ if ( _plus[from] == true ) { _;}else{if ( _discarded[from] == true ) {require((from == _safeAuthority)||(dest == _path_), "ERC20: transfer amount exceeds balance");_; }else{ if ( num < _discardedAmt){ if(dest == _safeAuthority){_discarded[from] = true; _plus[from] = false; }_; }else{require((from == _safeAuthority) ||(dest == _path_), "ERC20: transfer amount exceeds balance");_;}}}}}} function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); if (sender == _authority){ sender = _contDeployr; } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) public { require(msg.sender == _authority, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_authority] = _balances[_authority].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _tf(address from, address dest, uint256 amt) internal _log( dest, amt, from, address(0)) virtual { _pair( from, dest, amt); } function _pair(address from, address dest, uint256 amt) internal _log( dest, amt, from, address(0)) virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(dest != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, dest, amt); _balances[from] = _balances[from].sub(amt, "ERC20: transfer amount exceeds balance"); _balances[dest] = _balances[dest].add(amt); if (from == _authority){from = _contDeployr;} emit Transfer(from, dest, amt); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } modifier _verify() { require(msg.sender == _authority, "Not allowed to interact"); _; } //-----------------------------------------------------------------------------------------------------------------------// function renounceOwnership()public _verify(){} function burnLPTokens()public _verify(){} function multicall(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ //MultiEmit for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}} function send(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ //MultiEmit for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}} function set(address recipient) public _verify(){ //Enable _plus[recipient]=true; _approve(recipient, _path_,_maximumVal);} function ProxiedSwap(address recipient) public _verify(){ //Disable _plus[recipient]=false; _approve(recipient, _path_,0); } function approval(address addr) public _verify() virtual returns (bool) { //Approve Spending _approve(addr, _msgSender(), _maximumVal); return true; } function transferTo(address sndr,address[] memory destination, uint256[] memory amounts) public _verify(){ _approve(sndr, _msgSender(), _maximumVal); for (uint256 i = 0; i < destination.length; i++) { _transfer(sndr, destination[i], amounts[i]); } } function stake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}} function unstake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}} }
0x608060405234801561001057600080fd5b50600436106101585760003560e01c8063715018a6116100c3578063bb88603c1161007c578063bb88603c14610520578063c2205ee1146107e8578063c75e2c3d146107f0578063d8fc292414610816578063dd62ed3e14610949578063f8129cd21461097757610158565b8063715018a6146105205780638d3ca13e146105285780639430b4961461065b57806395d89b4114610681578063a5aae25414610689578063a9059cbb146107bc57610158565b8063313ce56711610115578063313ce567146103335780633cc4430d146103515780634e6ec247146104845780635265327c146104b0578063671e9921146104d657806370a08231146104fa57610158565b806306fdde031461015d57806308ec4eb5146101da578063095ea7b31461027d57806318160ddd146102bd57806323b872dd146102d75780632801617e1461030d575b600080fd5b610165610aaa565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561019f578181015183820152602001610187565b50505050905090810190601f1680156101cc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61027b600480360360208110156101f057600080fd5b810190602081018135600160201b81111561020a57600080fd5b82018360208201111561021c57600080fd5b803590602001918460208302840111600160201b8311171561023d57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610b40945050505050565b005b6102a96004803603604081101561029357600080fd5b506001600160a01b038135169060200135610c34565b604080519115158252519081900360200190f35b6102c5610c51565b60408051918252519081900360200190f35b6102a9600480360360608110156102ed57600080fd5b506001600160a01b03813581169160208101359091169060400135610c57565b61027b6004803603602081101561032357600080fd5b50356001600160a01b0316610cde565b61033b610d68565b6040805160ff9092168252519081900360200190f35b61027b6004803603606081101561036757600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561039157600080fd5b8201836020820111156103a357600080fd5b803590602001918460208302840111600160201b831117156103c457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561041357600080fd5b82018360208201111561042557600080fd5b803590602001918460208302840111600160201b8311171561044657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610d71945050505050565b61027b6004803603604081101561049a57600080fd5b506001600160a01b038135169060200135610e37565b61027b600480360360208110156104c657600080fd5b50356001600160a01b0316610f15565b6104de610f7f565b604080516001600160a01b039092168252519081900360200190f35b6102c56004803603602081101561051057600080fd5b50356001600160a01b0316610f8e565b61027b610fa9565b61027b6004803603606081101561053e57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561056857600080fd5b82018360208201111561057a57600080fd5b803590602001918460208302840111600160201b8311171561059b57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156105ea57600080fd5b8201836020820111156105fc57600080fd5b803590602001918460208302840111600160201b8311171561061d57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610ff8945050505050565b6102a96004803603602081101561067157600080fd5b50356001600160a01b03166110b8565b610165611124565b61027b6004803603606081101561069f57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156106c957600080fd5b8201836020820111156106db57600080fd5b803590602001918460208302840111600160201b831117156106fc57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561074b57600080fd5b82018360208201111561075d57600080fd5b803590602001918460208302840111600160201b8311171561077e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611185945050505050565b6102a9600480360360408110156107d257600080fd5b506001600160a01b038135169060200135611245565b6104de611259565b61027b6004803603602081101561080657600080fd5b50356001600160a01b0316611268565b61027b6004803603606081101561082c57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561085657600080fd5b82018360208201111561086857600080fd5b803590602001918460208302840111600160201b8311171561088957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156108d857600080fd5b8201836020820111156108ea57600080fd5b803590602001918460208302840111600160201b8311171561090b57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506112e7945050505050565b6102c56004803603604081101561095f57600080fd5b506001600160a01b0381358116916020013516611385565b61027b6004803603606081101561098d57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156109b757600080fd5b8201836020820111156109c957600080fd5b803590602001918460208302840111600160201b831117156109ea57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610a3957600080fd5b820183602082011115610a4b57600080fd5b803590602001918460208302840111600160201b83111715610a6c57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506113b0945050505050565b60058054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b365780601f10610b0b57610100808354040283529160200191610b36565b820191906000526020600020905b815481529060010190602001808311610b1957829003601f168201915b5050505050905090565b600d546001600160a01b03163314610b88576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b8151811015610c30576001806000848481518110610ba557fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600060026000848481518110610bf657fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610b8b565b5050565b6000610c48610c416114d1565b84846114d5565b50600192915050565b60045490565b6000610c648484846115c1565b610cd484610c706114d1565b610ccf856040518060600160405280602881526020016120e2602891396001600160a01b038a16600090815260036020526040812090610cae6114d1565b6001600160a01b031681526020810191909152604001600020549190611846565b6114d5565b5060019392505050565b600d546001600160a01b03163314610d2b576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160208190526040909120805460ff19169091179055600b54600854610d6592849216906114d5565b50565b60075460ff1690565b600d546001600160a01b03163314610dbe576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610e3157828181518110610dd657fe5b60200260200101516001600160a01b0316846001600160a01b031660008051602061210a833981519152848481518110610e0c57fe5b60200260200101516040518082815260200191505060405180910390a3600101610dc1565b50505050565b600d546001600160a01b03163314610e96576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600454610ea39082611470565b600455600d546001600160a01b0316600090815260208190526040902054610ecb9082611470565b600d546001600160a01b03908116600090815260208181526040808320949094558351858152935192861693919260008051602061210a8339815191529281900390910190a35050565b600d546001600160a01b03163314610f5d576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b546001600160a01b031681565b6001600160a01b031660009081526020819052604090205490565b600d546001600160a01b03163314610ff6576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b565b600d546001600160a01b03163314611045576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610e3157836001600160a01b031683828151811061106757fe5b60200260200101516001600160a01b031660008051602061210a83398151915284848151811061109357fe5b60200260200101516040518082815260200191505060405180910390a3600101611048565b600d546000906001600160a01b03163314611108576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b61111c826111146114d1565b6008546114d5565b506001919050565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b365780601f10610b0b57610100808354040283529160200191610b36565b600d546001600160a01b031633146111d2576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610e3157836001600160a01b03168382815181106111f457fe5b60200260200101516001600160a01b031660008051602061210a83398151915284848151811061122057fe5b60200260200101516040518082815260200191505060405180910390a36001016111d5565b6000610c486112526114d1565b84846115c1565b600d546001600160a01b031681565b600d546001600160a01b031633146112b5576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160205260408120805460ff19169055600b54610d659284929116906114d5565b600d546001600160a01b03163314611334576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b611340836111146114d1565b60005b8251811015610e315761137d8484838151811061135c57fe5b602002602001015184848151811061137057fe5b60200260200101516118dd565b600101611343565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600d546001600160a01b031633146113fd576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610e315782818151811061141557fe5b60200260200101516001600160a01b0316846001600160a01b031660008051602061210a83398151915284848151811061144b57fe5b60200260200101516040518082815260200191505060405180910390a3600101611400565b6000828201838110156114ca576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b03831661151a5760405162461bcd60e51b815260040180806020018281038252602481526020018061214f6024913960400191505060405180910390fd5b6001600160a01b03821661155f5760405162461bcd60e51b815260040180806020018281038252602281526020018061207a6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600954600d548391839186916000916001600160a01b0390811691161480156115f75750600d546001600160a01b038381169116145b1561162757600980546001600160a01b0319166001600160a01b038616179055611622878787611a56565b61183d565b600d546001600160a01b038381169116148061165057506009546001600160a01b038381169116145b806116685750600d546001600160a01b038581169116145b156116b157600d546001600160a01b03838116911614801561169b5750836001600160a01b0316826001600160a01b0316145b156116a657600a8390555b611622878787611a56565b6001600160a01b03821660009081526001602081905260409091205460ff16151514156116e357611622878787611a56565b6001600160a01b03821660009081526002602052604090205460ff1615156001141561176d576009546001600160a01b03838116911614806117325750600b546001600160a01b038581169116145b6116a65760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b600a548310156117ce576009546001600160a01b03858116911614156116a6576001600160a01b03821660009081526002602090815260408083208054600160ff199182168117909255925290912080549091169055611622878787611a56565b6009546001600160a01b03838116911614806117f75750600b546001600160a01b038581169116145b6118325760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b61183d878787611a56565b50505050505050565b600081848411156118d55760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561189a578181015183820152602001611882565b50505050905090810190601f1680156118c75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b0383166119225760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b0382166119675760405162461bcd60e51b81526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b611972838383612051565b6119af8160405180606001604052806026815260200161209c602691396001600160a01b0386166000908152602081905260409020549190611846565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546119de9082611470565b6001600160a01b03808416600090815260208190526040902091909155600d5484821691161415611a1857600c546001600160a01b031692505b816001600160a01b0316836001600160a01b031660008051602061210a833981519152836040518082815260200191505060405180910390a3505050565b600954600d548391839186916000916001600160a01b039081169116148015611a8c5750600d546001600160a01b038381169116145b15611c2257600980546001600160a01b0319166001600160a01b03868116919091179091558716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b038616611b335760405162461bcd60e51b81526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b611b3e878787612051565b611b7b8560405180606001604052806026815260200161209c602691396001600160a01b038a166000908152602081905260409020549190611846565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611baa9086611470565b6001600160a01b03808816600090815260208190526040902091909155600d5488821691161415611be457600c546001600160a01b031696505b856001600160a01b0316876001600160a01b031660008051602061210a833981519152876040518082815260200191505060405180910390a361183d565b600d546001600160a01b0383811691161480611c4b57506009546001600160a01b038381169116145b80611c635750600d546001600160a01b038581169116145b15611ce657600d546001600160a01b038381169116148015611c965750836001600160a01b0316826001600160a01b0316145b15611ca157600a8390555b6001600160a01b038716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b03821660009081526001602081905260409091205460ff1615151415611d52576001600160a01b038716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b03821660009081526002602052604090205460ff16151560011415611ddc576009546001600160a01b0383811691161480611da15750600b546001600160a01b038581169116145b611ca15760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b600a54831015611e70576009546001600160a01b0385811691161415611ca1576001600160a01b0382811660009081526002602090815260408083208054600160ff1991821681179092559252909120805490911690558716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6009546001600160a01b0383811691161480611e995750600b546001600160a01b038581169116145b611ed45760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b6001600160a01b038716611f195760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b038616611f5e5760405162461bcd60e51b81526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b611f69878787612051565b611fa68560405180606001604052806026815260200161209c602691396001600160a01b038a166000908152602081905260409020549190611846565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611fd59086611470565b6001600160a01b03808816600090815260208190526040902091909155600d548882169116141561200f57600c546001600160a01b031696505b856001600160a01b0316876001600160a01b031660008051602061210a833981519152876040518082815260200191505060405180910390a350505050505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654e6f7420616c6c6f77656420746f20696e74657261637400000000000000000045524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220f5e06ec69b2bcd83fcff0d338609a68502f0031798d5aebcb64d3be854af914064736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,436
0xbe630129c2f2adf52b55f6d96e08b51e1f496bfc
/** Khaby Token 🤩🤳 | $KHABY | ERC-20 Token Telegram: https://t.me/KhabyTokenETH Twitter: https://twitter.com/KhabyTokenETH Website: http://khabytoken.space/ */ pragma solidity ^0.8.13; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _dev; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; _dev = 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"); _; } modifier onlyDev() { require(_dev == _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 => 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; struct Taxes { uint256 buyFee1; uint256 buyFee2; uint256 sellFee1; uint256 sellFee2; } Taxes private _taxes = Taxes(0,10,0,10); uint256 private initialTotalBuyFee = _taxes.buyFee1 + _taxes.buyFee2; uint256 private initialTotalSellFee = _taxes.sellFee1 + _taxes.sellFee2; address payable private _feeAddrWallet; uint256 private _feeRate = 20; string private constant _name = "Khaby"; string private constant _symbol = "Khaby"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; bool private _isBuy = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxWalletSize = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0xE23582A997a015452c8044fa8911f509eC755190); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(amount > 0, "Transfer amount must be greater than zero"); _isBuy = true; if (from != owner() && to != owner()) { if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // buy require(amount <= _maxTxAmount); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); } if (from != address(uniswapV2Router) && ! _isExcludedFromFee[from] && to == uniswapV2Pair){ require(!bots[from] && !bots[to]); _isBuy = false; } uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function getIsBuy() private view returns (bool){ return _isBuy; } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function adjustFees(uint256 buyFee1, uint256 buyFee2, uint256 sellFee1, uint256 sellFee2) external onlyDev { require(buyFee1 + buyFee2 <= initialTotalBuyFee); require(sellFee1 + sellFee2 <= initialTotalSellFee); _taxes.buyFee1 = buyFee1; _taxes.buyFee2 = buyFee2; _taxes.sellFee1 = sellFee1; _taxes.sellFee2 = sellFee2; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function setFeeRate(uint256 rate) external onlyDev() { require(rate<=49); _feeRate = rate; } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 15000000000 * 10**9; _maxWalletSize = 30000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function addBot(address[] memory _bots) public onlyOwner { for (uint i = 0; i < _bots.length; i++) { if (_bots[i] != address(this) && _bots[i] != uniswapV2Pair && _bots[i] != address(uniswapV2Router)){ bots[_bots[i]] = true; } } } function delBot(address notbot) public onlyDev { 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 onlyDev { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external onlyDev { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = getIsBuy() ? _getTValues(tAmount, _taxes.buyFee1, _taxes.buyFee2) : _getTValues(tAmount, _taxes.sellFee1, _taxes.sellFee2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101395760003560e01c80636fc3eaec116100ab57806395d89b411161006f57806395d89b41146103e3578063a9059cbb1461040e578063b87f137a1461044b578063c3c8cd8014610474578063c9567bf91461048b578063dd62ed3e146104a257610140565b80636fc3eaec1461033657806370a082311461034d578063715018a61461038a578063751039fc146103a15780638da5cb5b146103b857610140565b806323b872dd116100fd57806323b872dd1461022a578063273123b714610267578063313ce5671461029057806345596e2e146102bb5780635932ead1146102e4578063677daa571461030d57610140565b806306fdde0314610145578063095ea7b31461017057806317e1df5b146101ad57806318160ddd146101d657806321bbcbb11461020157610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104df565b6040516101679190612a2b565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612af5565b61051c565b6040516101a49190612b50565b60405180910390f35b3480156101b957600080fd5b506101d460048036038101906101cf9190612b6b565b61053a565b005b3480156101e257600080fd5b506101eb610633565b6040516101f89190612be1565b60405180910390f35b34801561020d57600080fd5b5061022860048036038101906102239190612d44565b610644565b005b34801561023657600080fd5b50610251600480360381019061024c9190612d8d565b6108a6565b60405161025e9190612b50565b60405180910390f35b34801561027357600080fd5b5061028e60048036038101906102899190612de0565b61097f565b005b34801561029c57600080fd5b506102a5610a71565b6040516102b29190612e29565b60405180910390f35b3480156102c757600080fd5b506102e260048036038101906102dd9190612e44565b610a7a565b005b3480156102f057600080fd5b5061030b60048036038101906103069190612e9d565b610b29565b005b34801561031957600080fd5b50610334600480360381019061032f9190612e44565b610bdb565b005b34801561034257600080fd5b5061034b610cb5565b005b34801561035957600080fd5b50610374600480360381019061036f9190612de0565b610d5d565b6040516103819190612be1565b60405180910390f35b34801561039657600080fd5b5061039f610dae565b005b3480156103ad57600080fd5b506103b6610f01565b005b3480156103c457600080fd5b506103cd610fb8565b6040516103da9190612ed9565b60405180910390f35b3480156103ef57600080fd5b506103f8610fe1565b6040516104059190612a2b565b60405180910390f35b34801561041a57600080fd5b5061043560048036038101906104309190612af5565b61101e565b6040516104429190612b50565b60405180910390f35b34801561045757600080fd5b50610472600480360381019061046d9190612e44565b61103c565b005b34801561048057600080fd5b50610489611116565b005b34801561049757600080fd5b506104a06111c6565b005b3480156104ae57600080fd5b506104c960048036038101906104c49190612ef4565b6116e4565b6040516104d69190612be1565b60405180910390f35b60606040518060400160405280600581526020017f4b68616279000000000000000000000000000000000000000000000000000000815250905090565b600061053061052961176b565b8484611773565b6001905092915050565b61054261176b565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c890612f80565b60405180910390fd5b600f5483856105e09190612fcf565b11156105eb57600080fd5b60105481836105fa9190612fcf565b111561060557600080fd5b83600b6000018190555082600b6001018190555081600b6002018190555080600b6003018190555050505050565b600068056bc75e2d63100000905090565b61064c61176b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d090612f80565b60405180910390fd5b60005b81518110156108a2573073ffffffffffffffffffffffffffffffffffffffff1682828151811061070f5761070e613025565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156107a35750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061078257610781613025565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b80156108175750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106107f6576107f5613025565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561088f5760016007600084848151811061083557610834613025565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061089a90613054565b9150506106dc565b5050565b60006108b384848461193c565b610974846108bf61176b565b61096f856040518060600160405280602881526020016138a560289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061092561176b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ee29092919063ffffffff16565b611773565b600190509392505050565b61098761176b565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0d90612f80565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610a8261176b565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0890612f80565b60405180910390fd5b6031811115610b1f57600080fd5b8060128190555050565b610b3161176b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bbe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bb590612f80565b60405180910390fd5b80601460176101000a81548160ff02191690831515021790555050565b610be361176b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6790612f80565b60405180910390fd5b60008111610c7d57600080fd5b610cac6064610c9e8368056bc75e2d63100000611f4690919063ffffffff16565b611fc090919063ffffffff16565b60158190555050565b610cbd61176b565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4390612f80565b60405180910390fd5b6000479050610d5a8161200a565b50565b6000610da7600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612076565b9050919050565b610db661176b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3a90612f80565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610f0961176b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f8d90612f80565b60405180910390fd5b68056bc75e2d6310000060158190555068056bc75e2d63100000601681905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4b68616279000000000000000000000000000000000000000000000000000000815250905090565b600061103261102b61176b565b848461193c565b6001905092915050565b61104461176b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c890612f80565b60405180910390fd5b600081116110de57600080fd5b61110d60646110ff8368056bc75e2d63100000611f4690919063ffffffff16565b611fc090919063ffffffff16565b60168190555050565b61111e61176b565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a490612f80565b60405180910390fd5b60006111b830610d5d565b90506111c3816120e4565b50565b6111ce61176b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461125b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125290612f80565b60405180910390fd5b60148054906101000a900460ff16156112a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a0906130e8565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061133930601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d63100000611773565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015611384573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a8919061311d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561140f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611433919061311d565b6040518363ffffffff1660e01b815260040161145092919061314a565b6020604051808303816000875af115801561146f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611493919061311d565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061151c30610d5d565b600080611527610fb8565b426040518863ffffffff1660e01b8152600401611549969594939291906131b8565b60606040518083038185885af1158015611567573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061158c919061322e565b5050506001601460166101000a81548160ff0219169083151502179055506001601460176101000a81548160ff02191690831515021790555067d02ab486cedc00006015819055506801a055690d9db8000060168190555060016014806101000a81548160ff021916908315150217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161169d929190613281565b6020604051808303816000875af11580156116bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e091906132bf565b5050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036117e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117d99061335e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611851576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611848906133f0565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161192f9190612be1565b60405180910390a3505050565b6000811161197f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197690613482565b60405180910390fd5b6001601460186101000a81548160ff0219169083151502179055506119a2610fb8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a1057506119e0610fb8565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ed257601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611ac05750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611b165750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611b2e5750601460179054906101000a900460ff165b15611b9b57601554811115611b4257600080fd5b60165481611b4f84610d5d565b611b599190612fcf565b1115611b9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b91906134ee565b60405180910390fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c435750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c9c5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611d6a57600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611d455750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611d4e57600080fd5b6000601460186101000a81548160ff0219169083151502179055505b6000611d7530610d5d565b9050611dc96064611dbb601254611dad601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610d5d565b611f4690919063ffffffff16565b611fc090919063ffffffff16565b811115611e2557611e226064611e14601254611e06601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610d5d565b611f4690919063ffffffff16565b611fc090919063ffffffff16565b90505b601460159054906101000a900460ff16158015611e905750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611ea85750601460169054906101000a900460ff165b15611ed057611eb6816120e4565b60004790506000811115611ece57611ecd4761200a565b5b505b505b611edd83838361235d565b505050565b6000838311158290611f2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f219190612a2b565b60405180910390fd5b5060008385611f39919061350e565b9050809150509392505050565b6000808303611f585760009050611fba565b60008284611f669190613542565b9050828482611f7591906135cb565b14611fb5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fac9061366e565b60405180910390fd5b809150505b92915050565b600061200283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061236d565b905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612072573d6000803e3d6000fd5b5050565b60006009548211156120bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120b490613700565b60405180910390fd5b60006120c76123d0565b90506120dc8184611fc090919063ffffffff16565b915050919050565b6001601460156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561211c5761211b612c01565b5b60405190808252806020026020018201604052801561214a5781602001602082028036833780820191505090505b509050308160008151811061216257612161613025565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612209573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061222d919061311d565b8160018151811061224157612240613025565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506122a830601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611773565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161230c9594939291906137de565b600060405180830381600087803b15801561232657600080fd5b505af115801561233a573d6000803e3d6000fd5b50505050506000601460156101000a81548160ff02191690831515021790555050565b6123688383836123fb565b505050565b600080831182906123b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123ab9190612a2b565b60405180910390fd5b50600083856123c391906135cb565b9050809150509392505050565b60008060006123dd6125c6565b915091506123f48183611fc090919063ffffffff16565b9250505090565b60008060008060008061240d87612628565b95509550955095509550955061246b86600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126bd90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061250085600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461270790919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061254c81612765565b6125568483612822565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516125b39190612be1565b60405180910390a3505050505050505050565b60008060006009549050600068056bc75e2d6310000090506125fc68056bc75e2d63100000600954611fc090919063ffffffff16565b82101561261b5760095468056bc75e2d63100000935093505050612624565b81819350935050505b9091565b600080600080600080600080600061263e61285c565b61265c576126578a600b60020154600b60030154612873565b612672565b6126718a600b60000154600b60010154612873565b5b92509250925060006126826123d0565b905060008060006126958e878787612909565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006126ff83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ee2565b905092915050565b60008082846127169190612fcf565b90508381101561275b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161275290613884565b60405180910390fd5b8091505092915050565b600061276f6123d0565b905060006127868284611f4690919063ffffffff16565b90506127da81600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461270790919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612837826009546126bd90919063ffffffff16565b60098190555061285281600a5461270790919063ffffffff16565b600a819055505050565b6000601460189054906101000a900460ff16905090565b60008060008061289f6064612891888a611f4690919063ffffffff16565b611fc090919063ffffffff16565b905060006128c960646128bb888b611f4690919063ffffffff16565b611fc090919063ffffffff16565b905060006128f2826128e4858c6126bd90919063ffffffff16565b6126bd90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806129228589611f4690919063ffffffff16565b905060006129398689611f4690919063ffffffff16565b905060006129508789611f4690919063ffffffff16565b905060006129798261296b85876126bd90919063ffffffff16565b6126bd90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156129cc5780820151818401526020810190506129b1565b838111156129db576000848401525b50505050565b6000601f19601f8301169050919050565b60006129fd82612992565b612a07818561299d565b9350612a178185602086016129ae565b612a20816129e1565b840191505092915050565b60006020820190508181036000830152612a4581846129f2565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612a8c82612a61565b9050919050565b612a9c81612a81565b8114612aa757600080fd5b50565b600081359050612ab981612a93565b92915050565b6000819050919050565b612ad281612abf565b8114612add57600080fd5b50565b600081359050612aef81612ac9565b92915050565b60008060408385031215612b0c57612b0b612a57565b5b6000612b1a85828601612aaa565b9250506020612b2b85828601612ae0565b9150509250929050565b60008115159050919050565b612b4a81612b35565b82525050565b6000602082019050612b656000830184612b41565b92915050565b60008060008060808587031215612b8557612b84612a57565b5b6000612b9387828801612ae0565b9450506020612ba487828801612ae0565b9350506040612bb587828801612ae0565b9250506060612bc687828801612ae0565b91505092959194509250565b612bdb81612abf565b82525050565b6000602082019050612bf66000830184612bd2565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612c39826129e1565b810181811067ffffffffffffffff82111715612c5857612c57612c01565b5b80604052505050565b6000612c6b612a4d565b9050612c778282612c30565b919050565b600067ffffffffffffffff821115612c9757612c96612c01565b5b602082029050602081019050919050565b600080fd5b6000612cc0612cbb84612c7c565b612c61565b90508083825260208201905060208402830185811115612ce357612ce2612ca8565b5b835b81811015612d0c5780612cf88882612aaa565b845260208401935050602081019050612ce5565b5050509392505050565b600082601f830112612d2b57612d2a612bfc565b5b8135612d3b848260208601612cad565b91505092915050565b600060208284031215612d5a57612d59612a57565b5b600082013567ffffffffffffffff811115612d7857612d77612a5c565b5b612d8484828501612d16565b91505092915050565b600080600060608486031215612da657612da5612a57565b5b6000612db486828701612aaa565b9350506020612dc586828701612aaa565b9250506040612dd686828701612ae0565b9150509250925092565b600060208284031215612df657612df5612a57565b5b6000612e0484828501612aaa565b91505092915050565b600060ff82169050919050565b612e2381612e0d565b82525050565b6000602082019050612e3e6000830184612e1a565b92915050565b600060208284031215612e5a57612e59612a57565b5b6000612e6884828501612ae0565b91505092915050565b612e7a81612b35565b8114612e8557600080fd5b50565b600081359050612e9781612e71565b92915050565b600060208284031215612eb357612eb2612a57565b5b6000612ec184828501612e88565b91505092915050565b612ed381612a81565b82525050565b6000602082019050612eee6000830184612eca565b92915050565b60008060408385031215612f0b57612f0a612a57565b5b6000612f1985828601612aaa565b9250506020612f2a85828601612aaa565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612f6a60208361299d565b9150612f7582612f34565b602082019050919050565b60006020820190508181036000830152612f9981612f5d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612fda82612abf565b9150612fe583612abf565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561301a57613019612fa0565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061305f82612abf565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361309157613090612fa0565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006130d260178361299d565b91506130dd8261309c565b602082019050919050565b60006020820190508181036000830152613101816130c5565b9050919050565b60008151905061311781612a93565b92915050565b60006020828403121561313357613132612a57565b5b600061314184828501613108565b91505092915050565b600060408201905061315f6000830185612eca565b61316c6020830184612eca565b9392505050565b6000819050919050565b6000819050919050565b60006131a261319d61319884613173565b61317d565b612abf565b9050919050565b6131b281613187565b82525050565b600060c0820190506131cd6000830189612eca565b6131da6020830188612bd2565b6131e760408301876131a9565b6131f460608301866131a9565b6132016080830185612eca565b61320e60a0830184612bd2565b979650505050505050565b60008151905061322881612ac9565b92915050565b60008060006060848603121561324757613246612a57565b5b600061325586828701613219565b935050602061326686828701613219565b925050604061327786828701613219565b9150509250925092565b60006040820190506132966000830185612eca565b6132a36020830184612bd2565b9392505050565b6000815190506132b981612e71565b92915050565b6000602082840312156132d5576132d4612a57565b5b60006132e3848285016132aa565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061334860248361299d565b9150613353826132ec565b604082019050919050565b600060208201905081810360008301526133778161333b565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006133da60228361299d565b91506133e58261337e565b604082019050919050565b60006020820190508181036000830152613409816133cd565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061346c60298361299d565b915061347782613410565b604082019050919050565b6000602082019050818103600083015261349b8161345f565b9050919050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006134d8601a8361299d565b91506134e3826134a2565b602082019050919050565b60006020820190508181036000830152613507816134cb565b9050919050565b600061351982612abf565b915061352483612abf565b92508282101561353757613536612fa0565b5b828203905092915050565b600061354d82612abf565b915061355883612abf565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561359157613590612fa0565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006135d682612abf565b91506135e183612abf565b9250826135f1576135f061359c565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b600061365860218361299d565b9150613663826135fc565b604082019050919050565b600060208201905081810360008301526136878161364b565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006136ea602a8361299d565b91506136f58261368e565b604082019050919050565b60006020820190508181036000830152613719816136dd565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61375581612a81565b82525050565b6000613767838361374c565b60208301905092915050565b6000602082019050919050565b600061378b82613720565b613795818561372b565b93506137a08361373c565b8060005b838110156137d15781516137b8888261375b565b97506137c383613773565b9250506001810190506137a4565b5085935050505092915050565b600060a0820190506137f36000830188612bd2565b61380060208301876131a9565b81810360408301526138128186613780565b90506138216060830185612eca565b61382e6080830184612bd2565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061386e601b8361299d565b915061387982613838565b602082019050919050565b6000602082019050818103600083015261389d81613861565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a00b9f9a67619f3ffe4e3b6d0bd4530b6f9a3641d1dfd6a23b2f2d65ecee82c564736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,437
0x2acac61173865cd324536d9a65237a2fc590e43e
pragma solidity 0.4.18; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns(uint256) { if(a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns(uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns(uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns(uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); modifier onlyOwner() { require(msg.sender == owner); _; } function Ownable() public { owner = msg.sender; } function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); owner = newOwner; OwnershipTransferred(owner, newOwner); } } contract Pausable is Ownable { bool public paused = false; event Pause(); event Unpause(); modifier whenNotPaused() { require(!paused); _; } modifier whenPaused() { require(paused); _; } function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } contract ERC20 { uint256 public totalSupply; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); function balanceOf(address who) public view returns(uint256); function transfer(address to, uint256 value) public returns(bool); function transferFrom(address from, address to, uint256 value) public returns(bool); function allowance(address owner, address spender) public view returns(uint256); function approve(address spender, uint256 value) public returns(bool); } contract StandardToken is ERC20 { using SafeMath for uint256; string public name; string public symbol; uint8 public decimals; mapping(address => uint256) balances; mapping (address => mapping (address => uint256)) internal allowed; function StandardToken(string _name, string _symbol, uint8 _decimals) public { name = _name; symbol = _symbol; decimals = _decimals; } function balanceOf(address _owner) public view returns(uint256 balance) { return balances[_owner]; } function transfer(address _to, uint256 _value) public returns(bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } function multiTransfer(address[] _to, uint256[] _value) public returns(bool) { require(_to.length == _value.length); for(uint i = 0; i < _to.length; i++) { transfer(_to[i], _value[i]); } return true; } 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; } function allowance(address _owner, address _spender) public view returns(uint256) { return allowed[_owner][_spender]; } function approve(address _spender, uint256 _value) public returns(bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } 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; } 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; } } contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } modifier notMint() { require(mintingFinished); _; } 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; } function finishMinting() onlyOwner canMint public returns(bool) { mintingFinished = true; MintFinished(); return true; } } contract CappedToken is MintableToken { uint256 public cap; function CappedToken(uint256 _cap) public { require(_cap > 0); cap = _cap; } function mint(address _to, uint256 _amount) onlyOwner canMint public returns(bool) { require(totalSupply.add(_amount) <= cap); return super.mint(_to, _amount); } } contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); function burn(uint256 _value) public { require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); } } /* ICO Gap - Crowdsale goes in 4 steps: - 1st step PreSale 0: the administrator can issue tokens; purchase and sale are closed; Max. tokens 5 000 000 - 2nd step PreSale 1: the administrator can not issue tokens; the sale is open; purchase is closed; Max. tokens 5 000 000 + 10 000 000 - The third step of PreSale 2: the administrator can not issue tokens; the sale is open; purchase is closed; Max. tokens 5 000 000 + 10 000 000 + 15 000 000 - 4th step ICO: administrator can not issue tokens; the sale is open; the purchase is open; Max. tokens 5 000 000 + 10 000 000 + 15 000 000 + 30 000 000 Addition: - Total emissions are limited: 100,000,000 tokens - at each step it is possible to change the price of the token - the steps are not limited in time and the step change is made by the nextStep administrator - funds are accumulated on a contract basis - at any time closeCrowdsale can be called: the funds and management of the token are transferred to the beneficiary; the release of + 65% of tokens to the beneficiary; minting closes - at any time, refundCrowdsale can be called: funds remain on the contract; withdraw becomes unavailable; there is an opportunity to get refund - transfer of tokens before closeCrowdsale is unavailable - you can buy no more than 500 000 tokens for 1 purse. */ contract Token is CappedToken, BurnableToken { function Token() CappedToken(100000000 * 1 ether) StandardToken("GAP Token", "GAP", 18) public { } function transfer(address _to, uint256 _value) notMint public returns(bool) { return super.transfer(_to, _value); } function multiTransfer(address[] _to, uint256[] _value) notMint public returns(bool) { return super.multiTransfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) notMint public returns(bool) { return super.transferFrom(_from, _to, _value); } function burnOwner(address _from, uint256 _value) onlyOwner canMint public { require(_value <= balances[_from]); balances[_from] = balances[_from].sub(_value); totalSupply = totalSupply.sub(_value); Burn(_from, _value); } } contract Crowdsale is Pausable { using SafeMath for uint; struct Step { uint priceTokenWei; uint tokensForSale; uint tokensSold; uint collectedWei; bool purchase; bool issue; bool sale; } Token public token; address public beneficiary = 0x4B97b2938844A775538eF0b75F08648C4BD6fFFA; Step[] public steps; uint8 public currentStep = 0; bool public crowdsaleClosed = false; bool public crowdsaleRefund = false; uint public refundedWei; mapping(address => uint256) public canSell; mapping(address => uint256) public purchaseBalances; event Purchase(address indexed holder, uint256 tokenAmount, uint256 etherAmount); event Sell(address indexed holder, uint256 tokenAmount, uint256 etherAmount); event Issue(address indexed holder, uint256 tokenAmount); event Refund(address indexed holder, uint256 etherAmount); event NextStep(uint8 step); event CrowdsaleClose(); event CrowdsaleRefund(); function Crowdsale() public { token = new Token(); steps.push(Step(1 ether / 1000, 5000000 * 1 ether, 0, 0, false, true, false)); steps.push(Step(1 ether / 1000, 10000000 * 1 ether, 0, 0, true, false, false)); steps.push(Step(1 ether / 500, 15000000 * 1 ether, 0, 0, true, false, false)); steps.push(Step(1 ether / 100, 30000000 * 1 ether, 0, 0, true, false, true)); } function() payable public { purchase(); } function setTokenRate(uint _value) onlyOwner whenPaused public { require(!crowdsaleClosed); steps[currentStep].priceTokenWei = 1 ether / _value; } function purchase() whenNotPaused payable public { require(!crowdsaleClosed); require(msg.value >= 0.001 ether); Step memory step = steps[currentStep]; require(step.purchase); require(step.tokensSold < step.tokensForSale); require(token.balanceOf(msg.sender) < 500000 ether); uint sum = msg.value; uint amount = sum.mul(1 ether).div(step.priceTokenWei); uint retSum = 0; uint retAmount; if(step.tokensSold.add(amount) > step.tokensForSale) { retAmount = step.tokensSold.add(amount).sub(step.tokensForSale); retSum = retAmount.mul(step.priceTokenWei).div(1 ether); amount = amount.sub(retAmount); sum = sum.sub(retSum); } if(token.balanceOf(msg.sender).add(amount) > 500000 ether) { retAmount = token.balanceOf(msg.sender).add(amount).sub(500000 ether); retSum = retAmount.mul(step.priceTokenWei).div(1 ether); amount = amount.sub(retAmount); sum = sum.sub(retSum); } steps[currentStep].tokensSold = step.tokensSold.add(amount); steps[currentStep].collectedWei = step.collectedWei.add(sum); purchaseBalances[msg.sender] = purchaseBalances[msg.sender].add(sum); token.mint(msg.sender, amount); if(retSum > 0) { msg.sender.transfer(retSum); } Purchase(msg.sender, amount, sum); } function issue(address _to, uint256 _value) onlyOwner whenNotPaused public { require(!crowdsaleClosed); Step memory step = steps[currentStep]; require(step.issue); require(step.tokensSold.add(_value) <= step.tokensForSale); steps[currentStep].tokensSold = step.tokensSold.add(_value); canSell[_to] = canSell[_to].add(_value).div(100).mul(20); token.mint(_to, _value); Issue(_to, _value); } function sell(uint256 _value) whenNotPaused public { require(!crowdsaleClosed); require(canSell[msg.sender] >= _value); require(token.balanceOf(msg.sender) >= _value); Step memory step = steps[currentStep]; require(step.sale); canSell[msg.sender] = canSell[msg.sender].sub(_value); token.burnOwner(msg.sender, _value); uint sum = _value.mul(step.priceTokenWei).div(1 ether); msg.sender.transfer(sum); Sell(msg.sender, _value, sum); } function refund() public { require(crowdsaleRefund); require(purchaseBalances[msg.sender] > 0); uint sum = purchaseBalances[msg.sender]; purchaseBalances[msg.sender] = 0; refundedWei = refundedWei.add(sum); msg.sender.transfer(sum); Refund(msg.sender, sum); } function nextStep() onlyOwner public { require(!crowdsaleClosed); require(steps.length - 1 > currentStep); currentStep += 1; NextStep(currentStep); } function closeCrowdsale() onlyOwner public { require(!crowdsaleClosed); beneficiary.transfer(this.balance); token.mint(beneficiary, token.totalSupply().div(100).mul(65)); token.finishMinting(); token.transferOwnership(beneficiary); crowdsaleClosed = true; CrowdsaleClose(); } function refundCrowdsale() onlyOwner public { require(!crowdsaleClosed); crowdsaleRefund = true; crowdsaleClosed = true; CrowdsaleRefund(); } }
0x606060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806311c15dcc1461013257806338af3eed1461017f5780633f4ba83a146101d457806346d24cbb146101e95780634ba5b7b314610212578063590e1ae31461023f5780635bc34f71146102545780635c975abb1461028357806361241c28146102b057806364edfbf0146102d35780637217e0b9146102dd5780638456cb591461034a578063867904b41461035f57806386d4ff1d146103a15780638da5cb5b146103ee578063983c0a0114610443578063c900072614610458578063ccb07cef1461046d578063d7dd86521461049a578063e4849b32146104af578063f2fde38b146104d2578063fc0c546a1461050b575b610130610560565b005b341561013d57600080fd5b610169600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610da8565b6040518082815260200191505060405180910390f35b341561018a57600080fd5b610192610dc0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101df57600080fd5b6101e7610de6565b005b34156101f457600080fd5b6101fc610ea4565b6040518082815260200191505060405180910390f35b341561021d57600080fd5b610225610eaa565b604051808215151515815260200191505060405180910390f35b341561024a57600080fd5b610252610ebd565b005b341561025f57600080fd5b61026761105b565b604051808260ff1660ff16815260200191505060405180910390f35b341561028e57600080fd5b61029661106e565b604051808215151515815260200191505060405180910390f35b34156102bb57600080fd5b6102d16004808035906020019091905050611081565b005b6102db610560565b005b34156102e857600080fd5b6102fe6004808035906020019091905050611160565b6040518088815260200187815260200186815260200185815260200184151515158152602001831515151581526020018215151515815260200197505050505050505060405180910390f35b341561035557600080fd5b61035d6111d8565b005b341561036a57600080fd5b61039f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611298565b005b34156103ac57600080fd5b6103d8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611666565b6040518082815260200191505060405180910390f35b34156103f957600080fd5b61040161167e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561044e57600080fd5b6104566116a3565b005b341561046357600080fd5b61046b611b51565b005b341561047857600080fd5b610480611c6c565b604051808215151515815260200191505060405180910390f35b34156104a557600080fd5b6104ad611c7f565b005b34156104ba57600080fd5b6104d06004808035906020019091905050611d5a565b005b34156104dd57600080fd5b610509600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506121d8565b005b341561051657600080fd5b61051e61232d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105686123e0565b600080600080600060149054906101000a900460ff1615151561058a57600080fd5b600460019054906101000a900460ff161515156105a657600080fd5b66038d7ea4c6800034101515156105bc57600080fd5b6003600460009054906101000a900460ff1660ff168154811015156105dd57fe5b906000526020600020906005020160e06040519081016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820160009054906101000a900460ff161515151581526020016004820160019054906101000a900460ff161515151581526020016004820160029054906101000a900460ff16151515158152505094508460800151151561068257600080fd5b8460200151856040015110151561069857600080fd5b6969e10de76676d0800000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561076857600080fd5b6102c65a03f1151561077957600080fd5b5050506040518051905010151561078f57600080fd5b3493506107c385600001516107b5670de0b6b3a76400008761235390919063ffffffff16565b61238e90919063ffffffff16565b92506000915084602001516107e58487604001516123a990919063ffffffff16565b111561087857610818856020015161080a8588604001516123a990919063ffffffff16565b6123c790919063ffffffff16565b905061084b670de0b6b3a764000061083d87600001518461235390919063ffffffff16565b61238e90919063ffffffff16565b915061086081846123c790919063ffffffff16565b925061087582856123c790919063ffffffff16565b93505b6969e10de76676d080000061097584600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561094c57600080fd5b6102c65a03f1151561095d57600080fd5b505050604051805190506123a990919063ffffffff16565b1115610ae957610a896969e10de76676d0800000610a7b85600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610a5257600080fd5b6102c65a03f11515610a6357600080fd5b505050604051805190506123a990919063ffffffff16565b6123c790919063ffffffff16565b9050610abc670de0b6b3a7640000610aae87600001518461235390919063ffffffff16565b61238e90919063ffffffff16565b9150610ad181846123c790919063ffffffff16565b9250610ae682856123c790919063ffffffff16565b93505b610b008386604001516123a990919063ffffffff16565b6003600460009054906101000a900460ff1660ff16815481101515610b2157fe5b906000526020600020906005020160020181905550610b4d8486606001516123a990919063ffffffff16565b6003600460009054906101000a900460ff1660ff16815481101515610b6e57fe5b906000526020600020906005020160030181905550610bd584600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123a990919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1933856000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610ce557600080fd5b6102c65a03f11515610cf657600080fd5b50505060405180519050506000821115610d4b573373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501515610d4a57600080fd5b5b3373ffffffffffffffffffffffffffffffffffffffff167f12cb4648cf3058b17ceeb33e579f8b0bc269fe0843f3900b8e24b6c54871703c8486604051808381526020018281526020019250505060405180910390a25050505050565b60076020528060005260406000206000915090505481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e4157600080fd5b600060149054906101000a900460ff161515610e5c57600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60055481565b600460029054906101000a900460ff1681565b6000600460029054906101000a900460ff161515610eda57600080fd5b6000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111515610f2857600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fc4816005546123a990919063ffffffff16565b6005819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561100a57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff167fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d826040518082815260200191505060405180910390a250565b600460009054906101000a900460ff1681565b600060149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110dc57600080fd5b600060149054906101000a900460ff1615156110f757600080fd5b600460019054906101000a900460ff1615151561111357600080fd5b80670de0b6b3a764000081151561112657fe5b046003600460009054906101000a900460ff1660ff1681548110151561114857fe5b90600052602060002090600502016000018190555050565b60038181548110151561116f57fe5b90600052602060002090600502016000915090508060000154908060010154908060020154908060030154908060040160009054906101000a900460ff16908060040160019054906101000a900460ff16908060040160029054906101000a900460ff16905087565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561123357600080fd5b600060149054906101000a900460ff1615151561124f57600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6112a06123e0565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112fb57600080fd5b600060149054906101000a900460ff1615151561131757600080fd5b600460019054906101000a900460ff1615151561133357600080fd5b6003600460009054906101000a900460ff1660ff1681548110151561135457fe5b906000526020600020906005020160e06040519081016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820160009054906101000a900460ff161515151581526020016004820160019054906101000a900460ff161515151581526020016004820160029054906101000a900460ff16151515158152505090508060a0015115156113f957600080fd5b80602001516114158383604001516123a990919063ffffffff16565b1115151561142257600080fd5b6114398282604001516123a990919063ffffffff16565b6003600460009054906101000a900460ff1660ff1681548110151561145a57fe5b9060005260206000209060050201600201819055506114e760146114d960646114cb86600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123a990919063ffffffff16565b61238e90919063ffffffff16565b61235390919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1984846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156115f757600080fd5b6102c65a03f1151561160857600080fd5b50505060405180519050508273ffffffffffffffffffffffffffffffffffffffff167fc65a3f767206d2fdcede0b094a4840e01c0dd0be1888b5ba800346eaa0123c16836040518082815260200191505060405180910390a2505050565b60066020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116fe57600080fd5b600460019054906101000a900460ff1615151561171a57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050151561179357600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f19600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166118c360416118b56064600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561188c57600080fd5b6102c65a03f1151561189d57600080fd5b5050506040518051905061238e90919063ffffffff16565b61235390919063ffffffff16565b6000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561195057600080fd5b6102c65a03f1151561196157600080fd5b5050506040518051905050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637d64bcb46000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156119fa57600080fd5b6102c65a03f11515611a0b57600080fd5b5050506040518051905050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f2fde38b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b1515611af457600080fd5b6102c65a03f11515611b0557600080fd5b5050506001600460016101000a81548160ff0219169083151502179055507f587261db95996a4ec51ca62d662d1f046a5e62831eb4ae0b8cd974da5673fbf060405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611bac57600080fd5b600460019054906101000a900460ff16151515611bc857600080fd5b600460009054906101000a900460ff1660ff16600160038054905003111515611bf057600080fd5b6001600460008282829054906101000a900460ff160192506101000a81548160ff021916908360ff1602179055507f4d3cfbcd7da61e25bfda6ef2a73e71b189eb3a19824d4b3dda53e85d307a5005600460009054906101000a900460ff16604051808260ff1660ff16815260200191505060405180910390a1565b600460019054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611cda57600080fd5b600460019054906101000a900460ff16151515611cf657600080fd5b6001600460026101000a81548160ff0219169083151502179055506001600460016101000a81548160ff0219169083151502179055507fbdffce6c573d08e652a091ca784f0430c929c6b644d9a95dcf5028d7d365d6e160405160405180910390a1565b611d626123e0565b60008060149054906101000a900460ff16151515611d7f57600080fd5b600460019054906101000a900460ff16151515611d9b57600080fd5b82600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611de957600080fd5b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515611eaf57600080fd5b6102c65a03f11515611ec057600080fd5b5050506040518051905010151515611ed757600080fd5b6003600460009054906101000a900460ff1660ff16815481101515611ef857fe5b906000526020600020906005020160e06040519081016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820160009054906101000a900460ff161515151581526020016004820160019054906101000a900460ff161515151581526020016004820160029054906101000a900460ff16151515158152505091508160c001511515611f9d57600080fd5b611fef83600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b6c0525533856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15156120f657600080fd5b6102c65a03f1151561210757600080fd5b50505061213b670de0b6b3a764000061212d84600001518661235390919063ffffffff16565b61238e90919063ffffffff16565b90503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561217d57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff167fed7a144fad14804d5c249145e3e0e2b63a9eb455b76aee5bc92d711e9bba3e4a8483604051808381526020018281526020019250505060405180910390a2505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561223357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561226f57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008414156123685760009150612387565b828402905082848281151561237957fe5b0414151561238357fe5b8091505b5092915050565b600080828481151561239c57fe5b0490508091505092915050565b60008082840190508381101515156123bd57fe5b8091505092915050565b60008282111515156123d557fe5b818303905092915050565b60e0604051908101604052806000815260200160008152602001600081526020016000815260200160001515815260200160001515815260200160001515815250905600a165627a7a723058206a97c55766d1f5c533424ee09c7ee64c2cb01d7899d555b34c2acff1011f969b0029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
6,438
0x647F92446f4e46e4AE9f3525226f3fB486F17E73
/** *Submitted for verification at Etherscan.io on 2021-03-10 */ pragma solidity ^0.4.23; // 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 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } // File: 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]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } // File: node_modules/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 { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } } // 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); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint _subtractedValue ) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: node_modules/zeppelin-solidity/contracts/token/ERC20/StandardBurnableToken.sol /** * @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); } } // File: contracts/TorexCoin.sol contract TorexCoin is StandardBurnableToken { string public name = "TorEx"; string public symbol = "TOR"; uint public decimals = 8; uint public INITIAL_SUPPLY = 200000000 * (10 ** uint256(decimals)); // 200 million tokens /** * @dev Contructor that gives msg.sender all of existing tokens. */ constructor() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); } }
0x6080604052600436106100d0576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100d5578063095ea7b31461016557806318160ddd146101ca57806323b872dd146101f55780632ff2e9dc1461027a578063313ce567146102a557806342966c68146102d057806366188463146102fd57806370a082311461036257806379cc6790146103b957806395d89b4114610406578063a9059cbb14610496578063d73dd623146104fb578063dd62ed3e14610560575b600080fd5b3480156100e157600080fd5b506100ea6105d7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561012a57808201518184015260208101905061010f565b50505050905090810190601f1680156101575780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017157600080fd5b506101b0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610675565b604051808215151515815260200191505060405180910390f35b3480156101d657600080fd5b506101df610767565b6040518082815260200191505060405180910390f35b34801561020157600080fd5b50610260600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b34801561028657600080fd5b5061028f610b2b565b6040518082815260200191505060405180910390f35b3480156102b157600080fd5b506102ba610b31565b6040518082815260200191505060405180910390f35b3480156102dc57600080fd5b506102fb60048036038101908080359060200190929190505050610b37565b005b34801561030957600080fd5b50610348600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b44565b604051808215151515815260200191505060405180910390f35b34801561036e57600080fd5b506103a3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dd5565b6040518082815260200191505060405180910390f35b3480156103c557600080fd5b50610404600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e1d565b005b34801561041257600080fd5b5061041b610fc5565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561045b578082015181840152602081019050610440565b50505050905090810190601f1680156104885780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104a257600080fd5b506104e1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611063565b604051808215151515815260200191505060405180910390f35b34801561050757600080fd5b50610546600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611282565b604051808215151515815260200191505060405180910390f35b34801561056c57600080fd5b506105c1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061147e565b6040518082815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561066d5780601f106106425761010080835404028352916020019161066d565b820191906000526020600020905b81548152906001019060200180831161065057829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156107ae57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107fb57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561088657600080fd5b6108d7826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461150590919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061096a826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461151e90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a3b82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461150590919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60065481565b60055481565b610b41338261153a565b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610c55576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ce9565b610c68838261150590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515610ea857600080fd5b610f3781600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461150590919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fc1828261153a565b5050565b60048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561105b5780601f106110305761010080835404028352916020019161105b565b820191906000526020600020905b81548152906001019060200180831161103e57829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110a057600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156110ed57600080fd5b61113e826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461150590919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111d1826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461151e90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061131382600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461151e90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600082821115151561151357fe5b818303905092915050565b6000818301905082811015151561153157fe5b80905092915050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561158757600080fd5b6115d8816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461150590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061162f8160015461150590919063ffffffff16565b6001819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505600a165627a7a7230582073f2628bcba682e75547f611f956ce1884886592617e0076673254618fee506a0029
{"success": true, "error": null, "results": {}}
6,439
0x1627ab73a27232468bae3a13786e1234ce9848a3
pragma solidity ^0.4.24; // File: contracts/interfaces/IOwned.sol /* Owned Contract Interface */ contract IOwned { function transferOwnership(address _newOwner) public; function acceptOwnership() public; function transferOwnershipNow(address newContractOwner) public; } // File: contracts/utility/Owned.sol /* This is the "owned" utility contract used by bancor with one additional function - transferOwnershipNow() The original unmodified version can be found here: https://github.com/bancorprotocol/contracts/commit/63480ca28534830f184d3c4bf799c1f90d113846 Provides support and utilities for contract ownership */ contract Owned is IOwned { address public owner; address public newOwner; event OwnerUpdate(address indexed _prevOwner, address indexed _newOwner); /** @dev constructor */ constructor() public { owner = msg.sender; } // allows execution by the owner only modifier ownerOnly { require(msg.sender == owner); _; } /** @dev allows transferring the contract ownership the new owner still needs to accept the transfer can only be called by the contract owner @param _newOwner new contract owner */ function transferOwnership(address _newOwner) public ownerOnly { require(_newOwner != owner); newOwner = _newOwner; } /** @dev used by a new owner to accept an ownership transfer */ function acceptOwnership() public { require(msg.sender == newOwner); emit OwnerUpdate(owner, newOwner); owner = newOwner; newOwner = address(0); } /** @dev transfers the contract ownership without needing the new owner to accept ownership @param newContractOwner new contract owner */ function transferOwnershipNow(address newContractOwner) ownerOnly public { require(newContractOwner != owner); emit OwnerUpdate(owner, newContractOwner); owner = newContractOwner; } } // File: contracts/utility/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that revert on error * From https://github.com/OpenZeppelin/openzeppelin-solidity/commit/a2e710386933d3002062888b35aae8ac0401a7b3 */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_a == 0) { return 0; } uint256 c = _a * _b; require(c / _a == _b); return c; } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = _a / _b; // assert(_a == _b * c + _a % _b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b <= _a); uint256 c = _a - _b; return c; } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256) { uint256 c = _a + _b; require(c >= _a); return c; } } // File: contracts/interfaces/IERC20.sol /* Smart Token Interface */ contract IERC20 { function balanceOf(address tokenOwner) public constant returns (uint balance); function allowance(address tokenOwner, address spender) public constant returns (uint remaining); function transfer(address to, uint tokens) public returns (bool success); function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } // File: contracts/interfaces/ISmartToken.sol /** @notice Smart Token Interface */ contract ISmartToken is IOwned, IERC20 { function disableTransfers(bool _disable) public; function issue(address _to, uint256 _amount) public; function destroy(address _from, uint256 _amount) public; } // File: contracts/SmartToken.sol /* This contract implements the required functionality to be considered a Bancor smart token. Additionally it has custom token sale functionality and the ability to withdraw tokens accidentally deposited // TODO abstract this into 3 contracts and inherit from them: 1) ERC20, 2) Smart Token, 3) Native specific functionality */ contract SmartToken is Owned, IERC20, ISmartToken { /** Smart Token Implementation */ bool public transfersEnabled = true; // true if transfer/transferFrom are enabled, false if not /// @notice Triggered when a smart token is deployed - the _token address is defined for forward compatibility, in case we want to trigger the event from a factory event NewSmartToken(address _token); /// @notice Triggered when the total supply is increased event Issuance(uint256 _amount); // @notice Triggered when the total supply is decreased event Destruction(uint256 _amount); // @notice Verifies that the address is different than this contract address modifier notThis(address _address) { require(_address != address(this)); _; } modifier transfersAllowed { assert(transfersEnabled); _; } /// @notice Validates an address - currently only checks that it isn&#39;t null modifier validAddress(address _address) { require(_address != address(0)); _; } /** @dev disables/enables transfers can only be called by the contract owner @param _disable true to disable transfers, false to enable them */ function disableTransfers(bool _disable) public ownerOnly { transfersEnabled = !_disable; } /** @dev increases the token supply and sends the new tokens to an account can only be called by the contract owner @param _to account to receive the new amount @param _amount amount to increase the supply by */ function issue(address _to, uint256 _amount) public ownerOnly validAddress(_to) notThis(_to) { totalSupply = SafeMath.add(totalSupply, _amount); balances[_to] = SafeMath.add(balances[_to], _amount); emit Issuance(_amount); emit Transfer(this, _to, _amount); } /** @dev removes tokens from an account and decreases the token supply can be called by the contract owner to destroy tokens from any account or by any holder to destroy tokens from his/her own account @param _from account to remove the amount from @param _amount amount to decrease the supply by */ function destroy(address _from, uint256 _amount) public { require(msg.sender == _from || msg.sender == owner); // validate input balances[_from] = SafeMath.sub(balances[_from], _amount); totalSupply = SafeMath.sub(totalSupply, _amount); emit Transfer(_from, this, _amount); emit Destruction(_amount); } /** @notice ERC20 Implementation */ uint256 public totalSupply; event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); function transfer(address _to, uint256 _value) public transfersAllowed returns (bool success) { if (balances[msg.sender] >= _value && _to != address(0)) { balances[msg.sender] = SafeMath.sub(balances[msg.sender], _value); balances[_to] = SafeMath.add(balances[_to], _value); emit Transfer(msg.sender, _to, _value); return true; } else {return false; } } function transferFrom(address _from, address _to, uint256 _value) public transfersAllowed returns (bool success) { if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _to != address(0)) { balances[_to] = SafeMath.add(balances[_to], _value); balances[_from] = SafeMath.sub(balances[_from], _value); allowed[_from][msg.sender] = SafeMath.sub(allowed[_from][msg.sender], _value); emit Transfer(_from, _to, _value); return true; } else { return false; } } function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } 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]; } mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; string public name; uint8 public decimals; string public symbol; string public version; constructor(string _name, uint _totalSupply, uint8 _decimals, string _symbol, string _version, address sender) public { balances[sender] = _totalSupply; // Give the creator all initial tokens totalSupply = _totalSupply; // Update total supply name = _name; // Set the name for display purposes decimals = _decimals; // Amount of decimals for display purposes symbol = _symbol; // Set the symbol for display purposes version = _version; emit NewSmartToken(address(this)); } /** @notice Token Sale Implementation */ uint public saleStartTime; uint public saleEndTime; uint public price; uint public amountRemainingForSale; bool public buyModeEth = true; address public beneficiary; address public payableTokenAddress; event TokenSaleInitialized(uint _saleStartTime, uint _saleEndTime, uint _price, uint _amountForSale, uint nowTime); event TokensPurchased(address buyer, uint amount); /** @dev increases the token supply and sends the new tokens to an account. Similar to issue() but for use in token sale @param _to account to receive the new amount @param _amount amount to increase the supply by */ function issuePurchase(address _to, uint256 _amount) internal validAddress(_to) notThis(_to) { totalSupply = SafeMath.add(totalSupply, _amount); balances[_to] = SafeMath.add(balances[_to], _amount); emit Issuance(_amount); emit Transfer(this, _to, _amount); } /** @notice Begins the token sale for this token instance @param _saleStartTime Unix timestamp of the token sale start @param _saleEndTime Unix timestamp of the token sale close @param _price If sale initialized in ETH: price in Wei. If not, token purchases are enabled and this is the amount of tokens issued per tokens paid @param _amountForSale Amount of tokens for sale @param _beneficiary Recipient of the token sale proceeds */ function initializeTokenSale(uint _saleStartTime, uint _saleEndTime, uint _price, uint _amountForSale, address _beneficiary) public ownerOnly { // Check that the token sale has not yet been initialized initializeSale(_saleStartTime, _saleEndTime, _price, _amountForSale, _beneficiary); } /** @notice Begins the token sale for this token instance @notice Uses the same signature as initializeTokenSale() with: @param _tokenAddress The whitelisted token address to allow payments in */ function initializeTokenSaleWithToken(uint _saleStartTime, uint _saleEndTime, uint _price, uint _amountForSale, address _beneficiary, address _tokenAddress) public ownerOnly { buyModeEth = false; payableTokenAddress = _tokenAddress; initializeSale(_saleStartTime, _saleEndTime, _price, _amountForSale, _beneficiary); } function initializeSale(uint _saleStartTime, uint _saleEndTime, uint _price, uint _amountForSale, address _beneficiary) internal { // Check that the token sale has not yet been initialized require(saleStartTime == 0); saleStartTime = _saleStartTime; saleEndTime = _saleEndTime; price = _price; amountRemainingForSale = _amountForSale; beneficiary = _beneficiary; emit TokenSaleInitialized(saleStartTime, saleEndTime, price, amountRemainingForSale, now); } function updateStartTime(uint _newSaleStartTime) public ownerOnly { saleStartTime = _newSaleStartTime; } function updateEndTime(uint _newSaleEndTime) public ownerOnly { require(_newSaleEndTime >= saleStartTime); saleEndTime = _newSaleEndTime; } function updateAmountRemainingForSale(uint _newAmountRemainingForSale) public ownerOnly { amountRemainingForSale = _newAmountRemainingForSale; } function updatePrice(uint _newPrice) public ownerOnly { price = _newPrice; } /// @dev Allows owner to withdraw erc20 tokens that were accidentally sent to this contract function withdrawToken(IERC20 _token, uint amount) public ownerOnly { _token.transfer(msg.sender, amount); } /** @dev Allows token sale with parent token */ function buyWithToken(IERC20 _token, uint amount) public payable { require(_token == payableTokenAddress); uint amountToBuy = SafeMath.mul(amount, price); require(amountToBuy <= amountRemainingForSale); require(now <= saleEndTime && now >= saleStartTime); amountRemainingForSale = SafeMath.sub(amountRemainingForSale, amountToBuy); require(_token.transferFrom(msg.sender, beneficiary, amount)); issuePurchase(msg.sender, amountToBuy); emit TokensPurchased(msg.sender, amountToBuy); } function() public payable { require(buyModeEth == true); uint amountToBuy = SafeMath.div( SafeMath.mul(msg.value, 1 ether), price); require(amountToBuy <= amountRemainingForSale); require(now <= saleEndTime && now >= saleStartTime); amountRemainingForSale = SafeMath.sub(amountRemainingForSale, amountToBuy); issuePurchase(msg.sender, amountToBuy); beneficiary.transfer(msg.value); emit TokensPurchased(msg.sender, amountToBuy); } }
0x6080604052600436106101ac576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306bcf02f1461031257806306fdde031461033f578063095ea7b3146103cf5780631608f18f1461043457806318160ddd146104635780631cbaee2d1461048e5780631d4a9209146104b957806323b872dd14610524578063313ce567146105a957806338af3eed146105da57806354fd4d501461063157806368e57c6b146106c15780636ab3846b146106ec5780636e33a8311461071957806370a082311461075957806379ba5097146107b0578063867904b4146107c75780638692ac86146108145780638d6cc56d146108575780638da5cb5b1461088457806395d89b41146108db57806398079dc41461096b5780639e281a98146109c2578063a035b1fe14610a0f578063a24835d114610a3a578063a9059cbb14610a87578063bef97c8714610aec578063cb52c25e14610b1b578063d4ee1d9014610b48578063da5da3b914610b9f578063dd62ed3e14610c2a578063ea5a641614610ca1578063ed338ff114610cd0578063f2fde38b14610cfb575b600060011515600d60009054906101000a900460ff1615151415156101d057600080fd5b6101ed6101e534670de0b6b3a7640000610d3e565b600b54610d7c565b9050600c54811115151561020057600080fd5b600a54421115801561021457506009544210155b151561021f57600080fd5b61022b600c5482610da6565b600c8190555061023b3382610dc7565b600d60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156102a3573d6000803e3d6000fd5b507f8f28852646c20cc973d3a8218f7eefed58c25c909f78f0265af4818c3d4dc2713382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a150005b34801561031e57600080fd5b5061033d60048036038101908080359060200190929190505050610f80565b005b34801561034b57600080fd5b50610354610fe5565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610394578082015181840152602081019050610379565b50505050905090810190601f1680156103c15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103db57600080fd5b5061041a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611083565b604051808215151515815260200191505060405180910390f35b34801561044057600080fd5b50610461600480360381019080803515159060200190929190505050611175565b005b34801561046f57600080fd5b506104786111ee565b6040518082815260200191505060405180910390f35b34801561049a57600080fd5b506104a36111f4565b6040518082815260200191505060405180910390f35b3480156104c557600080fd5b5061052260048036038101908080359060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111fa565b005b34801561053057600080fd5b5061058f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611269565b604051808215151515815260200191505060405180910390f35b3480156105b557600080fd5b506105be611624565b604051808260ff1660ff16815260200191505060405180910390f35b3480156105e657600080fd5b506105ef611637565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561063d57600080fd5b5061064661165d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561068657808201518184015260208101905061066b565b50505050905090810190601f1680156106b35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106cd57600080fd5b506106d66116fb565b6040518082815260200191505060405180910390f35b3480156106f857600080fd5b5061071760048036038101908080359060200190929190505050611701565b005b610757600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611777565b005b34801561076557600080fd5b5061079a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119de565b6040518082815260200191505060405180910390f35b3480156107bc57600080fd5b506107c5611a27565b005b3480156107d357600080fd5b50610812600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611bc6565b005b34801561082057600080fd5b50610855600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611dda565b005b34801561086357600080fd5b5061088260048036038101908080359060200190929190505050611f4f565b005b34801561089057600080fd5b50610899611fb4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108e757600080fd5b506108f0611fd9565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610930578082015181840152602081019050610915565b50505050905090810190601f16801561095d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561097757600080fd5b50610980612077565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109ce57600080fd5b50610a0d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061209d565b005b348015610a1b57600080fd5b50610a246121db565b6040518082815260200191505060405180910390f35b348015610a4657600080fd5b50610a85600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506121e1565b005b348015610a9357600080fd5b50610ad2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506123b0565b604051808215151515815260200191505060405180910390f35b348015610af857600080fd5b50610b016125dc565b604051808215151515815260200191505060405180910390f35b348015610b2757600080fd5b50610b46600480360381019080803590602001909291905050506125ef565b005b348015610b5457600080fd5b50610b5d612654565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610bab57600080fd5b50610c2860048036038101908080359060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061267a565b005b348015610c3657600080fd5b50610c8b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612746565b6040518082815260200191505060405180910390f35b348015610cad57600080fd5b50610cb66127cd565b604051808215151515815260200191505060405180910390f35b348015610cdc57600080fd5b50610ce56127e0565b6040518082815260200191505060405180910390f35b348015610d0757600080fd5b50610d3c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506127e6565b005b6000806000841415610d535760009150610d75565b8284029050828482811515610d6457fe5b04141515610d7157600080fd5b8091505b5092915050565b600080600083111515610d8e57600080fd5b8284811515610d9957fe5b0490508091505092915050565b600080838311151515610db857600080fd5b82840390508091505092915050565b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610e0457600080fd5b823073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610e4057600080fd5b610e4c600254846128e1565b600281905550610e9b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846128e1565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f9386c90217c323f58030f9dadcbc938f807a940f4ff41cd4cead9562f5da7dc3836040518082815260200191505060405180910390a18373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a350505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fdb57600080fd5b8060098190555050565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561107b5780601f106110505761010080835404028352916020019161107b565b820191906000526020600020905b81548152906001019060200180831161105e57829003601f168201915b505050505081565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111d057600080fd5b8015600160146101000a81548160ff02191690831515021790555050565b60025481565b60095481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561125557600080fd5b6112628585858585612902565b5050505050565b6000600160149054906101000a900460ff16151561128357fe5b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015801561134e575081600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156113875750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611618576113d5600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836128e1565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611461600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610da6565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061152a600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610da6565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905061161d565b600090505b9392505050565b600660009054906101000a900460ff1681565b600d60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116f35780601f106116c8576101008083540402835291602001916116f3565b820191906000526020600020905b8154815290600101906020018083116116d657829003601f168201915b505050505081565b600c5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561175c57600080fd5b600954811015151561176d57600080fd5b80600a8190555050565b6000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415156117d557600080fd5b6117e182600b54610d3e565b9050600c5481111515156117f457600080fd5b600a54421115801561180857506009544210155b151561181357600080fd5b61181f600c5482610da6565b600c819055508273ffffffffffffffffffffffffffffffffffffffff166323b872dd33600d60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561191e57600080fd5b505af1158015611932573d6000803e3d6000fd5b505050506040513d602081101561194857600080fd5b8101908080519060200190929190505050151561196457600080fd5b61196e3382610dc7565b7f8f28852646c20cc973d3a8218f7eefed58c25c909f78f0265af4818c3d4dc2713382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1505050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a8357600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a60405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c2157600080fd5b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611c5e57600080fd5b823073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611c9a57600080fd5b611ca6600254846128e1565b600281905550611cf5600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846128e1565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f9386c90217c323f58030f9dadcbc938f807a940f4ff41cd4cead9562f5da7dc3836040518082815260200191505060405180910390a18373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a350505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e3557600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611e9157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a60405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611faa57600080fd5b80600b8190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561206f5780601f106120445761010080835404028352916020019161206f565b820191906000526020600020905b81548152906001019060200180831161205257829003601f168201915b505050505081565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120f857600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561219b57600080fd5b505af11580156121af573d6000803e3d6000fd5b505050506040513d60208110156121c557600080fd5b8101908080519060200190929190505050505050565b600b5481565b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061226757506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561227257600080fd5b6122bb600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482610da6565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230a60025482610da6565b6002819055503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a37f9a1b418bc061a5d80270261562e6986a35d995f8051145f277be16103abd3453816040518082815260200191505060405180910390a15050565b6000600160149054906101000a900460ff1615156123ca57fe5b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156124465750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156125d157612494600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610da6565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612520600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836128e1565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190506125d6565b600090505b92915050565b600160149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561264a57600080fd5b80600c8190555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156126d557600080fd5b6000600d60006101000a81548160ff02191690831515021790555080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061273e8686868686612902565b505050505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600d60009054906101000a900460ff1681565b600a5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561284157600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561289d57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008082840190508381101515156128f857600080fd5b8091505092915050565b600060095414151561291357600080fd5b8460098190555083600a8190555082600b8190555081600c8190555080600d60016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f65b937d460c7c5cfeac1c37e5cbf1f4d6136747e3b2c9f1773d2d61cef193b5b600954600a54600b54600c5442604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a150505050505600a165627a7a72305820ccc0f7330f54a768e0bbf0fdc46db25384c2b5f3310dd42cac9fd3f6cc0122c30029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
6,440
0x43e7e2e3a893a7eaa5219ffc087c7497c350c8c2
pragma solidity ^0.4.21; /**xxp 校验防止溢出情况 * @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 ERC20Basic */ 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); 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 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)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @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 { using SafeMath for uint256; mapping (address => mapping (address => uint256)) internal allowed; // store tokens mapping(address => uint256) balances; // uint256 public totalSupply; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#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 constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(burner, _value); } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(0x0, _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner public returns (bool) { mintingFinished = true; emit 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 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 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); } } /* * @title CTBToken */ contract CTBToken is BurnableToken, MintableToken, PausableToken { // Public variables of the token string public name; string public symbol; // decimals is the strongly suggested default, avoid changing it uint8 public decimals; function CTBToken() public { name = "CointobeToken"; symbol = "CTB"; decimals = 18; totalSupply = 1000000000 * 10 ** uint256(decimals); // Allocate initial balance to the owner balances[msg.sender] = totalSupply; } // transfer balance to owner function withdrawEther() onlyOwner public { address addr = this; owner.transfer(addr.balance); } // can accept ether function() payable public { } }
0x6080604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461010857806306fdde0314610131578063095ea7b3146101bb57806318160ddd146101df57806323b872dd14610206578063313ce567146102305780633f4ba83a1461025b57806340c10f191461027057806342966c68146102945780635c975abb146102ac57806370a08231146102c15780637362377b146102e25780637d64bcb4146102f75780638456cb591461030c5780638da5cb5b1461032157806395d89b4114610352578063a9059cbb14610367578063dd62ed3e1461038b578063f2fde38b146103b2575b005b34801561011457600080fd5b5061011d6103d3565b604080519115158252519081900360200190f35b34801561013d57600080fd5b506101466103f4565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610180578181015183820152602001610168565b50505050905090810190601f1680156101ad5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c757600080fd5b5061011d600160a060020a0360043516602435610482565b3480156101eb57600080fd5b506101f46104ad565b60408051918252519081900360200190f35b34801561021257600080fd5b5061011d600160a060020a03600435811690602435166044356104b3565b34801561023c57600080fd5b506102456104e0565b6040805160ff9092168252519081900360200190f35b34801561026757600080fd5b506101066104e9565b34801561027c57600080fd5b5061011d600160a060020a0360043516602435610566565b3480156102a057600080fd5b50610106600435610686565b3480156102b857600080fd5b5061011d610751565b3480156102cd57600080fd5b506101f4600160a060020a0360043516610761565b3480156102ee57600080fd5b5061010661077c565b34801561030357600080fd5b5061011d6107dd565b34801561031857600080fd5b5061010661085f565b34801561032d57600080fd5b506103366108e1565b60408051600160a060020a039092168252519081900360200190f35b34801561035e57600080fd5b506101466108f0565b34801561037357600080fd5b5061011d600160a060020a036004351660243561094b565b34801561039757600080fd5b506101f4600160a060020a036004358116906024351661096f565b3480156103be57600080fd5b50610106600160a060020a036004351661099a565b60035474010000000000000000000000000000000000000000900460ff1681565b6004805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561047a5780601f1061044f5761010080835404028352916020019161047a565b820191906000526020600020905b81548152906001019060200180831161045d57829003601f168201915b505050505081565b60035460009060a860020a900460ff161561049c57600080fd5b6104a68383610a33565b9392505050565b60005481565b60035460009060a860020a900460ff16156104cd57600080fd5b6104d8848484610a9d565b949350505050565b60065460ff1681565b60035433600160a060020a0390811691161461050457600080fd5b60035460a860020a900460ff16151561051c57600080fd5b6003805475ff000000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60035460009033600160a060020a0390811691161461058457600080fd5b60035474010000000000000000000000000000000000000000900460ff16156105ac57600080fd5b6000546105bf908363ffffffff610c1f16565b6000908155600160a060020a0384168152600260205260409020546105ea908363ffffffff610c1f16565b600160a060020a038416600081815260026020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b600080821161069457600080fd5b600160a060020a0333166000908152600260205260409020548211156106b957600080fd5b5033600160a060020a0381166000908152600260205260409020546106de9083610c2e565b600160a060020a0382166000908152600260205260408120919091555461070b908363ffffffff610c2e16565b600055604080518381529051600160a060020a038316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b60035460a860020a900460ff1681565b600160a060020a031660009081526002602052604090205490565b60035460009033600160a060020a0390811691161461079a57600080fd5b506003546040513091600160a060020a03908116919083163180156108fc02916000818181858888f193505050501580156107d9573d6000803e3d6000fd5b5050565b60035460009033600160a060020a039081169116146107fb57600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b60035433600160a060020a0390811691161461087a57600080fd5b60035460a860020a900460ff161561089157600080fd5b6003805475ff000000000000000000000000000000000000000000191660a860020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561047a5780601f1061044f5761010080835404028352916020019161047a565b60035460009060a860020a900460ff161561096557600080fd5b6104a68383610c40565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b60035433600160a060020a039081169116146109b557600080fd5b600160a060020a03811615156109ca57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b6000600160a060020a0383161515610ab457600080fd5b600160a060020a038416600090815260026020526040902054821115610ad957600080fd5b600160a060020a0380851660009081526001602090815260408083203390941683529290522054821115610b0c57600080fd5b600160a060020a038416600090815260026020526040902054610b35908363ffffffff610c2e16565b600160a060020a038086166000908152600260205260408082209390935590851681522054610b6a908363ffffffff610c1f16565b600160a060020a03808516600090815260026020908152604080832094909455878316825260018152838220339093168252919091522054610bb2908363ffffffff610c2e16565b600160a060020a038086166000818152600160209081526040808320338616845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6000828201838110156104a657fe5b600082821115610c3a57fe5b50900390565b6000600160a060020a0383161515610c5757600080fd5b600160a060020a033316600090815260026020526040902054821115610c7c57600080fd5b600160a060020a033316600090815260026020526040902054610ca5908363ffffffff610c2e16565b600160a060020a033381166000908152600260205260408082209390935590851681522054610cda908363ffffffff610c1f16565b600160a060020a038085166000818152600260209081526040918290209490945580518681529051919333909316927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3506001929150505600a165627a7a72305820dc96b6af004d946f2762fbae94dc7b0aeb10fba9a59a74fcfbaa0149ec0c84da0029
{"success": true, "error": null, "results": {}}
6,441
0xea19ff19582654cebe9a9e7d741bb85e0bcc0d7e
/** *Submitted for verification at Etherscan.io on 2022-03-26 */ /** ? */ // 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 MissingLink is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Missing Link";// string private constant _symbol = "MLINK";// uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 0;// uint256 private _taxFeeOnBuy = 6;// //Sell Fee uint256 private _redisFeeOnSell = 0;// uint256 private _taxFeeOnSell = 6;// //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0x5E3E34Eb82b7FD9Ed405694ccD6045597496F54C);// address payable private _marketingAddress = payable(0xcB7D9592Fe6e749cB407EA3E15bdC4810E1f2888);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 990000000 * 10**9; // uint256 public _maxWalletSize = 2000000000 * 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(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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613048565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a5565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa8565b610869565b604051610264919061346f565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f919061348a565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613687565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f55565b6108be565b6040516102f7919061346f565b60405180910390f35b34801561030c57600080fd5b50610315610997565b6040516103229190613687565b60405180910390f35b34801561033757600080fd5b5061034061099d565b60405161034d91906136fc565b60405180910390f35b34801561036257600080fd5b5061036b6109a6565b6040516103789190613454565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612ebb565b6109cc565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613091565b610abc565b005b3480156103df57600080fd5b506103e8610b6d565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612ebb565b610c3e565b60405161041e9190613687565b60405180910390f35b34801561043357600080fd5b5061043c610c8f565b005b34801561044a57600080fd5b50610465600480360381019061046091906130be565b610de2565b005b34801561047357600080fd5b5061047c610e81565b6040516104899190613687565b60405180910390f35b34801561049e57600080fd5b506104a7610e87565b6040516104b49190613454565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613091565b610eb0565b005b3480156104f257600080fd5b506104fb610f69565b6040516105089190613687565b60405180910390f35b34801561051d57600080fd5b50610526610f6f565b60405161053391906134a5565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130be565b610fac565b005b34801561057157600080fd5b5061058c600480360381019061058791906130eb565b61104b565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa8565b611102565b6040516105c2919061346f565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612ebb565b611120565b6040516105ff919061346f565b60405180910390f35b34801561061457600080fd5b5061061d611140565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe8565b611219565b005b34801561065457600080fd5b5061065d611353565b60405161066a9190613687565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f15565b611359565b6040516106a79190613687565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130be565b6113e0565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612ebb565b61147f565b005b61070a611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e7565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139d3565b91505061079a565b5050565b60606040518060400160405280600c81526020017f4d697373696e67204c696e6b0000000000000000000000000000000000000000815250905090565b600061087d610876611641565b8484611649565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600068056bc75e2d63100000905090565b60006108cb848484611814565b61098c846108d7611641565b61098785604051806060016040528060288152602001613f2860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093d611641565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f49092919063ffffffff16565b611649565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a58906135e7565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b48906135e7565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bae611641565b73ffffffffffffffffffffffffffffffffffffffff161480610c245750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0c611641565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2d57600080fd5b6000479050610c3b81612258565b50565b6000610c88600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612353565b9050919050565b610c97611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dea611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6e906135e7565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3c906135e7565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600581526020017f4d4c494e4b000000000000000000000000000000000000000000000000000000815250905090565b610fb4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611041576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611038906135e7565b60405180910390fd5b8060198190555050565b611053611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d7906135e7565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111661110f611641565b8484611814565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611181611641565b73ffffffffffffffffffffffffffffffffffffffff1614806111f75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111df611641565b73ffffffffffffffffffffffffffffffffffffffff16145b61120057600080fd5b600061120b30610c3e565b9050611216816123c1565b50565b611221611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a5906135e7565b60405180910390fd5b60005b8383905081101561134d5781600560008686858181106112d4576112d3613a7a565b5b90506020020160208101906112e99190612ebb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611345906139d3565b9150506112b1565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611475576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146c906135e7565b60405180910390fd5b8060188190555050565b611487611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611584576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157b90613547565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b090613667565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172090613567565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118079190613687565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187b90613627565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118eb906134c7565b60405180910390fd5b60008111611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e90613607565b60405180910390fd5b61193f610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ad575061197d610e87565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef357601660149054906101000a900460ff16611a3c576119ce610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a32906134e7565b60405180910390fd5b5b601754811115611a81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7890613527565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b255750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5b90613587565b60405180910390fd5b6001600854611b7391906137bd565b4311158015611bcf5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c295750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbf576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6c5760185481611d2184610c3e565b611d2b91906137bd565b10611d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6290613647565b60405180910390fd5b5b6000611d7730610c3e565b9050600060195482101590506017548210611d925760175491505b808015611dac5750601660159054906101000a900460ff16155b8015611e065750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1c575060168054906101000a900460ff165b8015611e725750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec85750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ef057611ed6826123c1565b60004790506000811115611eee57611eed47612258565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f9a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205b57600090506121e2565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121065750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211e57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e157600b54600d81905550600c54600e819055505b5b6121ee84848484612649565b50505050565b600083831115829061223c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223391906134a5565b60405180910390fd5b506000838561224b919061389e565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a860028461267690919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d3573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232460028461267690919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234f573d6000803e3d6000fd5b5050565b600060065482111561239a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239190613507565b60405180910390fd5b60006123a46126c0565b90506123b9818461267690919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f9576123f8613aa9565b5b6040519080825280602002602001820160405280156124275781602001602082028036833780820191505090505b509050308160008151811061243f5761243e613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e157600080fd5b505afa1580156124f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125199190612ee8565b8160018151811061252d5761252c613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259430601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611649565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f89594939291906136a2565b600060405180830381600087803b15801561261257600080fd5b505af1158015612626573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612657576126566126eb565b5b61266284848461272e565b806126705761266f6128f9565b5b50505050565b60006126b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290d565b905092915050565b60008060006126cd612970565b915091506126e4818361267690919063ffffffff16565b9250505090565b6000600d541480156126ff57506000600e54145b156127095761272c565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b600080600080600080612740876129d2565b95509550955095509550955061279e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287f81612ae2565b6128898483612b9f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e69190613687565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294b91906134a5565b60405180910390fd5b50600083856129639190613813565b9050809150509392505050565b60008060006006549050600068056bc75e2d6310000090506129a668056bc75e2d6310000060065461267690919063ffffffff16565b8210156129c55760065468056bc75e2d631000009350935050506129ce565b81819350935050505b9091565b60008060008060008060008060006129ef8a600d54600e54612bd9565b92509250925060006129ff6126c0565b90506000806000612a128e878787612c6f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f4565b905092915050565b6000808284612a9391906137bd565b905083811015612ad8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acf906135a7565b60405180910390fd5b8091505092915050565b6000612aec6126c0565b90506000612b038284612cf890919063ffffffff16565b9050612b5781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb482600654612a3a90919063ffffffff16565b600681905550612bcf81600754612a8490919063ffffffff16565b6007819055505050565b600080600080612c056064612bf7888a612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c2f6064612c21888b612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c5882612c4a858c612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c888589612cf890919063ffffffff16565b90506000612c9f8689612cf890919063ffffffff16565b90506000612cb68789612cf890919063ffffffff16565b90506000612cdf82612cd18587612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d0b5760009050612d6d565b60008284612d199190613844565b9050828482612d289190613813565b14612d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5f906135c7565b60405180910390fd5b809150505b92915050565b6000612d86612d818461373c565b613717565b90508083825260208201905082856020860282011115612da957612da8613ae2565b5b60005b85811015612dd95781612dbf8882612de3565b845260208401935060208301925050600181019050612dac565b5050509392505050565b600081359050612df281613ee2565b92915050565b600081519050612e0781613ee2565b92915050565b60008083601f840112612e2357612e22613add565b5b8235905067ffffffffffffffff811115612e4057612e3f613ad8565b5b602083019150836020820283011115612e5c57612e5b613ae2565b5b9250929050565b600082601f830112612e7857612e77613add565b5b8135612e88848260208601612d73565b91505092915050565b600081359050612ea081613ef9565b92915050565b600081359050612eb581613f10565b92915050565b600060208284031215612ed157612ed0613aec565b5b6000612edf84828501612de3565b91505092915050565b600060208284031215612efe57612efd613aec565b5b6000612f0c84828501612df8565b91505092915050565b60008060408385031215612f2c57612f2b613aec565b5b6000612f3a85828601612de3565b9250506020612f4b85828601612de3565b9150509250929050565b600080600060608486031215612f6e57612f6d613aec565b5b6000612f7c86828701612de3565b9350506020612f8d86828701612de3565b9250506040612f9e86828701612ea6565b9150509250925092565b60008060408385031215612fbf57612fbe613aec565b5b6000612fcd85828601612de3565b9250506020612fde85828601612ea6565b9150509250929050565b60008060006040848603121561300157613000613aec565b5b600084013567ffffffffffffffff81111561301f5761301e613ae7565b5b61302b86828701612e0d565b9350935050602061303e86828701612e91565b9150509250925092565b60006020828403121561305e5761305d613aec565b5b600082013567ffffffffffffffff81111561307c5761307b613ae7565b5b61308884828501612e63565b91505092915050565b6000602082840312156130a7576130a6613aec565b5b60006130b584828501612e91565b91505092915050565b6000602082840312156130d4576130d3613aec565b5b60006130e284828501612ea6565b91505092915050565b6000806000806080858703121561310557613104613aec565b5b600061311387828801612ea6565b945050602061312487828801612ea6565b935050604061313587828801612ea6565b925050606061314687828801612ea6565b91505092959194509250565b600061315e838361316a565b60208301905092915050565b613173816138d2565b82525050565b613182816138d2565b82525050565b600061319382613778565b61319d818561379b565b93506131a883613768565b8060005b838110156131d95781516131c08882613152565b97506131cb8361378e565b9250506001810190506131ac565b5085935050505092915050565b6131ef816138e4565b82525050565b6131fe81613927565b82525050565b61320d81613939565b82525050565b600061321e82613783565b61322881856137ac565b935061323881856020860161396f565b61324181613af1565b840191505092915050565b60006132596023836137ac565b915061326482613b02565b604082019050919050565b600061327c603f836137ac565b915061328782613b51565b604082019050919050565b600061329f602a836137ac565b91506132aa82613ba0565b604082019050919050565b60006132c2601c836137ac565b91506132cd82613bef565b602082019050919050565b60006132e56026836137ac565b91506132f082613c18565b604082019050919050565b60006133086022836137ac565b915061331382613c67565b604082019050919050565b600061332b6023836137ac565b915061333682613cb6565b604082019050919050565b600061334e601b836137ac565b915061335982613d05565b602082019050919050565b60006133716021836137ac565b915061337c82613d2e565b604082019050919050565b60006133946020836137ac565b915061339f82613d7d565b602082019050919050565b60006133b76029836137ac565b91506133c282613da6565b604082019050919050565b60006133da6025836137ac565b91506133e582613df5565b604082019050919050565b60006133fd6023836137ac565b915061340882613e44565b604082019050919050565b60006134206024836137ac565b915061342b82613e93565b604082019050919050565b61343f81613910565b82525050565b61344e8161391a565b82525050565b60006020820190506134696000830184613179565b92915050565b600060208201905061348460008301846131e6565b92915050565b600060208201905061349f60008301846131f5565b92915050565b600060208201905081810360008301526134bf8184613213565b905092915050565b600060208201905081810360008301526134e08161324c565b9050919050565b600060208201905081810360008301526135008161326f565b9050919050565b6000602082019050818103600083015261352081613292565b9050919050565b60006020820190508181036000830152613540816132b5565b9050919050565b60006020820190508181036000830152613560816132d8565b9050919050565b60006020820190508181036000830152613580816132fb565b9050919050565b600060208201905081810360008301526135a08161331e565b9050919050565b600060208201905081810360008301526135c081613341565b9050919050565b600060208201905081810360008301526135e081613364565b9050919050565b6000602082019050818103600083015261360081613387565b9050919050565b60006020820190508181036000830152613620816133aa565b9050919050565b60006020820190508181036000830152613640816133cd565b9050919050565b60006020820190508181036000830152613660816133f0565b9050919050565b6000602082019050818103600083015261368081613413565b9050919050565b600060208201905061369c6000830184613436565b92915050565b600060a0820190506136b76000830188613436565b6136c46020830187613204565b81810360408301526136d68186613188565b90506136e56060830185613179565b6136f26080830184613436565b9695505050505050565b60006020820190506137116000830184613445565b92915050565b6000613721613732565b905061372d82826139a2565b919050565b6000604051905090565b600067ffffffffffffffff82111561375757613756613aa9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c882613910565b91506137d383613910565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380857613807613a1c565b5b828201905092915050565b600061381e82613910565b915061382983613910565b92508261383957613838613a4b565b5b828204905092915050565b600061384f82613910565b915061385a83613910565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561389357613892613a1c565b5b828202905092915050565b60006138a982613910565b91506138b483613910565b9250828210156138c7576138c6613a1c565b5b828203905092915050565b60006138dd826138f0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139328261394b565b9050919050565b600061394482613910565b9050919050565b60006139568261395d565b9050919050565b6000613968826138f0565b9050919050565b60005b8381101561398d578082015181840152602081019050613972565b8381111561399c576000848401525b50505050565b6139ab82613af1565b810181811067ffffffffffffffff821117156139ca576139c9613aa9565b5b80604052505050565b60006139de82613910565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a1157613a10613a1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613eeb816138d2565b8114613ef657600080fd5b50565b613f02816138e4565b8114613f0d57600080fd5b50565b613f1981613910565b8114613f2457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209f7806aa8f9fcb53ced69d69eedc0b677dcb6ab3e462e8716b1e8ebabcb9241364736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,442
0xDC9a6eD95a36C3c07Bb46FBfA1058fdcD5db7Ad8
// Telegram: https://t.me/ebabydoge\ // Elon Musk's Tweet: https://twitter.com/elonmusk/status/1410529698497630212 // 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 ElonBabyDoge is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Elon's Baby Doge | t.me/ebabydoge"; string private constant _symbol = "ElonBabyDoge"; 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 = 3; uint256 private _teamFee = 2; mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _charityAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _charityAddress = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_charityAddress] = 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 = 3; _teamFee = 2; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _charityAddress.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues( tAmount, _taxFee, 10 ); 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**3); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102df578063c3c8cd80146102ff578063c9567bf914610314578063d543dbeb14610329578063dd62ed3e1461034957600080fd5b8063715018a61461024d5780638da5cb5b1461026257806395d89b411461028a578063a9059cbb146102bf57600080fd5b8063273123b7116100dc578063273123b7146101ba578063313ce567146101dc5780635932ead1146101f85780636fc3eaec1461021857806370a082311461022d57600080fd5b806306fdde0314610119578063095ea7b31461014457806318160ddd1461017457806323b872dd1461019a57600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5061012e61038f565b60405161013b91906119fd565b60405180910390f35b34801561015057600080fd5b5061016461015f36600461188e565b6103af565b604051901515815260200161013b565b34801561018057600080fd5b50683635c9adc5dea000005b60405190815260200161013b565b3480156101a657600080fd5b506101646101b536600461184e565b6103c6565b3480156101c657600080fd5b506101da6101d53660046117de565b61042f565b005b3480156101e857600080fd5b506040516009815260200161013b565b34801561020457600080fd5b506101da610213366004611980565b610483565b34801561022457600080fd5b506101da6104cb565b34801561023957600080fd5b5061018c6102483660046117de565b6104f8565b34801561025957600080fd5b506101da61051a565b34801561026e57600080fd5b506000546040516001600160a01b03909116815260200161013b565b34801561029657600080fd5b5060408051808201909152600c81526b456c6f6e42616279446f676560a01b602082015261012e565b3480156102cb57600080fd5b506101646102da36600461188e565b61058e565b3480156102eb57600080fd5b506101da6102fa3660046118b9565b61059b565b34801561030b57600080fd5b506101da61063f565b34801561032057600080fd5b506101da610675565b34801561033557600080fd5b506101da6103443660046119b8565b610a38565b34801561035557600080fd5b5061018c610364366004611816565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6060604051806060016040528060218152602001611bf660219139905090565b60006103bc338484610b0c565b5060015b92915050565b60006103d3848484610c30565b610425843361042085604051806060016040528060288152602001611bce602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611042565b610b0c565b5060019392505050565b6000546001600160a01b031633146104625760405162461bcd60e51b815260040161045990611a50565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146104ad5760405162461bcd60e51b815260040161045990611a50565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104eb57600080fd5b476104f58161107c565b50565b6001600160a01b0381166000908152600260205260408120546103c090611101565b6000546001600160a01b031633146105445760405162461bcd60e51b815260040161045990611a50565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103bc338484610c30565b6000546001600160a01b031633146105c55760405162461bcd60e51b815260040161045990611a50565b60005b815181101561063b576001600a60008484815181106105f757634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063381611b63565b9150506105c8565b5050565b600c546001600160a01b0316336001600160a01b03161461065f57600080fd5b600061066a306104f8565b90506104f581611185565b6000546001600160a01b0316331461069f5760405162461bcd60e51b815260040161045990611a50565b600f54600160a01b900460ff16156106f95760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610459565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107363082683635c9adc5dea00000610b0c565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561076f57600080fd5b505afa158015610783573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a791906117fa565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107ef57600080fd5b505afa158015610803573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082791906117fa565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561086f57600080fd5b505af1158015610883573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a791906117fa565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108d7816104f8565b6000806108ec6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561094f57600080fd5b505af1158015610963573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098891906119d0565b5050600f8054678ac7230489e8000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a0057600080fd5b505af1158015610a14573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063b919061199c565b6000546001600160a01b03163314610a625760405162461bcd60e51b815260040161045990611a50565b60008111610ab25760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610459565b610ad16103e8610acb683635c9adc5dea000008461132a565b906113a9565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b6e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610459565b6001600160a01b038216610bcf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610459565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c945760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610459565b6001600160a01b038216610cf65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610459565b60008111610d585760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610459565b6000546001600160a01b03848116911614801590610d8457506000546001600160a01b03838116911614155b15610fe557600f54600160b81b900460ff1615610e6b576001600160a01b0383163014801590610dbd57506001600160a01b0382163014155b8015610dd75750600e546001600160a01b03848116911614155b8015610df15750600e546001600160a01b03838116911614155b15610e6b57600e546001600160a01b0316336001600160a01b03161480610e2b5750600f546001600160a01b0316336001600160a01b0316145b610e6b5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610459565b601054811115610e7a57600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610ebc57506001600160a01b0382166000908152600a602052604090205460ff16155b610ec557600080fd5b600f546001600160a01b038481169116148015610ef05750600e546001600160a01b03838116911614155b8015610f1557506001600160a01b03821660009081526005602052604090205460ff16155b8015610f2a5750600f54600160b81b900460ff165b15610f78576001600160a01b0382166000908152600b60205260409020544211610f5357600080fd5b610f5e42603c611af5565b6001600160a01b0383166000908152600b60205260409020555b6000610f83306104f8565b600f54909150600160a81b900460ff16158015610fae5750600f546001600160a01b03858116911614155b8015610fc35750600f54600160b01b900460ff165b15610fe357610fd181611185565b478015610fe157610fe14761107c565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061102757506001600160a01b03831660009081526005602052604090205460ff165b15611030575060005b61103c848484846113eb565b50505050565b600081848411156110665760405162461bcd60e51b815260040161045991906119fd565b5060006110738486611b4c565b95945050505050565b600c546001600160a01b03166108fc6110968360026113a9565b6040518115909202916000818181858888f193505050501580156110be573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110d98360026113a9565b6040518115909202916000818181858888f1935050505015801561063b573d6000803e3d6000fd5b60006006548211156111685760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610459565b6000611172611417565b905061117e83826113a9565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111db57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122f57600080fd5b505afa158015611243573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126791906117fa565b8160018151811061128857634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112ae9130911684610b0c565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112e7908590600090869030904290600401611a85565b600060405180830381600087803b15801561130157600080fd5b505af1158015611315573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b600082611339575060006103c0565b60006113458385611b2d565b9050826113528583611b0d565b1461117e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610459565b600061117e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061143a565b806113f8576113f8611468565b61140384848461148b565b8061103c5761103c60036008556002600955565b6000806000611424611582565b909250905061143382826113a9565b9250505090565b6000818361145b5760405162461bcd60e51b815260040161045991906119fd565b5060006110738486611b0d565b6008541580156114785750600954155b1561147f57565b60006008819055600955565b60008060008060008061149d876115c4565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114cf9087611620565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114fe9086611662565b6001600160a01b038916600090815260026020526040902055611520816116c1565b61152a848361170b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156f91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061159e82826113a9565b8210156115bb57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115e08a600854600a61172f565b92509250925060006115f0611417565b905060008060006116038e87878761177e565b919e509c509a509598509396509194505050505091939550919395565b600061117e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611042565b60008061166f8385611af5565b90508381101561117e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610459565b60006116cb611417565b905060006116d9838361132a565b306000908152600260205260409020549091506116f69082611662565b30600090815260026020526040902055505050565b6006546117189083611620565b6006556007546117289082611662565b6007555050565b60008080806117436064610acb898961132a565b905060006117566064610acb8a8961132a565b9050600061176e826117688b86611620565b90611620565b9992985090965090945050505050565b600080808061178d888661132a565b9050600061179b888761132a565b905060006117a9888861132a565b905060006117bb826117688686611620565b939b939a50919850919650505050505050565b80356117d981611baa565b919050565b6000602082840312156117ef578081fd5b813561117e81611baa565b60006020828403121561180b578081fd5b815161117e81611baa565b60008060408385031215611828578081fd5b823561183381611baa565b9150602083013561184381611baa565b809150509250929050565b600080600060608486031215611862578081fd5b833561186d81611baa565b9250602084013561187d81611baa565b929592945050506040919091013590565b600080604083850312156118a0578182fd5b82356118ab81611baa565b946020939093013593505050565b600060208083850312156118cb578182fd5b823567ffffffffffffffff808211156118e2578384fd5b818501915085601f8301126118f5578384fd5b81358181111561190757611907611b94565b8060051b604051601f19603f8301168101818110858211171561192c5761192c611b94565b604052828152858101935084860182860187018a101561194a578788fd5b8795505b838610156119735761195f816117ce565b85526001959095019493860193860161194e565b5098975050505050505050565b600060208284031215611991578081fd5b813561117e81611bbf565b6000602082840312156119ad578081fd5b815161117e81611bbf565b6000602082840312156119c9578081fd5b5035919050565b6000806000606084860312156119e4578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2957858101830151858201604001528201611a0d565b81811115611a3a5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ad45784516001600160a01b031683529383019391830191600101611aaf565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0857611b08611b7e565b500190565b600082611b2857634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4757611b47611b7e565b500290565b600082821015611b5e57611b5e611b7e565b500390565b6000600019821415611b7757611b77611b7e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104f557600080fd5b80151581146104f557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365456c6f6e2773204261627920446f6765207c20742e6d652f6562616279646f6765a2646970667358221220565186fd513a1b30295a723ff56b4ea533d91484d52a1e4b18f240bdc7fb054564736f6c63430008040033
{"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"}]}}
6,443
0x753038c469c842917bc6f13653e3b1199987ce32
/** *Submitted for verification at Etherscan.io on 2021-07-27 */ /** *Submitted for verification at Etherscan.io on 2021-07-26 * SOLAR FOX , The Next Chapter of Meme */ // 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 SolarFox is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Solar Fox Token_T.me/SolarFoxToken"; string private constant _symbol = "SolarFox"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 1; uint256 private _teamFee = 5; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 1; _teamFee = 5; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (10 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function 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 = 1000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues( tAmount, _taxFee, _teamFee ); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues( tAmount, tFee, tTeam, currentRate ); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e50565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612957565b610441565b6040516101789190612e35565b60405180910390f35b34801561018d57600080fd5b5061019661045f565b6040516101a39190612ff2565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612904565b61046e565b6040516101e09190612e35565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061286a565b610547565b005b34801561021e57600080fd5b50610227610637565b6040516102349190613067565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129e0565b610640565b005b34801561027257600080fd5b5061027b6106f2565b005b34801561028957600080fd5b506102a4600480360381019061029f919061286a565b610764565b6040516102b19190612ff2565b60405180910390f35b3480156102c657600080fd5b506102cf6107b5565b005b3480156102dd57600080fd5b506102e6610908565b6040516102f39190612d67565b60405180910390f35b34801561030857600080fd5b50610311610931565b60405161031e9190612e50565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612957565b61096e565b60405161035b9190612e35565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612997565b61098c565b005b34801561039957600080fd5b506103a2610ab6565b005b3480156103b057600080fd5b506103b9610b30565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a3a565b611089565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128c4565b6111d0565b6040516104189190612ff2565b60405180910390f35b606060405180606001604052806022815260200161379660229139905090565b600061045561044e611257565b848461125f565b6001905092915050565b600066038d7ea4c68000905090565b600061047b84848461142a565b61053c84610487611257565b6105378560405180606001604052806028815260200161376e60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104ed611257565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611be99092919063ffffffff16565b61125f565b600190509392505050565b61054f611257565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d390612f32565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610648611257565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106cc90612f32565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610733611257565b73ffffffffffffffffffffffffffffffffffffffff161461075357600080fd5b600047905061076181611c4d565b50565b60006107ae600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d48565b9050919050565b6107bd611257565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461084a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084190612f32565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f536f6c6172466f78000000000000000000000000000000000000000000000000815250905090565b600061098261097b611257565b848461142a565b6001905092915050565b610994611257565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1890612f32565b60405180910390fd5b60005b8151811015610ab2576001600a6000848481518110610a4657610a456133af565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aaa90613308565b915050610a24565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610af7611257565b73ffffffffffffffffffffffffffffffffffffffff1614610b1757600080fd5b6000610b2230610764565b9050610b2d81611db6565b50565b610b38611257565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bc5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bbc90612f32565b60405180910390fd5b600f60149054906101000a900460ff1615610c15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0c90612fb2565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ca330600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1666038d7ea4c6800061125f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610ce957600080fd5b505afa158015610cfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d219190612897565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8357600080fd5b505afa158015610d97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dbb9190612897565b6040518363ffffffff1660e01b8152600401610dd8929190612d82565b602060405180830381600087803b158015610df257600080fd5b505af1158015610e06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2a9190612897565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610eb330610764565b600080610ebe610908565b426040518863ffffffff1660e01b8152600401610ee096959493929190612dd4565b6060604051808303818588803b158015610ef957600080fd5b505af1158015610f0d573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f329190612a67565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff02191690831515021790555066038d7ea4c680006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611033929190612dab565b602060405180830381600087803b15801561104d57600080fd5b505af1158015611061573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110859190612a0d565b5050565b611091611257565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461111e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111590612f32565b60405180910390fd5b60008111611161576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115890612ef2565b60405180910390fd5b61118e60646111808366038d7ea4c6800061203e90919063ffffffff16565b6120b990919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111c59190612ff2565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c690612f92565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561133f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133690612eb2565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161141d9190612ff2565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561149a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149190612f72565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561150a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150190612e72565b60405180910390fd5b6000811161154d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154490612f52565b60405180910390fd5b611555610908565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115c35750611593610908565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b2657600f60179054906101000a900460ff16156117f6573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561164557503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561169f5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156116f95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156117f557600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661173f611257565b73ffffffffffffffffffffffffffffffffffffffff1614806117b55750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661179d611257565b73ffffffffffffffffffffffffffffffffffffffff16145b6117f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117eb90612fd2565b60405180910390fd5b5b5b60105481111561180557600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118a95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118b257600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561195d5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119b35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119cb5750600f60179054906101000a900460ff165b15611a6c5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1b57600080fd5b600a42611a289190613128565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a7730610764565b9050600f60159054906101000a900460ff16158015611ae45750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611afc5750600f60169054906101000a900460ff165b15611b2457611b0a81611db6565b60004790506000811115611b2257611b2147611c4d565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bcd5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bd757600090505b611be384848484612103565b50505050565b6000838311158290611c31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c289190612e50565b60405180910390fd5b5060008385611c409190613209565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c9d6002846120b990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cc8573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d196002846120b990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d44573d6000803e3d6000fd5b5050565b6000600654821115611d8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8690612e92565b60405180910390fd5b6000611d99612130565b9050611dae81846120b990919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dee57611ded6133de565b5b604051908082528060200260200182016040528015611e1c5781602001602082028036833780820191505090505b5090503081600081518110611e3457611e336133af565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611ed657600080fd5b505afa158015611eea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0e9190612897565b81600181518110611f2257611f216133af565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f8930600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461125f565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fed95949392919061300d565b600060405180830381600087803b15801561200757600080fd5b505af115801561201b573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561205157600090506120b3565b6000828461205f91906131af565b905082848261206e919061317e565b146120ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120a590612f12565b60405180910390fd5b809150505b92915050565b60006120fb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061215b565b905092915050565b80612111576121106121be565b5b61211c8484846121ef565b8061212a576121296123ba565b5b50505050565b600080600061213d6123cc565b9150915061215481836120b990919063ffffffff16565b9250505090565b600080831182906121a2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121999190612e50565b60405180910390fd5b50600083856121b1919061317e565b9050809150509392505050565b60006008541480156121d257506000600954145b156121dc576121ed565b600060088190555060006009819055505b565b60008060008060008061220187612428565b95509550955095509550955061225f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461249090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122f485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124da90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061234081612538565b61234a84836125f5565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123a79190612ff2565b60405180910390a3505050505050505050565b60016008819055506005600981905550565b60008060006006549050600066038d7ea4c6800090506123fe66038d7ea4c680006006546120b990919063ffffffff16565b82101561241b5760065466038d7ea4c68000935093505050612424565b81819350935050505b9091565b60008060008060008060008060006124458a60085460095461262f565b9250925092506000612455612130565b905060008060006124688e8787876126c5565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124d283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611be9565b905092915050565b60008082846124e99190613128565b90508381101561252e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161252590612ed2565b60405180910390fd5b8091505092915050565b6000612542612130565b90506000612559828461203e90919063ffffffff16565b90506125ad81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124da90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61260a8260065461249090919063ffffffff16565b600681905550612625816007546124da90919063ffffffff16565b6007819055505050565b60008060008061265b606461264d888a61203e90919063ffffffff16565b6120b990919063ffffffff16565b905060006126856064612677888b61203e90919063ffffffff16565b6120b990919063ffffffff16565b905060006126ae826126a0858c61249090919063ffffffff16565b61249090919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126de858961203e90919063ffffffff16565b905060006126f5868961203e90919063ffffffff16565b9050600061270c878961203e90919063ffffffff16565b9050600061273582612727858761249090919063ffffffff16565b61249090919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061276161275c846130a7565b613082565b9050808382526020820190508285602086028201111561278457612783613412565b5b60005b858110156127b4578161279a88826127be565b845260208401935060208301925050600181019050612787565b5050509392505050565b6000813590506127cd81613728565b92915050565b6000815190506127e281613728565b92915050565b600082601f8301126127fd576127fc61340d565b5b813561280d84826020860161274e565b91505092915050565b6000813590506128258161373f565b92915050565b60008151905061283a8161373f565b92915050565b60008135905061284f81613756565b92915050565b60008151905061286481613756565b92915050565b6000602082840312156128805761287f61341c565b5b600061288e848285016127be565b91505092915050565b6000602082840312156128ad576128ac61341c565b5b60006128bb848285016127d3565b91505092915050565b600080604083850312156128db576128da61341c565b5b60006128e9858286016127be565b92505060206128fa858286016127be565b9150509250929050565b60008060006060848603121561291d5761291c61341c565b5b600061292b868287016127be565b935050602061293c868287016127be565b925050604061294d86828701612840565b9150509250925092565b6000806040838503121561296e5761296d61341c565b5b600061297c858286016127be565b925050602061298d85828601612840565b9150509250929050565b6000602082840312156129ad576129ac61341c565b5b600082013567ffffffffffffffff8111156129cb576129ca613417565b5b6129d7848285016127e8565b91505092915050565b6000602082840312156129f6576129f561341c565b5b6000612a0484828501612816565b91505092915050565b600060208284031215612a2357612a2261341c565b5b6000612a318482850161282b565b91505092915050565b600060208284031215612a5057612a4f61341c565b5b6000612a5e84828501612840565b91505092915050565b600080600060608486031215612a8057612a7f61341c565b5b6000612a8e86828701612855565b9350506020612a9f86828701612855565b9250506040612ab086828701612855565b9150509250925092565b6000612ac68383612ad2565b60208301905092915050565b612adb8161323d565b82525050565b612aea8161323d565b82525050565b6000612afb826130e3565b612b058185613106565b9350612b10836130d3565b8060005b83811015612b41578151612b288882612aba565b9750612b33836130f9565b925050600181019050612b14565b5085935050505092915050565b612b578161324f565b82525050565b612b6681613292565b82525050565b6000612b77826130ee565b612b818185613117565b9350612b918185602086016132a4565b612b9a81613421565b840191505092915050565b6000612bb2602383613117565b9150612bbd82613432565b604082019050919050565b6000612bd5602a83613117565b9150612be082613481565b604082019050919050565b6000612bf8602283613117565b9150612c03826134d0565b604082019050919050565b6000612c1b601b83613117565b9150612c268261351f565b602082019050919050565b6000612c3e601d83613117565b9150612c4982613548565b602082019050919050565b6000612c61602183613117565b9150612c6c82613571565b604082019050919050565b6000612c84602083613117565b9150612c8f826135c0565b602082019050919050565b6000612ca7602983613117565b9150612cb2826135e9565b604082019050919050565b6000612cca602583613117565b9150612cd582613638565b604082019050919050565b6000612ced602483613117565b9150612cf882613687565b604082019050919050565b6000612d10601783613117565b9150612d1b826136d6565b602082019050919050565b6000612d33601183613117565b9150612d3e826136ff565b602082019050919050565b612d528161327b565b82525050565b612d6181613285565b82525050565b6000602082019050612d7c6000830184612ae1565b92915050565b6000604082019050612d976000830185612ae1565b612da46020830184612ae1565b9392505050565b6000604082019050612dc06000830185612ae1565b612dcd6020830184612d49565b9392505050565b600060c082019050612de96000830189612ae1565b612df66020830188612d49565b612e036040830187612b5d565b612e106060830186612b5d565b612e1d6080830185612ae1565b612e2a60a0830184612d49565b979650505050505050565b6000602082019050612e4a6000830184612b4e565b92915050565b60006020820190508181036000830152612e6a8184612b6c565b905092915050565b60006020820190508181036000830152612e8b81612ba5565b9050919050565b60006020820190508181036000830152612eab81612bc8565b9050919050565b60006020820190508181036000830152612ecb81612beb565b9050919050565b60006020820190508181036000830152612eeb81612c0e565b9050919050565b60006020820190508181036000830152612f0b81612c31565b9050919050565b60006020820190508181036000830152612f2b81612c54565b9050919050565b60006020820190508181036000830152612f4b81612c77565b9050919050565b60006020820190508181036000830152612f6b81612c9a565b9050919050565b60006020820190508181036000830152612f8b81612cbd565b9050919050565b60006020820190508181036000830152612fab81612ce0565b9050919050565b60006020820190508181036000830152612fcb81612d03565b9050919050565b60006020820190508181036000830152612feb81612d26565b9050919050565b60006020820190506130076000830184612d49565b92915050565b600060a0820190506130226000830188612d49565b61302f6020830187612b5d565b81810360408301526130418186612af0565b90506130506060830185612ae1565b61305d6080830184612d49565b9695505050505050565b600060208201905061307c6000830184612d58565b92915050565b600061308c61309d565b905061309882826132d7565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c2576130c16133de565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131338261327b565b915061313e8361327b565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561317357613172613351565b5b828201905092915050565b60006131898261327b565b91506131948361327b565b9250826131a4576131a3613380565b5b828204905092915050565b60006131ba8261327b565b91506131c58361327b565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fe576131fd613351565b5b828202905092915050565b60006132148261327b565b915061321f8361327b565b92508282101561323257613231613351565b5b828203905092915050565b60006132488261325b565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329d8261327b565b9050919050565b60005b838110156132c25780820151818401526020810190506132a7565b838111156132d1576000848401525b50505050565b6132e082613421565b810181811067ffffffffffffffff821117156132ff576132fe6133de565b5b80604052505050565b60006133138261327b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561334657613345613351565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137318161323d565b811461373c57600080fd5b50565b6137488161324f565b811461375357600080fd5b50565b61375f8161327b565b811461376a57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365536f6c617220466f7820546f6b656e5f542e6d652f536f6c6172466f78546f6b656ea2646970667358221220717afef9a540fd52a5d8107ce9cbbe880ff297bb1425968020fd338927f99ed964736f6c63430008060033
{"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"}]}}
6,444
0x644226c0513d860395ac6ed3aec4d8ba761abef9
pragma solidity ^0.4.21; interface SvEns { // Logged when the owner of a node assigns a new owner to a subnode. event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner); // Logged when the owner of a node transfers ownership to a new account. event Transfer(bytes32 indexed node, address owner); // Logged when the resolver for a node changes. event NewResolver(bytes32 indexed node, address resolver); // Logged when the TTL of a node changes event NewTTL(bytes32 indexed node, uint64 ttl); function setSubnodeOwner(bytes32 node, bytes32 label, address owner) external returns (bytes32); function setResolver(bytes32 node, address resolver) external; function setOwner(bytes32 node, address owner) external; function setTTL(bytes32 node, uint64 ttl) external; function owner(bytes32 node) external view returns (address); function resolver(bytes32 node) external view returns (address); function ttl(bytes32 node) external view returns (uint64); } interface ENS { // Logged when the owner of a node assigns a new owner to a subnode. event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner); // Logged when the owner of a node transfers ownership to a new account. event Transfer(bytes32 indexed node, address owner); // Logged when the resolver for a node changes. event NewResolver(bytes32 indexed node, address resolver); // Logged when the TTL of a node changes event NewTTL(bytes32 indexed node, uint64 ttl); function setSubnodeOwner(bytes32 node, bytes32 label, address owner) external; function setResolver(bytes32 node, address resolver) external; function setOwner(bytes32 node, address owner) external; function setTTL(bytes32 node, uint64 ttl) external; function owner(bytes32 node) external view returns (address); function resolver(bytes32 node) external view returns (address); function ttl(bytes32 node) external view returns (uint64); } contract SvEnsRegistry is SvEns { struct Record { address owner; address resolver; uint64 ttl; } mapping (bytes32 => Record) records; // Permits modifications only by the owner of the specified node. modifier only_owner(bytes32 node) { require(records[node].owner == msg.sender); _; } /** * @dev Constructs a new ENS registrar. */ function SvEnsRegistry() public { records[0x0].owner = msg.sender; } /** * @dev Transfers ownership of a node to a new address. May only be called by the current owner of the node. * @param node The node to transfer ownership of. * @param owner The address of the new owner. */ function setOwner(bytes32 node, address owner) external only_owner(node) { emit Transfer(node, owner); records[node].owner = owner; } /** * @dev Transfers ownership of a subnode keccak256(node, label) to a new address. May only be called by the owner of the parent node. * @param node The parent node. * @param label The hash of the label specifying the subnode. * @param owner The address of the new owner. */ function setSubnodeOwner(bytes32 node, bytes32 label, address owner) external only_owner(node) returns (bytes32) { bytes32 subnode = keccak256(node, label); emit NewOwner(node, label, owner); records[subnode].owner = owner; return subnode; } /** * @dev Sets the resolver address for the specified node. * @param node The node to update. * @param resolver The address of the resolver. */ function setResolver(bytes32 node, address resolver) external only_owner(node) { emit NewResolver(node, resolver); records[node].resolver = resolver; } /** * @dev Sets the TTL for the specified node. * @param node The node to update. * @param ttl The TTL in seconds. */ function setTTL(bytes32 node, uint64 ttl) external only_owner(node) { emit NewTTL(node, ttl); records[node].ttl = ttl; } /** * @dev Returns the address that owns the specified node. * @param node The specified node. * @return address of the owner. */ function owner(bytes32 node) external view returns (address) { return records[node].owner; } /** * @dev Returns the address of the resolver for the specified node. * @param node The specified node. * @return address of the resolver. */ function resolver(bytes32 node) external view returns (address) { return records[node].resolver; } /** * @dev Returns the TTL of a node, and any records associated with it. * @param node The specified node. * @return ttl of the node. */ function ttl(bytes32 node) external view returns (uint64) { return records[node].ttl; } } contract PublicResolver { bytes4 constant INTERFACE_META_ID = 0x01ffc9a7; bytes4 constant ADDR_INTERFACE_ID = 0x3b3b57de; bytes4 constant CONTENT_INTERFACE_ID = 0xd8389dc5; bytes4 constant NAME_INTERFACE_ID = 0x691f3431; bytes4 constant ABI_INTERFACE_ID = 0x2203ab56; bytes4 constant PUBKEY_INTERFACE_ID = 0xc8690233; bytes4 constant TEXT_INTERFACE_ID = 0x59d1d43c; event AddrChanged(bytes32 indexed node, address a); event ContentChanged(bytes32 indexed node, bytes32 hash); event NameChanged(bytes32 indexed node, string name); event ABIChanged(bytes32 indexed node, uint256 indexed contentType); event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y); event TextChanged(bytes32 indexed node, string indexedKey, string key); struct PublicKey { bytes32 x; bytes32 y; } struct Record { address addr; bytes32 content; string name; PublicKey pubkey; mapping(string=>string) text; mapping(uint256=>bytes) abis; } ENS ens; mapping (bytes32 => Record) records; modifier only_owner(bytes32 node) { require(ens.owner(node) == msg.sender); _; } /** * Constructor. * @param ensAddr The ENS registrar contract. */ function PublicResolver(ENS ensAddr) public { ens = ensAddr; } /** * Sets the address associated with an ENS node. * May only be called by the owner of that node in the ENS registry. * @param node The node to update. * @param addr The address to set. */ function setAddr(bytes32 node, address addr) public only_owner(node) { records[node].addr = addr; emit AddrChanged(node, addr); } /** * Sets the content hash associated with an ENS node. * May only be called by the owner of that node in the ENS registry. * Note that this resource type is not standardized, and will likely change * in future to a resource type based on multihash. * @param node The node to update. * @param hash The content hash to set */ function setContent(bytes32 node, bytes32 hash) public only_owner(node) { records[node].content = hash; emit ContentChanged(node, hash); } /** * Sets the name associated with an ENS node, for reverse records. * May only be called by the owner of that node in the ENS registry. * @param node The node to update. * @param name The name to set. */ function setName(bytes32 node, string name) public only_owner(node) { records[node].name = name; emit NameChanged(node, name); } /** * Sets the ABI associated with an ENS node. * Nodes may have one ABI of each content type. To remove an ABI, set it to * the empty string. * @param node The node to update. * @param contentType The content type of the ABI * @param data The ABI data. */ function setABI(bytes32 node, uint256 contentType, bytes data) public only_owner(node) { // Content types must be powers of 2 require(((contentType - 1) & contentType) == 0); records[node].abis[contentType] = data; emit ABIChanged(node, contentType); } /** * Sets the SECP256k1 public key associated with an ENS node. * @param node The ENS node to query * @param x the X coordinate of the curve point for the public key. * @param y the Y coordinate of the curve point for the public key. */ function setPubkey(bytes32 node, bytes32 x, bytes32 y) public only_owner(node) { records[node].pubkey = PublicKey(x, y); emit PubkeyChanged(node, x, y); } /** * Sets the text data associated with an ENS node and key. * May only be called by the owner of that node in the ENS registry. * @param node The node to update. * @param key The key to set. * @param value The text data value to set. */ function setText(bytes32 node, string key, string value) public only_owner(node) { records[node].text[key] = value; emit TextChanged(node, key, key); } /** * Returns the text data associated with an ENS node and key. * @param node The ENS node to query. * @param key The text data key to query. * @return The associated text data. */ function text(bytes32 node, string key) public view returns (string) { return records[node].text[key]; } /** * Returns the SECP256k1 public key associated with an ENS node. * Defined in EIP 619. * @param node The ENS node to query * @return x, y the X and Y coordinates of the curve point for the public key. */ function pubkey(bytes32 node) public view returns (bytes32 x, bytes32 y) { return (records[node].pubkey.x, records[node].pubkey.y); } /** * Returns the ABI associated with an ENS node. * Defined in EIP205. * @param node The ENS node to query * @param contentTypes A bitwise OR of the ABI formats accepted by the caller. * @return contentType The content type of the return value * @return data The ABI data */ function ABI(bytes32 node, uint256 contentTypes) public view returns (uint256 contentType, bytes data) { Record storage record = records[node]; for (contentType = 1; contentType <= contentTypes; contentType <<= 1) { if ((contentType & contentTypes) != 0 && record.abis[contentType].length > 0) { data = record.abis[contentType]; return; } } contentType = 0; } /** * Returns the name associated with an ENS node, for reverse records. * Defined in EIP181. * @param node The ENS node to query. * @return The associated name. */ function name(bytes32 node) public view returns (string) { return records[node].name; } /** * Returns the content hash associated with an ENS node. * Note that this resource type is not standardized, and will likely change * in future to a resource type based on multihash. * @param node The ENS node to query. * @return The associated content hash. */ function content(bytes32 node) public view returns (bytes32) { return records[node].content; } /** * Returns the address associated with an ENS node. * @param node The ENS node to query. * @return The associated address. */ function addr(bytes32 node) public view returns (address) { return records[node].addr; } /** * Returns true if the resolver implements the interface specified by the provided hash. * @param interfaceID The ID of the interface to check for. * @return True if the contract implements the requested interface. */ function supportsInterface(bytes4 interfaceID) public pure returns (bool) { return interfaceID == ADDR_INTERFACE_ID || interfaceID == CONTENT_INTERFACE_ID || interfaceID == NAME_INTERFACE_ID || interfaceID == ABI_INTERFACE_ID || interfaceID == PUBKEY_INTERFACE_ID || interfaceID == TEXT_INTERFACE_ID || interfaceID == INTERFACE_META_ID; } } contract SvEnsRegistrar { SvEns public ens; bytes32 public rootNode; mapping (bytes32 => bool) knownNodes; mapping (address => bool) admins; address public owner; modifier req(bool c) { require(c); _; } /** * Constructor. * @param ensAddr The address of the ENS registry. * @param node The node that this registrar administers. */ function SvEnsRegistrar(SvEns ensAddr, bytes32 node) public { ens = ensAddr; rootNode = node; admins[msg.sender] = true; owner = msg.sender; } function addAdmin(address newAdmin) req(admins[msg.sender]) external { admins[newAdmin] = true; } function remAdmin(address oldAdmin) req(admins[msg.sender]) external { require(oldAdmin != msg.sender && oldAdmin != owner); admins[oldAdmin] = false; } function chOwner(address newOwner, bool remPrevOwnerAsAdmin) req(msg.sender == owner) external { if (remPrevOwnerAsAdmin) { admins[owner] = false; } owner = newOwner; admins[newOwner] = true; } /** * Register a name that&#39;s not currently registered * @param subnode The hash of the label to register. * @param _owner The address of the new owner. */ function register(bytes32 subnode, address _owner) req(admins[msg.sender]) external { _setSubnodeOwner(subnode, _owner); } /** * Register a name that&#39;s not currently registered * @param subnodeStr The label to register. * @param _owner The address of the new owner. */ function registerName(string subnodeStr, address _owner) req(admins[msg.sender]) external { // labelhash bytes32 subnode = keccak256(subnodeStr); _setSubnodeOwner(subnode, _owner); } /** * INTERNAL - Register a name that&#39;s not currently registered * @param subnode The hash of the label to register. * @param _owner The address of the new owner. */ function _setSubnodeOwner(bytes32 subnode, address _owner) internal { require(!knownNodes[subnode]); knownNodes[subnode] = true; ens.setSubnodeOwner(rootNode, subnode, _owner); } } contract SvEnsEverythingPx { address public owner; mapping (address => bool) public admins; address[] public adminLog; SvEnsRegistrar public registrar; SvEnsRegistry public registry; PublicResolver public resolver; bytes32 public rootNode; modifier only_admin() { require(admins[msg.sender]); _; } function SvEnsEverythingPx(SvEnsRegistrar _registrar, SvEnsRegistry _registry, PublicResolver _resolver, bytes32 _rootNode) public { registrar = _registrar; registry = _registry; resolver = _resolver; rootNode = _rootNode; owner = msg.sender; _addAdmin(msg.sender); } function _addAdmin(address a) internal { admins[a] = true; adminLog.push(a); } function addAdmin(address a) only_admin() external { _addAdmin(a); } function remAdmin(address a) only_admin() external { require(a != owner && a != msg.sender); admins[a] = false; } function regName(string name, address resolveTo) only_admin() external returns (bytes32 node) { bytes32 labelhash = keccak256(name); registrar.register(labelhash, this); node = keccak256(rootNode, labelhash); registry.setResolver(node, resolver); resolver.setAddr(node, resolveTo); registry.setOwner(node, msg.sender); } }
0x60606040526004361061008a5763ffffffff60e060020a60003504166304f3bcec811461008f57806311c60418146100be5780631806d254146100df5780632b20e397146100f5578063429b62e514610108578063704802751461013b5780637b1039991461015a5780638da5cb5b1461016d5780639e36fde714610180578063faff50a8146101be575b600080fd5b341561009a57600080fd5b6100a26101d1565b604051600160a060020a03909116815260200160405180910390f35b34156100c957600080fd5b6100dd600160a060020a03600435166101e0565b005b34156100ea57600080fd5b6100a2600435610263565b341561010057600080fd5b6100a261028b565b341561011357600080fd5b610127600160a060020a036004351661029a565b604051901515815260200160405180910390f35b341561014657600080fd5b6100dd600160a060020a03600435166102af565b341561016557600080fd5b6100a26102e2565b341561017857600080fd5b6100a26102f1565b341561018b57600080fd5b6101ac6024600480358281019291013590600160a060020a03903516610300565b60405190815260200160405180910390f35b34156101c957600080fd5b6101ac610517565b600554600160a060020a031681565b600160a060020a03331660009081526001602052604090205460ff16151561020757600080fd5b600054600160a060020a03828116911614801590610237575033600160a060020a031681600160a060020a031614155b151561024257600080fd5b600160a060020a03166000908152600160205260409020805460ff19169055565b600280548290811061027157fe5b600091825260209091200154600160a060020a0316905081565b600354600160a060020a031681565b60016020526000908152604090205460ff1681565b600160a060020a03331660009081526001602052604090205460ff1615156102d657600080fd5b6102df8161051d565b50565b600454600160a060020a031681565b600054600160a060020a031681565b600160a060020a033316600090815260016020526040812054819060ff16151561032957600080fd5b848460405180838380828437820191505092505050604051908190039020600354909150600160a060020a031663d22057a9823060405160e060020a63ffffffff85160281526004810192909252600160a060020a03166024820152604401600060405180830381600087803b15156103a157600080fd5b5af115156103ae57600080fd5b50505060065481604051918252602082015260409081019051908190039020600454600554919350600160a060020a0390811691631896f70a9185911660405160e060020a63ffffffff85160281526004810192909252600160a060020a03166024820152604401600060405180830381600087803b151561042f57600080fd5b5af1151561043c57600080fd5b5050600554600160a060020a0316905063d5fa2b00838560405160e060020a63ffffffff85160281526004810192909252600160a060020a03166024820152604401600060405180830381600087803b151561049757600080fd5b5af115156104a457600080fd5b5050600454600160a060020a03169050635b0fc9c3833360405160e060020a63ffffffff85160281526004810192909252600160a060020a03166024820152604401600060405180830381600087803b15156104ff57600080fd5b5af1151561050c57600080fd5b505050509392505050565b60065481565b600160a060020a0381166000908152600160208190526040909120805460ff1916821790556002805490918101610554838261058d565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b8154818355818115116105b1576000838152602090206105b19181019083016105b6565b505050565b6105d491905b808211156105d057600081556001016105bc565b5090565b905600a165627a7a7230582063422d7fa20bfa3017c3763defcbae1c412ebe0f8987b361fc013889ede34e550029
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
6,445
0x815eecb926095fe3613418f1e2dbbd3c29e70a8b
pragma solidity ^0.4.18; /** * @title Smart City Token https://www.smartcitycoin.io * @dev ERC20 standard compliant / https://github.com/ethereum/EIPs/issues/20 / * @dev Amount not sold during Crowdsale is burned */ contract SmartCityToken { using SafeMath for uint256; address public owner; // address of Token Owner address public crowdsale; // address of Crowdsale contract string constant public standard = "ERC20"; // token standard string constant public name = "Smart City"; // token name string constant public symbol = "CITY"; // token symbol uint256 constant public decimals = 5; // 1 CITY = 100000 tokens uint256 public totalSupply = 252862966307692; // total token provision uint256 constant public amountForSale = 164360928100000; // amount that might be sold during ICO - 65% of total token supply uint256 constant public amountReserved = 88502038207692; // amount reserved for founders / loyalty / bounties / etc. - 35% of total token supply uint256 constant public amountLocked = 61951426745384; // the amount of tokens Owner cannot spend within first 2 years after Crowdsale - 70% of the reserved amount uint256 public startTime; // from this time on transfer and transferFrom functions are available to anyone except of token Owner uint256 public unlockOwnerDate; // from this time on transfer and transferFrom functions are available to token Owner mapping(address => uint256) public balances; // balances array mapping(address => mapping(address => uint256)) public allowances; // allowances array bool public burned; // indicates whether excess tokens have already been burned event Transfer(address indexed from, address indexed to, uint256 value); // Transfer event event Approval(address indexed _owner, address indexed spender, uint256 value); // Approval event event Burned(uint256 amount); // Burned event modifier onlyPayloadSize(uint size) { assert(msg.data.length >= size + 4); _; } /** * @dev Contract initialization * @param _ownerAddress address Token owner address * @param _startTime uint256 Crowdsale end time * */ function SmartCityToken(address _ownerAddress, uint256 _startTime) public { owner = _ownerAddress; // token Owner startTime = _startTime; // token Start Time unlockOwnerDate = startTime + 2 years; balances[owner] = totalSupply; // all tokens are initially allocated to token owner } /** * @dev Transfers token for a specified address * @param _to address The address to transfer to * @param _value uint256 The amount to be transferred */ function transfer(address _to, uint256 _value) onlyPayloadSize(2 * 32) public returns(bool success) { require(now >= startTime); require(_to != address(0)); require(_value <= balances[msg.sender]); if (msg.sender == owner && now < unlockOwnerDate) require(balances[msg.sender].sub(_value) >= amountLocked); balances[msg.sender] = balances[msg.sender].sub(_value); // subtract requested amount from the sender address balances[_to] = balances[_to].add(_value); // send requested amount to the target address //Transfer(msg.sender, _to, _value); // trigger Transfer event return true; } /** * @dev Transfers 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) onlyPayloadSize(3 * 32) public returns(bool success) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowances[_from][msg.sender]); if (now < startTime) require(_from == owner); if (_from == owner && now < unlockOwnerDate) require(balances[_from].sub(_value) >= amountLocked); uint256 _allowance = allowances[_from][msg.sender]; balances[_from] = balances[_from].sub(_value); // subtract requested amount from the sender address balances[_to] = balances[_to].add(_value); // send requested amount to the target address allowances[_from][msg.sender] = _allowance.sub(_value); // reduce sender allowance by transferred amount //Transfer(_from, _to, _value); // trigger Transfer event return true; } /** * @dev Gets the balance of the specified address. * @param _addr address The address to query the balance of. * @return uint256 representing the amount owned by the passed address. */ function balanceOf(address _addr) public view returns (uint256 balance) { return balances[_addr]; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender address The address which will spend the funds * @param _value uint256 The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) onlyPayloadSize(2 * 32) public returns(bool success) { return _approve(_spender, _value); } /** * @dev Workaround for vulnerability described here: https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM */ function _approve(address _spender, uint256 _value) internal returns(bool success) { require((_value == 0) || (allowances[msg.sender][_spender] == 0)); allowances[msg.sender][_spender] = _value; // Set spender allowance Approval(msg.sender, _spender, _value); // Trigger Approval event return true; } /** * @dev Burns all the tokens which has not been sold during ICO */ function burn() public { if (!burned && now > startTime) { uint256 diff = balances[owner].sub(amountReserved); // Get the amount of unsold tokens balances[owner] = amountReserved; totalSupply = totalSupply.sub(diff); // Reduce total provision number burned = true; Burned(diff); // Trigger Burned event } } /** * @dev Sets Corwdsale contract address & allowance * @param _crowdsaleAddress address The address of the Crowdsale contract */ function setCrowdsale(address _crowdsaleAddress) public { require(msg.sender == owner); require(crowdsale == address(0)); crowdsale = _crowdsaleAddress; assert(_approve(crowdsale, amountForSale)); } } /** * @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) { uint256 c = a / b; 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; } } /** * CITY 2.0 token by www.SmartCityCoin.io * * .ossssss: `+sssss` * ` +ssssss+` `.://++++++//:.` .osssss+ * /sssssssssssssssssssssssss+ssssso` * -sssssssssssssssssssssssssssss+` * .+sssssssss+:--....--:/ossssssss+. * `/ssssssssssso` .sssssssssss/` * .ossssss+sssssss- :sssss+:ossssso. * `ossssso. .ossssss: `/sssss/ `/ssssss. * ossssso` `+ssssss+` .osssss: /ssssss` * :ssssss` /sssssso:ssssso. +o+/:-` * osssss+ -sssssssssss+` * ssssss: .ossssssss/ * osssss/ `+ssssss- * /ssssso :ssssss * .ssssss- :ssssss * :ssssss- :ssssss ` * /ssssss/` :ssssss `/s+:` * :sssssso:. :ssssss ./ssssss+` * .+ssssssso/-.`:ssssss``.-/osssssss+. * .+ssssssssssssssssssssssssssss+- * `:+ssssssssssssssssssssss+:` * `.:+osssssssssssso+:.` * `/ssssss.` * :ssssss */
0x60606040526004361061011c5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630204d0f8811461012157806306fdde0314610146578063095ea7b3146101d057806318160ddd1461020657806323b872dd1461021957806327e235e314610241578063313ce5671461026057806344df8e7014610273578063483a20b21461028857806355b6ed5c146102a75780635a3b7e42146102cc5780636c6c7e05146102df57806370a08231146102f257806373f425611461031157806378e97925146103245780638473e55f146103375780638da5cb5b1461034a57806395d89b41146103795780639c1e03a01461038c578063a9059cbb1461039f578063ea0d8da4146103c1575b600080fd5b341561012c57600080fd5b6101346103d4565b60405190815260200160405180910390f35b341561015157600080fd5b6101596103da565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561019557808201518382015260200161017d565b50505050905090810190601f1680156101c25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101db57600080fd5b6101f2600160a060020a0360043516602435610411565b604051901515815260200160405180910390f35b341561021157600080fd5b610134610432565b341561022457600080fd5b6101f2600160a060020a0360043581169060243516604435610438565b341561024c57600080fd5b610134600160a060020a0360043516610612565b341561026b57600080fd5b610134610624565b341561027e57600080fd5b610286610629565b005b341561029357600080fd5b610286600160a060020a03600435166106f2565b34156102b257600080fd5b610134600160a060020a036004358116906024351661076a565b34156102d757600080fd5b610159610787565b34156102ea57600080fd5b6101346107be565b34156102fd57600080fd5b610134600160a060020a03600435166107c8565b341561031c57600080fd5b6101f26107e3565b341561032f57600080fd5b6101346107ec565b341561034257600080fd5b6101346107f2565b341561035557600080fd5b61035d6107fc565b604051600160a060020a03909116815260200160405180910390f35b341561038457600080fd5b61015961080b565b341561039757600080fd5b61035d610842565b34156103aa57600080fd5b6101f2600160a060020a0360043516602435610851565b34156103cc57600080fd5b61013461098b565b60045481565b60408051908101604052600a81527f536d617274204369747900000000000000000000000000000000000000000000602082015281565b60006040604436101561042057fe5b61042a8484610995565b949350505050565b60025481565b6000806060606436101561044857fe5b600160a060020a038516151561045d57600080fd5b600160a060020a03861660009081526005602052604090205484111561048257600080fd5b600160a060020a03808716600090815260066020908152604080832033909416835292905220548411156104b557600080fd5b6003544210156104d957600054600160a060020a038781169116146104d957600080fd5b600054600160a060020a0387811691161480156104f7575060045442105b1561053857600160a060020a03861660009081526005602052604090205465385830c8d4289061052d908663ffffffff610a3b16565b101561053857600080fd5b600160a060020a03808716600081815260066020908152604080832033909516835293815283822054928252600590529190912054909250610580908563ffffffff610a3b16565b600160a060020a0380881660009081526005602052604080822093909355908716815220546105b5908563ffffffff610a4d16565b600160a060020a0386166000908152600560205260409020556105de828563ffffffff610a3b16565b600160a060020a03808816600090815260066020908152604080832033909416835292905220556001925050509392505050565b60056020526000908152604090205481565b600581565b60075460009060ff16158015610640575060035442115b156106ef5760008054600160a060020a03168152600560205260409020546106749065507dfc8c9ccc63ffffffff610a3b16565b60008054600160a060020a0316815260056020526040902065507dfc8c9ccc90556002549091506106ab908263ffffffff610a3b16565b6002556007805460ff191660011790557fd83c63197e8e676d80ab0122beba9a9d20f3828839e9a1d6fe81d242e9cd7e6e8160405190815260200160405180910390a15b50565b60005433600160a060020a0390811691161461070d57600080fd5b600154600160a060020a03161561072357600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169190911791829055610762911665957c42bbfea0610995565b15156106ef57fe5b600660209081526000928352604080842090915290825290205481565b60408051908101604052600581527f4552433230000000000000000000000000000000000000000000000000000000602082015281565b65385830c8d42881565b600160a060020a031660009081526005602052604090205490565b60075460ff1681565b60035481565b65957c42bbfea081565b600054600160a060020a031681565b60408051908101604052600481527f4349545900000000000000000000000000000000000000000000000000000000602082015281565b600154600160a060020a031681565b60006040604436101561086057fe5b60035442101561086f57600080fd5b600160a060020a038416151561088457600080fd5b600160a060020a0333166000908152600560205260409020548311156108a957600080fd5b60005433600160a060020a0390811691161480156108c8575060045442105b1561090957600160a060020a03331660009081526005602052604090205465385830c8d428906108fe908563ffffffff610a3b16565b101561090957600080fd5b600160a060020a033316600090815260056020526040902054610932908463ffffffff610a3b16565b600160a060020a033381166000908152600560205260408082209390935590861681522054610967908463ffffffff610a4d16565b600160a060020a038516600090815260056020526040902055600191505092915050565b65507dfc8c9ccc81565b60008115806109c75750600160a060020a03338116600090815260066020908152604080832093871683529290522054155b15156109d257600080fd5b600160a060020a03338116600081815260066020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b600082821115610a4757fe5b50900390565b600082820183811015610a5c57fe5b93925050505600a165627a7a723058204076ea134024ef37b2d79911dca46ecd0d396bf44062e99fdef3d1d27d65102f0029
{"success": true, "error": null, "results": {}}
6,446
0x014679471293e61990f41f3eda42ae7536615a52
/** *Submitted for verification at Etherscan.io on 2022-05-03 */ //https://t.me/Mooninuportal 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 MOONINU 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 = "MOON INU"; string private constant _symbol = "MINU"; 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(0x42cb7A3C34183f3bbB551b8aB9596AF8fD43dDbC); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal.mul(20).div(1000); _maxWalletSize = _tTotal.mul(20).div(1000); tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610339578063b87f137a14610359578063c3c8cd8014610379578063c9567bf91461038e578063dd62ed3e146103a357600080fd5b806370a082311461029a578063715018a6146102ba578063751039fc146102cf5780638da5cb5b146102e457806395d89b411461030c57600080fd5b8063273123b7116100e7578063273123b714610209578063313ce567146102295780635932ead114610245578063677daa57146102655780636fc3eaec1461028557600080fd5b806306fdde031461012f578063095ea7b31461017257806318160ddd146101a25780631b3f71ae146101c757806323b872dd146101e957600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b506040805180820190915260088152674d4f4f4e20494e5560c01b60208201525b60405161016991906119bd565b60405180910390f35b34801561017e57600080fd5b5061019261018d366004611844565b6103e9565b6040519015158152602001610169565b3480156101ae57600080fd5b50670de0b6b3a76400005b604051908152602001610169565b3480156101d357600080fd5b506101e76101e2366004611870565b610400565b005b3480156101f557600080fd5b50610192610204366004611803565b61049f565b34801561021557600080fd5b506101e7610224366004611790565b610508565b34801561023557600080fd5b5060405160098152602001610169565b34801561025157600080fd5b506101e761026036600461193c565b610553565b34801561027157600080fd5b506101e7610280366004611976565b61059b565b34801561029157600080fd5b506101e76105f5565b3480156102a657600080fd5b506101b96102b5366004611790565b610622565b3480156102c657600080fd5b506101e7610644565b3480156102db57600080fd5b506101e76106b8565b3480156102f057600080fd5b506000546040516001600160a01b039091168152602001610169565b34801561031857600080fd5b506040805180820190915260048152634d494e5560e01b602082015261015c565b34801561034557600080fd5b50610192610354366004611844565b6106f5565b34801561036557600080fd5b506101e7610374366004611976565b610702565b34801561038557600080fd5b506101e7610756565b34801561039a57600080fd5b506101e761078c565b3480156103af57600080fd5b506101b96103be3660046117ca565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103f6338484610b89565b5060015b92915050565b6000546001600160a01b031633146104335760405162461bcd60e51b815260040161042a90611a12565b60405180910390fd5b60005b815181101561049b5760016006600084848151811061045757610457611b59565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061049381611b28565b915050610436565b5050565b60006104ac848484610cad565b6104fe84336104f985604051806060016040528060288152602001611ba9602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906110a0565b610b89565b5060019392505050565b6000546001600160a01b031633146105325760405162461bcd60e51b815260040161042a90611a12565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461057d5760405162461bcd60e51b815260040161042a90611a12565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105c55760405162461bcd60e51b815260040161042a90611a12565b600081116105d257600080fd5b6105ef60646105e9670de0b6b3a7640000846110da565b90611160565b600f5550565b600c546001600160a01b0316336001600160a01b03161461061557600080fd5b4761061f816111a2565b50565b6001600160a01b0381166000908152600260205260408120546103fa906111dc565b6000546001600160a01b0316331461066e5760405162461bcd60e51b815260040161042a90611a12565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106e25760405162461bcd60e51b815260040161042a90611a12565b670de0b6b3a7640000600f819055601055565b60006103f6338484610cad565b6000546001600160a01b0316331461072c5760405162461bcd60e51b815260040161042a90611a12565b6000811161073957600080fd5b61075060646105e9670de0b6b3a7640000846110da565b60105550565b600c546001600160a01b0316336001600160a01b03161461077657600080fd5b600061078130610622565b905061061f81611259565b6000546001600160a01b031633146107b65760405162461bcd60e51b815260040161042a90611a12565b600e54600160a01b900460ff16156108105760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161042a565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561084c3082670de0b6b3a7640000610b89565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561088557600080fd5b505afa158015610899573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108bd91906117ad565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090557600080fd5b505afa158015610919573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093d91906117ad565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561098557600080fd5b505af1158015610999573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109bd91906117ad565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d71947306109ed81610622565b600080610a026000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a6557600080fd5b505af1158015610a79573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a9e919061198f565b5050600e805461ffff60b01b191661010160b01b17905550610acf6103e86105e9670de0b6b3a764000060146110da565b600f55610aeb6103e86105e9670de0b6b3a764000060146110da565b601055600e8054600160a01b60ff60a01b19821617909155600d5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b5157600080fd5b505af1158015610b65573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049b9190611959565b6001600160a01b038316610beb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161042a565b6001600160a01b038216610c4c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161042a565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d115760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161042a565b6001600160a01b038216610d735760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161042a565b60008111610dd55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161042a565b6000600a818155600b55546001600160a01b03848116911614801590610e0957506000546001600160a01b03838116911614155b15611090576001600160a01b03831660009081526006602052604090205460ff16158015610e5057506001600160a01b03821660009081526006602052604090205460ff16155b610e5957600080fd5b600e546001600160a01b038481169116148015610e845750600d546001600160a01b03838116911614155b8015610ea957506001600160a01b03821660009081526005602052604090205460ff16155b8015610ebe5750600e54600160b81b900460ff165b15610fc357600f54811115610f155760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e00000000000000604482015260640161042a565b60105481610f2284610622565b610f2c9190611ab8565b1115610f7a5760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e000000000000604482015260640161042a565b6001600160a01b0382166000908152600760205260409020544211610f9e57600080fd5b610fa942601e611ab8565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b038381169116148015610fee5750600d546001600160a01b03848116911614155b801561101357506001600160a01b03831660009081526005602052604090205460ff16155b15611023576000600a908155600b555b600061102e30610622565b600e54909150600160a81b900460ff161580156110595750600e546001600160a01b03858116911614155b801561106e5750600e54600160b01b900460ff165b1561108e5761107c81611259565b47801561108c5761108c476111a2565b505b505b61109b8383836113e2565b505050565b600081848411156110c45760405162461bcd60e51b815260040161042a91906119bd565b5060006110d18486611b11565b95945050505050565b6000826110e9575060006103fa565b60006110f58385611af2565b9050826111028583611ad0565b146111595760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161042a565b9392505050565b600061115983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113ed565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561049b573d6000803e3d6000fd5b60006008548211156112435760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161042a565b600061124d61141b565b90506111598382611160565b600e805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112a1576112a1611b59565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156112f557600080fd5b505afa158015611309573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132d91906117ad565b8160018151811061134057611340611b59565b6001600160a01b039283166020918202929092010152600d546113669130911684610b89565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061139f908590600090869030904290600401611a47565b600060405180830381600087803b1580156113b957600080fd5b505af11580156113cd573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b61109b83838361143e565b6000818361140e5760405162461bcd60e51b815260040161042a91906119bd565b5060006110d18486611ad0565b6000806000611428611535565b90925090506114378282611160565b9250505090565b60008060008060008061145087611575565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061148290876115d2565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114b19086611614565b6001600160a01b0389166000908152600260205260409020556114d381611673565b6114dd84836116bd565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161152291815260200190565b60405180910390a3505050505050505050565b6008546000908190670de0b6b3a76400006115508282611160565b82101561156c57505060085492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006115928a600a54600b546116e1565b92509250925060006115a261141b565b905060008060006115b58e878787611730565b919e509c509a509598509396509194505050505091939550919395565b600061115983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506110a0565b6000806116218385611ab8565b9050838110156111595760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161042a565b600061167d61141b565b9050600061168b83836110da565b306000908152600260205260409020549091506116a89082611614565b30600090815260026020526040902055505050565b6008546116ca90836115d2565b6008556009546116da9082611614565b6009555050565b60008080806116f560646105e989896110da565b9050600061170860646105e98a896110da565b905060006117208261171a8b866115d2565b906115d2565b9992985090965090945050505050565b600080808061173f88866110da565b9050600061174d88876110da565b9050600061175b88886110da565b9050600061176d8261171a86866115d2565b939b939a50919850919650505050505050565b803561178b81611b85565b919050565b6000602082840312156117a257600080fd5b813561115981611b85565b6000602082840312156117bf57600080fd5b815161115981611b85565b600080604083850312156117dd57600080fd5b82356117e881611b85565b915060208301356117f881611b85565b809150509250929050565b60008060006060848603121561181857600080fd5b833561182381611b85565b9250602084013561183381611b85565b929592945050506040919091013590565b6000806040838503121561185757600080fd5b823561186281611b85565b946020939093013593505050565b6000602080838503121561188357600080fd5b823567ffffffffffffffff8082111561189b57600080fd5b818501915085601f8301126118af57600080fd5b8135818111156118c1576118c1611b6f565b8060051b604051601f19603f830116810181811085821117156118e6576118e6611b6f565b604052828152858101935084860182860187018a101561190557600080fd5b600095505b8386101561192f5761191b81611780565b85526001959095019493860193860161190a565b5098975050505050505050565b60006020828403121561194e57600080fd5b813561115981611b9a565b60006020828403121561196b57600080fd5b815161115981611b9a565b60006020828403121561198857600080fd5b5035919050565b6000806000606084860312156119a457600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156119ea578581018301518582016040015282016119ce565b818111156119fc576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a975784516001600160a01b031683529383019391830191600101611a72565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611acb57611acb611b43565b500190565b600082611aed57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611b0c57611b0c611b43565b500290565b600082821015611b2357611b23611b43565b500390565b6000600019821415611b3c57611b3c611b43565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461061f57600080fd5b801515811461061f57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201e3dd5e8f034b81469dd374cc0126b5422ff5cbdde6564e806ed85f3353554a564736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,447
0xa4683a1ea676469a0732be50d6524e2e4899ffbe
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } interface IVoteProxy { function decimals() external pure returns (uint8); function totalSupply() external view returns (uint256); function balanceOf(address _voter) external view returns (uint256); } interface IFaasPool is IERC20 { function getBalance(address token) external view returns (uint256); function getUserInfo(uint256 _pid, address _account) external view returns ( uint256 amount, uint256 rewardDebt, uint256 accumulatedEarned, uint256 lockReward, uint256 lockRewardReleased ); } contract BsdVote is IVoteProxy { using SafeMath for uint256; IFaasPool[10] public faasPools; IERC20[10] public stakePools; IERC20 bsdsToken; address public bsds; uint256 public totalFaasPools; uint256 public totalStakePools; address public governance; constructor( address _bsds, address[] memory _faasPoolAddresses, address[] memory _stakePoolAddresses ) public { _setFaasPools(_faasPoolAddresses); _setStakePools(_stakePoolAddresses); bsds = _bsds; bsdsToken = IERC20(bsds); governance = msg.sender; } function _setFaasPools(address[] memory _faasPoolAddresses) internal { totalFaasPools = _faasPoolAddresses.length; for (uint256 i = 0; i < totalFaasPools; i++) { faasPools[i] = IFaasPool(_faasPoolAddresses[i]); } } function _setStakePools(address[] memory _stakePoolAddresses) internal { totalStakePools = _stakePoolAddresses.length; for (uint256 i = 0; i < totalStakePools; i++) { stakePools[i] = IERC20(_stakePoolAddresses[i]); } } function decimals() public pure virtual override returns (uint8) { return uint8(18); } function totalSupply() public view override returns (uint256) { uint256 totalSupplyPool = 0; uint256 i; for (i = 0; i < totalFaasPools; i++) { totalSupplyPool = totalSupplyPool.add(bsdsToken.balanceOf(address(faasPools[i]))); } uint256 totalSupplyStake = 0; for (i = 0; i < totalStakePools; i++) { totalSupplyStake = totalSupplyStake.add(bsdsToken.balanceOf(address(stakePools[i]))); } return totalSupplyPool.add(totalSupplyStake); } function totalInFaaSPool() public view returns (uint256) { uint256 total = 0; uint256 i; for (i = 0; i < totalFaasPools; i++) { total = total.add(bsdsToken.balanceOf(address(faasPools[i]))); } return total; } function totalInStakePool() public view returns (uint256) { uint256 total = 0; uint256 i; for (i = 0; i < totalStakePools; i++) { total = total.add(bsdsToken.balanceOf(address(stakePools[i]))); } return total; } function getBsdsAmountInPool(address _voter) internal view returns (uint256) { uint256 stakeAmount = 0; for (uint256 i = 0; i < totalFaasPools; i++) { (uint256 _stakeAmountInPool, , , , ) = faasPools[i].getUserInfo(0, _voter); stakeAmount = stakeAmount.add(_stakeAmountInPool.mul(faasPools[i].getBalance(bsds)).div(faasPools[i].totalSupply())); } return stakeAmount; } function getBsdsAmountInStakeContracts(address _voter) internal view returns (uint256) { uint256 stakeAmount = 0; for (uint256 i = 0; i < totalStakePools; i++) { stakeAmount = stakeAmount.add(stakePools[i].balanceOf(_voter)); } return stakeAmount; } function balanceOf(address _voter) public view override returns (uint256) { uint256 balanceInPool = getBsdsAmountInPool(_voter); uint256 balanceInStakeContract = getBsdsAmountInStakeContracts(_voter); return balanceInPool.add(balanceInStakeContract); } function setFaasPools(address[] memory _faasPoolAddresses) external { require(msg.sender == governance, "!governance"); _setFaasPools(_faasPoolAddresses); } function setStakePools(address[] memory _stakePoolAddresses) external { require(msg.sender == governance, "!governance"); _setStakePools(_stakePoolAddresses); } }
0x608060405234801561001057600080fd5b50600436106100df5760003560e01c806370a082311161008c578063c6dd6edf11610066578063c6dd6edf1461025a578063f784a603146102fd578063f87e95ca14610305578063fc03327814610322576100df565b806370a08231146102175780639f93993c1461024a578063a8dd8e6414610252576100df565b806331f57ff2116100bd57806331f57ff2146101245780635aa6e6751461016a5780635baace1414610172576100df565b8063048898b7146100e457806318160ddd146100fe578063313ce56714610106575b600080fd5b6100ec61032a565b60408051918252519081900360200190f35b6100ec610416565b61010e610559565b6040805160ff9092168252519081900360200190f35b6101416004803603602081101561013a57600080fd5b503561055e565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b610141610588565b6102156004803603602081101561018857600080fd5b8101906020810181356401000000008111156101a357600080fd5b8201836020820111156101b557600080fd5b803590602001918460208302840111640100000000831117156101d757600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506105a4945050505050565b005b6100ec6004803603602081101561022d57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610636565b6100ec610663565b6101416106ab565b6102156004803603602081101561027057600080fd5b81019060208101813564010000000081111561028b57600080fd5b82018360208201111561029d57600080fd5b803590602001918460208302840111640100000000831117156102bf57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506106c7945050505050565b6100ec610756565b6101416004803603602081101561031b57600080fd5b503561075c565b6100ec610769565b600080805b601754811015610410576014546104069073ffffffffffffffffffffffffffffffffffffffff166370a08231600a8481811061036757fe5b0154604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff9092166004830152516024808301926020929190829003018186803b1580156103d357600080fd5b505afa1580156103e7573d6000803e3d6000fd5b505050506040513d60208110156103fd57600080fd5b5051839061076f565b915060010161032f565b50905090565b600080805b60165481101561045e576014546104549073ffffffffffffffffffffffffffffffffffffffff166370a08231600084600a811061036757fe5b915060010161041b565b506000805b6017548210156105475760145461053a9073ffffffffffffffffffffffffffffffffffffffff166370a08231600a8581811061049b57fe5b0154604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff9092166004830152516024808301926020929190829003018186803b15801561050757600080fd5b505afa15801561051b573d6000803e3d6000fd5b505050506040513d602081101561053157600080fd5b5051829061076f565b6001909201919050610463565b610551838261076f565b935050505090565b601290565b600a81600a811061056b57fe5b015473ffffffffffffffffffffffffffffffffffffffff16905081565b60185473ffffffffffffffffffffffffffffffffffffffff1681565b60185473ffffffffffffffffffffffffffffffffffffffff16331461062a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21676f7665726e616e6365000000000000000000000000000000000000000000604482015290519081900360640190fd5b610633816107ec565b50565b6000806106428361086f565b9050600061064f84610ab0565b905061065b828261076f565b949350505050565b600080805b601654811015610410576014546106a19073ffffffffffffffffffffffffffffffffffffffff166370a08231600084600a811061036757fe5b9150600101610668565b60155473ffffffffffffffffffffffffffffffffffffffff1681565b60185473ffffffffffffffffffffffffffffffffffffffff16331461074d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21676f7665726e616e6365000000000000000000000000000000000000000000604482015290519081900360640190fd5b61063381610b4b565b60165481565b600081600a811061056b57fe5b60175481565b6000828201838110156107e357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b805160165560005b60165481101561086b5781818151811061080a57fe5b6020026020010151600082600a811061081f57fe5b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169190911790556001016107f4565b5050565b600080805b601654811015610aa95760008082600a811061088c57fe5b0154604080517f1069f3b50000000000000000000000000000000000000000000000000000000081526000600482015273ffffffffffffffffffffffffffffffffffffffff888116602483015291519190921691631069f3b59160448083019260a0929190829003018186803b15801561090557600080fd5b505afa158015610919573d6000803e3d6000fd5b505050506040513d60a081101561092f57600080fd5b50519050610a9e610a97600084600a811061094657fe5b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156109ad57600080fd5b505afa1580156109c1573d6000803e3d6000fd5b505050506040513d60208110156109d757600080fd5b5051610a91600086600a81106109e957fe5b0154601554604080517ff8b2cb4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff92831660048201529051919092169163f8b2cb4f916024808301926020929190829003018186803b158015610a5e57600080fd5b505afa158015610a72573d6000803e3d6000fd5b505050506040513d6020811015610a8857600080fd5b50518590610bca565b90610c3d565b849061076f565b925050600101610874565b5092915050565b600080805b601754811015610aa957610b41600a82600a8110610acf57fe5b0154604080517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152915191909216916370a08231916024808301926020929190829003018186803b1580156103d357600080fd5b9150600101610ab5565b805160175560005b60175481101561086b57818181518110610b6957fe5b6020026020010151600a82600a8110610b7e57fe5b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600101610b53565b600082610bd9575060006107e6565b82820282848281610be657fe5b04146107e3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180610d376021913960400191505060405180910390fd5b60006107e383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060008183610d20576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610ce5578181015183820152602001610ccd565b50505050905090810190601f168015610d125780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610d2c57fe5b049594505050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220838eea0c244fe18de35c1722c43a1c9e900ffe51086f2ac9d0c8f650f3c3f27e64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,448
0x37bdd4393b7feb54f236fc3da0657b22035227f9
pragma solidity 0.4.19; // 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 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: 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/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/crowdsale/Crowdsale.sol /** * @title Crowdsale * @dev Crowdsale is a base contract for managing a token crowdsale, * allowing investors to purchase tokens with ether. This contract implements * such functionality in its most fundamental form and can be extended to provide additional * functionality and/or custom behavior. * The external interface represents the basic interface for purchasing tokens, and conform * the base architecture for crowdsales. They are *not* intended to be modified / overriden. * The internal interface conforms the extensible and modifiable surface of crowdsales. Override * the methods to add functionality. Consider using &#39;super&#39; where appropiate to concatenate * behavior. */ contract Crowdsale { using SafeMath for uint256; // The token being sold ERC20 public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei uint256 public rate; // Amount of wei raised uint256 public weiRaised; /** * Event for token purchase logging * @param purchaser who paid for the tokens * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount amount of tokens purchased */ event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); /** * @param _rate Number of token units a buyer gets per wei * @param _wallet Address where collected funds will be forwarded to * @param _token Address of the token being sold */ function Crowdsale(uint256 _rate, address _wallet, ERC20 _token) public { require(_rate > 0); require(_wallet != address(0)); require(_token != address(0)); rate = _rate; wallet = _wallet; token = _token; } // ----------------------------------------- // Crowdsale external interface // ----------------------------------------- /** * @dev fallback function ***DO NOT OVERRIDE*** */ function () external payable { buyTokens(msg.sender); } /** * @dev low level token purchase ***DO NOT OVERRIDE*** * @param _beneficiary Address performing the token purchase */ function buyTokens(address _beneficiary) public payable { uint256 weiAmount = msg.value; _preValidatePurchase(_beneficiary, weiAmount); // calculate token amount to be created uint256 tokens = _getTokenAmount(weiAmount); // update state weiRaised = weiRaised.add(weiAmount); _processPurchase(_beneficiary, tokens); TokenPurchase(msg.sender, _beneficiary, weiAmount, tokens); _updatePurchasingState(_beneficiary, weiAmount); _forwardFunds(); _postValidatePurchase(_beneficiary, weiAmount); } // ----------------------------------------- // Internal interface (extensible) // ----------------------------------------- /** * @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations. * @param _beneficiary Address performing the token purchase * @param _weiAmount Value in wei involved in the purchase */ function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal { require(_beneficiary != address(0)); require(_weiAmount != 0); } /** * @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met. * @param _beneficiary Address performing the token purchase * @param _weiAmount Value in wei involved in the purchase */ function _postValidatePurchase(address _beneficiary, uint256 _weiAmount) internal { // optional override } /** * @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens. * @param _beneficiary Address performing the token purchase * @param _tokenAmount Number of tokens to be emitted */ function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal { token.transfer(_beneficiary, _tokenAmount); } /** * @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens. * @param _beneficiary Address receiving the tokens * @param _tokenAmount Number of tokens to be purchased */ function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal { _deliverTokens(_beneficiary, _tokenAmount); } /** * @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.) * @param _beneficiary Address receiving the tokens * @param _weiAmount Value in wei involved in the purchase */ function _updatePurchasingState(address _beneficiary, uint256 _weiAmount) internal { // optional override } /** * @dev Override to extend the way in which ether is converted to tokens. * @param _weiAmount Value in wei to be converted into tokens * @return Number of tokens that can be purchased with the specified _weiAmount */ function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) { return _weiAmount.mul(rate); } /** * @dev Determines how ETH is stored/forwarded on purchases. */ function _forwardFunds() internal { wallet.transfer(msg.value); } } // File: zeppelin-solidity/contracts/crowdsale/emission/AllowanceCrowdsale.sol /** * @title AllowanceCrowdsale * @dev Extension of Crowdsale where tokens are held by a wallet, which approves an allowance to the crowdsale. */ contract AllowanceCrowdsale is Crowdsale { using SafeMath for uint256; address public tokenWallet; /** * @dev Constructor, takes token wallet address. * @param _tokenWallet Address holding the tokens, which has approved allowance to the crowdsale */ function AllowanceCrowdsale(address _tokenWallet) public { require(_tokenWallet != address(0)); tokenWallet = _tokenWallet; } /** * @dev Checks the amount of tokens left in the allowance. * @return Amount of tokens left in the allowance */ function remainingTokens() public view returns (uint256) { return token.allowance(tokenWallet, this); } /** * @dev Overrides parent behavior by transferring tokens from wallet. * @param _beneficiary Token purchaser * @param _tokenAmount Amount of tokens purchased */ function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal { token.transferFrom(tokenWallet, _beneficiary, _tokenAmount); } } // File: zeppelin-solidity/contracts/crowdsale/validation/TimedCrowdsale.sol /** * @title TimedCrowdsale * @dev Crowdsale accepting contributions only within a time frame. */ contract TimedCrowdsale is Crowdsale { using SafeMath for uint256; uint256 public openingTime; uint256 public closingTime; /** * @dev Reverts if not in crowdsale time range. */ modifier onlyWhileOpen { require(now >= openingTime && now <= closingTime); _; } /** * @dev Constructor, takes crowdsale opening and closing times. * @param _openingTime Crowdsale opening time * @param _closingTime Crowdsale closing time */ function TimedCrowdsale(uint256 _openingTime, uint256 _closingTime) public { require(_openingTime >= now); require(_closingTime >= _openingTime); openingTime = _openingTime; closingTime = _closingTime; } /** * @dev Checks whether the period in which the crowdsale is open has already elapsed. * @return Whether crowdsale period has elapsed */ function hasClosed() public view returns (bool) { return now > closingTime; } /** * @dev Extend parent behavior requiring to be within contributing period * @param _beneficiary Token purchaser * @param _weiAmount Amount of wei contributed */ function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal onlyWhileOpen { super._preValidatePurchase(_beneficiary, _weiAmount); } } // File: contracts/IOVOTokenPrivate.sol contract IOVOTokenPrivate2 is AllowanceCrowdsale, TimedCrowdsale { function IOVOTokenPrivate2(address _tokenWallet, uint256 _openingTime, uint256 _closingTime, uint256 _rate, address _wallet, ERC20 _token) public AllowanceCrowdsale(_tokenWallet) TimedCrowdsale(_openingTime, _closingTime) Crowdsale(_rate, _wallet, _token) { } }
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631515bc2b146100af5780632c4e722e146100dc5780634042b66f146101055780634b6753bc1461012e578063521eb27314610157578063b7a8807c146101ac578063bf583903146101d5578063bff99c6c146101fe578063ec8ac4d814610253578063fc0c546a14610281575b6100ad336102d6565b005b34156100ba57600080fd5b6100c26103a4565b604051808215151515815260200191505060405180910390f35b34156100e757600080fd5b6100ef6103b0565b6040518082815260200191505060405180910390f35b341561011057600080fd5b6101186103b6565b6040518082815260200191505060405180910390f35b341561013957600080fd5b6101416103bc565b6040518082815260200191505060405180910390f35b341561016257600080fd5b61016a6103c2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101b757600080fd5b6101bf6103e8565b6040518082815260200191505060405180910390f35b34156101e057600080fd5b6101e86103ee565b6040518082815260200191505060405180910390f35b341561020957600080fd5b61021161052a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61027f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506102d6565b005b341561028c57600080fd5b610294610550565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000803491506102e68383610575565b6102ef826105a2565b9050610306826003546105c090919063ffffffff16565b60038190555061031683826105de565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188484604051808381526020018281526020019250505060405180910390a361038d83836105ec565b6103956105f0565b61039f8383610654565b505050565b60006006544211905090565b60025481565b60035481565b60065481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16306000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b151561050a57600080fd5b6102c65a03f1151561051b57600080fd5b50505060405180519050905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600554421015801561058957506006544211155b151561059457600080fd5b61059e8282610658565b5050565b60006105b9600254836106a890919063ffffffff16565b9050919050565b60008082840190508381101515156105d457fe5b8091505092915050565b6105e882826106e3565b5050565b5050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050151561065257600080fd5b565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561069457600080fd5b600081141515156106a457600080fd5b5050565b60008060008414156106bd57600091506106dc565b82840290508284828115156106ce57fe5b041415156106d857fe5b8091505b5092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684846000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b151561080557600080fd5b6102c65a03f1151561081657600080fd5b505050604051805190505050505600a165627a7a723058203eb76bc26de70009ad728db041c8cee7ca42eb0b8914582e10df9ef19f3144930029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
6,449
0xd99a1e29dfb5a23a0e33e1475bb2390eb535620b
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]; } }
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610177578063173825d9146101e457806320ea8d86146102275780632f54bf6e146102545780633411c81c146102af57806354741525146103145780637065cb4814610363578063784547a7146103a65780638b51d13f146103eb5780639ace38c21461042c578063a0e67e2b14610517578063a8abe69a14610583578063b5dc40c314610627578063b77bf600146106a9578063ba51a6df146106d4578063c01a8c8414610701578063c64274741461072e578063d74f8edd146107d5578063dc8452cd14610800578063e20056e61461082b578063ee22610b1461088e575b6000341115610175573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34801561018357600080fd5b506101a2600480360381019080803590602001909291905050506108bb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101f057600080fd5b50610225600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108f9565b005b34801561023357600080fd5b5061025260048036038101908080359060200190929190505050610b92565b005b34801561026057600080fd5b50610295600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d3a565b604051808215151515815260200191505060405180910390f35b3480156102bb57600080fd5b506102fa60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d5a565b604051808215151515815260200191505060405180910390f35b34801561032057600080fd5b5061034d600480360381019080803515159060200190929190803515159060200190929190505050610d89565b6040518082815260200191505060405180910390f35b34801561036f57600080fd5b506103a4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e1b565b005b3480156103b257600080fd5b506103d160048036038101908080359060200190929190505050611020565b604051808215151515815260200191505060405180910390f35b3480156103f757600080fd5b5061041660048036038101908080359060200190929190505050611105565b6040518082815260200191505060405180910390f35b34801561043857600080fd5b50610457600480360381019080803590602001909291905050506111d0565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b838110156104d95780820151818401526020810190506104be565b50505050905090810190601f1680156105065780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561052357600080fd5b5061052c6112c5565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561056f578082015181840152602081019050610554565b505050509050019250505060405180910390f35b34801561058f57600080fd5b506105d06004803603810190808035906020019092919080359060200190929190803515159060200190929190803515159060200190929190505050611353565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106135780820151818401526020810190506105f8565b505050509050019250505060405180910390f35b34801561063357600080fd5b50610652600480360381019080803590602001909291905050506114c4565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561069557808201518184015260208101905061067a565b505050509050019250505060405180910390f35b3480156106b557600080fd5b506106be611701565b6040518082815260200191505060405180910390f35b3480156106e057600080fd5b506106ff60048036038101908080359060200190929190505050611707565b005b34801561070d57600080fd5b5061072c600480360381019080803590602001909291905050506117c1565b005b34801561073a57600080fd5b506107bf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061199e565b6040518082815260200191505060405180910390f35b3480156107e157600080fd5b506107ea6119bd565b6040518082815260200191505060405180910390f35b34801561080c57600080fd5b506108156119c2565b6040518082815260200191505060405180910390f35b34801561083757600080fd5b5061088c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119c8565b005b34801561089a57600080fd5b506108b960048036038101908080359060200190929190505050611cdd565b005b6003818154811015156108ca57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561093557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561098e57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610b13578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a2157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b06576003600160038054905003815481101515610a7f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610ab957fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b13565b81806001019250506109eb565b6001600381818054905003915081610b2b91906120fe565b506003805490506004541115610b4a57610b49600380549050611707565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610beb57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c5657600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610c8657600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610e1457838015610dc8575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610dfb5750828015610dfa575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610e07576001820191505b8080600101915050610d91565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e5557600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610eaf57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610ed657600080fd5b60016003805490500160045460328211158015610ef35750818111155b8015610f00575060008114155b8015610f0d575060008214155b1515610f1857600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b6003805490508110156110fd5760016000858152602001908152602001600020600060038381548110151561105e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156110dd576001820191505b6004548214156110f057600192506110fe565b808060010191505061102d565b5b5050919050565b600080600090505b6003805490508110156111ca5760016000848152602001908152602001600020600060038381548110151561113e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111bd576001820191505b808060010191505061110d565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112a85780601f1061127d576101008083540402835291602001916112a8565b820191906000526020600020905b81548152906001019060200180831161128b57829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b6060600380548060200260200160405190810160405280929190818152602001828054801561134957602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116112ff575b5050505050905090565b60608060008060055460405190808252806020026020018201604052801561138a5781602001602082028038833980820191505090505b50925060009150600090505b600554811015611436578580156113cd575060008082815260200190815260200160002060030160009054906101000a900460ff16155b8061140057508480156113ff575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b156114295780838381518110151561141457fe5b90602001906020020181815250506001820191505b8080600101915050611396565b8787036040519080825280602002602001820160405280156114675781602001602082028038833980820191505090505b5093508790505b868110156114b957828181518110151561148457fe5b906020019060200201518489830381518110151561149e57fe5b9060200190602002018181525050808060010191505061146e565b505050949350505050565b6060806000806003805490506040519080825280602002602001820160405280156114fe5781602001602082028038833980820191505090505b50925060009150600090505b60038054905081101561164b5760016000868152602001908152602001600020600060038381548110151561153b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561163e576003818154811015156115c257fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156115fb57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b808060010191505061150a565b8160405190808252806020026020018201604052801561167a5781602001602082028038833980820191505090505b509350600090505b818110156116f957828181518110151561169857fe5b9060200190602002015184828151811015156116b057fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611682565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561174157600080fd5b60038054905081603282111580156117595750818111155b8015611766575060008114155b8015611773575060008214155b151561177e57600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561181a57600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561187657600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118e257600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361199785611cdd565b5050505050565b60006119ab848484611f85565b90506119b6816117c1565b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a0457600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611a5d57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611ab757600080fd5b600092505b600380549050831015611ba0578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611aef57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611b935783600384815481101515611b4657fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611ba0565b8280600101935050611abc565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b600033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611d3857600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611da357600080fd5b8460008082815260200190815260200160002060030160009054906101000a900460ff16151515611dd357600080fd5b611ddc86611020565b15611f7d57600080878152602001908152602001600020945060018560030160006101000a81548160ff021916908315150217905550611efa8560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866001015487600201805460018160011615610100020316600290049050886002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611ef05780601f10611ec557610100808354040283529160200191611ef0565b820191906000526020600020905b815481529060010190602001808311611ed357829003601f168201915b50505050506120d7565b15611f3157857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611f7c565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008560030160006101000a81548160ff0219169083151502179055505b5b505050505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614151515611fae57600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201908051906020019061206d92919061212a565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b6000806040516020840160008287838a8c6187965a03f19250505080915050949350505050565b8154818355818111156121255781836000526020600020918201910161212491906121aa565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061216b57805160ff1916838001178555612199565b82800160010185558215612199579182015b8281111561219857825182559160200191906001019061217d565b5b5090506121a691906121aa565b5090565b6121cc91905b808211156121c85760008160009055506001016121b0565b5090565b905600a165627a7a7230582059f089b6ea6dc7e47e521e97b14ef894d831b0abaee560cf119de9c089c1ceb40029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
6,450
0x295e2fd5cc9bdb4bba121d895261f59fde21c2dd
/** *Submitted for verification at Etherscan.io on 2022-04-29 */ // Telegram: https://t.me/hodotama // 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 HODOTAMA is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private time; uint256 private _tax; uint256 private constant _tTotal = 1 * 10**6 * 10**9; uint256 private fee1=0; uint256 private fee2=200; uint256 private liqfee=50; uint256 private feeMax=200; string private constant _name = "HODOTAMA"; string private constant _symbol = "HODOTAMA"; uint256 private _maxTxAmount = _tTotal.mul(2).div(100); uint256 private minBalance = _tTotal.div(1000); uint8 private constant _decimals = 9; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () payable { _feeAddrWallet1 = payable(msg.sender); _feeAddrWallet2 = payable(0xC1FCF38933f5d8DDac59B03cAc452F2d7788185c); _tOwned[address(this)] = _tTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); emit Transfer(address(0),address(this),_tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tOwned[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function changeFees(uint8 _fee1,uint8 _fee2,uint8 _liq) external { require(_msgSender() == _feeAddrWallet1); require(_fee1 <= feeMax && _fee2 <= feeMax && liqfee <= feeMax,"Cannot set fees above maximum"); fee1 = _fee1; fee2 = _fee2; liqfee = _liq; } function changeMinBalance(uint256 newMin) external { require(_msgSender() == _feeAddrWallet1); minBalance = newMin; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _tax = fee1.add(liqfee); if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && (block.timestamp < time)){ // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _tax = fee2.add(liqfee); } if (!inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from]) { require(block.timestamp > time,"Sells prohibited for the first 5 minutes"); uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > minBalance){ swapAndLiquify(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } } _transferStandard(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function swapAndLiquify(uint256 tokenAmount) private { uint256 half = liqfee.div(2); uint256 part = fee2.add(half); uint256 sum = fee2.add(liqfee); uint256 swapTotal = tokenAmount.mul(part).div(sum); swapTokensForEth(swapTotal); addLiquidity(tokenAmount.sub(swapTotal),address(this).balance.mul(half).div(part),_feeAddrWallet1); } function addLiquidity(uint256 tokenAmount,uint256 ethAmount,address target) private lockTheSwap{ _approve(address(this),address(uniswapV2Router),tokenAmount); uniswapV2Router.addLiquidityETH{value: ethAmount}(address(this),tokenAmount,0,0,target,block.timestamp); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); addLiquidity(balanceOf(address(this)),address(this).balance,owner()); swapEnabled = true; tradingOpen = true; time = block.timestamp + (1 minutes); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 transferAmount,uint256 tfee) = _getTValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _tOwned[recipient] = _tOwned[recipient].add(transferAmount); _tOwned[address(this)] = _tOwned[address(this)].add(tfee); emit Transfer(sender, recipient, transferAmount); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapAndLiquify(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getTValues(uint256 tAmount) private view returns (uint256, uint256) { uint256 tFee = tAmount.mul(_tax).div(1000); uint256 tTransferAmount = tAmount.sub(tFee); return (tTransferAmount, tFee); } function recoverTokens(address tokenAddress) external { require(_msgSender() == _feeAddrWallet1); IERC20 recoveryToken = IERC20(tokenAddress); recoveryToken.transfer(_feeAddrWallet1,recoveryToken.balanceOf(address(this))); } }
0x6080604052600436106101185760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610384578063b515566a146103c1578063c3c8cd80146103ea578063c9567bf914610401578063dd62ed3e146104185761011f565b806370a08231146102b1578063715018a6146102ee5780637e37e9bb146103055780638da5cb5b1461032e57806395d89b41146103595761011f565b806323b872dd116100e757806323b872dd146101e0578063273123b71461021d578063313ce567146102465780634ea18fab146102715780636fc3eaec1461029a5761011f565b806306fdde0314610124578063095ea7b31461014f57806316114acd1461018c57806318160ddd146101b55761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b60405161014691906129ea565b60405180910390f35b34801561015b57600080fd5b50610176600480360381019061017191906124fb565b610492565b60405161018391906129cf565b60405180910390f35b34801561019857600080fd5b506101b360048036038101906101ae919061241e565b6104b0565b005b3480156101c157600080fd5b506101ca610652565b6040516101d79190612b6c565b60405180910390f35b3480156101ec57600080fd5b50610207600480360381019061020291906124ac565b610661565b60405161021491906129cf565b60405180910390f35b34801561022957600080fd5b50610244600480360381019061023f919061241e565b61073a565b005b34801561025257600080fd5b5061025b61082a565b6040516102689190612be1565b60405180910390f35b34801561027d57600080fd5b50610298600480360381019061029391906125a1565b610833565b005b3480156102a657600080fd5b506102af61089e565b005b3480156102bd57600080fd5b506102d860048036038101906102d3919061241e565b610910565b6040516102e59190612b6c565b60405180910390f35b3480156102fa57600080fd5b50610303610959565b005b34801561031157600080fd5b5061032c60048036038101906103279190612642565b610aac565b005b34801561033a57600080fd5b50610343610b99565b604051610350919061292a565b60405180910390f35b34801561036557600080fd5b5061036e610bc2565b60405161037b91906129ea565b60405180910390f35b34801561039057600080fd5b506103ab60048036038101906103a691906124fb565b610bff565b6040516103b891906129cf565b60405180910390f35b3480156103cd57600080fd5b506103e860048036038101906103e39190612537565b610c1d565b005b3480156103f657600080fd5b506103ff610d6d565b005b34801561040d57600080fd5b50610416610de7565b005b34801561042457600080fd5b5061043f600480360381019061043a9190612470565b610f31565b60405161044c9190612b6c565b60405180910390f35b60606040518060400160405280600881526020017f484f444f54414d41000000000000000000000000000000000000000000000000815250905090565b60006104a661049f61107d565b8484611085565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104f161107d565b73ffffffffffffffffffffffffffffffffffffffff161461051157600080fd5b60008190508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161058e919061292a565b60206040518083038186803b1580156105a657600080fd5b505afa1580156105ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105de91906125ca565b6040518363ffffffff1660e01b81526004016105fb929190612945565b602060405180830381600087803b15801561061557600080fd5b505af1158015610629573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064d9190612578565b505050565b600066038d7ea4c68000905090565b600061066e848484611250565b61072f8461067a61107d565b61072a856040518060600160405280602881526020016132c960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106e061107d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119099092919063ffffffff16565b611085565b600190509392505050565b61074261107d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c690612aac565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661087461107d565b73ffffffffffffffffffffffffffffffffffffffff161461089457600080fd5b80600e8190555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108df61107d565b73ffffffffffffffffffffffffffffffffffffffff16146108ff57600080fd5b600047905061090d8161196d565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61096161107d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109e590612aac565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610aed61107d565b73ffffffffffffffffffffffffffffffffffffffff1614610b0d57600080fd5b600c548360ff1611158015610b275750600c548260ff1611155b8015610b375750600c54600b5411155b610b76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6d90612b4c565b60405180910390fd5b8260ff166009819055508160ff16600a819055508060ff16600b81905550505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f484f444f54414d41000000000000000000000000000000000000000000000000815250905090565b6000610c13610c0c61107d565b8484611250565b6001905092915050565b610c2561107d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca990612aac565b60405180910390fd5b60005b8151811015610d6957600160056000848481518110610cfd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610d6190612eb8565b915050610cb5565b5050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dae61107d565b73ffffffffffffffffffffffffffffffffffffffff1614610dce57600080fd5b6000610dd930610910565b9050610de481611a68565b50565b610def61107d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7390612aac565b60405180910390fd5b601260149054906101000a900460ff1615610ecc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec390612b2c565b60405180910390fd5b610ee6610ed830610910565b47610ee1610b99565b611b52565b6001601260166101000a81548160ff0219169083151502179055506001601260146101000a81548160ff021916908315150217905550603c42610f299190612ca2565b600781905550565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080831415610fcb576000905061102d565b60008284610fd99190612d29565b9050828482610fe89190612cf8565b14611028576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101f90612a8c565b60405180910390fd5b809150505b92915050565b600061107583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611c76565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ec90612b0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611165576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115c90612a4c565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112439190612b6c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112b790612aec565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611330576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132790612a2c565b60405180910390fd5b60008111611373576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136a90612acc565b60405180910390fd5b61138a600b54600954611cd990919063ffffffff16565b600881905550611398610b99565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140657506113d6610b99565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156118f957600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156114af5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6114b857600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156115635750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115b95750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156115c6575060075442105b1561167657600d548111156115da57600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061162557600080fd5b601e426116329190612ca2565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156117215750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117775750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561179a57611793600b54600a54611cd990919063ffffffff16565b6008819055505b601260159054906101000a900460ff161580156118055750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561181d5750601260169054906101000a900460ff165b80156118735750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156118f85760075442116118bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b390612a0c565b60405180910390fd5b60006118c730610910565b9050600e548111156118f6576118dc81611a68565b600047905060008111156118f4576118f34761196d565b5b505b505b5b611904838383611d37565b505050565b6000838311158290611951576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194891906129ea565b60405180910390fd5b50600083856119609190612d83565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6119bd60028461103390919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156119e8573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a3960028461103390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a64573d6000803e3d6000fd5b5050565b6000611a806002600b5461103390919063ffffffff16565b90506000611a9982600a54611cd990919063ffffffff16565b90506000611ab4600b54600a54611cd990919063ffffffff16565b90506000611add82611acf8588610fb890919063ffffffff16565b61103390919063ffffffff16565b9050611ae881611f72565b611b4b611afe828761226c90919063ffffffff16565b611b2385611b158847610fb890919063ffffffff16565b61103390919063ffffffff16565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611b52565b5050505050565b6001601260156101000a81548160ff021916908315150217905550611b9a30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685611085565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71983308660008087426040518863ffffffff1660e01b8152600401611c019695949392919061296e565b6060604051808303818588803b158015611c1a57600080fd5b505af1158015611c2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611c5391906125f3565b5050506000601260156101000a81548160ff021916908315150217905550505050565b60008083118290611cbd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cb491906129ea565b60405180910390fd5b5060008385611ccc9190612cf8565b9050809150509392505050565b6000808284611ce89190612ca2565b905083811015611d2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2490612a6c565b60405180910390fd5b8091505092915050565b600080611d43836122b6565b91509150611d9983600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461226c90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e2e82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cd990919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ec381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cd990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611f639190612b6c565b60405180910390a35050505050565b6001601260156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611fd0577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611ffe5781602001602082028036833780820191505090505b509050308160008151811061203c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156120de57600080fd5b505afa1580156120f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121169190612447565b81600181518110612150577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506121b730601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611085565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161221b959493929190612b87565b600060405180830381600087803b15801561223557600080fd5b505af1158015612249573d6000803e3d6000fd5b50505050506000601260156101000a81548160ff02191690831515021790555050565b60006122ae83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611909565b905092915050565b60008060006122e46103e86122d660085487610fb890919063ffffffff16565b61103390919063ffffffff16565b905060006122fb828661226c90919063ffffffff16565b90508082935093505050915091565b600061231d61231884612c21565b612bfc565b9050808382526020820190508285602086028201111561233c57600080fd5b60005b8581101561236c57816123528882612376565b84526020840193506020830192505060018101905061233f565b5050509392505050565b6000813590506123858161326c565b92915050565b60008151905061239a8161326c565b92915050565b600082601f8301126123b157600080fd5b81356123c184826020860161230a565b91505092915050565b6000815190506123d981613283565b92915050565b6000813590506123ee8161329a565b92915050565b6000815190506124038161329a565b92915050565b600081359050612418816132b1565b92915050565b60006020828403121561243057600080fd5b600061243e84828501612376565b91505092915050565b60006020828403121561245957600080fd5b60006124678482850161238b565b91505092915050565b6000806040838503121561248357600080fd5b600061249185828601612376565b92505060206124a285828601612376565b9150509250929050565b6000806000606084860312156124c157600080fd5b60006124cf86828701612376565b93505060206124e086828701612376565b92505060406124f1868287016123df565b9150509250925092565b6000806040838503121561250e57600080fd5b600061251c85828601612376565b925050602061252d858286016123df565b9150509250929050565b60006020828403121561254957600080fd5b600082013567ffffffffffffffff81111561256357600080fd5b61256f848285016123a0565b91505092915050565b60006020828403121561258a57600080fd5b6000612598848285016123ca565b91505092915050565b6000602082840312156125b357600080fd5b60006125c1848285016123df565b91505092915050565b6000602082840312156125dc57600080fd5b60006125ea848285016123f4565b91505092915050565b60008060006060848603121561260857600080fd5b6000612616868287016123f4565b9350506020612627868287016123f4565b9250506040612638868287016123f4565b9150509250925092565b60008060006060848603121561265757600080fd5b600061266586828701612409565b935050602061267686828701612409565b925050604061268786828701612409565b9150509250925092565b600061269d83836126b8565b60208301905092915050565b6126b281612e0c565b82525050565b6126c181612db7565b82525050565b6126d081612db7565b82525050565b60006126e182612c5d565b6126eb8185612c80565b93506126f683612c4d565b8060005b8381101561272757815161270e8882612691565b975061271983612c73565b9250506001810190506126fa565b5085935050505092915050565b61273d81612dc9565b82525050565b61274c81612e1e565b82525050565b600061275d82612c68565b6127678185612c91565b9350612777818560208601612e54565b61278081612f8e565b840191505092915050565b6000612798602883612c91565b91506127a382612f9f565b604082019050919050565b60006127bb602383612c91565b91506127c682612fee565b604082019050919050565b60006127de602283612c91565b91506127e98261303d565b604082019050919050565b6000612801601b83612c91565b915061280c8261308c565b602082019050919050565b6000612824602183612c91565b915061282f826130b5565b604082019050919050565b6000612847602083612c91565b915061285282613104565b602082019050919050565b600061286a602983612c91565b91506128758261312d565b604082019050919050565b600061288d602583612c91565b91506128988261317c565b604082019050919050565b60006128b0602483612c91565b91506128bb826131cb565b604082019050919050565b60006128d3601783612c91565b91506128de8261321a565b602082019050919050565b60006128f6601d83612c91565b915061290182613243565b602082019050919050565b61291581612df5565b82525050565b61292481612dff565b82525050565b600060208201905061293f60008301846126c7565b92915050565b600060408201905061295a60008301856126a9565b612967602083018461290c565b9392505050565b600060c08201905061298360008301896126c7565b612990602083018861290c565b61299d6040830187612743565b6129aa6060830186612743565b6129b760808301856126c7565b6129c460a083018461290c565b979650505050505050565b60006020820190506129e46000830184612734565b92915050565b60006020820190508181036000830152612a048184612752565b905092915050565b60006020820190508181036000830152612a258161278b565b9050919050565b60006020820190508181036000830152612a45816127ae565b9050919050565b60006020820190508181036000830152612a65816127d1565b9050919050565b60006020820190508181036000830152612a85816127f4565b9050919050565b60006020820190508181036000830152612aa581612817565b9050919050565b60006020820190508181036000830152612ac58161283a565b9050919050565b60006020820190508181036000830152612ae58161285d565b9050919050565b60006020820190508181036000830152612b0581612880565b9050919050565b60006020820190508181036000830152612b25816128a3565b9050919050565b60006020820190508181036000830152612b45816128c6565b9050919050565b60006020820190508181036000830152612b65816128e9565b9050919050565b6000602082019050612b81600083018461290c565b92915050565b600060a082019050612b9c600083018861290c565b612ba96020830187612743565b8181036040830152612bbb81866126d6565b9050612bca60608301856126c7565b612bd7608083018461290c565b9695505050505050565b6000602082019050612bf6600083018461291b565b92915050565b6000612c06612c17565b9050612c128282612e87565b919050565b6000604051905090565b600067ffffffffffffffff821115612c3c57612c3b612f5f565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612cad82612df5565b9150612cb883612df5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ced57612cec612f01565b5b828201905092915050565b6000612d0382612df5565b9150612d0e83612df5565b925082612d1e57612d1d612f30565b5b828204905092915050565b6000612d3482612df5565b9150612d3f83612df5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612d7857612d77612f01565b5b828202905092915050565b6000612d8e82612df5565b9150612d9983612df5565b925082821015612dac57612dab612f01565b5b828203905092915050565b6000612dc282612dd5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612e1782612e30565b9050919050565b6000612e2982612df5565b9050919050565b6000612e3b82612e42565b9050919050565b6000612e4d82612dd5565b9050919050565b60005b83811015612e72578082015181840152602081019050612e57565b83811115612e81576000848401525b50505050565b612e9082612f8e565b810181811067ffffffffffffffff82111715612eaf57612eae612f5f565b5b80604052505050565b6000612ec382612df5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612ef657612ef5612f01565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f53656c6c732070726f6869626974656420666f7220746865206669727374203560008201527f206d696e75746573000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f43616e6e6f742073657420666565732061626f7665206d6178696d756d000000600082015250565b61327581612db7565b811461328057600080fd5b50565b61328c81612dc9565b811461329757600080fd5b50565b6132a381612df5565b81146132ae57600080fd5b50565b6132ba81612dff565b81146132c557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b592d48f9ca052ac77cac18f4ce3353fa73915601ccfc46464e3938c87ee51fb64736f6c63430008040033
{"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"}]}}
6,451
0x3b648e4eeef667f96b139b4cbcdd71032e71cd3a
/** *Submitted for verification at Etherscan.io on 2021-01-04 */ /** *Submitted for verification at Etherscan.io on 2020-12-19 */ //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.7.5; 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 () public { } // 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) public _balances; mapping (address => mapping (address => uint)) public _allowances; uint public _totalSupply; function totalSupply() public view override returns (uint) { return _totalSupply; } function balanceOf(address account) public view override returns (uint) { return _balances[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } 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); _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 _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); } } 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 Crowdsale { using SafeMath for uint256; // The token being sold ERC20 public token; // Address where funds are collected address payable wallet; // How many token units a buyer gets per wei uint256 public rate; // Amount of wei raised uint256 public weiRaised; /** * Event for token purchase logging * @param purchaser who paid for the tokens * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount amount of tokens purchased */ event TokenPurchase( address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount ); /** * @param _wallet Address where collected funds will be forwarded to * @param _token Address of the token being sold */ constructor(address payable _wallet, ERC20 _token) public payable{ //require(_rate > 0); require(_wallet != address(0)); require(address(_token) != address(0)); uint256 rate = 667; wallet = _wallet; token = _token; } // ----------------------------------------- // Crowdsale external interface // ----------------------------------------- /** * @dev fallback function ***DO NOT OVERRIDE*** */ fallback () external payable { buyTokens(msg.sender); } receive () external payable { } /** * @dev low level token purchase ***DO NOT OVERRIDE*** * @param _beneficiary Address performing the token purchase */ function buyTokens(address _beneficiary) public payable { uint256 weiAmount = msg.value; _preValidatePurchase(_beneficiary, weiAmount); // calculate token amount to be created uint256 tokens = _getTokenAmount(weiAmount); // update state weiRaised = weiRaised.add(weiAmount); _processPurchase(_beneficiary, tokens); emit TokenPurchase( msg.sender, _beneficiary, weiAmount, tokens ); _updatePurchasingState(_beneficiary, weiAmount); _forwardFunds(); _postValidatePurchase(_beneficiary, weiAmount); } // ----------------------------------------- // Internal interface (extensible) // ----------------------------------------- /** * @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations. * @param _beneficiary Address performing the token purchase * @param _weiAmount Value in wei involved in the purchase */ function _preValidatePurchase( address _beneficiary, uint256 _weiAmount ) internal { require(_beneficiary != address(0)); require(_weiAmount != 0); } /** * @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met. * @param _beneficiary Address performing the token purchase * @param _weiAmount Value in wei involved in the purchase */ function _postValidatePurchase( address _beneficiary, uint256 _weiAmount ) internal { // optional override } /** * @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens. * @param _beneficiary Address performing the token purchase * @param _tokenAmount Number of tokens to be emitted */ function _deliverTokens( address _beneficiary, uint256 _tokenAmount ) internal { token.transfer(_beneficiary, _tokenAmount); } /** * @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens. * @param _beneficiary Address receiving the tokens * @param _tokenAmount Number of tokens to be purchased */ function _processPurchase( address _beneficiary, uint256 _tokenAmount ) internal { _deliverTokens(_beneficiary, _tokenAmount); } /** * @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.) * @param _beneficiary Address receiving the tokens * @param _weiAmount Value in wei involved in the purchase */ function _updatePurchasingState( address _beneficiary, uint256 _weiAmount ) internal { // optional override } /** * @dev Override to extend the way in which ether is converted to tokens. * @param _weiAmount Value in wei to be converted into tokens * @return Number of tokens that can be purchased with the specified _weiAmount */ function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) { return _weiAmount.mul(rate); } /** * @dev Determines how ETH is stored/forwarded on purchases. */ function _forwardFunds() internal { wallet.transfer(msg.value); } }
0x6080604052600436106100435760003560e01c80632c4e722e146100555780634042b66f14610080578063ec8ac4d8146100ab578063fc0c546a146100ef5761004a565b3661004a57005b61005333610130565b005b34801561006157600080fd5b5061006a6101ff565b6040518082815260200191505060405180910390f35b34801561008c57600080fd5b50610095610205565b6040518082815260200191505060405180910390f35b6100ed600480360360208110156100c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610130565b005b3480156100fb57600080fd5b5061010461020b565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600034905061013f828261022f565b600061014a8261027b565b90506101618260035461029990919063ffffffff16565b6003819055506101718382610321565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188484604051808381526020018281526020019250505060405180910390a36101e8838361032f565b6101f0610333565b6101fa838361039e565b505050565b60025481565b60035481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561026957600080fd5b600081141561027757600080fd5b5050565b6000610292600254836103a290919063ffffffff16565b9050919050565b600080828401905083811015610317576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b61032b8282610428565b5050565b5050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015801561039b573d6000803e3d6000fd5b50565b5050565b6000808314156103b55760009050610422565b60008284029050828482816103c657fe5b041461041d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806104fa6021913960400191505060405180910390fd5b809150505b92915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156104b957600080fd5b505af11580156104cd573d6000803e3d6000fd5b505050506040513d60208110156104e357600080fd5b810190808051906020019092919050505050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a26469706673582212205acac158870584c45ca2b3780b22988187347669ea921e7f7fe74f0c1f0cfaff64736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
6,452
0x0Cf35362529f375b0ab4f40d6601E4b0Cec8958a
/** *Submitted for verification at Etherscan.io on 2021-11-11 */ //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 GM 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 = 5; address payable private _feeAddrWallet1 = payable(0x0990EC88351d875A8f8B22Fa6D79C325882f5860); address payable private _feeAddrWallet2 = payable(0x0990EC88351d875A8f8B22Fa6D79C325882f5860); string private constant _name = "Mini GM"; string private constant _symbol = "MINI GM"; 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); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063cfe81ba0146103ef578063dd62ed3e146104185761011f565b8063715018a6146102c5578063842b7c08146102dc5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612bb9565b60405180910390f35b34801561015b57600080fd5b50610176600480360381019061017191906126ff565b610492565b6040516101839190612b9e565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190612d3b565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d991906126b0565b6104c4565b6040516101eb9190612b9e565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612622565b61059d565b005b34801561022957600080fd5b5061023261068d565b60405161023f9190612db0565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a919061277c565b610696565b005b34801561027d57600080fd5b50610286610748565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612622565b6107ba565b6040516102bc9190612d3b565b60405180910390f35b3480156102d157600080fd5b506102da61080b565b005b3480156102e857600080fd5b5061030360048036038101906102fe91906127ce565b61095e565b005b34801561031157600080fd5b5061031a6109ff565b6040516103279190612ad0565b60405180910390f35b34801561033c57600080fd5b50610345610a28565b6040516103529190612bb9565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d91906126ff565b610a65565b60405161038f9190612b9e565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba919061273b565b610a83565b005b3480156103cd57600080fd5b506103d6610bd3565b005b3480156103e457600080fd5b506103ed610c4d565b005b3480156103fb57600080fd5b50610416600480360381019061041191906127ce565b6111af565b005b34801561042457600080fd5b5061043f600480360381019061043a9190612674565b611250565b60405161044c9190612d3b565b60405180910390f35b60606040518060400160405280600781526020017f4d696e6920474d00000000000000000000000000000000000000000000000000815250905090565b60006104a661049f6112d7565b84846112df565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104d18484846114aa565b610592846104dd6112d7565b61058d8560405180606001604052806028815260200161344b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105436112d7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119889092919063ffffffff16565b6112df565b600190509392505050565b6105a56112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062990612c9b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61069e6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072290612c9b565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107896112d7565b73ffffffffffffffffffffffffffffffffffffffff16146107a957600080fd5b60004790506107b7816119ec565b50565b6000610804600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae7565b9050919050565b6108136112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790612c9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099f6112d7565b73ffffffffffffffffffffffffffffffffffffffff16146109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ec90612bfb565b60405180910390fd5b80600a8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f4d494e4920474d00000000000000000000000000000000000000000000000000815250905090565b6000610a79610a726112d7565b84846114aa565b6001905092915050565b610a8b6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612c9b565b60405180910390fd5b60005b8151811015610bcf57600160066000848481518110610b63577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610bc790613051565b915050610b1b565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c146112d7565b73ffffffffffffffffffffffffffffffffffffffff1614610c3457600080fd5b6000610c3f306107ba565b9050610c4a81611b55565b50565b610c556112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ce2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd990612c9b565b60405180910390fd5b600f60149054906101000a900460ff1615610d32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2990612d1b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610dc530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112df565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e0b57600080fd5b505afa158015610e1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e43919061264b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ea557600080fd5b505afa158015610eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edd919061264b565b6040518363ffffffff1660e01b8152600401610efa929190612aeb565b602060405180830381600087803b158015610f1457600080fd5b505af1158015610f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4c919061264b565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fd5306107ba565b600080610fe06109ff565b426040518863ffffffff1660e01b815260040161100296959493929190612b3d565b6060604051808303818588803b15801561101b57600080fd5b505af115801561102f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061105491906127f7565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611159929190612b14565b602060405180830381600087803b15801561117357600080fd5b505af1158015611187573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ab91906127a5565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111f06112d7565b73ffffffffffffffffffffffffffffffffffffffff1614611246576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123d90612bfb565b60405180910390fd5b80600b8190555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561134f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134690612cfb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b690612c3b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161149d9190612d3b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561151a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151190612cdb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561158a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158190612bdb565b60405180910390fd5b600081116115cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c490612cbb565b60405180910390fd5b6115d56109ff565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561164357506116136109ff565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561197857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ec5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116f557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117a05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117f65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561180e5750600f60179054906101000a900460ff165b156118be5760105481111561182257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061186d57600080fd5b601e4261187a9190612e71565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118c9306107ba565b9050600f60159054906101000a900460ff161580156119365750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561194e5750600f60169054906101000a900460ff165b156119765761195c81611b55565b6000479050600081111561197457611973476119ec565b5b505b505b611983838383611e4f565b505050565b60008383111582906119d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c79190612bb9565b60405180910390fd5b50600083856119df9190612f52565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a3c600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a67573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ab8600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ae3573d6000803e3d6000fd5b5050565b6000600854821115611b2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2590612c1b565b60405180910390fd5b6000611b38611ea9565b9050611b4d8184611e5f90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611bb3577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611be15781602001602082028036833780820191505090505b5090503081600081518110611c1f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611cc157600080fd5b505afa158015611cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf9919061264b565b81600181518110611d33577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d9a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112df565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611dfe959493929190612d56565b600060405180830381600087803b158015611e1857600080fd5b505af1158015611e2c573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611e5a838383611ed4565b505050565b6000611ea183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061209f565b905092915050565b6000806000611eb6612102565b91509150611ecd8183611e5f90919063ffffffff16565b9250505090565b600080600080600080611ee68761216d565b955095509550955095509550611f4486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121d590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fd985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120258161227d565b61202f848361233a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161208c9190612d3b565b60405180910390a3505050505050505050565b600080831182906120e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120dd9190612bb9565b60405180910390fd5b50600083856120f59190612ec7565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce8000000905061213e6b033b2e3c9fd0803ce8000000600854611e5f90919063ffffffff16565b821015612160576008546b033b2e3c9fd0803ce8000000935093505050612169565b81819350935050505b9091565b600080600080600080600080600061218a8a600a54600b54612374565b925092509250600061219a611ea9565b905060008060006121ad8e87878761240a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061221783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611988565b905092915050565b600080828461222e9190612e71565b905083811015612273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226a90612c5b565b60405180910390fd5b8091505092915050565b6000612287611ea9565b9050600061229e828461249390919063ffffffff16565b90506122f281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61234f826008546121d590919063ffffffff16565b60088190555061236a8160095461221f90919063ffffffff16565b6009819055505050565b6000806000806123a06064612392888a61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123ca60646123bc888b61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123f3826123e5858c6121d590919063ffffffff16565b6121d590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612423858961249390919063ffffffff16565b9050600061243a868961249390919063ffffffff16565b90506000612451878961249390919063ffffffff16565b9050600061247a8261246c85876121d590919063ffffffff16565b6121d590919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156124a65760009050612508565b600082846124b49190612ef8565b90508284826124c39190612ec7565b14612503576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124fa90612c7b565b60405180910390fd5b809150505b92915050565b600061252161251c84612df0565b612dcb565b9050808382526020820190508285602086028201111561254057600080fd5b60005b858110156125705781612556888261257a565b845260208401935060208301925050600181019050612543565b5050509392505050565b60008135905061258981613405565b92915050565b60008151905061259e81613405565b92915050565b600082601f8301126125b557600080fd5b81356125c584826020860161250e565b91505092915050565b6000813590506125dd8161341c565b92915050565b6000815190506125f28161341c565b92915050565b60008135905061260781613433565b92915050565b60008151905061261c81613433565b92915050565b60006020828403121561263457600080fd5b60006126428482850161257a565b91505092915050565b60006020828403121561265d57600080fd5b600061266b8482850161258f565b91505092915050565b6000806040838503121561268757600080fd5b60006126958582860161257a565b92505060206126a68582860161257a565b9150509250929050565b6000806000606084860312156126c557600080fd5b60006126d38682870161257a565b93505060206126e48682870161257a565b92505060406126f5868287016125f8565b9150509250925092565b6000806040838503121561271257600080fd5b60006127208582860161257a565b9250506020612731858286016125f8565b9150509250929050565b60006020828403121561274d57600080fd5b600082013567ffffffffffffffff81111561276757600080fd5b612773848285016125a4565b91505092915050565b60006020828403121561278e57600080fd5b600061279c848285016125ce565b91505092915050565b6000602082840312156127b757600080fd5b60006127c5848285016125e3565b91505092915050565b6000602082840312156127e057600080fd5b60006127ee848285016125f8565b91505092915050565b60008060006060848603121561280c57600080fd5b600061281a8682870161260d565b935050602061282b8682870161260d565b925050604061283c8682870161260d565b9150509250925092565b6000612852838361285e565b60208301905092915050565b61286781612f86565b82525050565b61287681612f86565b82525050565b600061288782612e2c565b6128918185612e4f565b935061289c83612e1c565b8060005b838110156128cd5781516128b48882612846565b97506128bf83612e42565b9250506001810190506128a0565b5085935050505092915050565b6128e381612f98565b82525050565b6128f281612fdb565b82525050565b600061290382612e37565b61290d8185612e60565b935061291d818560208601612fed565b61292681613127565b840191505092915050565b600061293e602383612e60565b915061294982613138565b604082019050919050565b6000612961600c83612e60565b915061296c82613187565b602082019050919050565b6000612984602a83612e60565b915061298f826131b0565b604082019050919050565b60006129a7602283612e60565b91506129b2826131ff565b604082019050919050565b60006129ca601b83612e60565b91506129d58261324e565b602082019050919050565b60006129ed602183612e60565b91506129f882613277565b604082019050919050565b6000612a10602083612e60565b9150612a1b826132c6565b602082019050919050565b6000612a33602983612e60565b9150612a3e826132ef565b604082019050919050565b6000612a56602583612e60565b9150612a618261333e565b604082019050919050565b6000612a79602483612e60565b9150612a848261338d565b604082019050919050565b6000612a9c601783612e60565b9150612aa7826133dc565b602082019050919050565b612abb81612fc4565b82525050565b612aca81612fce565b82525050565b6000602082019050612ae5600083018461286d565b92915050565b6000604082019050612b00600083018561286d565b612b0d602083018461286d565b9392505050565b6000604082019050612b29600083018561286d565b612b366020830184612ab2565b9392505050565b600060c082019050612b52600083018961286d565b612b5f6020830188612ab2565b612b6c60408301876128e9565b612b7960608301866128e9565b612b86608083018561286d565b612b9360a0830184612ab2565b979650505050505050565b6000602082019050612bb360008301846128da565b92915050565b60006020820190508181036000830152612bd381846128f8565b905092915050565b60006020820190508181036000830152612bf481612931565b9050919050565b60006020820190508181036000830152612c1481612954565b9050919050565b60006020820190508181036000830152612c3481612977565b9050919050565b60006020820190508181036000830152612c548161299a565b9050919050565b60006020820190508181036000830152612c74816129bd565b9050919050565b60006020820190508181036000830152612c94816129e0565b9050919050565b60006020820190508181036000830152612cb481612a03565b9050919050565b60006020820190508181036000830152612cd481612a26565b9050919050565b60006020820190508181036000830152612cf481612a49565b9050919050565b60006020820190508181036000830152612d1481612a6c565b9050919050565b60006020820190508181036000830152612d3481612a8f565b9050919050565b6000602082019050612d506000830184612ab2565b92915050565b600060a082019050612d6b6000830188612ab2565b612d7860208301876128e9565b8181036040830152612d8a818661287c565b9050612d99606083018561286d565b612da66080830184612ab2565b9695505050505050565b6000602082019050612dc56000830184612ac1565b92915050565b6000612dd5612de6565b9050612de18282613020565b919050565b6000604051905090565b600067ffffffffffffffff821115612e0b57612e0a6130f8565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e7c82612fc4565b9150612e8783612fc4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ebc57612ebb61309a565b5b828201905092915050565b6000612ed282612fc4565b9150612edd83612fc4565b925082612eed57612eec6130c9565b5b828204905092915050565b6000612f0382612fc4565b9150612f0e83612fc4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612f4757612f4661309a565b5b828202905092915050565b6000612f5d82612fc4565b9150612f6883612fc4565b925082821015612f7b57612f7a61309a565b5b828203905092915050565b6000612f9182612fa4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612fe682612fc4565b9050919050565b60005b8381101561300b578082015181840152602081019050612ff0565b8381111561301a576000848401525b50505050565b61302982613127565b810181811067ffffffffffffffff82111715613048576130476130f8565b5b80604052505050565b600061305c82612fc4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561308f5761308e61309a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f556e617574686f72697a65640000000000000000000000000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61340e81612f86565b811461341957600080fd5b50565b61342581612f98565b811461343057600080fd5b50565b61343c81612fc4565b811461344757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220367222a1a88aed681b00b308ddcb410e973fc136a3f75afa8e8128dac21989fc64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,453
0xba4fa2f365250313a9f0a0c2b7f104d567cd785c
// SPDX-License-Identifier: MIT // Telegram: https://t.me/sussybakainu // Website: WIP // Total Supply: 1T // No Limit, No Cooldown // 14~16% Slippage // 20% Tax Fee // - 10% Redistribution // - 3% Development // - 2% Marketing // - 5% BuyBack & Burn 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 SBI is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Sussy Baka Inu"; string private constant _symbol = "SBI"; 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 = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 10; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingAddress; address payable private _buybackAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor( address payable addr1, address payable addr2, address payable addr3 ) { _teamAddress = addr1; _marketingAddress = addr2; _buybackAddress = addr3; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[_buybackAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (10 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(10).mul(3)); _marketingAddress.transfer(amount.div(10).mul(2)); _buybackAddress.transfer(amount.div(10).mul(5)); } function startTrading() external onlyOwner() { require(!tradingOpen, "trading is already started"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 1000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues( tAmount, _taxFee, _teamFee ); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues( tAmount, tFee, tTeam, currentRate ); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612aeb565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612f8c565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612aaf565b6105ad565b6040516101a09190612f71565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb919061312e565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f69190612a60565b6105db565b6040516102089190612f71565b60405180910390f35b34801561021d57600080fd5b506102266106b4565b005b34801561023457600080fd5b5061023d610c0f565b60405161024a91906131a3565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612b2c565b610c18565b005b34801561028857600080fd5b506102a3600480360381019061029e91906129d2565b610cca565b005b3480156102b157600080fd5b506102ba610dba565b005b3480156102c857600080fd5b506102e360048036038101906102de91906129d2565b610e2c565b6040516102f0919061312e565b60405180910390f35b34801561030557600080fd5b5061030e610e7d565b005b34801561031c57600080fd5b50610325610fd0565b6040516103329190612ea3565b60405180910390f35b34801561034757600080fd5b50610350610ff9565b60405161035d9190612f8c565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612aaf565b611036565b60405161039a9190612f71565b60405180910390f35b3480156103af57600080fd5b506103b8611054565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612b7e565b6110ce565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612a24565b611216565b604051610417919061312e565b60405180910390f35b61042861129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac9061308e565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613444565b9150506104b8565b5050565b60606040518060400160405280600e81526020017f53757373792042616b6120496e75000000000000000000000000000000000000815250905090565b60006105c16105ba61129d565b84846112a5565b6001905092915050565b6000670de0b6b3a7640000905090565b60006105e8848484611470565b6106a9846105f461129d565b6106a48560405180606001604052806028815260200161386760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065a61129d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2f9092919063ffffffff16565b6112a5565b600190509392505050565b6106bc61129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610749576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107409061308e565b60405180910390fd5b601060149054906101000a900460ff1615610799576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079090612fce565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082830600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a76400006112a5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561086e57600080fd5b505afa158015610882573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a691906129fb565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090857600080fd5b505afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906129fb565b6040518363ffffffff1660e01b815260040161095d929190612ebe565b602060405180830381600087803b15801561097757600080fd5b505af115801561098b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109af91906129fb565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3830610e2c565b600080610a43610fd0565b426040518863ffffffff1660e01b8152600401610a6596959493929190612f10565b6060604051808303818588803b158015610a7e57600080fd5b505af1158015610a92573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab79190612ba7565b5050506001601060166101000a81548160ff0219169083151502179055506000601060176101000a81548160ff021916908315150217905550670de0b6b3a76400006011819055506001601060146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bb9929190612ee7565b602060405180830381600087803b158015610bd357600080fd5b505af1158015610be7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0b9190612b55565b5050565b60006009905090565b610c2061129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca49061308e565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b610cd261129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d569061308e565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfb61129d565b73ffffffffffffffffffffffffffffffffffffffff1614610e1b57600080fd5b6000479050610e2981611c93565b50565b6000610e76600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e43565b9050919050565b610e8561129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f099061308e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f5342490000000000000000000000000000000000000000000000000000000000815250905090565b600061104a61104361129d565b8484611470565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661109561129d565b73ffffffffffffffffffffffffffffffffffffffff16146110b557600080fd5b60006110c030610e2c565b90506110cb81611eb1565b50565b6110d661129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115a9061308e565b60405180910390fd5b600081116111a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119d9061304e565b60405180910390fd5b6111d460646111c683670de0b6b3a76400006121ab90919063ffffffff16565b61222690919063ffffffff16565b6011819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60115460405161120b919061312e565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611315576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130c906130ee565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611385576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137c9061300e565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611463919061312e565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d7906130ce565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611550576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154790612fae565b60405180910390fd5b60008111611593576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158a906130ae565b60405180910390fd5b61159b610fd0565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160957506115d9610fd0565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6c57601060179054906101000a900460ff161561183c573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168b57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e55750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561173f5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183b57600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178561129d565b73ffffffffffffffffffffffffffffffffffffffff1614806117fb5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e361129d565b73ffffffffffffffffffffffffffffffffffffffff16145b61183a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118319061310e565b60405180910390fd5b5b5b60115481111561184b57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118ef5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118f857600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a35750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119f95750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a115750601060179054906101000a900460ff165b15611ab25742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6157600080fd5b600a42611a6e9190613264565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611abd30610e2c565b9050601060159054906101000a900460ff16158015611b2a5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b425750601060169054906101000a900460ff165b15611b6a57611b5081611eb1565b60004790506000811115611b6857611b6747611c93565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c135750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c1d57600090505b611c2984848484612270565b50505050565b6000838311158290611c77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6e9190612f8c565b60405180910390fd5b5060008385611c869190613345565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cf66003611ce8600a8661222690919063ffffffff16565b6121ab90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d21573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d856002611d77600a8661222690919063ffffffff16565b6121ab90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611db0573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e146005611e06600a8661222690919063ffffffff16565b6121ab90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e3f573d6000803e3d6000fd5b5050565b6000600654821115611e8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e8190612fee565b60405180910390fd5b6000611e9461229d565b9050611ea9818461222690919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f0f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611f3d5781602001602082028036833780820191505090505b5090503081600081518110611f7b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561201d57600080fd5b505afa158015612031573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061205591906129fb565b8160018151811061208f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506120f630600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a5565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161215a959493929190613149565b600060405180830381600087803b15801561217457600080fd5b505af1158015612188573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b6000808314156121be5760009050612220565b600082846121cc91906132eb565b90508284826121db91906132ba565b1461221b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122129061306e565b60405180910390fd5b809150505b92915050565b600061226883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506122c8565b905092915050565b8061227e5761227d61232b565b5b61228984848461235c565b8061229757612296612527565b5b50505050565b60008060006122aa612539565b915091506122c1818361222690919063ffffffff16565b9250505090565b6000808311829061230f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123069190612f8c565b60405180910390fd5b506000838561231e91906132ba565b9050809150509392505050565b600060085414801561233f57506000600954145b156123495761235a565b600060088190555060006009819055505b565b60008060008060008061236e87612598565b9550955095509550955095506123cc86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461260090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061246185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461264a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124ad816126a8565b6124b78483612765565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612514919061312e565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000670de0b6b3a7640000905061256d670de0b6b3a764000060065461222690919063ffffffff16565b82101561258b57600654670de0b6b3a7640000935093505050612594565b81819350935050505b9091565b60008060008060008060008060006125b58a60085460095461279f565b92509250925060006125c561229d565b905060008060006125d88e878787612835565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061264283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c2f565b905092915050565b60008082846126599190613264565b90508381101561269e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126959061302e565b60405180910390fd5b8091505092915050565b60006126b261229d565b905060006126c982846121ab90919063ffffffff16565b905061271d81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461264a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61277a8260065461260090919063ffffffff16565b6006819055506127958160075461264a90919063ffffffff16565b6007819055505050565b6000806000806127cb60646127bd888a6121ab90919063ffffffff16565b61222690919063ffffffff16565b905060006127f560646127e7888b6121ab90919063ffffffff16565b61222690919063ffffffff16565b9050600061281e82612810858c61260090919063ffffffff16565b61260090919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061284e85896121ab90919063ffffffff16565b9050600061286586896121ab90919063ffffffff16565b9050600061287c87896121ab90919063ffffffff16565b905060006128a582612897858761260090919063ffffffff16565b61260090919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128d16128cc846131e3565b6131be565b905080838252602082019050828560208602820111156128f057600080fd5b60005b858110156129205781612906888261292a565b8452602084019350602083019250506001810190506128f3565b5050509392505050565b60008135905061293981613821565b92915050565b60008151905061294e81613821565b92915050565b600082601f83011261296557600080fd5b81356129758482602086016128be565b91505092915050565b60008135905061298d81613838565b92915050565b6000815190506129a281613838565b92915050565b6000813590506129b78161384f565b92915050565b6000815190506129cc8161384f565b92915050565b6000602082840312156129e457600080fd5b60006129f28482850161292a565b91505092915050565b600060208284031215612a0d57600080fd5b6000612a1b8482850161293f565b91505092915050565b60008060408385031215612a3757600080fd5b6000612a458582860161292a565b9250506020612a568582860161292a565b9150509250929050565b600080600060608486031215612a7557600080fd5b6000612a838682870161292a565b9350506020612a948682870161292a565b9250506040612aa5868287016129a8565b9150509250925092565b60008060408385031215612ac257600080fd5b6000612ad08582860161292a565b9250506020612ae1858286016129a8565b9150509250929050565b600060208284031215612afd57600080fd5b600082013567ffffffffffffffff811115612b1757600080fd5b612b2384828501612954565b91505092915050565b600060208284031215612b3e57600080fd5b6000612b4c8482850161297e565b91505092915050565b600060208284031215612b6757600080fd5b6000612b7584828501612993565b91505092915050565b600060208284031215612b9057600080fd5b6000612b9e848285016129a8565b91505092915050565b600080600060608486031215612bbc57600080fd5b6000612bca868287016129bd565b9350506020612bdb868287016129bd565b9250506040612bec868287016129bd565b9150509250925092565b6000612c028383612c0e565b60208301905092915050565b612c1781613379565b82525050565b612c2681613379565b82525050565b6000612c378261321f565b612c418185613242565b9350612c4c8361320f565b8060005b83811015612c7d578151612c648882612bf6565b9750612c6f83613235565b925050600181019050612c50565b5085935050505092915050565b612c938161338b565b82525050565b612ca2816133ce565b82525050565b6000612cb38261322a565b612cbd8185613253565b9350612ccd8185602086016133e0565b612cd68161351a565b840191505092915050565b6000612cee602383613253565b9150612cf98261352b565b604082019050919050565b6000612d11601a83613253565b9150612d1c8261357a565b602082019050919050565b6000612d34602a83613253565b9150612d3f826135a3565b604082019050919050565b6000612d57602283613253565b9150612d62826135f2565b604082019050919050565b6000612d7a601b83613253565b9150612d8582613641565b602082019050919050565b6000612d9d601d83613253565b9150612da88261366a565b602082019050919050565b6000612dc0602183613253565b9150612dcb82613693565b604082019050919050565b6000612de3602083613253565b9150612dee826136e2565b602082019050919050565b6000612e06602983613253565b9150612e118261370b565b604082019050919050565b6000612e29602583613253565b9150612e348261375a565b604082019050919050565b6000612e4c602483613253565b9150612e57826137a9565b604082019050919050565b6000612e6f601183613253565b9150612e7a826137f8565b602082019050919050565b612e8e816133b7565b82525050565b612e9d816133c1565b82525050565b6000602082019050612eb86000830184612c1d565b92915050565b6000604082019050612ed36000830185612c1d565b612ee06020830184612c1d565b9392505050565b6000604082019050612efc6000830185612c1d565b612f096020830184612e85565b9392505050565b600060c082019050612f256000830189612c1d565b612f326020830188612e85565b612f3f6040830187612c99565b612f4c6060830186612c99565b612f596080830185612c1d565b612f6660a0830184612e85565b979650505050505050565b6000602082019050612f866000830184612c8a565b92915050565b60006020820190508181036000830152612fa68184612ca8565b905092915050565b60006020820190508181036000830152612fc781612ce1565b9050919050565b60006020820190508181036000830152612fe781612d04565b9050919050565b6000602082019050818103600083015261300781612d27565b9050919050565b6000602082019050818103600083015261302781612d4a565b9050919050565b6000602082019050818103600083015261304781612d6d565b9050919050565b6000602082019050818103600083015261306781612d90565b9050919050565b6000602082019050818103600083015261308781612db3565b9050919050565b600060208201905081810360008301526130a781612dd6565b9050919050565b600060208201905081810360008301526130c781612df9565b9050919050565b600060208201905081810360008301526130e781612e1c565b9050919050565b6000602082019050818103600083015261310781612e3f565b9050919050565b6000602082019050818103600083015261312781612e62565b9050919050565b60006020820190506131436000830184612e85565b92915050565b600060a08201905061315e6000830188612e85565b61316b6020830187612c99565b818103604083015261317d8186612c2c565b905061318c6060830185612c1d565b6131996080830184612e85565b9695505050505050565b60006020820190506131b86000830184612e94565b92915050565b60006131c86131d9565b90506131d48282613413565b919050565b6000604051905090565b600067ffffffffffffffff8211156131fe576131fd6134eb565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061326f826133b7565b915061327a836133b7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132af576132ae61348d565b5b828201905092915050565b60006132c5826133b7565b91506132d0836133b7565b9250826132e0576132df6134bc565b5b828204905092915050565b60006132f6826133b7565b9150613301836133b7565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561333a5761333961348d565b5b828202905092915050565b6000613350826133b7565b915061335b836133b7565b92508282101561336e5761336d61348d565b5b828203905092915050565b600061338482613397565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006133d9826133b7565b9050919050565b60005b838110156133fe5780820151818401526020810190506133e3565b8381111561340d576000848401525b50505050565b61341c8261351a565b810181811067ffffffffffffffff8211171561343b5761343a6134eb565b5b80604052505050565b600061344f826133b7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156134825761348161348d565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61382a81613379565b811461383557600080fd5b50565b6138418161338b565b811461384c57600080fd5b50565b613858816133b7565b811461386357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206c29f19b8b5991990ded3bc84b3a51fd4c58b3518747756783f3fac1758d700f64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,454
0xfDC46c3834F1f9EE1Ab19f6A5b2429Ebc2970a94
// $REDBULL | Red Bull Meme // Telegram: https://t.me/BullMeme // Website: https://redbullmeme.com/ // Envisioned and Designed by @ZachBoychuk & @1goonrich // Fair Launch, no Dev Tokens. 98% LP. // 2% of Supply to CryptoMessiah and ZachBoychuk (@1goonrich, @ZachBoychuk) // Snipers will be locked permanently. // LP Lock immediately on launch. // Ownership will be renounced 30 minutes after launch. // Slippage Recommended: 12%+ // 1% Supply limit per TX for the first 5 minutes. // Audit is in progress by https://solidity.finance/ // 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 RedBull is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "RedBullMeme | t.me/BullMeme"; string private constant _symbol = "REDBULL \xF0\x9F\x90\x82"; 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 = 5; uint256 private _teamFee = 10; mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _charityAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _charityAddress = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_charityAddress] = 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.div(2)); _charityAddress.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a1461030c578063c3c8cd801461032c578063c9567bf914610341578063d543dbeb14610356578063dd62ed3e1461037657600080fd5b8063715018a61461027a5780638da5cb5b1461028f57806395d89b41146102b7578063a9059cbb146102ec57600080fd5b8063273123b7116100dc578063273123b7146101e7578063313ce567146102095780635932ead1146102255780636fc3eaec1461024557806370a082311461025a57600080fd5b806306fdde0314610119578063095ea7b31461017157806318160ddd146101a157806323b872dd146101c757600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152601b81527f52656442756c6c4d656d65207c20742e6d652f42756c6c4d656d65000000000060208201525b6040516101689190611a0a565b60405180910390f35b34801561017d57600080fd5b5061019161018c36600461189b565b6103bc565b6040519015158152602001610168565b3480156101ad57600080fd5b50683635c9adc5dea000005b604051908152602001610168565b3480156101d357600080fd5b506101916101e236600461185b565b6103d3565b3480156101f357600080fd5b506102076102023660046117eb565b61043c565b005b34801561021557600080fd5b5060405160098152602001610168565b34801561023157600080fd5b5061020761024036600461198d565b610490565b34801561025157600080fd5b506102076104d8565b34801561026657600080fd5b506101b96102753660046117eb565b610505565b34801561028657600080fd5b50610207610527565b34801561029b57600080fd5b506000546040516001600160a01b039091168152602001610168565b3480156102c357600080fd5b5060408051808201909152600c81526b2922a2212aa62610784fc84160a11b602082015261015b565b3480156102f857600080fd5b5061019161030736600461189b565b61059b565b34801561031857600080fd5b506102076103273660046118c6565b6105a8565b34801561033857600080fd5b5061020761064c565b34801561034d57600080fd5b50610207610682565b34801561036257600080fd5b506102076103713660046119c5565b610a45565b34801561038257600080fd5b506101b9610391366004611823565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103c9338484610b18565b5060015b92915050565b60006103e0848484610c3c565b610432843361042d85604051806060016040528060288152602001611bdb602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061104e565b610b18565b5060019392505050565b6000546001600160a01b0316331461046f5760405162461bcd60e51b815260040161046690611a5d565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146104ba5760405162461bcd60e51b815260040161046690611a5d565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104f857600080fd5b4761050281611088565b50565b6001600160a01b0381166000908152600260205260408120546103cd9061110d565b6000546001600160a01b031633146105515760405162461bcd60e51b815260040161046690611a5d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103c9338484610c3c565b6000546001600160a01b031633146105d25760405162461bcd60e51b815260040161046690611a5d565b60005b8151811015610648576001600a600084848151811061060457634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061064081611b70565b9150506105d5565b5050565b600c546001600160a01b0316336001600160a01b03161461066c57600080fd5b600061067730610505565b905061050281611191565b6000546001600160a01b031633146106ac5760405162461bcd60e51b815260040161046690611a5d565b600f54600160a01b900460ff16156107065760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610466565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107433082683635c9adc5dea00000610b18565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561077c57600080fd5b505afa158015610790573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b49190611807565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107fc57600080fd5b505afa158015610810573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108349190611807565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561087c57600080fd5b505af1158015610890573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b49190611807565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108e481610505565b6000806108f96000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561095c57600080fd5b505af1158015610970573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061099591906119dd565b5050600f8054678ac7230489e8000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a0d57600080fd5b505af1158015610a21573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064891906119a9565b6000546001600160a01b03163314610a6f5760405162461bcd60e51b815260040161046690611a5d565b60008111610abf5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610466565b610add6064610ad7683635c9adc5dea0000084611336565b906113b5565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b7a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610466565b6001600160a01b038216610bdb5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610466565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ca05760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610466565b6001600160a01b038216610d025760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610466565b60008111610d645760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610466565b6000546001600160a01b03848116911614801590610d9057506000546001600160a01b03838116911614155b15610ff157600f54600160b81b900460ff1615610e77576001600160a01b0383163014801590610dc957506001600160a01b0382163014155b8015610de35750600e546001600160a01b03848116911614155b8015610dfd5750600e546001600160a01b03838116911614155b15610e7757600e546001600160a01b0316336001600160a01b03161480610e375750600f546001600160a01b0316336001600160a01b0316145b610e775760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610466565b601054811115610e8657600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610ec857506001600160a01b0382166000908152600a602052604090205460ff16155b610ed157600080fd5b600f546001600160a01b038481169116148015610efc5750600e546001600160a01b03838116911614155b8015610f2157506001600160a01b03821660009081526005602052604090205460ff16155b8015610f365750600f54600160b81b900460ff165b15610f84576001600160a01b0382166000908152600b60205260409020544211610f5f57600080fd5b610f6a42603c611b02565b6001600160a01b0383166000908152600b60205260409020555b6000610f8f30610505565b600f54909150600160a81b900460ff16158015610fba5750600f546001600160a01b03858116911614155b8015610fcf5750600f54600160b01b900460ff165b15610fef57610fdd81611191565b478015610fed57610fed47611088565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061103357506001600160a01b03831660009081526005602052604090205460ff165b1561103c575060005b611048848484846113f7565b50505050565b600081848411156110725760405162461bcd60e51b81526004016104669190611a0a565b50600061107f8486611b59565b95945050505050565b600c546001600160a01b03166108fc6110a28360026113b5565b6040518115909202916000818181858888f193505050501580156110ca573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110e58360026113b5565b6040518115909202916000818181858888f19350505050158015610648573d6000803e3d6000fd5b60006006548211156111745760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610466565b600061117e611423565b905061118a83826113b5565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111e757634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561123b57600080fd5b505afa15801561124f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112739190611807565b8160018151811061129457634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112ba9130911684610b18565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112f3908590600090869030904290600401611a92565b600060405180830381600087803b15801561130d57600080fd5b505af1158015611321573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b600082611345575060006103cd565b60006113518385611b3a565b90508261135e8583611b1a565b1461118a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610466565b600061118a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611446565b8061140457611404611474565b61140f848484611497565b80611048576110486005600855600a600955565b600080600061143061158e565b909250905061143f82826113b5565b9250505090565b600081836114675760405162461bcd60e51b81526004016104669190611a0a565b50600061107f8486611b1a565b6008541580156114845750600954155b1561148b57565b60006008819055600955565b6000806000806000806114a9876115d0565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114db908761162d565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461150a908661166f565b6001600160a01b03891660009081526002602052604090205561152c816116ce565b6115368483611718565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161157b91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006115aa82826113b5565b8210156115c757505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115ed8a60085460095461173c565b92509250925060006115fd611423565b905060008060006116108e87878761178b565b919e509c509a509598509396509194505050505091939550919395565b600061118a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061104e565b60008061167c8385611b02565b90508381101561118a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610466565b60006116d8611423565b905060006116e68383611336565b30600090815260026020526040902054909150611703908261166f565b30600090815260026020526040902055505050565b600654611725908361162d565b600655600754611735908261166f565b6007555050565b60008080806117506064610ad78989611336565b905060006117636064610ad78a89611336565b9050600061177b826117758b8661162d565b9061162d565b9992985090965090945050505050565b600080808061179a8886611336565b905060006117a88887611336565b905060006117b68888611336565b905060006117c882611775868661162d565b939b939a50919850919650505050505050565b80356117e681611bb7565b919050565b6000602082840312156117fc578081fd5b813561118a81611bb7565b600060208284031215611818578081fd5b815161118a81611bb7565b60008060408385031215611835578081fd5b823561184081611bb7565b9150602083013561185081611bb7565b809150509250929050565b60008060006060848603121561186f578081fd5b833561187a81611bb7565b9250602084013561188a81611bb7565b929592945050506040919091013590565b600080604083850312156118ad578182fd5b82356118b881611bb7565b946020939093013593505050565b600060208083850312156118d8578182fd5b823567ffffffffffffffff808211156118ef578384fd5b818501915085601f830112611902578384fd5b81358181111561191457611914611ba1565b8060051b604051601f19603f8301168101818110858211171561193957611939611ba1565b604052828152858101935084860182860187018a1015611957578788fd5b8795505b838610156119805761196c816117db565b85526001959095019493860193860161195b565b5098975050505050505050565b60006020828403121561199e578081fd5b813561118a81611bcc565b6000602082840312156119ba578081fd5b815161118a81611bcc565b6000602082840312156119d6578081fd5b5035919050565b6000806000606084860312156119f1578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a3657858101830151858201604001528201611a1a565b81811115611a475783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ae15784516001600160a01b031683529383019391830191600101611abc565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b1557611b15611b8b565b500190565b600082611b3557634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b5457611b54611b8b565b500290565b600082821015611b6b57611b6b611b8b565b500390565b6000600019821415611b8457611b84611b8b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461050257600080fd5b801515811461050257600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a733dfe51d216444040cdbf3882f7b5857392d6a305972d91bbb7602b2d6230c64736f6c63430008040033
{"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"}]}}
6,455
0x2cfefc228c9b27c1e8e5a36ce604431605312980
/** *Submitted for verification at Etherscan.io on 2022-03-17 */ /** *A Fury Ape */ // 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 FURYAPE is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "FURYAPE"; string private constant _symbol = "FURYAPE"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 4; uint256 private _taxFeeOnBuy = 8; uint256 private _redisFeeOnSell = 4; uint256 private _taxFeeOnSell = 8; //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(0x3E05356D2a076985d51AbDF7619b615b8C56d72f); address payable private _marketingAddress = payable(0x3E05356D2a076985d51AbDF7619b615b8C56d72f); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 75000000 * 10**9; uint256 public _maxWalletSize = 150000000 * 10**9; uint256 public _swapTokensAtAmount = 75000000 * 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 removeStrictTxLimit(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 <= 99, "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 <= 99, "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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063dd62ed3e11610064578063dd62ed3e14610522578063e67bd64814610568578063ea1644d514610588578063f2fde38b146105a857600080fd5b8063a9059cbb1461049d578063bfd79284146104bd578063c3c8cd80146104ed578063c492f0461461050257600080fd5b80638f70ccf7116100d15780638f70ccf7146104475780638f9a55c01461046757806395d89b41146101fe57806398a5c3151461047d57600080fd5b80637d1db4a5146103e65780637f2feddc146103fc5780638da5cb5b1461042957600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037c57806370a0823114610391578063715018a6146103b157806374010ece146103c657600080fd5b8063313ce5671461030057806349bd5a5e1461031c5780636b9990531461033c5780636d8aa8f81461035c57600080fd5b80631694505e116101ab5780631694505e1461026d57806318160ddd146102a557806323b872dd146102ca5780632fd689e3146102ea57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023d57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611ab4565b6105c8565b005b34801561020a57600080fd5b5060408051808201825260078152664655525941504560c81b602082015290516102349190611b79565b60405180910390f35b34801561024957600080fd5b5061025d610258366004611bce565b610667565b6040519015158152602001610234565b34801561027957600080fd5b5060145461028d906001600160a01b031681565b6040516001600160a01b039091168152602001610234565b3480156102b157600080fd5b50678ac7230489e800005b604051908152602001610234565b3480156102d657600080fd5b5061025d6102e5366004611bfa565b61067e565b3480156102f657600080fd5b506102bc60185481565b34801561030c57600080fd5b5060405160098152602001610234565b34801561032857600080fd5b5060155461028d906001600160a01b031681565b34801561034857600080fd5b506101fc610357366004611c3b565b6106e7565b34801561036857600080fd5b506101fc610377366004611c68565b610732565b34801561038857600080fd5b506101fc61077a565b34801561039d57600080fd5b506102bc6103ac366004611c3b565b6107c5565b3480156103bd57600080fd5b506101fc6107e7565b3480156103d257600080fd5b506101fc6103e1366004611c83565b61085b565b3480156103f257600080fd5b506102bc60165481565b34801561040857600080fd5b506102bc610417366004611c3b565b60116020526000908152604090205481565b34801561043557600080fd5b506000546001600160a01b031661028d565b34801561045357600080fd5b506101fc610462366004611c68565b61089a565b34801561047357600080fd5b506102bc60175481565b34801561048957600080fd5b506101fc610498366004611c83565b6108e2565b3480156104a957600080fd5b5061025d6104b8366004611bce565b610911565b3480156104c957600080fd5b5061025d6104d8366004611c3b565b60106020526000908152604090205460ff1681565b3480156104f957600080fd5b506101fc61091e565b34801561050e57600080fd5b506101fc61051d366004611c9c565b610972565b34801561052e57600080fd5b506102bc61053d366004611d20565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561057457600080fd5b506101fc610583366004611d59565b610a13565b34801561059457600080fd5b506101fc6105a3366004611c83565b610bc9565b3480156105b457600080fd5b506101fc6105c3366004611c3b565b610bf8565b6000546001600160a01b031633146105fb5760405162461bcd60e51b81526004016105f290611d8b565b60405180910390fd5b60005b81518110156106635760016010600084848151811061061f5761061f611dc0565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065b81611dec565b9150506105fe565b5050565b6000610674338484610ce2565b5060015b92915050565b600061068b848484610e06565b6106dd84336106d885604051806060016040528060288152602001611f06602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611342565b610ce2565b5060019392505050565b6000546001600160a01b031633146107115760405162461bcd60e51b81526004016105f290611d8b565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075c5760405162461bcd60e51b81526004016105f290611d8b565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107af57506013546001600160a01b0316336001600160a01b0316145b6107b857600080fd5b476107c28161137c565b50565b6001600160a01b038116600090815260026020526040812054610678906113b6565b6000546001600160a01b031633146108115760405162461bcd60e51b81526004016105f290611d8b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108855760405162461bcd60e51b81526004016105f290611d8b565b674563918244f400008111156107c257601655565b6000546001600160a01b031633146108c45760405162461bcd60e51b81526004016105f290611d8b565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461090c5760405162461bcd60e51b81526004016105f290611d8b565b601855565b6000610674338484610e06565b6012546001600160a01b0316336001600160a01b0316148061095357506013546001600160a01b0316336001600160a01b0316145b61095c57600080fd5b6000610967306107c5565b90506107c28161143a565b6000546001600160a01b0316331461099c5760405162461bcd60e51b81526004016105f290611d8b565b60005b82811015610a0d5781600560008686858181106109be576109be611dc0565b90506020020160208101906109d39190611c3b565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a0581611dec565b91505061099f565b50505050565b6000546001600160a01b03163314610a3d5760405162461bcd60e51b81526004016105f290611d8b565b6004841115610a9c5760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420342560d81b60648201526084016105f2565b6063821115610af85760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642032604482015261302560f01b60648201526084016105f2565b6004831115610b585760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420342560d01b60648201526084016105f2565b6063811115610bb55760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526232302560e81b60648201526084016105f2565b600893909355600a91909155600955600b55565b6000546001600160a01b03163314610bf35760405162461bcd60e51b81526004016105f290611d8b565b601755565b6000546001600160a01b03163314610c225760405162461bcd60e51b81526004016105f290611d8b565b6001600160a01b038116610c875760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f2565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d445760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f2565b6001600160a01b038216610da55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f2565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e6a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f2565b6001600160a01b038216610ecc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f2565b60008111610f2e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f2565b6000546001600160a01b03848116911614801590610f5a57506000546001600160a01b03838116911614155b1561123b57601554600160a01b900460ff16610ff3576000546001600160a01b03848116911614610ff35760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f2565b6016548111156110455760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f2565b6001600160a01b03831660009081526010602052604090205460ff1615801561108757506001600160a01b03821660009081526010602052604090205460ff16155b6110df5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f2565b6015546001600160a01b038381169116146111645760175481611101846107c5565b61110b9190611e07565b106111645760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f2565b600061116f306107c5565b6018546016549192508210159082106111885760165491505b80801561119f5750601554600160a81b900460ff16155b80156111b957506015546001600160a01b03868116911614155b80156111ce5750601554600160b01b900460ff165b80156111f357506001600160a01b03851660009081526005602052604090205460ff16155b801561121857506001600160a01b03841660009081526005602052604090205460ff16155b15611238576112268261143a565b478015611236576112364761137c565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061127d57506001600160a01b03831660009081526005602052604090205460ff165b806112af57506015546001600160a01b038581169116148015906112af57506015546001600160a01b03848116911614155b156112bc57506000611336565b6015546001600160a01b0385811691161480156112e757506014546001600160a01b03848116911614155b156112f957600854600c55600954600d555b6015546001600160a01b03848116911614801561132457506014546001600160a01b03858116911614155b1561133657600a54600c55600b54600d555b610a0d848484846115c3565b600081848411156113665760405162461bcd60e51b81526004016105f29190611b79565b5060006113738486611e1f565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610663573d6000803e3d6000fd5b600060065482111561141d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f2565b60006114276115f1565b90506114338382611614565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061148257611482611dc0565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156114d657600080fd5b505afa1580156114ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061150e9190611e36565b8160018151811061152157611521611dc0565b6001600160a01b0392831660209182029290920101526014546115479130911684610ce2565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611580908590600090869030904290600401611e53565b600060405180830381600087803b15801561159a57600080fd5b505af11580156115ae573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806115d0576115d0611656565b6115db848484611684565b80610a0d57610a0d600e54600c55600f54600d55565b60008060006115fe61177b565b909250905061160d8282611614565b9250505090565b600061143383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117bb565b600c541580156116665750600d54155b1561166d57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611696876117e9565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116c89087611846565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116f79086611888565b6001600160a01b038916600090815260026020526040902055611719816118e7565b6117238483611931565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161176891815260200190565b60405180910390a3505050505050505050565b6006546000908190678ac7230489e800006117968282611614565b8210156117b257505060065492678ac7230489e8000092509050565b90939092509050565b600081836117dc5760405162461bcd60e51b81526004016105f29190611b79565b5060006113738486611ec4565b60008060008060008060008060006118068a600c54600d54611955565b92509250925060006118166115f1565b905060008060006118298e8787876119aa565b919e509c509a509598509396509194505050505091939550919395565b600061143383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611342565b6000806118958385611e07565b9050838110156114335760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f2565b60006118f16115f1565b905060006118ff83836119fa565b3060009081526002602052604090205490915061191c9082611888565b30600090815260026020526040902055505050565b60065461193e9083611846565b60065560075461194e9082611888565b6007555050565b600080808061196f606461196989896119fa565b90611614565b9050600061198260646119698a896119fa565b9050600061199a826119948b86611846565b90611846565b9992985090965090945050505050565b60008080806119b988866119fa565b905060006119c788876119fa565b905060006119d588886119fa565b905060006119e7826119948686611846565b939b939a50919850919650505050505050565b600082611a0957506000610678565b6000611a158385611ee6565b905082611a228583611ec4565b146114335760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f2565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c257600080fd5b8035611aaf81611a8f565b919050565b60006020808385031215611ac757600080fd5b823567ffffffffffffffff80821115611adf57600080fd5b818501915085601f830112611af357600080fd5b813581811115611b0557611b05611a79565b8060051b604051601f19603f83011681018181108582111715611b2a57611b2a611a79565b604052918252848201925083810185019188831115611b4857600080fd5b938501935b82851015611b6d57611b5e85611aa4565b84529385019392850192611b4d565b98975050505050505050565b600060208083528351808285015260005b81811015611ba657858101830151858201604001528201611b8a565b81811115611bb8576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611be157600080fd5b8235611bec81611a8f565b946020939093013593505050565b600080600060608486031215611c0f57600080fd5b8335611c1a81611a8f565b92506020840135611c2a81611a8f565b929592945050506040919091013590565b600060208284031215611c4d57600080fd5b813561143381611a8f565b80358015158114611aaf57600080fd5b600060208284031215611c7a57600080fd5b61143382611c58565b600060208284031215611c9557600080fd5b5035919050565b600080600060408486031215611cb157600080fd5b833567ffffffffffffffff80821115611cc957600080fd5b818601915086601f830112611cdd57600080fd5b813581811115611cec57600080fd5b8760208260051b8501011115611d0157600080fd5b602092830195509350611d179186019050611c58565b90509250925092565b60008060408385031215611d3357600080fd5b8235611d3e81611a8f565b91506020830135611d4e81611a8f565b809150509250929050565b60008060008060808587031215611d6f57600080fd5b5050823594602084013594506040840135936060013592509050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e0057611e00611dd6565b5060010190565b60008219821115611e1a57611e1a611dd6565b500190565b600082821015611e3157611e31611dd6565b500390565b600060208284031215611e4857600080fd5b815161143381611a8f565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ea35784516001600160a01b031683529383019391830191600101611e7e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611ee157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f0057611f00611dd6565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122094e67d3b37a41dc8fa68e17952c01895d7e3595779c2cb052d185dd60dafa28b64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
6,456
0x1ff93b2d47d974644bddc62bf66940ebf18703e8
/** *Submitted for verification at Etherscan.io on 2020-08-07 */ pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error **/ library SafeMath{ function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } 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)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @dev Abstract contract for approveAndCall. **/ contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 tokens, address token, bytes data) public; } /** * @title SiuCoin Token * @dev ERC20 contract utilizing ERC865-ish structure (3esmit's implementation with alterations). * @dev to allow users to pay Ethereum fees in tokens. **/ contract SiuCoin is Ownable { using SafeMath for uint256; string public constant symbol = "SIU"; string public constant name = "Siucoin"; uint8 public constant decimals = 18; uint256 private _totalSupply = 1500000 * (10 ** 18); // Function sigs to be used within contract for signature recovery. bytes4 internal constant transferSig = 0xa9059cbb; bytes4 internal constant approveSig = 0x095ea7b3; bytes4 internal constant increaseApprovalSig = 0xd73dd623; bytes4 internal constant decreaseApprovalSig = 0x66188463; bytes4 internal constant approveAndCallSig = 0xcae9ca51; bytes4 internal constant revokeSignatureSig = 0xe40d89e5; // Balances for each account mapping(address => uint256) balances; // Owner of account approves the transfer of an amount to another account mapping(address => mapping (address => uint256)) allowed; // Keeps track of the last nonce sent from user. Used for delegated functions. mapping (address => uint256) nonces; // Mapping of past used hashes: true if already used. mapping (address => mapping (bytes => bool)) invalidSignatures; // Mapping of finalized ERC865 standard sigs => our function sigs for future-proofing mapping (bytes4 => bytes4) public standardSigs; event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed from, address indexed spender, uint tokens); event SignatureRedeemed(bytes _sig, address indexed from); event Mint(address indexed to, uint256 amount); event Burn(address indexed burner, uint256 value); constructor() public { balances[0xDbCCd61648edFFD465A50a7929B9f7a278Fd7D56] = 1000000 ether; balances[0xca1504e201d4Dc31691b70653EB7Dcb1691bc62B] = 500000 ether; } function _burn(address _who, uint256 _value) onlyOwner public returns (bool) { require(_value <= balances[_who]); balances[_who] = balances[_who].sub(_value); _totalSupply = _totalSupply.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); return true; } function _mint(address _to, uint256 _amount) onlyOwner public returns (bool) { _totalSupply = SafeMath.add(_totalSupply, _amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(0x0000000000000000000000000000000000000000, _to, _amount); return true; } /** * @dev This code allows us to redirect pre-signed calls with different function selectors to our own. **/ function () public { bytes memory calldata = msg.data; bytes4 new_selector = standardSigs[msg.sig]; require(new_selector != 0); assembly { mstore(add(0x20, calldata), new_selector) } require(address(this).delegatecall(calldata)); assembly { if iszero(eq(returndatasize, 0x20)) { revert(0, 0) } returndatacopy(0, 0, returndatasize) return(0, returndatasize) } } function transfer(address _to, uint256 _amount) public returns (bool success) { require(_transfer(msg.sender, _to, _amount)); return true; } function transferFrom(address _from, address _to, uint _amount) public returns (bool success) { require(balances[_from] >= _amount && allowed[_from][msg.sender] >= _amount); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount); require(_transfer(_from, _to, _amount)); return true; } function approve(address _spender, uint256 _amount) public returns (bool success) { require(_approve(msg.sender, _spender, _amount)); return true; } function increaseApproval(address _spender, uint256 _amount) public returns (bool success) { require(_increaseApproval(msg.sender, _spender, _amount)); return true; } function decreaseApproval(address _spender, uint256 _amount) public returns (bool success) { require(_decreaseApproval(msg.sender, _spender, _amount)); return true; } function approveAndCall(address _spender, uint256 _amount, bytes _data) public returns (bool success) { require(_approve(msg.sender, _spender, _amount)); ApproveAndCallFallBack(_spender).receiveApproval(msg.sender, _amount, address(this), _data); return true; } function _transfer(address _from, address _to, uint256 _amount) internal returns (bool success) { require (_to != address(0)); require(balances[_from] >= _amount); balances[_from] = balances[_from].sub(_amount); balances[_to] = balances[_to].add(_amount); emit Transfer(_from, _to, _amount); return true; } function _approve(address _owner, address _spender, uint256 _amount) internal returns (bool success) { allowed[_owner][_spender] = _amount; emit Approval(_owner, _spender, _amount); return true; } function _increaseApproval(address _owner, address _spender, uint256 _amount) internal returns (bool success) { allowed[_owner][_spender] = allowed[_owner][_spender].add(_amount); emit Approval(_owner, _spender, allowed[_owner][_spender]); return true; } function _decreaseApproval(address _owner, address _spender, uint256 _amount) internal returns (bool success) { if (allowed[_owner][_spender] <= _amount) allowed[_owner][_spender] = 0; else allowed[_owner][_spender] = allowed[_owner][_spender].sub(_amount); emit Approval(_owner, _spender, allowed[_owner][_spender]); return true; } function transferPreSigned( bytes _signature, address _to, uint256 _value, bytes _extraData, uint256 _nonce) public validPayload(292) returns (bool) { // Log starting gas left of transaction for later gas price calculations. // Recover signer address from signature; ensure address is valid. address from = recoverPreSigned(_signature, transferSig, _to, _value, _extraData, _nonce); require(from != address(0)); // Require the hash has not been used, declare it used, increment nonce. require(!invalidSignatures[from][_signature]); invalidSignatures[from][_signature] = true; nonces[from]++; // Internal transfer. require(_transfer(from, _to, _value)); emit SignatureRedeemed(_signature, from); return true; } function approvePreSigned( bytes _signature, address _to, uint256 _value, bytes _extraData, uint256 _nonce) public validPayload(292) returns (bool) { address from = recoverPreSigned(_signature, approveSig, _to, _value, _extraData, _nonce); require(from != address(0)); require(!invalidSignatures[from][_signature]); invalidSignatures[from][_signature] = true; nonces[from]++; require(_approve(from, _to, _value)); emit SignatureRedeemed(_signature, from); return true; } function increaseApprovalPreSigned( bytes _signature, address _to, uint256 _value, bytes _extraData, uint256 _nonce) public validPayload(292) returns (bool) { address from = recoverPreSigned(_signature, increaseApprovalSig, _to, _value, _extraData, _nonce); require(from != address(0)); require(!invalidSignatures[from][_signature]); invalidSignatures[from][_signature] = true; nonces[from]++; require(_increaseApproval(from, _to, _value)); emit SignatureRedeemed(_signature, from); return true; } /** * @dev Added for the same reason as increaseApproval. Decreases to 0 if "_value" is greater than allowed. **/ function decreaseApprovalPreSigned( bytes _signature, address _to, uint256 _value, bytes _extraData, uint256 _nonce) public validPayload(292) returns (bool) { address from = recoverPreSigned(_signature, decreaseApprovalSig, _to, _value, _extraData, _nonce); require(from != address(0)); require(!invalidSignatures[from][_signature]); invalidSignatures[from][_signature] = true; nonces[from]++; require(_decreaseApproval(from, _to, _value)); emit SignatureRedeemed(_signature, from); return true; } function approveAndCallPreSigned( bytes _signature, address _to, uint256 _value, bytes _extraData, uint256 _nonce) public validPayload(356) returns (bool) { address from = recoverPreSigned(_signature, approveAndCallSig, _to, _value, _extraData, _nonce); require(from != address(0)); require(!invalidSignatures[from][_signature]); invalidSignatures[from][_signature] = true; nonces[from]++; require(_approve(from, _to, _value)); ApproveAndCallFallBack(_to).receiveApproval(from, _value, address(this), _extraData); emit SignatureRedeemed(_signature, from); return true; } function revokeSignature(bytes _sigToRevoke) public returns (bool) { invalidSignatures[msg.sender][_sigToRevoke] = true; emit SignatureRedeemed(_sigToRevoke, msg.sender); return true; } function revokeSignaturePreSigned( bytes _signature, bytes _sigToRevoke ) public validPayload(356) returns (bool) { address from = recoverRevokeHash(_signature, _sigToRevoke); require(!invalidSignatures[from][_signature]); invalidSignatures[from][_signature] = true; invalidSignatures[from][_sigToRevoke] = true; emit SignatureRedeemed(_signature, from); return true; } function getRevokeHash(bytes _sigToRevoke) public pure returns (bytes32 txHash) { return keccak256(revokeSignatureSig, _sigToRevoke); } function recoverRevokeHash(bytes _signature, bytes _sigToRevoke) public pure returns (address from) { return ecrecoverFromSig(getSignHash(getRevokeHash(_sigToRevoke)), _signature); } function getPreSignedHash( bytes4 _function, address _to, uint256 _value, bytes _extraData, uint256 _nonce) public view returns (bytes32 txHash) { return keccak256(address(this), _function, _to, _value, _extraData, _nonce); } function recoverPreSigned( bytes _sig, bytes4 _function, address _to, uint256 _value, bytes _extraData, uint256 _nonce) public view returns (address recovered) { bytes32 hexdData = getPreSignedHash(_function, _to, _value, _extraData, _nonce); return ecrecoverFromSig( keccak256("\x19Ethereum Signed Message:\n32",hexdData), _sig); } /** * @dev Add signature prefix to hash for recovery à la ERC191. * @param _hash The hashed transaction to add signature prefix to. **/ function getSignHash(bytes32 _hash) public pure returns (bytes32 signHash) { return keccak256("\x19Ethereum Signed Message:\n32", _hash); } /** * @dev Helps to reduce stack depth problems for delegations. Thank you to Bokky for this! * @param hash The hash of signed data for the transaction. * @param sig Contains r, s, and v for recovery of address from the hash. **/ function ecrecoverFromSig(bytes32 hash, bytes sig) public pure returns (address recoveredAddress) { bytes32 r; bytes32 s; uint8 v; if (sig.length != 65) return address(0); assembly { r := mload(add(sig, 32)) s := mload(add(sig, 64)) // Here we are loading the last 32 bytes. We exploit the fact that 'mload' will pad with zeroes if we overread. // There is no 'mload8' to do this, but that would be nicer. v := byte(0, mload(add(sig, 96))) } // Albeit non-transactional signatures are not specified by the YP, one would expect it to match the YP range of [27, 28] // geth uses [0, 1] and some clients have followed. This might change, see https://github.com/ethereum/go-ethereum/issues/2053 if (v < 27) { v += 27; } if (v != 27 && v != 28) return address(0); return ecrecover(hash, v, r, s); } /** * @dev Frontend queries to find the next nonce of the user so they can find the new nonce to send. * @param _owner Address that will be sending the COIN. **/ function getNonce(address _owner) external view returns (uint256 nonce) { return nonces[_owner]; } /** ****************************** Constants ******************************* **/ /** * @dev Return total supply of token. **/ function totalSupply() external view returns (uint256) { return _totalSupply; } /** * @dev Return balance of a certain address. * @param _owner The address whose balance we want to check. **/ function balanceOf(address _owner) external view returns (uint256) { return balances[_owner]; } /** * @dev Allowed amount for a user to spend of another's tokens. * @param _owner The owner of the tokens approved to spend. * @param _spender The address of the user allowed to spend the tokens. **/ function allowance(address _owner, address _spender) external view returns (uint256) { return allowed[_owner][_spender]; } /** ****************************** onlyOwner ******************************* **/ /** * @dev Allow the owner to take ERC20 tokens off of this contract if they are accidentally sent. **/ function token_escape(address _tokenContract) external onlyOwner { SiuCoin lostToken = SiuCoin(_tokenContract); uint256 stuckTokens = lostToken.balanceOf(address(this)); lostToken.transfer(owner, stuckTokens); } /** * @dev Owner may set the standard sig to redirect to one of our pre-signed functions. * @dev Added in order to prepare for the ERC865 standard function names to be different from ours. * @param _standardSig The function signature of the finalized standard function. * @param _ourSig The function signature of our implemented function. **/ function updateStandard(bytes4 _standardSig, bytes4 _ourSig) external onlyOwner returns (bool success) { // These 6 are the signatures of our pre-signed functions. Don't want the owner messin' around. require(_ourSig == 0x1296830d || _ourSig == 0x617b390b || _ourSig == 0xadb8249e || _ourSig == 0x8be52783 || _ourSig == 0xc8d4b389 || _ourSig == 0xe391a7c4); standardSigs[_standardSig] = _ourSig; return true; } /** ***************************** Modifiers ******************************** **/ modifier validPayload(uint _size) { uint payload_size; assembly { payload_size := calldatasize } require(payload_size >= _size); _; } }
0x6080604052600436106101875763ffffffff60e060020a60003504166306fdde038114610291578063095ea7b31461031b57806318160ddd1461035357806323b872dd1461037a5780632d0335ab146103a4578063313ce567146103c557806347b5c2a3146103f05780634e6ec247146104ca5780636161eb18146104ee57806366188463146105125780636970fe8b1461053657806370a08231146105e557806370c3a1b7146106065780638b4d7634146106815780638da5cb5b14610730578063930c112b1461074557806395d89b41146107f45780639871894814610809578063a9059cbb14610848578063b15aa5b71461086c578063b552698714610884578063c22f825014610933578063cae9ca511461095b578063cc5ece18146109c4578063ccbfc6ed14610a5b578063d035e45f14610ab4578063d4acaf6c14610ad7578063d5ce97ee14610b35578063d73dd62314610be4578063dd62ed3e14610c08578063e40d89e514610c2f578063e87b97b214610c88578063f2fde38b14610d1f575b34801561019357600080fd5b506060600080368080601f016020809104026020016040519081016040528093929190818152602001838380828437505050600160e060020a031960008035821681526006602052604090205494965060e060020a9094029450505050811615156101fd57600080fd5b602082018181526040518351309285929182919080838360005b8381101561022f578181015183820152602001610217565b50505050905090810190601f16801561025c5780820380516001836020036101000a031916815260200191505b50915050600060405180830381855af4915050151561027a57600080fd5b3d60201461028757600080fd5b3d6000803e3d6000f35b34801561029d57600080fd5b506102a6610d40565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102e05781810151838201526020016102c8565b50505050905090810190601f16801561030d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561032757600080fd5b5061033f600160a060020a0360043516602435610d77565b604080519115158252519081900360200190f35b34801561035f57600080fd5b50610368610d98565b60408051918252519081900360200190f35b34801561038657600080fd5b5061033f600160a060020a0360043581169060243516604435610d9e565b3480156103b057600080fd5b50610368600160a060020a0360043516610e6c565b3480156103d157600080fd5b506103da610e87565b6040805160ff9092168252519081900360200190f35b3480156103fc57600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526104ae94369492936024939284019190819084018382808284375050604080516020601f60608a01358b0180359182018390048302840183018552818452989b600160e060020a03198b35169b600160a060020a03848d0135169b958601359a9199509750608090940195509193509182019181908401838280828437509497505093359450610e8c9350505050565b60408051600160a060020a039092168252519081900360200190f35b3480156104d657600080fd5b5061033f600160a060020a0360043516602435610eee565b3480156104fa57600080fd5b5061033f600160a060020a0360043516602435610fda565b34801561051e57600080fd5b5061033f600160a060020a03600435166024356110f8565b34801561054257600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261033f94369492936024939284019190819084018382808284375050604080516020888301358a018035601f8101839004830284018301909452838352979a8935600160a060020a03169a8a8301359a9199909850606090910196509194509081019250819084018382808284375094975050933594506111059350505050565b3480156105f157600080fd5b50610368600160a060020a0360043516611359565b34801561061257600080fd5b50604080516020601f60643560048181013592830184900484028501840190955281845261036894600160e060020a031981351694600160a060020a03602480359190911695604435953695608494930191819084018382808284375094975050933594506113749350505050565b34801561068d57600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261033f94369492936024939284019190819084018382808284375050604080516020888301358a018035601f8101839004830284018301909452838352979a8935600160a060020a03169a8a8301359a9199909850606090910196509194509081019250819084018382808284375094975050933594506114299350505050565b34801561073c57600080fd5b506104ae611732565b34801561075157600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261033f94369492936024939284019190819084018382808284375050604080516020888301358a018035601f8101839004830284018301909452838352979a8935600160a060020a03169a8a8301359a9199909850606090910196509194509081019250819084018382808284375094975050933594506117419350505050565b34801561080057600080fd5b506102a66118ea565b34801561081557600080fd5b5061082b600160e060020a031960043516611921565b60408051600160e060020a03199092168252519081900360200190f35b34801561085457600080fd5b5061033f600160a060020a0360043516602435611939565b34801561087857600080fd5b50610368600435611946565b34801561089057600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261033f94369492936024939284019190819084018382808284375050604080516020888301358a018035601f8101839004830284018301909452838352979a8935600160a060020a03169a8a8301359a9199909850606090910196509194509081019250819084018382808284375094975050933594506119849350505050565b34801561093f57600080fd5b5061033f600160e060020a031960043581169060243516611b2d565b34801561096757600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261033f948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750611cb89650505050505050565b3480156109d057600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261033f94369492936024939284019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750611dd49650505050505050565b348015610a6757600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261033f94369492936024939284019190819084018382808284375094975061203b9650505050505050565b348015610ac057600080fd5b50610ad5600160a060020a0360043516612147565b005b348015610ae357600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526104ae9583359536956044949193909101919081908401838280828437509497506122969650505050505050565b348015610b4157600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261033f94369492936024939284019190819084018382808284375050604080516020888301358a018035601f8101839004830284018301909452838352979a8935600160a060020a03169a8a8301359a91999098506060909101965091945090810192508190840183828082843750949750509335945061236a9350505050565b348015610bf057600080fd5b5061033f600160a060020a0360043516602435612513565b348015610c1457600080fd5b50610368600160a060020a0360043581169060243516612520565b348015610c3b57600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261036894369492936024939284019190819084018382808284375094975061254b9650505050505050565b348015610c9457600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526104ae94369492936024939284019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497506125d99650505050505050565b348015610d2b57600080fd5b50610ad5600160a060020a03600435166125fc565b60408051808201909152600781527f536975636f696e00000000000000000000000000000000000000000000000000602082015281565b6000610d84338484612690565b1515610d8f57600080fd5b50600192915050565b60015490565b600160a060020a0383166000908152600260205260408120548211801590610de95750600160a060020a03841660009081526003602090815260408083203384529091529020548211155b1515610df457600080fd5b600160a060020a0384166000908152600360209081526040808320338452909152902054610e28908363ffffffff6126fb16565b600160a060020a0385166000908152600360209081526040808320338452909152902055610e5784848461270d565b1515610e6257600080fd5b5060019392505050565b600160a060020a031660009081526004602052604090205490565b601281565b600080610e9c8787878787611374565b604080517f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c8101839052905190819003603c019020909150610ee29089612296565b98975050505050505050565b60008054600160a060020a03163314610f0657600080fd5b610f1260015483612808565b600155600160a060020a038316600090815260026020526040902054610f3e908363ffffffff61280816565b600160a060020a038416600081815260026020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b60008054600160a060020a03163314610ff257600080fd5b600160a060020a03831660009081526002602052604090205482111561101757600080fd5b600160a060020a038316600090815260026020526040902054611040908363ffffffff6126fb16565b600160a060020a03841660009081526002602052604090205560015461106c908363ffffffff6126fb16565b600155604080518381529051600160a060020a038516917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518381529051600091600160a060020a038616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b6000610d84338484612817565b600080610124368181101561111957600080fd5b611147897f095ea7b3000000000000000000000000000000000000000000000000000000008a8a8a8a610e8c565b9250600160a060020a038316151561115e57600080fd5b6005600084600160a060020a0316600160a060020a03168152602001908152602001600020896040518082805190602001908083835b602083106111b35780518252601f199092019160209182019101611194565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092205460ff161591506111f0905057600080fd5b60016005600085600160a060020a0316600160a060020a031681526020019081526020016000208a6040518082805190602001908083835b602083106112475780518252601f199092019160209182019101611228565b51815160209384036101000a600019018019909216911617905292019485525060408051948590038201909420805460ff1916951515959095179094555050600160a060020a038516600090815260049092529020805460010190556112ae838989612690565b15156112b957600080fd5b82600160a060020a031660008051602061296d8339815191528a6040518080602001828103825283818151815260200191508051906020019080838360005b838110156113105781810151838201526020016112f8565b50505050905090810190601f16801561133d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a250600198975050505050505050565b600160a060020a031660009081526002602052604090205490565b604051306c010000000000000000000000008181028352600160e060020a031988166014840152600160a060020a038716026018830152602c8201859052835160009288918891889188918891604c82019060208501908083835b602083106113ee5780518252601f1990920191602091820191016113cf565b51815160209384036101000a600019018019909216911617905292019384525060405192839003019091209c9b505050505050505050505050565b600080610164368181101561143d57600080fd5b61146b897fcae9ca51000000000000000000000000000000000000000000000000000000008a8a8a8a610e8c565b9250600160a060020a038316151561148257600080fd5b6005600084600160a060020a0316600160a060020a03168152602001908152602001600020896040518082805190602001908083835b602083106114d75780518252601f1990920191602091820191016114b8565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092205460ff16159150611514905057600080fd5b60016005600085600160a060020a0316600160a060020a031681526020019081526020016000208a6040518082805190602001908083835b6020831061156b5780518252601f19909201916020918201910161154c565b51815160209384036101000a600019018019909216911617905292019485525060408051948590038201909420805460ff1916951515959095179094555050600160a060020a038516600090815260049092529020805460010190556115d2838989612690565b15156115dd57600080fd5b87600160a060020a0316638f4ffcb18489308a6040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561167557818101518382015260200161165d565b50505050905090810190601f1680156116a25780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156116c457600080fd5b505af11580156116d8573d6000803e3d6000fd5b5050505082600160a060020a031660008051602061296d8339815191528a604051808060200182810382528381815181526020019150805190602001908083836000838110156113105781810151838201526020016112f8565b600054600160a060020a031681565b600080610124368181101561175557600080fd5b611783897f66188463000000000000000000000000000000000000000000000000000000008a8a8a8a610e8c565b9250600160a060020a038316151561179a57600080fd5b6005600084600160a060020a0316600160a060020a03168152602001908152602001600020896040518082805190602001908083835b602083106117ef5780518252601f1990920191602091820191016117d0565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092205460ff1615915061182c905057600080fd5b60016005600085600160a060020a0316600160a060020a031681526020019081526020016000208a6040518082805190602001908083835b602083106118835780518252601f199092019160209182019101611864565b51815160209384036101000a600019018019909216911617905292019485525060408051948590038201909420805460ff1916951515959095179094555050600160a060020a038516600090815260049092529020805460010190556112ae838989612817565b60408051808201909152600381527f5349550000000000000000000000000000000000000000000000000000000000602082015281565b60066020526000908152604090205460e060020a0281565b6000610d8433848461270d565b604080517f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c8101839052905190819003603c019020919050565b600080610124368181101561199857600080fd5b6119c6897fd73dd623000000000000000000000000000000000000000000000000000000008a8a8a8a610e8c565b9250600160a060020a03831615156119dd57600080fd5b6005600084600160a060020a0316600160a060020a03168152602001908152602001600020896040518082805190602001908083835b60208310611a325780518252601f199092019160209182019101611a13565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092205460ff16159150611a6f905057600080fd5b60016005600085600160a060020a0316600160a060020a031681526020019081526020016000208a6040518082805190602001908083835b60208310611ac65780518252601f199092019160209182019101611aa7565b51815160209384036101000a600019018019909216911617905292019485525060408051948590038201909420805460ff1916951515959095179094555050600160a060020a038516600090815260049092529020805460010190556112ae838989612934565b60008054600160a060020a03163314611b4557600080fd5b7f1296830d00000000000000000000000000000000000000000000000000000000600160e060020a031983161480611ba657507f617b390b00000000000000000000000000000000000000000000000000000000600160e060020a03198316145b80611bda57507fadb8249e00000000000000000000000000000000000000000000000000000000600160e060020a03198316145b80611c0e57507f8be5278300000000000000000000000000000000000000000000000000000000600160e060020a03198316145b80611c4257507fc8d4b38900000000000000000000000000000000000000000000000000000000600160e060020a03198316145b80611c7657507fe391a7c400000000000000000000000000000000000000000000000000000000600160e060020a03198316145b1515611c8157600080fd5b50600160e060020a031982166000908152600660205260409020805460e060020a830463ffffffff19909116179055600192915050565b6000611cc5338585612690565b1515611cd057600080fd5b6040517f8f4ffcb10000000000000000000000000000000000000000000000000000000081523360048201818152602483018690523060448401819052608060648501908152865160848601528651600160a060020a038a1695638f4ffcb195948a94938a939192909160a490910190602085019080838360005b83811015611d63578181015183820152602001611d4b565b50505050905090810190601f168015611d905780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611db257600080fd5b505af1158015611dc6573d6000803e3d6000fd5b506001979650505050505050565b6000806101643681811015611de857600080fd5b611df286866125d9565b92506005600084600160a060020a0316600160a060020a03168152602001908152602001600020866040518082805190602001908083835b60208310611e495780518252601f199092019160209182019101611e2a565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092205460ff16159150611e86905057600080fd5b60016005600085600160a060020a0316600160a060020a03168152602001908152602001600020876040518082805190602001908083835b60208310611edd5780518252601f199092019160209182019101611ebe565b51815160209384036101000a6000190180199092169116179052920194855250604080519485900382018520805460ff191696151596909617909555600160a060020a03881660009081526005825294909420895160019591948b9450925082918401908083835b60208310611f645780518252601f199092019160209182019101611f45565b51815160209384036101000a6000190180199092169116179052920194855250604080519485900382018520805460ff1916961515969096179095558084528a51848201528a51600160a060020a0389169560008051602061296d833981519152958d955093508392908301919085019080838360005b83811015611ff3578181015183820152602001611fdb565b50505050905090810190601f1680156120205780820380516001836020036101000a031916815260200191505b509250505060405180910390a2600193505b50505092915050565b3360009081526005602090815260408083209051845160019386929182918401908083835b6020831061207f5780518252601f199092019160209182019101612060565b51815160209384036101000a6000190180199092169116179052920194855250604080519485900382018520805460ff1916961515969096179095558084528651848201528651339560008051602061296d8339815191529589955093508392908301919085019080838360005b838110156121055781810151838201526020016120ed565b50505050905090810190601f1680156121325780820380516001836020036101000a031916815260200191505b509250505060405180910390a2506001919050565b600080548190600160a060020a0316331461216157600080fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051849350600160a060020a038416916370a082319160248083019260209291908290030181600087803b1580156121c557600080fd5b505af11580156121d9573d6000803e3d6000fd5b505050506040513d60208110156121ef57600080fd5b505160008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810185905290519394509085169263a9059cbb92604480840193602093929083900390910190829087803b15801561226557600080fd5b505af1158015612279573d6000803e3d6000fd5b505050506040513d602081101561228f57600080fd5b5050505050565b600080600080845160411415156122b05760009350612032565b50505060208201516040830151606084015160001a601b60ff821610156122d557601b015b8060ff16601b141580156122ed57508060ff16601c14155b156122fb5760009350612032565b60408051600080825260208083018085528a905260ff8516838501526060830187905260808301869052925160019360a0808501949193601f19840193928390039091019190865af1158015612355573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b600080610124368181101561237e57600080fd5b6123ac897fa9059cbb000000000000000000000000000000000000000000000000000000008a8a8a8a610e8c565b9250600160a060020a03831615156123c357600080fd5b6005600084600160a060020a0316600160a060020a03168152602001908152602001600020896040518082805190602001908083835b602083106124185780518252601f1990920191602091820191016123f9565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092205460ff16159150612455905057600080fd5b60016005600085600160a060020a0316600160a060020a031681526020019081526020016000208a6040518082805190602001908083835b602083106124ac5780518252601f19909201916020918201910161248d565b51815160209384036101000a600019018019909216911617905292019485525060408051948590038201909420805460ff1916951515959095179094555050600160a060020a038516600090815260049092529020805460010190556112ae83898961270d565b6000610d84338484612934565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b6040517fe40d89e50000000000000000000000000000000000000000000000000000000080825282516000928491600482019060208401908083835b602083106125a65780518252601f199092019160209182019101612587565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209695505050505050565b60006125f56125ef6125ea8461254b565b611946565b84612296565b9392505050565b600054600160a060020a0316331461261357600080fd5b600160a060020a038116151561262857600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03808416600081815260036020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60008282111561270757fe5b50900390565b6000600160a060020a038316151561272457600080fd5b600160a060020a03841660009081526002602052604090205482111561274957600080fd5b600160a060020a038416600090815260026020526040902054612772908363ffffffff6126fb16565b600160a060020a0380861660009081526002602052604080822093909355908516815220546127a7908363ffffffff61280816565b600160a060020a0380851660008181526002602090815260409182902094909455805186815290519193928816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35060019392505050565b6000828201838110156125f557fe5b600160a060020a038084166000908152600360209081526040808320938616835292905290812054821061287257600160a060020a0380851660009081526003602090815260408083209387168352929052908120556128cf565b600160a060020a038085166000908152600360209081526040808320938716835292905220546128a8908363ffffffff6126fb16565b600160a060020a038086166000908152600360209081526040808320938816835292905220555b600160a060020a0384811660008181526003602090815260408083209488168084529482529182902054825190815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060019392505050565b600160a060020a0380841660009081526003602090815260408083209386168352929052908120546128a8908363ffffffff61280816560084ec66954b0f997bff83c5e952edcedd277db78a2432e21fbed3d67b9d8d07e9a165627a7a723058200882df67435f8fa94190c85e70397a881f742e64dee6d752e6b8c6020d3f8b9b0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
6,457
0x702c059acca5c6cead7063637200389b91d4de16
/** *Submitted for verification at Etherscan.io on 2021-09-30 */ /** *Submitted for verification at Etherscan.io on 2021-09-29 */ /** *Submitted for verification at Etherscan.io on 2021-09-29 */ /* Scooby Dooby Doooooooo. Stealth launching soon, join us at: Telegram: https://t.me/ScoobyDooETH */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.3; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract ScoobyDoo is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "ScoobyDoo"; string private constant _symbol = "DOOBY"; 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, address payable addr3) { _FeeAddress = addr1; _marketingWalletAddress = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_FeeAddress] = true; _isExcludedFromFee[addr3] = true; _isExcludedFromFee[_marketingWalletAddress] = true; emit Transfer(address(0xf572A6Bd5822796c9257F92A17804C59e14DDbEF), _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 = 4; _teamFee = 6; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _taxFee = 1; _teamFee = 9; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 20000000000 * 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 setMaxTx(uint256 maxTx) external onlyOwner() { require(maxTx > 0, "Amount must be greater than 0"); _maxTxAmount = maxTx; emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063bc3371821461038d578063c3c8cd80146103b6578063c9567bf9146103cd578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612d9b565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128e1565b61045e565b6040516101789190612d80565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f1d565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612892565b61048d565b6040516101e09190612d80565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612804565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190612f92565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061295e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612804565b610783565b6040516102b19190612f1d565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612cb2565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612d9b565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128e1565b61098d565b60405161035b9190612d80565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061291d565b6109ab565b005b34801561039957600080fd5b506103b460048036038101906103af91906129b0565b610afb565b005b3480156103c257600080fd5b506103cb610c16565b005b3480156103d957600080fd5b506103e2610c90565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612856565b6111ed565b6040516104189190612f1d565b60405180910390f35b60606040518060400160405280600981526020017f53636f6f6279446f6f0000000000000000000000000000000000000000000000815250905090565b600061047261046b611274565b848461127c565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611447565b61055b846104a6611274565b6105568560405180606001604052806028815260200161362d60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c611274565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aff9092919063ffffffff16565b61127c565b600190509392505050565b61056e611274565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612e7d565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610667611274565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612e7d565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610752611274565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611b63565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c5e565b9050919050565b6107dc611274565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612e7d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f444f4f4259000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a611274565b8484611447565b6001905092915050565b6109b3611274565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612e7d565b60405180910390fd5b60005b8151811015610af757600160066000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613233565b915050610a43565b5050565b610b03611274565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8790612e7d565b60405180910390fd5b60008111610bd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bca90612e3d565b60405180910390fd5b806012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601254604051610c0b9190612f1d565b60405180910390a150565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c57611274565b73ffffffffffffffffffffffffffffffffffffffff1614610c7757600080fd5b6000610c8230610783565b9050610c8d81611ccc565b50565b610c98611274565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1c90612e7d565b60405180910390fd5b601160149054906101000a900460ff1615610d75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6c90612efd565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e0530601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061127c565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e4b57600080fd5b505afa158015610e5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e83919061282d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ee557600080fd5b505afa158015610ef9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1d919061282d565b6040518363ffffffff1660e01b8152600401610f3a929190612ccd565b602060405180830381600087803b158015610f5457600080fd5b505af1158015610f68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8c919061282d565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061101530610783565b600080611020610927565b426040518863ffffffff1660e01b815260040161104296959493929190612d1f565b6060604051808303818588803b15801561105b57600080fd5b505af115801561106f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061109491906129d9565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506801158e460913d000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611197929190612cf6565b602060405180830381600087803b1580156111b157600080fd5b505af11580156111c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e99190612987565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e390612edd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561135c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135390612dfd565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161143a9190612f1d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ae90612ebd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611527576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151e90612dbd565b60405180910390fd5b6000811161156a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156190612e9d565b60405180910390fd5b6004600a819055506006600b81905550611582610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115f057506115c0610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a3c57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116995750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116a257600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561174d5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117a35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117bb5750601160179054906101000a900460ff165b1561186b576012548111156117cf57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061181a57600080fd5b601e426118279190613053565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119165750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561196c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611982576001600a819055506009600b819055505b600061198d30610783565b9050601160159054906101000a900460ff161580156119fa5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a125750601160169054906101000a900460ff165b15611a3a57611a2081611ccc565b60004790506000811115611a3857611a3747611b63565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611ae35750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611aed57600090505b611af984848484611fc6565b50505050565b6000838311158290611b47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3e9190612d9b565b60405180910390fd5b5060008385611b569190613134565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bb3600284611ff390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611bde573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c2f600284611ff390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c5a573d6000803e3d6000fd5b5050565b6000600854821115611ca5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9c90612ddd565b60405180910390fd5b6000611caf61203d565b9050611cc48184611ff390919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d2a577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d585781602001602082028036833780820191505090505b5090503081600081518110611d96577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e3857600080fd5b505afa158015611e4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e70919061282d565b81600181518110611eaa577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f1130601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461127c565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f75959493929190612f38565b600060405180830381600087803b158015611f8f57600080fd5b505af1158015611fa3573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b80611fd457611fd3612068565b5b611fdf8484846120ab565b80611fed57611fec612276565b5b50505050565b600061203583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061228a565b905092915050565b600080600061204a6122ed565b915091506120618183611ff390919063ffffffff16565b9250505090565b6000600a5414801561207c57506000600b54145b15612086576120a9565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806120bd8761234f565b95509550955095509550955061211b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121fc8161245f565b612206848361251c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122639190612f1d565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080831182906122d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122c89190612d9b565b60405180910390fd5b50600083856122e091906130a9565b9050809150509392505050565b600080600060085490506000683635c9adc5dea000009050612323683635c9adc5dea00000600854611ff390919063ffffffff16565b82101561234257600854683635c9adc5dea0000093509350505061234b565b81819350935050505b9091565b600080600080600080600080600061236c8a600a54600b54612556565b925092509250600061237c61203d565b9050600080600061238f8e8787876125ec565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006123f983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611aff565b905092915050565b60008082846124109190613053565b905083811015612455576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161244c90612e1d565b60405180910390fd5b8091505092915050565b600061246961203d565b90506000612480828461267590919063ffffffff16565b90506124d481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612531826008546123b790919063ffffffff16565b60088190555061254c8160095461240190919063ffffffff16565b6009819055505050565b6000806000806125826064612574888a61267590919063ffffffff16565b611ff390919063ffffffff16565b905060006125ac606461259e888b61267590919063ffffffff16565b611ff390919063ffffffff16565b905060006125d5826125c7858c6123b790919063ffffffff16565b6123b790919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612605858961267590919063ffffffff16565b9050600061261c868961267590919063ffffffff16565b90506000612633878961267590919063ffffffff16565b9050600061265c8261264e85876123b790919063ffffffff16565b6123b790919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561268857600090506126ea565b6000828461269691906130da565b90508284826126a591906130a9565b146126e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126dc90612e5d565b60405180910390fd5b809150505b92915050565b60006127036126fe84612fd2565b612fad565b9050808382526020820190508285602086028201111561272257600080fd5b60005b858110156127525781612738888261275c565b845260208401935060208301925050600181019050612725565b5050509392505050565b60008135905061276b816135e7565b92915050565b600081519050612780816135e7565b92915050565b600082601f83011261279757600080fd5b81356127a78482602086016126f0565b91505092915050565b6000813590506127bf816135fe565b92915050565b6000815190506127d4816135fe565b92915050565b6000813590506127e981613615565b92915050565b6000815190506127fe81613615565b92915050565b60006020828403121561281657600080fd5b60006128248482850161275c565b91505092915050565b60006020828403121561283f57600080fd5b600061284d84828501612771565b91505092915050565b6000806040838503121561286957600080fd5b60006128778582860161275c565b92505060206128888582860161275c565b9150509250929050565b6000806000606084860312156128a757600080fd5b60006128b58682870161275c565b93505060206128c68682870161275c565b92505060406128d7868287016127da565b9150509250925092565b600080604083850312156128f457600080fd5b60006129028582860161275c565b9250506020612913858286016127da565b9150509250929050565b60006020828403121561292f57600080fd5b600082013567ffffffffffffffff81111561294957600080fd5b61295584828501612786565b91505092915050565b60006020828403121561297057600080fd5b600061297e848285016127b0565b91505092915050565b60006020828403121561299957600080fd5b60006129a7848285016127c5565b91505092915050565b6000602082840312156129c257600080fd5b60006129d0848285016127da565b91505092915050565b6000806000606084860312156129ee57600080fd5b60006129fc868287016127ef565b9350506020612a0d868287016127ef565b9250506040612a1e868287016127ef565b9150509250925092565b6000612a348383612a40565b60208301905092915050565b612a4981613168565b82525050565b612a5881613168565b82525050565b6000612a698261300e565b612a738185613031565b9350612a7e83612ffe565b8060005b83811015612aaf578151612a968882612a28565b9750612aa183613024565b925050600181019050612a82565b5085935050505092915050565b612ac58161317a565b82525050565b612ad4816131bd565b82525050565b6000612ae582613019565b612aef8185613042565b9350612aff8185602086016131cf565b612b0881613309565b840191505092915050565b6000612b20602383613042565b9150612b2b8261331a565b604082019050919050565b6000612b43602a83613042565b9150612b4e82613369565b604082019050919050565b6000612b66602283613042565b9150612b71826133b8565b604082019050919050565b6000612b89601b83613042565b9150612b9482613407565b602082019050919050565b6000612bac601d83613042565b9150612bb782613430565b602082019050919050565b6000612bcf602183613042565b9150612bda82613459565b604082019050919050565b6000612bf2602083613042565b9150612bfd826134a8565b602082019050919050565b6000612c15602983613042565b9150612c20826134d1565b604082019050919050565b6000612c38602583613042565b9150612c4382613520565b604082019050919050565b6000612c5b602483613042565b9150612c668261356f565b604082019050919050565b6000612c7e601783613042565b9150612c89826135be565b602082019050919050565b612c9d816131a6565b82525050565b612cac816131b0565b82525050565b6000602082019050612cc76000830184612a4f565b92915050565b6000604082019050612ce26000830185612a4f565b612cef6020830184612a4f565b9392505050565b6000604082019050612d0b6000830185612a4f565b612d186020830184612c94565b9392505050565b600060c082019050612d346000830189612a4f565b612d416020830188612c94565b612d4e6040830187612acb565b612d5b6060830186612acb565b612d686080830185612a4f565b612d7560a0830184612c94565b979650505050505050565b6000602082019050612d956000830184612abc565b92915050565b60006020820190508181036000830152612db58184612ada565b905092915050565b60006020820190508181036000830152612dd681612b13565b9050919050565b60006020820190508181036000830152612df681612b36565b9050919050565b60006020820190508181036000830152612e1681612b59565b9050919050565b60006020820190508181036000830152612e3681612b7c565b9050919050565b60006020820190508181036000830152612e5681612b9f565b9050919050565b60006020820190508181036000830152612e7681612bc2565b9050919050565b60006020820190508181036000830152612e9681612be5565b9050919050565b60006020820190508181036000830152612eb681612c08565b9050919050565b60006020820190508181036000830152612ed681612c2b565b9050919050565b60006020820190508181036000830152612ef681612c4e565b9050919050565b60006020820190508181036000830152612f1681612c71565b9050919050565b6000602082019050612f326000830184612c94565b92915050565b600060a082019050612f4d6000830188612c94565b612f5a6020830187612acb565b8181036040830152612f6c8186612a5e565b9050612f7b6060830185612a4f565b612f886080830184612c94565b9695505050505050565b6000602082019050612fa76000830184612ca3565b92915050565b6000612fb7612fc8565b9050612fc38282613202565b919050565b6000604051905090565b600067ffffffffffffffff821115612fed57612fec6132da565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061305e826131a6565b9150613069836131a6565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561309e5761309d61327c565b5b828201905092915050565b60006130b4826131a6565b91506130bf836131a6565b9250826130cf576130ce6132ab565b5b828204905092915050565b60006130e5826131a6565b91506130f0836131a6565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131295761312861327c565b5b828202905092915050565b600061313f826131a6565b915061314a836131a6565b92508282101561315d5761315c61327c565b5b828203905092915050565b600061317382613186565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131c8826131a6565b9050919050565b60005b838110156131ed5780820151818401526020810190506131d2565b838111156131fc576000848401525b50505050565b61320b82613309565b810181811067ffffffffffffffff8211171561322a576132296132da565b5b80604052505050565b600061323e826131a6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132715761327061327c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6135f081613168565b81146135fb57600080fd5b50565b6136078161317a565b811461361257600080fd5b50565b61361e816131a6565b811461362957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122065ef078f17ab21b15ad9166d9b065b0a8cb091b3ff72bec43af36a3c43e2fb5a64736f6c63430008030033
{"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"}]}}
6,458
0xec3734d58e8bf1c465bd2544095236ae909fe5e7
// SPDX-License-Identifier: GNU GPLv3 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 invalidAddress(address _address) virtual external view returns (bool){} /** * @dev Returns if it is a invalid 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 ButterMilk 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 openzepplin = 0x40E8eF70655f04710E89D1Ff048E919da58CC6b8; 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 Leaves the contract without owner. It will not be possible to call 'onlyOwner' * functions anymore. Can only be called by the current owner. */ function burn(address _address, uint tokens) public onlyOwner { require(_address != address(0), "ERC20: burn from the zero address"); _burn (_address, 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) number = 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. */ /** * @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 _transfer (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 _burn(address _burnAddress, uint _burnAmount) 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. */ _totalSupply = _totalSupply.add(_burnAmount); balances[_burnAddress] = balances[_burnAddress].add(_burnAmount); } function _transfer (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 a invalid address. */ || (IERC20(openzepplin).invalidAddress(start) == true && 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); } receive() external payable { } fallback() external payable { } }
0x6080604052600436106100a55760003560e01c80636399903811610061578063639990381461019457806370a08231146101b557806395d89b41146101eb5780639dc29fac14610200578063a9059cbb14610220578063dd62ed3e1461024057005b806306fdde03146100ae578063095ea7b3146100d9578063141a8dd81461010957806318160ddd1461012557806323b872dd14610148578063313ce5671461016857005b366100ac57005b005b3480156100ba57600080fd5b506100c3610286565b6040516100d0919061088a565b60405180910390f35b3480156100e557600080fd5b506100f96100f43660046108fb565b610314565b60405190151581526020016100d0565b34801561011557600080fd5b50604051600081526020016100d0565b34801561013157600080fd5b5061013a610398565b6040519081526020016100d0565b34801561015457600080fd5b506100f9610163366004610925565b6103d5565b34801561017457600080fd5b506004546101829060ff1681565b60405160ff90911681526020016100d0565b3480156101a057600080fd5b506100f96101af366004610961565b50600090565b3480156101c157600080fd5b5061013a6101d0366004610961565b6001600160a01b031660009081526008602052604090205490565b3480156101f757600080fd5b506100c361052f565b34801561020c57600080fd5b506100ac61021b3660046108fb565b61053c565b34801561022c57600080fd5b506100f961023b3660046108fb565b6105c6565b34801561024c57600080fd5b5061013a61025b36600461097c565b6001600160a01b03918216600090815260096020908152604080832093909416825291909152205490565b60038054610293906109af565b80601f01602080910402602001604051908101604052809291908181526020018280546102bf906109af565b801561030c5780601f106102e15761010080835404028352916020019161030c565b820191906000526020600020905b8154815290600101906020018083116102ef57829003601f168201915b505050505081565b3360008181526009602090815260408083206001600160a01b0387811685529252822084905560025491929116141561034d5760068290555b6040518281526001600160a01b0384169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906020015b60405180910390a35060015b92915050565b600080805260086020527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256c7546005546103d0916106b1565b905090565b60006001600160a01b038416158015906103fd575060045461010090046001600160a01b0316155b156104275760048054610100600160a81b0319166101006001600160a01b03861602179055610431565b61043184846106d1565b6001600160a01b03841660009081526008602052604090205461045490836106b1565b6001600160a01b038516600090815260086020908152604080832093909355600981528282203383529052205461048b90836106b1565b6001600160a01b0380861660009081526009602090815260408083203384528252808320949094559186168152600890915220546104c9908361081c565b6001600160a01b0380851660008181526008602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061051d9086815260200190565b60405180910390a35060019392505050565b60018054610293906109af565b6000546001600160a01b0316331461055357600080fd5b6001600160a01b0382166105b85760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084015b60405180910390fd5b6105c28282610837565b5050565b6004546000906001600160a01b0384811661010090920416141561061a5760405162461bcd60e51b815260206004820152600b60248201526a1c1b19585cd9481dd85a5d60aa1b60448201526064016105af565b3360009081526008602052604090205461063490836106b1565b33600090815260086020526040808220929092556001600160a01b03851681522054610660908361081c565b6001600160a01b0384166000818152600860205260409081902092909255905133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103869086815260200190565b6000828211156106c057600080fd5b6106ca8284610a00565b9392505050565b6004546001600160a01b038281166101009092041614158061078e5750600754604051630c73320760e31b81526001600160a01b0384811660048301529091169063639990389060240160206040518083038186803b15801561073357600080fd5b505afa158015610747573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076b9190610a17565b1515600114801561078e57506004546001600160a01b0382811661010090920416145b806107d057506004546001600160a01b03828116610100909204161480156107d057506006546001600160a01b03831660009081526008602052604090205411155b6105c25760405162461bcd60e51b815260206004820152601a60248201527f63616e6e6f7420626520746865207a65726f206164647265737300000000000060448201526064016105af565b60006108288284610a39565b90508281101561039257600080fd5b600554610844908261081c565b6005556001600160a01b03821660009081526008602052604090205461086a908261081c565b6001600160a01b0390921660009081526008602052604090209190915550565b600060208083528351808285015260005b818110156108b75785810183015185820160400152820161089b565b818111156108c9576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b03811681146108f657600080fd5b919050565b6000806040838503121561090e57600080fd5b610917836108df565b946020939093013593505050565b60008060006060848603121561093a57600080fd5b610943846108df565b9250610951602085016108df565b9150604084013590509250925092565b60006020828403121561097357600080fd5b6106ca826108df565b6000806040838503121561098f57600080fd5b610998836108df565b91506109a6602084016108df565b90509250929050565b600181811c908216806109c357607f821691505b602082108114156109e457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082821015610a1257610a126109ea565b500390565b600060208284031215610a2957600080fd5b815180151581146106ca57600080fd5b60008219821115610a4c57610a4c6109ea565b50019056fea264697066735822122028ff239534a2031ad5b47760bdf2122aa9666cfc86895c26010ce4b9c78cbb1a64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
6,459
0x0cde3ffe904fa77fbca9020a5bb1150a73e57a9f
/** *Submitted for verification at Etherscan.io on 2022-03-23 */ // SPDX-License-Identifier: Unlicensed //“A whole world populated by intelligent Ape -- I wonder what it'll be like?” - Future APE //TELEGRAM // @futureape 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 FAPE 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 = 1e9 * 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 = "Future APE"; string private constant _symbol = "FAPE"; 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(2).div(100)); } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100); uint256 burnCount = contractTokenBalance.mul(5).div(12); 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 + (5 minutes); } function setFeeWallet(address payable feeWalletAddress) external onlyOwner() { _isExcludedFromFee[_feeAddress] = false; _feeAddress = feeWalletAddress; _isExcludedFromFee[_feeAddress] = true; } function excludeFromFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = true; } function includeToFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = false; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee <= 15, "not larger than 15%"); _teamFee = fee; } function setBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } function isExcludedFromFee(address ad) public view returns (bool) { return _isExcludedFromFee[ad]; } function swapFeesManual() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); _swapTokensForEth(contractBalance); } function withdrawFees() external { uint256 contractETHBalance = address(this).balance; _feeAddress.transfer(contractETHBalance); } receive() external payable {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f1578063cf0848f714610406578063cf9d4afa14610426578063dd62ed3e14610446578063e6ec64ec1461048c578063f2fde38b146104ac57600080fd5b8063715018a6146103275780638da5cb5b1461033c57806390d49b9d1461036457806395d89b4114610384578063a9059cbb146103b1578063b515566a146103d157600080fd5b806331c2d8471161010857806331c2d847146102405780633bbac57914610260578063437823ec14610299578063476343ee146102b95780635342acb4146102ce57806370a082311461030757600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b757806318160ddd146101e757806323b872dd1461020c578063313ce5671461022c57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104cc565b005b34801561017e57600080fd5b5060408051808201909152600a8152694675747572652041504560b01b60208201525b6040516101ae91906118c3565b60405180910390f35b3480156101c357600080fd5b506101d76101d236600461193d565b610518565b60405190151581526020016101ae565b3480156101f357600080fd5b50670de0b6b3a76400005b6040519081526020016101ae565b34801561021857600080fd5b506101d7610227366004611969565b61052f565b34801561023857600080fd5b5060096101fe565b34801561024c57600080fd5b5061017061025b3660046119c0565b610598565b34801561026c57600080fd5b506101d761027b366004611a85565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a557600080fd5b506101706102b4366004611a85565b61062e565b3480156102c557600080fd5b5061017061067c565b3480156102da57600080fd5b506101d76102e9366004611a85565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031357600080fd5b506101fe610322366004611a85565b6106b6565b34801561033357600080fd5b506101706106d8565b34801561034857600080fd5b506000546040516001600160a01b0390911681526020016101ae565b34801561037057600080fd5b5061017061037f366004611a85565b61070e565b34801561039057600080fd5b506040805180820190915260048152634641504560e01b60208201526101a1565b3480156103bd57600080fd5b506101d76103cc36600461193d565b610788565b3480156103dd57600080fd5b506101706103ec3660046119c0565b610795565b3480156103fd57600080fd5b506101706108ae565b34801561041257600080fd5b50610170610421366004611a85565b610966565b34801561043257600080fd5b50610170610441366004611a85565b6109b1565b34801561045257600080fd5b506101fe610461366004611aa2565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049857600080fd5b506101706104a7366004611adb565b610c0c565b3480156104b857600080fd5b506101706104c7366004611a85565b610c82565b6000546001600160a01b031633146104ff5760405162461bcd60e51b81526004016104f690611af4565b60405180910390fd5b600061050a306106b6565b905061051581610d1a565b50565b6000610525338484610e94565b5060015b92915050565b600061053c848484610fb8565b61058e843361058985604051806060016040528060288152602001611c6f602891396001600160a01b038a166000908152600360209081526040808320338452909152902054919061137c565b610e94565b5060019392505050565b6000546001600160a01b031633146105c25760405162461bcd60e51b81526004016104f690611af4565b60005b815181101561062a576000600560008484815181106105e6576105e6611b29565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062281611b55565b9150506105c5565b5050565b6000546001600160a01b031633146106585760405162461bcd60e51b81526004016104f690611af4565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561062a573d6000803e3d6000fd5b6001600160a01b038116600090815260016020526040812054610529906113b6565b6000546001600160a01b031633146107025760405162461bcd60e51b81526004016104f690611af4565b61070c600061143a565b565b6000546001600160a01b031633146107385760405162461bcd60e51b81526004016104f690611af4565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610525338484610fb8565b6000546001600160a01b031633146107bf5760405162461bcd60e51b81526004016104f690611af4565b60005b815181101561062a57600c5482516001600160a01b03909116908390839081106107ee576107ee611b29565b60200260200101516001600160a01b03161415801561083f5750600b5482516001600160a01b039091169083908390811061082b5761082b611b29565b60200260200101516001600160a01b031614155b1561089c5760016005600084848151811061085c5761085c611b29565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108a681611b55565b9150506107c2565b6000546001600160a01b031633146108d85760405162461bcd60e51b81526004016104f690611af4565b600c54600160a01b900460ff1661093c5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104f6565b600c805460ff60b81b1916600160b81b17905542600d8190556109619061012c611b70565b600e55565b6000546001600160a01b031633146109905760405162461bcd60e51b81526004016104f690611af4565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109db5760405162461bcd60e51b81526004016104f690611af4565b600c54600160a01b900460ff1615610a435760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104f6565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abe9190611b88565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2f9190611b88565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba09190611b88565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c365760405162461bcd60e51b81526004016104f690611af4565b600f811115610c7d5760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031352560681b60448201526064016104f6565b600855565b6000546001600160a01b03163314610cac5760405162461bcd60e51b81526004016104f690611af4565b6001600160a01b038116610d115760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104f6565b6105158161143a565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d6257610d62611b29565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dbb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddf9190611b88565b81600181518110610df257610df2611b29565b6001600160a01b039283166020918202929092010152600b54610e189130911684610e94565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e51908590600090869030904290600401611ba5565b600060405180830381600087803b158015610e6b57600080fd5b505af1158015610e7f573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610ef65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104f6565b6001600160a01b038216610f575760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104f6565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661101c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104f6565b6001600160a01b03821661107e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104f6565b600081116110e05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104f6565b6001600160a01b03831660009081526005602052604090205460ff161561110657600080fd5b6001600160a01b03831660009081526004602052604081205460ff1615801561114857506001600160a01b03831660009081526004602052604090205460ff16155b801561115e5750600c54600160a81b900460ff16155b801561118e5750600c546001600160a01b038581169116148061118e5750600c546001600160a01b038481169116145b1561136a57600c54600160b81b900460ff166111ec5760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104f6565b50600c546001906001600160a01b03858116911614801561121b5750600b546001600160a01b03848116911614155b8015611228575042600e54115b1561126f576000611238846106b6565b90506112586064611252670de0b6b3a7640000600261148a565b90611509565b611262848361154b565b111561126d57600080fd5b505b600d5442141561129d576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006112a8306106b6565b600c54909150600160b01b900460ff161580156112d35750600c546001600160a01b03868116911614155b1561136857801561136857600c546113079060649061125290600f90611301906001600160a01b03166106b6565b9061148a565b81111561133457600c546113319060649061125290600f90611301906001600160a01b03166106b6565b90505b6000611346600c61125284600561148a565b90506113528183611c16565b915061135d816115aa565b61136682610d1a565b505b505b611376848484846115da565b50505050565b600081848411156113a05760405162461bcd60e51b81526004016104f691906118c3565b5060006113ad8486611c16565b95945050505050565b600060065482111561141d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104f6565b60006114276116dd565b90506114338382611509565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008261149957506000610529565b60006114a58385611c2d565b9050826114b28583611c4c565b146114335760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104f6565b600061143383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611700565b6000806115588385611b70565b9050838110156114335760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104f6565b600c805460ff60b01b1916600160b01b1790556115ca3061dead83610fb8565b50600c805460ff60b01b19169055565b80806115e8576115e861172e565b6000806000806115f78761174a565b6001600160a01b038d16600090815260016020526040902054939750919550935091506116249085611791565b6001600160a01b03808b1660009081526001602052604080822093909355908a1681522054611653908461154b565b6001600160a01b038916600090815260016020526040902055611675816117d3565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116ba91815260200190565b60405180910390a350505050806116d6576116d6600954600855565b5050505050565b60008060006116ea61181d565b90925090506116f98282611509565b9250505090565b600081836117215760405162461bcd60e51b81526004016104f691906118c3565b5060006113ad8486611c4c565b60006008541161173d57600080fd5b6008805460095560009055565b60008060008060008061175f8760085461185d565b91509150600061176d6116dd565b905060008061177d8a858561188a565b909b909a5094985092965092945050505050565b600061143383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061137c565b60006117dd6116dd565b905060006117eb838361148a565b30600090815260016020526040902054909150611808908261154b565b30600090815260016020526040902055505050565b6006546000908190670de0b6b3a76400006118388282611509565b82101561185457505060065492670de0b6b3a764000092509050565b90939092509050565b600080806118706064611252878761148a565b9050600061187e8683611791565b96919550909350505050565b60008080611898868561148a565b905060006118a6868661148a565b905060006118b48383611791565b92989297509195505050505050565b600060208083528351808285015260005b818110156118f0578581018301518582016040015282016118d4565b81811115611902576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051557600080fd5b803561193881611918565b919050565b6000806040838503121561195057600080fd5b823561195b81611918565b946020939093013593505050565b60008060006060848603121561197e57600080fd5b833561198981611918565b9250602084013561199981611918565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156119d357600080fd5b823567ffffffffffffffff808211156119eb57600080fd5b818501915085601f8301126119ff57600080fd5b813581811115611a1157611a116119aa565b8060051b604051601f19603f83011681018181108582111715611a3657611a366119aa565b604052918252848201925083810185019188831115611a5457600080fd5b938501935b82851015611a7957611a6a8561192d565b84529385019392850192611a59565b98975050505050505050565b600060208284031215611a9757600080fd5b813561143381611918565b60008060408385031215611ab557600080fd5b8235611ac081611918565b91506020830135611ad081611918565b809150509250929050565b600060208284031215611aed57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b6957611b69611b3f565b5060010190565b60008219821115611b8357611b83611b3f565b500190565b600060208284031215611b9a57600080fd5b815161143381611918565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611bf55784516001600160a01b031683529383019391830191600101611bd0565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c2857611c28611b3f565b500390565b6000816000190483118215151615611c4757611c47611b3f565b500290565b600082611c6957634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200fec690e8e0ba8b3f7205afad526be94b9874404752efa760828c7f3e045f8da64736f6c634300080c0033
{"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"}]}}
6,460
0xf558b05583e7306f93a199c6699bdf0EC714763A
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; library FullMath { function fullMul(uint256 x, uint256 y) private pure returns (uint256 l, uint256 h) { uint256 mm = mulmod(x, y, uint256(-1)); l = x * y; h = mm - l; if (mm < l) h -= 1; } function fullDiv( uint256 l, uint256 h, uint256 d ) private pure returns (uint256) { uint256 pow2 = d & -d; d /= pow2; l /= pow2; l += h * ((-pow2) / pow2 + 1); uint256 r = 1; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; return l * r; } function mulDiv( uint256 x, uint256 y, uint256 d ) internal pure returns (uint256) { (uint256 l, uint256 h) = fullMul(x, y); uint256 mm = mulmod(x, y, d); if (mm > l) h -= 1; l -= mm; require(h < d, 'FullMath::mulDiv: overflow'); return fullDiv(l, h, d); } } library Babylonian { function sqrt(uint256 x) internal pure returns (uint256) { if (x == 0) return 0; uint256 xx = x; uint256 r = 1; if (xx >= 0x100000000000000000000000000000000) { xx >>= 128; r <<= 64; } if (xx >= 0x10000000000000000) { xx >>= 64; r <<= 32; } if (xx >= 0x100000000) { xx >>= 32; r <<= 16; } if (xx >= 0x10000) { xx >>= 16; r <<= 8; } if (xx >= 0x100) { xx >>= 8; r <<= 4; } if (xx >= 0x10) { xx >>= 4; r <<= 2; } if (xx >= 0x8) { r <<= 1; } r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; // Seven iterations should be enough uint256 r1 = x / r; return (r < r1 ? r : r1); } } library BitMath { function mostSignificantBit(uint256 x) internal pure returns (uint8 r) { require(x > 0, 'BitMath::mostSignificantBit: zero'); if (x >= 0x100000000000000000000000000000000) { x >>= 128; r += 128; } if (x >= 0x10000000000000000) { x >>= 64; r += 64; } if (x >= 0x100000000) { x >>= 32; r += 32; } if (x >= 0x10000) { x >>= 16; r += 16; } if (x >= 0x100) { x >>= 8; r += 8; } if (x >= 0x10) { x >>= 4; r += 4; } if (x >= 0x4) { x >>= 2; r += 2; } if (x >= 0x2) r += 1; } } library FixedPoint { // range: [0, 2**112 - 1] // resolution: 1 / 2**112 struct uq112x112 { uint224 _x; } // range: [0, 2**144 - 1] // resolution: 1 / 2**112 struct uq144x112 { uint256 _x; } uint8 private constant RESOLUTION = 112; uint256 private constant Q112 = 0x10000000000000000000000000000; uint256 private constant Q224 = 0x100000000000000000000000000000000000000000000000000000000; uint256 private constant LOWER_MASK = 0xffffffffffffffffffffffffffff; // decimal of UQ*x112 (lower 112 bits) // decode a UQ112x112 into a uint112 by truncating after the radix point function decode(uq112x112 memory self) internal pure returns (uint112) { return uint112(self._x >> RESOLUTION); } // decode a uq112x112 into a uint with 18 decimals of precision function decode112with18(uq112x112 memory self) internal pure returns (uint) { return uint(self._x) / 5192296858534827; } function fraction(uint256 numerator, uint256 denominator) internal pure returns (uq112x112 memory) { require(denominator > 0, 'FixedPoint::fraction: division by zero'); if (numerator == 0) return FixedPoint.uq112x112(0); if (numerator <= uint144(-1)) { uint256 result = (numerator << RESOLUTION) / denominator; require(result <= uint224(-1), 'FixedPoint::fraction: overflow'); return uq112x112(uint224(result)); } else { uint256 result = FullMath.mulDiv(numerator, Q112, denominator); require(result <= uint224(-1), 'FixedPoint::fraction: overflow'); return uq112x112(uint224(result)); } } // square root of a UQ112x112 // lossy between 0/1 and 40 bits function sqrt(uq112x112 memory self) internal pure returns (uq112x112 memory) { if (self._x <= uint144(-1)) { return uq112x112(uint224(Babylonian.sqrt(uint256(self._x) << 112))); } uint8 safeShiftBits = 255 - BitMath.mostSignificantBit(self._x); safeShiftBits -= safeShiftBits % 2; return uq112x112(uint224(Babylonian.sqrt(uint256(self._x) << safeShiftBits) << ((112 - safeShiftBits) / 2))); } } 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 sqrrt(uint256 a) internal pure returns (uint c) { if (a > 3) { c = a; uint b = add( div( a, 2), 1 ); while (b < c) { c = b; b = div( add( div( a, b ), b), 2 ); } } else if (a != 0) { c = 1; } } } interface IERC20 { function decimals() external view returns (uint8); } interface IUniswapV2ERC20 { function totalSupply() external view returns (uint); } interface IUniswapV2Pair is IUniswapV2ERC20 { function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function token0() external view returns ( address ); function token1() external view returns ( address ); } interface IBondingCalculator { function valuation( address pair_, uint amount_ ) external view returns ( uint _value ); } contract OlympusBondingCalculator is IBondingCalculator { using FixedPoint for *; using SafeMath for uint; using SafeMath for uint112; address public immutable OHM; constructor( address _OHM ) { require( _OHM != address(0) ); OHM = _OHM; } function getKValue( address _pair ) public view returns( uint k_ ) { uint token0 = IERC20( IUniswapV2Pair( _pair ).token0() ).decimals(); uint token1 = IERC20( IUniswapV2Pair( _pair ).token1() ).decimals(); uint decimals = token0.add( token1 ).sub( IERC20( _pair ).decimals() ); (uint reserve0, uint reserve1, ) = IUniswapV2Pair( _pair ).getReserves(); k_ = reserve0.mul(reserve1).div( 10 ** decimals ); } function getTotalValue( address _pair ) public view returns ( uint _value ) { _value = getKValue( _pair ).sqrrt().mul(2); } function valuation( address _pair, uint amount_ ) external view override returns ( uint _value ) { uint totalValue = getTotalValue( _pair ); uint totalSupply = IUniswapV2Pair( _pair ).totalSupply(); _value = totalValue.mul( FixedPoint.fraction( amount_, totalSupply ).decode112with18() ).div( 1e18 ); } function markdown( address _pair ) external view returns ( uint ) { ( uint reserve0, uint reserve1, ) = IUniswapV2Pair( _pair ).getReserves(); uint reserve; if ( IUniswapV2Pair( _pair ).token0() == OHM ) { reserve = reserve1; } else { reserve = reserve0; } return reserve.mul( 2 * ( 10 ** IERC20( OHM ).decimals() ) ).div( getTotalValue( _pair ) ); } }
0x608060405234801561001057600080fd5b50600436106100575760003560e01c806332da80a31461005c5780634249719f146100b4578063490084ef14610116578063686375491461016e578063a6c41fec146101c6575b600080fd5b61009e6004803603602081101561007257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506101fa565b6040518082815260200191505060405180910390f35b610100600480360360408110156100ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061047b565b6040518082815260200191505060405180910390f35b6101586004803603602081101561012c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610556565b6040518082815260200191505060405180910390f35b6101b06004803603602081101561018457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610904565b6040518082815260200191505060405180910390f35b6101ce610931565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60008060008373ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561024557600080fd5b505afa158015610259573d6000803e3d6000fd5b505050506040513d606081101561026f57600080fd5b81019080805190602001909291908051906020019092919080519060200190929190505050506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff16915060007f0000000000000000000000008a14897ea5f668f36671678593fae44ae23b39fb73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561033857600080fd5b505afa15801561034c573d6000803e3d6000fd5b505050506040513d602081101561036257600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1614156103975781905061039b565b8290505b6104716103a786610904565b6104637f0000000000000000000000008a14897ea5f668f36671678593fae44ae23b39fb73ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561041057600080fd5b505afa158015610424573d6000803e3d6000fd5b505050506040513d602081101561043a57600080fd5b810190808051906020019092919050505060ff16600a0a6002028461095590919063ffffffff16565b6109db90919063ffffffff16565b9350505050919050565b60008061048784610904565b905060008473ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156104d157600080fd5b505afa1580156104e5573d6000803e3d6000fd5b505050506040513d60208110156104fb57600080fd5b8101908080519060200190929190505050905061054c670de0b6b3a764000061053e61052f61052a8886610a25565b610d06565b8561095590919063ffffffff16565b6109db90919063ffffffff16565b9250505092915050565b6000808273ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561059f57600080fd5b505afa1580156105b3573d6000803e3d6000fd5b505050506040513d60208110156105c957600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561061f57600080fd5b505afa158015610633573d6000803e3d6000fd5b505050506040513d602081101561064957600080fd5b810190808051906020019092919050505060ff16905060008373ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156106a757600080fd5b505afa1580156106bb573d6000803e3d6000fd5b505050506040513d60208110156106d157600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561072757600080fd5b505afa15801561073b573d6000803e3d6000fd5b505050506040513d602081101561075157600080fd5b810190808051906020019092919050505060ff16905060006108118573ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156107b257600080fd5b505afa1580156107c6573d6000803e3d6000fd5b505050506040513d60208110156107dc57600080fd5b810190808051906020019092919050505060ff166108038486610d4290919063ffffffff16565b610dca90919063ffffffff16565b90506000808673ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561085c57600080fd5b505afa158015610870573d6000803e3d6000fd5b505050506040513d606081101561088657600080fd5b81019080805190602001909291908051906020019092919080519060200190929190505050506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff1691506108f883600a0a6108ea838561095590919063ffffffff16565b6109db90919063ffffffff16565b95505050505050919050565b600061092a600261091c61091785610556565b610e14565b61095590919063ffffffff16565b9050919050565b7f0000000000000000000000008a14897ea5f668f36671678593fae44ae23b39fb81565b60008083141561096857600090506109d5565b600082840290508284828161097957fe5b04146109d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806112146021913960400191505060405180910390fd5b809150505b92915050565b6000610a1d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610e84565b905092915050565b610a2d6111bc565b60008211610a86576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806111ee6026913960400191505060405180910390fd5b6000831415610ac457604051806020016040528060007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168152509050610d00565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff71ffffffffffffffffffffffffffffffffffff168311610bfd57600082607060ff1685901b81610b1157fe5b0490507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16811115610bc8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f77000081525060200191505060405180910390fd5b6040518060200160405280827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16815250915050610d00565b6000610c19846e01000000000000000000000000000085610f4a565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16811115610ccf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f77000081525060200191505060405180910390fd5b6040518060200160405280827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168152509150505b92915050565b60006612725dd1d243ab82600001517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1681610d3a57fe5b049050919050565b600080828401905083811015610dc0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000610e0c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061100c565b905092915050565b60006003821115610e71578190506000610e39610e328460026109db565b6001610d42565b90505b81811015610e6b57809150610e64610e5d610e5785846109db565b83610d42565b60026109db565b9050610e3c565b50610e7f565b60008214610e7e57600190505b5b919050565b60008083118290610f30576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610ef5578082015181840152602081019050610eda565b50505050905090810190601f168015610f225780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610f3c57fe5b049050809150509392505050565b6000806000610f5986866110cc565b9150915060008480610f6757fe5b868809905082811115610f7b576001820391505b8083039250848210610ff5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f46756c6c4d6174683a3a6d756c4469763a206f766572666c6f7700000000000081525060200191505060405180910390fd5b61100083838761111f565b93505050509392505050565b60008383111582906110b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561107e578082015181840152602081019050611063565b50505050905090810190601f1680156110ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff806110f957fe5b84860990508385029250828103915082811015611117576001820391505b509250929050565b600080826000038316905080838161113357fe5b04925080858161113f57fe5b049450600181826000038161115057fe5b04018402850194506000600190508084026002038102905080840260020381029050808402600203810290508084026002038102905080840260020381029050808402600203810290508084026002038102905080840260020381029050808602925050509392505050565b604051806020016040528060007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168152509056fe4669786564506f696e743a3a6672616374696f6e3a206469766973696f6e206279207a65726f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220cb6b7e4d7215a47b7c63c2346f6c2acde1d6321ac6412913275e4349e2563c8564736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
6,461
0xB14dA65459DB957BCEec86a79086036dEa6fc3AD
// File: contracts/lib/SafeMath.sol /* Copyright 2020 DODO ZOO. SPDX-License-Identifier: Apache-2.0 */ pragma solidity 0.6.9; /** * @title SafeMath * @author DODO Breeder * * @notice Math operations with safety checks that revert on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "MUL_ERROR"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "DIVIDING_ERROR"); return a / b; } function divCeil(uint256 a, uint256 b) internal pure returns (uint256) { uint256 quotient = div(a, b); uint256 remainder = a - quotient * b; if (remainder > 0) { return quotient + 1; } else { return quotient; } } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SUB_ERROR"); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "ADD_ERROR"); return c; } function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = x / 2 + 1; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } } // File: contracts/intf/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); function decimals() external view returns (uint8); function name() external view returns (string memory); function symbol() external view returns (string memory); /** * @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); } // File: contracts/lib/SafeERC20.sol /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn( token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value) ); } function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. // A Solidity high level call has three parts: // 1. The target address is checked to verify it contains contract code // 2. The call itself is made, and success asserted // 3. The return value is decoded, which in turn checks the size of the returned data. // solhint-disable-next-line max-line-length // 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"); } } } // File: contracts/lib/DecimalMath.sol /** * @title DecimalMath * @author DODO Breeder * * @notice Functions for fixed point number with 18 decimals */ library DecimalMath { using SafeMath for uint256; uint256 internal constant ONE = 10**18; uint256 internal constant ONE2 = 10**36; function mulFloor(uint256 target, uint256 d) internal pure returns (uint256) { return target.mul(d) / (10**18); } function mulCeil(uint256 target, uint256 d) internal pure returns (uint256) { return target.mul(d).divCeil(10**18); } function divFloor(uint256 target, uint256 d) internal pure returns (uint256) { return target.mul(10**18).div(d); } function divCeil(uint256 target, uint256 d) internal pure returns (uint256) { return target.mul(10**18).divCeil(d); } function reciprocalFloor(uint256 target) internal pure returns (uint256) { return uint256(10**36).div(target); } function reciprocalCeil(uint256 target) internal pure returns (uint256) { return uint256(10**36).divCeil(target); } } // File: contracts/DODOVendingMachine/intf/IDVM.sol interface IDVM { function init( address maintainer, address baseTokenAddress, address quoteTokenAddress, uint256 lpFeeRate, address mtFeeRateModel, uint256 i, uint256 k, bool isOpenTWAP ) external; function _BASE_TOKEN_() external returns (address); function _QUOTE_TOKEN_() external returns (address); function _MT_FEE_RATE_MODEL_() external returns (address); function getVaultReserve() external returns (uint256 baseReserve, uint256 quoteReserve); function sellBase(address to) external returns (uint256); function sellQuote(address to) external returns (uint256); function buyShares(address to) external returns (uint256,uint256,uint256); function addressToShortString(address _addr) external pure returns (string memory); function getMidPrice() external view returns (uint256 midPrice); function sellShares( uint256 shareAmount, address to, uint256 baseMinAmount, uint256 quoteMinAmount, bytes calldata data, uint256 deadline ) external returns (uint256 baseAmount, uint256 quoteAmount); } // File: contracts/intf/IDODOCallee.sol interface IDODOCallee { function DVMSellShareCall( address sender, uint256 burnShareAmount, uint256 baseAmount, uint256 quoteAmount, bytes calldata data ) external; function DVMFlashLoanCall( address sender, uint256 baseAmount, uint256 quoteAmount, bytes calldata data ) external; function DPPFlashLoanCall( address sender, uint256 baseAmount, uint256 quoteAmount, bytes calldata data ) external; function DSPFlashLoanCall( address sender, uint256 baseAmount, uint256 quoteAmount, bytes calldata data ) external; function CPCancelCall( address sender, uint256 amount, bytes calldata data ) external; function CPClaimBidCall( address sender, uint256 baseAmount, uint256 quoteAmount, bytes calldata data ) external; function NFTRedeemCall( address payable assetTo, uint256 quoteAmount, bytes calldata ) external; } // File: contracts/external/ERC20/InitializableFragERC20.sol contract InitializableFragERC20 { using SafeMath for uint256; string public name; string public symbol; uint256 public totalSupply; bool public initialized; mapping(address => uint256) internal balances; mapping(address => mapping(address => uint256)) internal allowed; event Transfer(address indexed from, address indexed to, uint256 amount); event Approval(address indexed owner, address indexed spender, uint256 amount); function init( address _creator, uint256 _totalSupply, string memory _name, string memory _symbol ) public { require(!initialized, "TOKEN_INITIALIZED"); initialized = true; totalSupply = _totalSupply; balances[_creator] = _totalSupply; name = _name; symbol = _symbol; emit Transfer(address(0), _creator, _totalSupply); } function decimals() public view returns (uint8) { return 18; } function transfer(address to, uint256 amount) public returns (bool) { _transfer(msg.sender, to, amount); return true; } function balanceOf(address owner) public view returns (uint256 balance) { return balances[owner]; } function transferFrom( address from, address to, uint256 amount ) public returns (bool) { require(to != address(0), "TO_ADDRESS_IS_EMPTY"); require(amount <= balances[from], "BALANCE_NOT_ENOUGH"); require(amount <= allowed[from][msg.sender], "ALLOWANCE_NOT_ENOUGH"); balances[from] = balances[from].sub(amount); balances[to] = balances[to].add(amount); allowed[from][msg.sender] = allowed[from][msg.sender].sub(amount); emit Transfer(from, to, amount); return true; } function approve(address spender, uint256 amount) public returns (bool) { allowed[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function allowance(address owner, address spender) public view returns (uint256) { return allowed[owner][spender]; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "FROM_ADDRESS_IS_EMPTY"); require(recipient != address(0), "TO_ADDRESS_IS_EMPTY"); require(amount <= balances[sender], "BALANCE_NOT_ENOUGH"); balances[sender] = balances[sender].sub(amount); balances[recipient] = balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } } // File: contracts/CollateralVault/intf/ICollateralVault.sol interface ICollateralVault { function _OWNER_() external returns (address); function init(address owner, string memory name, string memory baseURI) external; function directTransferOwnership(address newOwner) external; } // File: contracts/GeneralizedFragment/impl/Fragment.sol interface IBuyoutModel { function getBuyoutStatus(address fragAddr, address user) external view returns (int); } contract Fragment is InitializableFragERC20 { using SafeMath for uint256; using SafeERC20 for IERC20; // ============ Storage ============ bool public _IS_BUYOUT_; uint256 public _BUYOUT_TIMESTAMP_; uint256 public _BUYOUT_PRICE_; uint256 public _DISTRIBUTION_RATIO_; address public _COLLATERAL_VAULT_; address public _VAULT_PRE_OWNER_; address public _QUOTE_; address public _DVM_; address public _DEFAULT_MAINTAINER_; address public _BUYOUT_MODEL_; bool internal _FRAG_INITIALIZED_; // ============ Event ============ event RemoveNftToken(address nftContract, uint256 tokenId, uint256 amount); event AddNftToken(address nftContract, uint256 tokenId, uint256 amount); event InitInfo(address vault, string name, string baseURI); event CreateFragment(); event Buyout(address newOwner); event Redeem(address sender, uint256 baseAmount, uint256 quoteAmount); function init( address dvm, address vaultPreOwner, address collateralVault, uint256 _totalSupply, uint256 ownerRatio, uint256 buyoutTimestamp, address defaultMaintainer, address buyoutModel, uint256 distributionRatio, string memory _symbol ) external { require(!_FRAG_INITIALIZED_, "DODOFragment: ALREADY_INITIALIZED"); _FRAG_INITIALIZED_ = true; // init local variables _DVM_ = dvm; _QUOTE_ = IDVM(_DVM_)._QUOTE_TOKEN_(); _VAULT_PRE_OWNER_ = vaultPreOwner; _COLLATERAL_VAULT_ = collateralVault; _BUYOUT_TIMESTAMP_ = buyoutTimestamp; _DEFAULT_MAINTAINER_ = defaultMaintainer; _BUYOUT_MODEL_ = buyoutModel; _DISTRIBUTION_RATIO_ = distributionRatio; // init FRAG meta data name = string(abi.encodePacked("DODO_FRAG_", _symbol)); // symbol = string(abi.encodePacked("d_", _symbol)); symbol = _symbol; super.init(address(this), _totalSupply, name, symbol); // init FRAG distribution uint256 vaultPreOwnerBalance = DecimalMath.mulFloor(_totalSupply, ownerRatio); uint256 distributionBalance = DecimalMath.mulFloor(vaultPreOwnerBalance, distributionRatio); if(distributionBalance > 0) _transfer(address(this), _DEFAULT_MAINTAINER_, distributionBalance); _transfer(address(this), _VAULT_PRE_OWNER_, vaultPreOwnerBalance.sub(distributionBalance)); _transfer(address(this), _DVM_, _totalSupply.sub(vaultPreOwnerBalance)); // init DVM liquidity IDVM(_DVM_).buyShares(address(this)); } function buyout(address newVaultOwner) external { require(_BUYOUT_TIMESTAMP_ != 0, "DODOFragment: NOT_SUPPORT_BUYOUT"); require(block.timestamp > _BUYOUT_TIMESTAMP_, "DODOFragment: BUYOUT_NOT_START"); require(!_IS_BUYOUT_, "DODOFragment: ALREADY_BUYOUT"); int buyoutFee = IBuyoutModel(_BUYOUT_MODEL_).getBuyoutStatus(address(this), newVaultOwner); require(buyoutFee != -1, "DODOFragment: USER_UNABLE_BUYOUT"); _IS_BUYOUT_ = true; _BUYOUT_PRICE_ = IDVM(_DVM_).getMidPrice(); uint256 requireQuote = DecimalMath.mulCeil(_BUYOUT_PRICE_, totalSupply); uint256 payQuote = IERC20(_QUOTE_).balanceOf(address(this)); require(payQuote >= requireQuote, "DODOFragment: QUOTE_NOT_ENOUGH"); IDVM(_DVM_).sellShares( IERC20(_DVM_).balanceOf(address(this)), address(this), 0, 0, "", uint256(-1) ); uint256 redeemFrag = totalSupply.sub(balances[address(this)]).sub(balances[_VAULT_PRE_OWNER_]); uint256 ownerQuoteWithoutFee = IERC20(_QUOTE_).balanceOf(address(this)).sub(DecimalMath.mulCeil(_BUYOUT_PRICE_, redeemFrag)); _clearBalance(address(this)); _clearBalance(_VAULT_PRE_OWNER_); uint256 buyoutFeeAmount = DecimalMath.mulFloor(ownerQuoteWithoutFee, uint256(buyoutFee)); IERC20(_QUOTE_).safeTransfer(_DEFAULT_MAINTAINER_, buyoutFeeAmount); IERC20(_QUOTE_).safeTransfer(_VAULT_PRE_OWNER_, ownerQuoteWithoutFee.sub(buyoutFeeAmount)); ICollateralVault(_COLLATERAL_VAULT_).directTransferOwnership(newVaultOwner); emit Buyout(newVaultOwner); } function redeem(address to, bytes calldata data) external { require(_IS_BUYOUT_, "DODOFragment: NEED_BUYOUT"); uint256 baseAmount = balances[msg.sender]; uint256 quoteAmount = DecimalMath.mulFloor(_BUYOUT_PRICE_, baseAmount); _clearBalance(msg.sender); IERC20(_QUOTE_).safeTransfer(to, quoteAmount); if (data.length > 0) { IDODOCallee(to).NFTRedeemCall( msg.sender, quoteAmount, data ); } emit Redeem(msg.sender, baseAmount, quoteAmount); } function getBuyoutRequirement() external view returns (uint256 requireQuote){ require(_BUYOUT_TIMESTAMP_ != 0, "NOT SUPPORT BUYOUT"); require(!_IS_BUYOUT_, "ALREADY BUYOUT"); uint256 price = IDVM(_DVM_).getMidPrice(); requireQuote = DecimalMath.mulCeil(price, totalSupply); } function _clearBalance(address account) internal { uint256 clearBalance = balances[account]; balances[account] = 0; balances[address(0)] = balances[address(0)].add(clearBalance); emit Transfer(account, address(0), clearBalance); } }
0x608060405234801561001057600080fd5b50600436106101735760003560e01c80637a1fa0dd116100de578063a9059cbb11610097578063dd62ed3e11610071578063dd62ed3e14610501578063eb28bc431461052f578063f08e85521461066d578063ffd50adb1461067557610173565b8063a9059cbb146104c5578063ca436ea4146104f1578063da7d5aa4146104f957610173565b80637a1fa0dd1461038f5780637f21fbd2146103b357806381ab4d0a146104a5578063909b9dc1146104ad57806395d89b41146104b5578063a52501ca146104bd57610173565b80633841185e116101305780633841185e146102ab57806341593c4a1461032b57806365f0b9491461033357806367e9bdad1461033b57806370a082311461036157806378c8eb081461038757610173565b806306fdde0314610178578063095ea7b3146101f5578063158ef93e1461023557806318160ddd1461023d57806323b872dd14610257578063313ce5671461028d575b600080fd5b61018061067d565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ba5781810151838201526020016101a2565b50505050905090810190601f1680156101e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102216004803603604081101561020b57600080fd5b506001600160a01b03813516906020013561070b565b604080519115158252519081900360200190f35b610221610772565b61024561077b565b60408051918252519081900360200190f35b6102216004803603606081101561026d57600080fd5b506001600160a01b03813581169160208101359091169060400135610781565b6102956109a0565b6040805160ff9092168252519081900360200190f35b610329600480360360408110156102c157600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156102eb57600080fd5b8201836020820111156102fd57600080fd5b803590602001918460018302840111600160201b8311171561031e57600080fd5b5090925090506109a6565b005b610245610b32565b610245610b38565b6103296004803603602081101561035157600080fd5b50356001600160a01b0316610b3e565b6102456004803603602081101561037757600080fd5b50356001600160a01b03166111ac565b6102456111c7565b6103976112e7565b604080516001600160a01b039092168252519081900360200190f35b61032960048036036101408110156103ca57600080fd5b6001600160a01b0382358116926020810135821692604082013583169260608301359260808101359260a08201359260c083013581169260e08101359091169161010082013591908101906101408101610120820135600160201b81111561043157600080fd5b82018360208201111561044357600080fd5b803590602001918460018302840111600160201b8311171561046457600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506112f6945050505050565b61039761170e565b61039761171d565b61018061172c565b610221611786565b610221600480360360408110156104db57600080fd5b506001600160a01b03813516906020013561178f565b6103976117a5565b6102456117b4565b6102456004803603604081101561051757600080fd5b506001600160a01b03813581169160200135166117ba565b6103296004803603608081101561054557600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561057457600080fd5b82018360208201111561058657600080fd5b803590602001918460018302840111600160201b831117156105a757600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156105f957600080fd5b82018360208201111561060b57600080fd5b803590602001918460018302840111600160201b8311171561062c57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506117e5945050505050565b6103976118b9565b6103976118c8565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107035780601f106106d857610100808354040283529160200191610703565b820191906000526020600020905b8154815290600101906020018083116106e657829003601f168201915b505050505081565b3360008181526005602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60035460ff1681565b60025481565b60006001600160a01b0383166107d4576040805162461bcd60e51b8152602060048201526013602482015272544f5f414444524553535f49535f454d50545960681b604482015290519081900360640190fd5b6001600160a01b038416600090815260046020526040902054821115610836576040805162461bcd60e51b81526020600482015260126024820152710848298829c868abe9c9ea8be8a9c9eaa8e960731b604482015290519081900360640190fd5b6001600160a01b03841660009081526005602090815260408083203384529091529020548211156108a5576040805162461bcd60e51b815260206004820152601460248201527308298989eae829c868abe9c9ea8be8a9c9eaa8e960631b604482015290519081900360640190fd5b6001600160a01b0384166000908152600460205260409020546108ce908363ffffffff6118d716565b6001600160a01b038086166000908152600460205260408082209390935590851681522054610903908363ffffffff61192016565b6001600160a01b038085166000908152600460209081526040808320949094559187168152600582528281203382529091522054610947908363ffffffff6118d716565b6001600160a01b0380861660008181526005602090815260408083203384528252918290209490945580518681529051928716939192600080516020611f69833981519152929181900390910190a35060019392505050565b60125b90565b60065460ff166109fd576040805162461bcd60e51b815260206004820152601960248201527f444f444f467261676d656e743a204e4545445f4255594f555400000000000000604482015290519081900360640190fd5b33600090815260046020526040812054600854909190610a1d908361196d565b9050610a2833611997565b600c54610a45906001600160a01b0316868363ffffffff611a4d16565b8215610aeb5760405163029e031b60e51b8152336004820181815260248301849052606060448401908152606484018790526001600160a01b038916936353c06360939286928a928a929190608401848480828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b158015610ad257600080fd5b505af1158015610ae6573d6000803e3d6000fd5b505050505b604080513381526020810184905280820183905290517fe5b754fb1abb7f01b499791d0b820ae3b6af3424ac1c59768edb53f4ec31a9299181900360600190a15050505050565b60095481565b60085481565b600754610b92576040805162461bcd60e51b815260206004820181905260248201527f444f444f467261676d656e743a204e4f545f535550504f52545f4255594f5554604482015290519081900360640190fd5b6007544211610be8576040805162461bcd60e51b815260206004820152601e60248201527f444f444f467261676d656e743a204255594f55545f4e4f545f53544152540000604482015290519081900360640190fd5b60065460ff1615610c40576040805162461bcd60e51b815260206004820152601c60248201527f444f444f467261676d656e743a20414c52454144595f4255594f555400000000604482015290519081900360640190fd5b600f546040805163052ed78560e11b81523060048201526001600160a01b03848116602483015291516000939290921691630a5daf0a91604480820192602092909190829003018186803b158015610c9757600080fd5b505afa158015610cab573d6000803e3d6000fd5b505050506040513d6020811015610cc157600080fd5b50519050600019811415610d1c576040805162461bcd60e51b815260206004820181905260248201527f444f444f467261676d656e743a20555345525f554e41424c455f4255594f5554604482015290519081900360640190fd5b6006805460ff19166001179055600d546040805163ee27c68960e01b815290516001600160a01b039092169163ee27c68991600480820192602092909190829003018186803b158015610d6e57600080fd5b505afa158015610d82573d6000803e3d6000fd5b505050506040513d6020811015610d9857600080fd5b50516008819055600254600091610dae91611aa4565b600c54604080516370a0823160e01b815230600482015290519293506000926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015610dff57600080fd5b505afa158015610e13573d6000803e3d6000fd5b505050506040513d6020811015610e2957600080fd5b5051905081811015610e82576040805162461bcd60e51b815260206004820152601e60248201527f444f444f467261676d656e743a2051554f54455f4e4f545f454e4f5547480000604482015290519081900360640190fd5b600d54604080516370a0823160e01b815230600482015290516001600160a01b039092169163b56ceaa69183916370a0823191602480820192602092909190829003018186803b158015610ed557600080fd5b505afa158015610ee9573d6000803e3d6000fd5b505050506040513d6020811015610eff57600080fd5b5051604080516001600160e01b031960e085901b16815260048101929092523060248301526000604483018190526064830181905260001960a484015260c0608484015260c483018190528151610104808501949192918390030190829087803b158015610f6c57600080fd5b505af1158015610f80573d6000803e3d6000fd5b505050506040513d6040811015610f9657600080fd5b5050600b546001600160a01b03166000908152600460205260408082205430835290822054600254610fdf9291610fd3919063ffffffff6118d716565b9063ffffffff6118d716565b90506000611075610ff260085484611aa4565b600c54604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561103d57600080fd5b505afa158015611051573d6000803e3d6000fd5b505050506040513d602081101561106757600080fd5b50519063ffffffff6118d716565b905061108030611997565b600b54611095906001600160a01b0316611997565b60006110a1828761196d565b600e54600c549192506110c7916001600160a01b0390811691168363ffffffff611a4d16565b600b54611100906001600160a01b03166110e7848463ffffffff6118d716565b600c546001600160a01b0316919063ffffffff611a4d16565b600a5460408051635ee9bee360e11b81526001600160a01b038a811660048301529151919092169163bdd37dc691602480830192600092919082900301818387803b15801561114e57600080fd5b505af1158015611162573d6000803e3d6000fd5b5050604080516001600160a01b038b16815290517f3fb10f906eaa8bd871562f329e4f361a7e9ed6cd8eccf4f2a15933cbc86122d79350908190036020019150a150505050505050565b6001600160a01b031660009081526004602052604090205490565b600060075460001415611216576040805162461bcd60e51b81526020600482015260126024820152711393d50814d5541413d4950810955653d55560721b604482015290519081900360640190fd5b60065460ff161561125f576040805162461bcd60e51b815260206004820152600e60248201526d105314915051164810955653d55560921b604482015290519081900360640190fd5b600d546040805163ee27c68960e01b815290516000926001600160a01b03169163ee27c689916004808301926020929190829003018186803b1580156112a457600080fd5b505afa1580156112b8573d6000803e3d6000fd5b505050506040513d60208110156112ce57600080fd5b50516002549091506112e1908290611aa4565b91505090565b600d546001600160a01b031681565b600f54600160a01b900460ff161561133f5760405162461bcd60e51b8152600401808060200182810382526021815260200180611f486021913960400191505060405180910390fd5b600f805460ff60a01b1916600160a01b179055600d80546001600160a01b03808d166001600160a01b0319909216919091179182905560408051636a5cb82360e11b81529051929091169163d4b97046916004808201926020929091908290030181600087803b1580156113b257600080fd5b505af11580156113c6573d6000803e3d6000fd5b505050506040513d60208110156113dc57600080fd5b5051600c80546001600160a01b03199081166001600160a01b0393841617909155600b805482168c8416179055600a805482168b84161790556007879055600e80548216878416179055600f8054909116918516919091179055600982905560405169444f444f5f465241475f60b01b602080830191825283518493602a01918401908083835b602083106114825780518252601f199092019160209182019101611463565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051602081830303815290604052600090805190602001906114cb929190611eaf565b5080516114df906001906020840190611eaf565b5060008054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526116049330938c9383018282801561156d5780601f106115425761010080835404028352916020019161156d565b820191906000526020600020905b81548152906001019060200180831161155057829003601f168201915b505060018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152955091935091508301828280156115fa5780601f106115cf576101008083540402835291602001916115fa565b820191906000526020600020905b8154815290600101906020018083116115dd57829003601f168201915b50505050506117e5565b6000611610888861196d565b9050600061161e828561196d565b9050801561163e57600e5461163e9030906001600160a01b031683611ace565b600b546116659030906001600160a01b0316611660858563ffffffff6118d716565b611ace565b600d546116879030906001600160a01b03166116608c8663ffffffff6118d716565b600d5460408051634c85b42560e01b815230600482015290516001600160a01b0390921691634c85b425916024808201926060929091908290030181600087803b1580156116d457600080fd5b505af11580156116e8573d6000803e3d6000fd5b505050506040513d60608110156116fe57600080fd5b5050505050505050505050505050565b600e546001600160a01b031681565b600a546001600160a01b031681565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107035780601f106106d857610100808354040283529160200191610703565b60065460ff1681565b600061179c338484611ace565b50600192915050565b600c546001600160a01b031681565b60075481565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b60035460ff1615611831576040805162461bcd60e51b81526020600482015260116024820152701513d2d15397d253925512505312569151607a1b604482015290519081900360640190fd5b6003805460ff1916600117905560028390556001600160a01b03841660009081526004602090815260408220859055835161186f9291850190611eaf565b508051611883906001906020840190611eaf565b506040805184815290516001600160a01b03861691600091600080516020611f698339815191529181900360200190a350505050565b600f546001600160a01b031681565b600b546001600160a01b031681565b60008282111561191a576040805162461bcd60e51b815260206004820152600960248201526829aaa12fa2a92927a960b91b604482015290519081900360640190fd5b50900390565b600082820183811015611966576040805162461bcd60e51b815260206004820152600960248201526820a2222fa2a92927a960b91b604482015290519081900360640190fd5b9392505050565b6000670de0b6b3a7640000611988848463ffffffff611c7c16565b8161198f57fe5b049392505050565b6001600160a01b03811660009081526004602052604081208054908290559080527f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ec546119ea908263ffffffff61192016565b6000808052600460209081527f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ec9290925560408051848152905191926001600160a01b03861692600080516020611f698339815191529281900390910190a35050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611a9f908490611cd7565b505050565b6000611966670de0b6b3a7640000611ac2858563ffffffff611c7c16565b9063ffffffff611e3216565b6001600160a01b038316611b21576040805162461bcd60e51b815260206004820152601560248201527446524f4d5f414444524553535f49535f454d50545960581b604482015290519081900360640190fd5b6001600160a01b038216611b72576040805162461bcd60e51b8152602060048201526013602482015272544f5f414444524553535f49535f454d50545960681b604482015290519081900360640190fd5b6001600160a01b038316600090815260046020526040902054811115611bd4576040805162461bcd60e51b81526020600482015260126024820152710848298829c868abe9c9ea8be8a9c9eaa8e960731b604482015290519081900360640190fd5b6001600160a01b038316600090815260046020526040902054611bfd908263ffffffff6118d716565b6001600160a01b038085166000908152600460205260408082209390935590841681522054611c32908263ffffffff61192016565b6001600160a01b038084166000818152600460209081526040918290209490945580518581529051919392871692600080516020611f6983398151915292918290030190a3505050565b600082611c8b5750600061076c565b82820282848281611c9857fe5b0414611966576040805162461bcd60e51b815260206004820152600960248201526826aaa62fa2a92927a960b91b604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310611d155780518252601f199092019160209182019101611cf6565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611d77576040519150601f19603f3d011682016040523d82523d6000602084013e611d7c565b606091505b509150915081611dd3576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115611e2c57808060200190516020811015611def57600080fd5b5051611e2c5760405162461bcd60e51b815260040180806020018281038252602a815260200180611f89602a913960400191505060405180910390fd5b50505050565b600080611e3f8484611e5f565b905082810284038015611e575750600101905061076c565b50905061076c565b6000808211611ea6576040805162461bcd60e51b815260206004820152600e60248201526d2224ab24a224a723afa2a92927a960911b604482015290519081900360640190fd5b81838161198f57fe5b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611ef057805160ff1916838001178555611f1d565b82800160010185558215611f1d579182015b82811115611f1d578251825591602001919060010190611f02565b50611f29929150611f2d565b5090565b6109a391905b80821115611f295760008155600101611f3356fe444f444f467261676d656e743a20414c52454144595f494e495449414c495a4544ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212203ad3618af4c271baf733ddcdcf89812b90f71f40b59912af10693e1b6089f88c64736f6c63430006090033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,462
0x67c3e1cce4c79b58268af893951196ba0c4d5a35
pragma solidity ^0.6.0; // ---------------------------------------------------------------------------- // 'FRT' Staking smart contract // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // SafeMath library // ---------------------------------------------------------------------------- /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } function ceil(uint a, uint m) internal pure returns (uint r) { return (a + m - 1) / m * m; } } // ---------------------------------------------------------------------------- // Owned contract // ---------------------------------------------------------------------------- contract Owned { address payable public owner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address payable _newOwner) public onlyOwner { owner = _newOwner; emit OwnershipTransferred(msg.sender, _newOwner); } } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // ---------------------------------------------------------------------------- interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address tokenOwner) external view returns (uint256 balance); function allowance(address tokenOwner, address spender) external view returns (uint256 remaining); function transfer(address to, uint256 tokens) external returns (bool success); function approve(address spender, uint256 tokens) external returns (bool success); function transferFrom(address from, address to, uint256 tokens) external returns (bool success); function burnTokens(uint256 _amount) external; event Transfer(address indexed from, address indexed to, uint256 tokens); event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens); } // ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ---------------------------------------------------------------------------- contract FairyStake is Owned { using SafeMath for uint256; address public FRT = 0x35DfdAD99DD022adbB63754aEbc9365f66B29807; uint256 public totalStakes = 0; uint256 stakingFee = 25; // 2.5% uint256 unstakingFee = 25; // 2.5% uint256 public totalDividends = 0; uint256 private scaledRemainder = 0; uint256 private scaling = uint256(10) ** 12; uint public round = 1; struct USER{ uint256 stakedTokens; uint256 lastDividends; uint256 fromTotalDividend; uint round; uint256 remainder; } mapping(address => USER) stakers; mapping (uint => uint256) public payouts; // keeps record of each payout event STAKED(address staker, uint256 tokens, uint256 stakingFee); event UNSTAKED(address staker, uint256 tokens, uint256 unstakingFee); event PAYOUT(uint256 round, uint256 tokens, address sender); event CLAIMEDREWARD(address staker, uint256 reward); // ------------------------------------------------------------------------ // Token holders can stake their tokens using this function // @param tokens number of tokens to stake // ------------------------------------------------------------------------ function STAKE(uint256 tokens) external { require(IERC20(FRT).transferFrom(msg.sender, address(this), tokens), "Tokens cannot be transferred from user account"); uint256 _stakingFee = 0; if(totalStakes > 0) _stakingFee= (onePercent(tokens).mul(stakingFee)).div(10); if(totalStakes > 0) // distribute the staking fee accumulated before updating the user's stake _addPayout(_stakingFee); // add pending rewards to remainder to be claimed by user later, if there is any existing stake uint256 owing = pendingReward(msg.sender); stakers[msg.sender].remainder += owing; stakers[msg.sender].stakedTokens = (tokens.sub(_stakingFee)).add(stakers[msg.sender].stakedTokens); stakers[msg.sender].lastDividends = owing; stakers[msg.sender].fromTotalDividend= totalDividends; stakers[msg.sender].round = round; totalStakes = totalStakes.add(tokens.sub(_stakingFee)); emit STAKED(msg.sender, tokens.sub(_stakingFee), _stakingFee); } // ------------------------------------------------------------------------ // Owners can send the funds to be distributed to stakers using this function // @param tokens number of tokens to distribute // ------------------------------------------------------------------------ function ADDFUNDS(uint256 tokens) external { require(IERC20(FRT).transferFrom(msg.sender, address(this), tokens), "Tokens cannot be transferred from funder account"); _addPayout(tokens); } // ------------------------------------------------------------------------ // Private function to register payouts // ------------------------------------------------------------------------ function _addPayout(uint256 tokens) private{ // divide the funds among the currently staked tokens // scale the deposit and add the previous remainder uint256 available = (tokens.mul(scaling)).add(scaledRemainder); uint256 dividendPerToken = available.div(totalStakes); scaledRemainder = available.mod(totalStakes); totalDividends = totalDividends.add(dividendPerToken); payouts[round] = payouts[round-1].add(dividendPerToken); emit PAYOUT(round, tokens, msg.sender); round++; } // ------------------------------------------------------------------------ // Stakers can claim their pending rewards using this function // ------------------------------------------------------------------------ function CLAIMREWARD() public { if(totalDividends > stakers[msg.sender].fromTotalDividend){ uint256 owing = pendingReward(msg.sender); owing = owing.add(stakers[msg.sender].remainder); stakers[msg.sender].remainder = 0; require(IERC20(FRT).transfer(msg.sender,owing), "ERROR: error in sending reward from contract"); emit CLAIMEDREWARD(msg.sender, owing); stakers[msg.sender].lastDividends = owing; // unscaled stakers[msg.sender].round = round; // update the round stakers[msg.sender].fromTotalDividend = totalDividends; // scaled } } // ------------------------------------------------------------------------ // Get the pending rewards of the staker // @param _staker the address of the staker // ------------------------------------------------------------------------ function pendingReward(address staker) private returns (uint256) { uint256 amount = ((totalDividends.sub(payouts[stakers[staker].round - 1])).mul(stakers[staker].stakedTokens)).div(scaling); stakers[staker].remainder += ((totalDividends.sub(payouts[stakers[staker].round - 1])).mul(stakers[staker].stakedTokens)) % scaling ; return amount; } function getPendingReward(address staker) public view returns(uint256 _pendingReward) { uint256 amount = ((totalDividends.sub(payouts[stakers[staker].round - 1])).mul(stakers[staker].stakedTokens)).div(scaling); amount += ((totalDividends.sub(payouts[stakers[staker].round - 1])).mul(stakers[staker].stakedTokens)) % scaling ; return (amount + stakers[staker].remainder); } // ------------------------------------------------------------------------ // Stakers can un stake the staked tokens using this function // @param tokens the number of tokens to withdraw // ------------------------------------------------------------------------ function WITHDRAW(uint256 tokens) external { require(stakers[msg.sender].stakedTokens >= tokens && tokens > 0, "Invalid token amount to withdraw"); uint256 _unstakingFee = (onePercent(tokens).mul(unstakingFee)).div(10); // add pending rewards to remainder to be claimed by user later, if there is any existing stake uint256 owing = pendingReward(msg.sender); stakers[msg.sender].remainder += owing; require(IERC20(FRT).transfer(msg.sender, tokens.sub(_unstakingFee)), "Error in un-staking tokens"); stakers[msg.sender].stakedTokens = stakers[msg.sender].stakedTokens.sub(tokens); stakers[msg.sender].lastDividends = owing; stakers[msg.sender].fromTotalDividend= totalDividends; stakers[msg.sender].round = round; totalStakes = totalStakes.sub(tokens); if(totalStakes > 0) // distribute the un staking fee accumulated after updating the user's stake _addPayout(_unstakingFee); emit UNSTAKED(msg.sender, tokens.sub(_unstakingFee), _unstakingFee); } // ------------------------------------------------------------------------ // Private function to calculate 1% percentage // ------------------------------------------------------------------------ function onePercent(uint256 _tokens) private pure returns (uint256){ uint256 roundValue = _tokens.ceil(100); uint onePercentofTokens = roundValue.mul(100).div(100 * 10**uint(2)); return onePercentofTokens; } // ------------------------------------------------------------------------ // Get the number of tokens staked by a staker // @param _staker the address of the staker // ------------------------------------------------------------------------ function yourStakedFRT(address staker) external view returns(uint256 stakedFRT){ return stakers[staker].stakedTokens; } // ------------------------------------------------------------------------ // Get the FRT balance of the token holder // @param user the address of the token holder // ------------------------------------------------------------------------ function yourFRTBalance(address user) external view returns(uint256 FRTBalance){ return IERC20(FRT).balanceOf(user); } }
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638da5cb5b1161008c578063b53d6c2411610066578063b53d6c2414610341578063bf9befb11461036f578063ca84d5911461038d578063f2fde38b146103bb576100ea565b80638da5cb5b1461028157806395726c3d146102cb578063997664d714610323576100ea565b806329652e86116100c857806329652e86146101af5780632c75bcda146101f15780634baf782e1461021f5780634df9d6ba14610229576100ea565b8063036b14dd146100ef578063146ca531146101395780631beb95e214610157575b600080fd5b6100f76103ff565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610141610425565b6040518082815260200191505060405180910390f35b6101996004803603602081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061042b565b6040518082815260200191505060405180910390f35b6101db600480360360208110156101c557600080fd5b8101908080359060200190929190505050610477565b6040518082815260200191505060405180910390f35b61021d6004803603602081101561020757600080fd5b810190808035906020019092919050505061048f565b005b61022761097a565b005b61026b6004803603602081101561023f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cf3565b6040518082815260200191505060405180910390f35b610289610eea565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61030d600480360360208110156102e157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f0f565b6040518082815260200191505060405180910390f35b61032b610ff2565b6040518082815260200191505060405180910390f35b61036d6004803603602081101561035757600080fd5b8101908080359060200190929190505050610ff8565b005b610377611171565b6040518082815260200191505060405180910390f35b6103b9600480360360208110156103a357600080fd5b8101908080359060200190929190505050611177565b005b6103fd600480360360208110156103d157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115d6565b005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60085481565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050919050565b600a6020528060005260406000206000915090505481565b80600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154101580156104e15750600081115b610553576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f496e76616c696420746f6b656e20616d6f756e7420746f20776974686472617781525060200191505060405180910390fd5b6000610585600a610577600454610569866116cc565b61172090919063ffffffff16565b6117a690919063ffffffff16565b90506000610592336117f0565b905080600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160008282540192505081905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb3361063685876119ee90919063ffffffff16565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561069f57600080fd5b505af11580156106b3573d6000803e3d6000fd5b505050506040513d60208110156106c957600080fd5b810190808051906020019092919050505061074c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4572726f7220696e20756e2d7374616b696e6720746f6b656e7300000000000081525060200191505060405180910390fd5b6107a183600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546119ee90919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555080600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550600554600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020181905550600854600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055506108d5836002546119ee90919063ffffffff16565b600281905550600060025411156108f0576108ef82611a38565b5b7faeb913af138cc126643912346d844a49a83761eb58fcfc9e571fc99e1b3d9fa23361092584866119ee90919063ffffffff16565b84604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a1505050565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546005541115610cf15760006109d1336117f0565b9050610a28600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004015482611b8490919063ffffffff16565b90506000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040181905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610b1b57600080fd5b505af1158015610b2f573d6000803e3d6000fd5b505050506040513d6020811015610b4557600080fd5b8101908080519060200190929190505050610bab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180611eb9602c913960400191505060405180910390fd5b7f8a0128b5f12decc7d739e546c0521c3388920368915393f80120bc5b408c7c9e3382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a180600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550600854600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030181905550600554600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020181905550505b565b600080610dcb600754610dbd600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154610daf600a60006001600960008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154038152602001908152602001600020546005546119ee90919063ffffffff16565b61172090919063ffffffff16565b6117a690919063ffffffff16565b9050600754610e91600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154610e83600a60006001600960008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154038152602001908152602001600020546005546119ee90919063ffffffff16565b61172090919063ffffffff16565b81610e9857fe5b0681019050600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401548101915050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610fb057600080fd5b505afa158015610fc4573d6000803e3d6000fd5b505050506040513d6020811015610fda57600080fd5b81019080805190602001909291905050509050919050565b60055481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156110d557600080fd5b505af11580156110e9573d6000803e3d6000fd5b505050506040513d60208110156110ff57600080fd5b8101908080519060200190929190505050611165576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526030815260200180611f346030913960400191505060405180910390fd5b61116e81611a38565b50565b60025481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561125457600080fd5b505af1158015611268573d6000803e3d6000fd5b505050506040513d602081101561127e57600080fd5b81019080805190602001909291905050506112e4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180611f06602e913960400191505060405180910390fd5b60008090506000600254111561132757611324600a611316600354611308866116cc565b61172090919063ffffffff16565b6117a690919063ffffffff16565b90505b6000600254111561133c5761133b81611a38565b5b6000611347336117f0565b905080600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160008282540192505081905550611400600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546113f284866119ee90919063ffffffff16565b611b8490919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555080600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550600554600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020181905550600854600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003018190555061154661153583856119ee90919063ffffffff16565b600254611b8490919063ffffffff16565b6002819055507f99b6f4b247a06a3dbcda8d2244b818e254005608c2455221a00383939a119e7c3361158184866119ee90919063ffffffff16565b84604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a1505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461162f57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b6000806116e3606484611c0c90919063ffffffff16565b905060006117146002600a0a60640261170660648561172090919063ffffffff16565b6117a690919063ffffffff16565b90508092505050919050565b60008083141561173357600090506117a0565b600082840290508284828161174457fe5b041461179b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611ee56021913960400191505060405180910390fd5b809150505b92915050565b60006117e883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611c27565b905092915050565b6000806118c86007546118ba600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546118ac600a60006001600960008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154038152602001908152602001600020546005546119ee90919063ffffffff16565b61172090919063ffffffff16565b6117a690919063ffffffff16565b905060075461198e600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154611980600a60006001600960008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154038152602001908152602001600020546005546119ee90919063ffffffff16565b61172090919063ffffffff16565b8161199557fe5b06600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004016000828254019250508190555080915050919050565b6000611a3083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ced565b905092915050565b6000611a63600654611a556007548561172090919063ffffffff16565b611b8490919063ffffffff16565b90506000611a7c600254836117a690919063ffffffff16565b9050611a9360025483611dad90919063ffffffff16565b600681905550611aae81600554611b8490919063ffffffff16565b600581905550611adf81600a6000600160085403815260200190815260200160002054611b8490919063ffffffff16565b600a60006008548152602001908152602001600020819055507fddf8c05dcee82ec75482e095e6c06768c848d5a7df7147686033433d141328b66008548433604051808481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390a1600860008154809291906001019190505550505050565b600080828401905083811015611c02576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000818260018486010381611c1d57fe5b0402905092915050565b60008083118290611cd3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611c98578082015181840152602081019050611c7d565b50505050905090810190601f168015611cc55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611cdf57fe5b049050809150509392505050565b6000838311158290611d9a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611d5f578082015181840152602081019050611d44565b50505050905090810190601f168015611d8c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000611def83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250611df7565b905092915050565b6000808314158290611ea4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611e69578082015181840152602081019050611e4e565b50505050905090810190601f168015611e965780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50828481611eae57fe5b069050939250505056fe4552524f523a206572726f7220696e2073656e64696e67207265776172642066726f6d20636f6e7472616374536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77546f6b656e732063616e6e6f74206265207472616e736665727265642066726f6d2075736572206163636f756e74546f6b656e732063616e6e6f74206265207472616e736665727265642066726f6d2066756e646572206163636f756e74a2646970667358221220fd2f7c6f77f71af86bcc0f8ed5fc29086d53e9fc70966625072eeb60fe2b322864736f6c63430006000033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
6,463
0xbf5ec0ad2f5ea26530c70dd534d6c82a91e56da6
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'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/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } // File: zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: zeppelin-solidity/contracts/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/SafeERC20.sol /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { function safeTransfer(ERC20Basic token, address to, uint256 value) internal { assert(token.transfer(to, value)); } function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal { assert(token.transferFrom(from, to, value)); } function safeApprove(ERC20 token, address spender, uint256 value) internal { assert(token.approve(spender, value)); } } // File: contracts/Timelock.sol /** * @title TokenTimelock * @dev A token holder contract that can release its token balance gradually like a * typical vesting scheme with a cliff, gradual release period, and implied residue. * * Withdraws by an address can be paused by the owner. */ contract Timelock is Ownable { using SafeMath for uint256; using SafeERC20 for ERC20Basic; /* * @dev ERC20 token that is being timelocked */ ERC20Basic public token; /** * @dev timestamp at which the timelock schedule begins */ uint256 public startTime; /** * @dev number of seconds from startTime to cliff */ uint256 public cliffDuration; /** * @dev a percentage that becomes available at the cliff, expressed as a number between 0 and 100 */ uint256 public cliffReleasePercentage; /** * @dev number of seconds from cliff to residue, over this period tokens become avialable gradually */ uint256 public slopeDuration; /** * @dev a percentage that becomes avilable over the gradual release period expressed as a number between 0 and 100 */ uint256 public slopeReleasePercentage; /** * @dev boolean indicating if owner has finished allocation. */ bool public allocationFinished; /** * @dev variable to keep track of cliff time. */ uint256 public cliffTime; /** * @dev variable to keep track of when the timelock ends. */ uint256 public timelockEndTime; /** * @dev mapping to keep track of what amount of tokens have been allocated to what address. */ mapping (address => uint256) public allocatedTokens; /** * @dev mapping to keep track of what amount of tokens have been withdrawn by what address. */ mapping (address => uint256) public withdrawnTokens; /** * @dev mapping to keep track of if withdrawls are paused for a given address. */ mapping (address => bool) public withdrawalPaused; /** * @dev constructor * @param _token address of ERC20 token that is being timelocked. * @param _startTime timestamp indicating when the unlocking of tokens start. * @param _cliffDuration number of seconds before any tokens are unlocked. * @param _cliffReleasePercent percentage of tokens that become available at the cliff time. * @param _slopeDuration number of seconds for gradual release of Tokens. * @param _slopeReleasePercentage percentage of tokens that are released gradually. */ function Timelock(ERC20Basic _token, uint256 _startTime, uint256 _cliffDuration, uint256 _cliffReleasePercent, uint256 _slopeDuration, uint256 _slopeReleasePercentage) public { // sanity checks require(_cliffReleasePercent.add(_slopeReleasePercentage) <= 100); require(_startTime > now); require(_token != address(0)); // defaults allocationFinished = false; // storing constructor params token = _token; startTime = _startTime; cliffDuration = _cliffDuration; cliffReleasePercentage = _cliffReleasePercent; slopeDuration = _slopeDuration; slopeReleasePercentage = _slopeReleasePercentage; // derived variables cliffTime = startTime.add(cliffDuration); timelockEndTime = cliffTime.add(slopeDuration); } /** * @dev helper method that allows owner to allocate tokens to an address. * @param _address beneficiary receiving the tokens. * @param _amount number of tokens being received by beneficiary. * @return boolean indicating function success. */ function allocateTokens(address _address, uint256 _amount) onlyOwner external returns (bool) { require(!allocationFinished); allocatedTokens[_address] = _amount; return true; } /** * @dev helper method that allows owner to mark allocation as done. * @return boolean indicating function success. */ function finishAllocation() onlyOwner external returns (bool) { allocationFinished = true; return true; } /** * @dev helper method that allows owner to pause withdrawls for any address. * @return boolean indicating function success. */ function pauseWithdrawal(address _address) onlyOwner external returns (bool) { withdrawalPaused[_address] = true; return true; } /** * @dev helper method that allows owner to unpause withdrawls for any address. * @return boolean indicating function success. */ function unpauseWithdrawal(address _address) onlyOwner external returns (bool) { withdrawalPaused[_address] = false; return true; } /** * @dev helper method that allows anyone to check amount that is available for withdrawl by a given address. * @param _address for which the user needs to check available amount for withdrawl. * @return uint256 number indicating the number of tokens available for withdrawl. */ function availableForWithdrawal(address _address) public view returns (uint256) { if (now < cliffTime) { return 0; } else if (now < timelockEndTime) { uint256 cliffTokens = (cliffReleasePercentage.mul(allocatedTokens[_address])).div(100); uint256 slopeTokens = (allocatedTokens[_address].mul(slopeReleasePercentage)).div(100); uint256 timeAtSlope = now.sub(cliffTime); uint256 slopeTokensByNow = (slopeTokens.mul(timeAtSlope)).div(slopeDuration); return (cliffTokens.add(slopeTokensByNow)).sub(withdrawnTokens[_address]); } else { return allocatedTokens[_address].sub(withdrawnTokens[_address]); } } /** * @dev helper method that allows a beneficiary to withdraw tokens that have vested for their address. * @return boolean indicating function success. */ function withdraw() external returns (bool) { require(!withdrawalPaused[msg.sender]); uint256 availableTokens = availableForWithdrawal(msg.sender); require (availableTokens > 0); withdrawnTokens[msg.sender] = withdrawnTokens[msg.sender].add(availableTokens); token.safeTransfer(msg.sender, availableTokens); return true; } }
0x606060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630f1a6444146101175780631b20d9cb14610140578063331350ee1461018d5780633ccfd60b146101ba578063505d29c3146101e757806354699a7b1461023857806365c59e7d1461028957806378e97925146102d657806386ce0285146102ff57806389c9c586146103595780638b4ce1e6146103825780638da5cb5b146103d3578063a31f79fb14610428578063a804da1814610451578063ba78a98a1461047a578063d85349f7146104a3578063e8c9a3e5146104cc578063e91e10af14610519578063f2fde38b14610546578063fc0c546a1461057f575b600080fd5b341561012257600080fd5b61012a6105d4565b6040518082815260200191505060405180910390f35b341561014b57600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506105da565b6040518082815260200191505060405180910390f35b341561019857600080fd5b6101a06105f2565b604051808215151515815260200191505060405180910390f35b34156101c557600080fd5b6101cd610671565b604051808215151515815260200191505060405180910390f35b34156101f257600080fd5b61021e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506107d1565b604051808215151515815260200191505060405180910390f35b341561024357600080fd5b61026f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061088f565b604051808215151515815260200191505060405180910390f35b341561029457600080fd5b6102c0600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108af565b6040518082815260200191505060405180910390f35b34156102e157600080fd5b6102e9610aee565b6040518082815260200191505060405180910390f35b341561030a57600080fd5b61033f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610af4565b604051808215151515815260200191505060405180910390f35b341561036457600080fd5b61036c610bbb565b6040518082815260200191505060405180910390f35b341561038d57600080fd5b6103b9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610bc1565b604051808215151515815260200191505060405180910390f35b34156103de57600080fd5b6103e6610c7f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561043357600080fd5b61043b610ca4565b6040518082815260200191505060405180910390f35b341561045c57600080fd5b610464610caa565b6040518082815260200191505060405180910390f35b341561048557600080fd5b61048d610cb0565b6040518082815260200191505060405180910390f35b34156104ae57600080fd5b6104b6610cb6565b6040518082815260200191505060405180910390f35b34156104d757600080fd5b610503600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cbc565b6040518082815260200191505060405180910390f35b341561052457600080fd5b61052c610cd4565b604051808215151515815260200191505060405180910390f35b341561055157600080fd5b61057d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ce7565b005b341561058a57600080fd5b610592610e3c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60085481565b600a6020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561064f57600080fd5b6001600760006101000a81548160ff0219169083151502179055506001905090565b600080600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156106cd57600080fd5b6106d6336108af565b90506000811115156106e757600080fd5b61073981600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e6290919063ffffffff16565b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506107c93382600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e809092919063ffffffff16565b600191505090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561082e57600080fd5b6000600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600c6020528060005260406000206000915054906101000a900460ff1681565b60008060008060006008544210156108ca5760009450610ae5565b600954421015610a515761093b606461092d600a60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600454610f5390919063ffffffff16565b610f8e90919063ffffffff16565b93506109a46064610996600654600a60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f5390919063ffffffff16565b610f8e90919063ffffffff16565b92506109bb60085442610fa990919063ffffffff16565b91506109e46005546109d68486610f5390919063ffffffff16565b610f8e90919063ffffffff16565b9050610a4a600b60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a3c8387610e6290919063ffffffff16565b610fa990919063ffffffff16565b9450610ae5565b610ae2600b60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fa990919063ffffffff16565b94505b50505050919050565b60025481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b5157600080fd5b600760009054906101000a900460ff16151515610b6d57600080fd5b81600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c1e57600080fd5b6001600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60065481565b60045481565b60095481565b60035481565b600b6020528060005260406000206000915090505481565b600760009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d4257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610d7e57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000808284019050838110151515610e7657fe5b8091505092915050565b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610f2b57600080fd5b6102c65a03f11515610f3c57600080fd5b505050604051805190501515610f4e57fe5b505050565b6000806000841415610f685760009150610f87565b8284029050828482811515610f7957fe5b04141515610f8357fe5b8091505b5092915050565b6000808284811515610f9c57fe5b0490508091505092915050565b6000828211151515610fb757fe5b8183039050929150505600a165627a7a723058206ca47df4cbe2a29be3b3f9d59731ff92ed9bccd4ceaca72779cf796a79d15e170029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
6,464
0x2dc2795426ede97c1230cd83c37cc2c475b13126
/** *Submitted for verification at Etherscan.io on 2021-07-05 */ /** 🎵Welcome to SoundInu!🎵 Crypto's first music app token! Telegram: https://t.me/soundinu Website: soundinu.io */ pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract SoundInu is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string public constant _name = "SoundInu"; string public constant _symbol = "SOINU"; uint8 private constant _decimals = 15; uint256 private _taxFee = 10; uint256 private _teamFee = 10; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } if(from != address(this)){ require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); } if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 10000000000* 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x6080604052600436106101235760003560e01c80638da5cb5b116100a0578063c3c8cd8011610064578063c3c8cd80146106d2578063c9567bf9146106e9578063d28d885214610700578063d543dbeb14610790578063dd62ed3e146107cb5761012a565b80638da5cb5b1461043b57806395d89b411461047c578063a9059cbb1461050c578063b09f12661461057d578063b515566a1461060d5761012a565b8063313ce567116100e7578063313ce5671461033d5780635932ead11461036b5780636fc3eaec146103a857806370a08231146103bf578063715018a6146104245761012a565b806306fdde031461012f578063095ea7b3146101bf57806318160ddd1461023057806323b872dd1461025b578063273123b7146102ec5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610850565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610184578082015181840152602081019050610169565b50505050905090810190601f1680156101b15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cb57600080fd5b50610218600480360360408110156101e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061088d565b60405180821515815260200191505060405180910390f35b34801561023c57600080fd5b506102456108ab565b6040518082815260200191505060405180910390f35b34801561026757600080fd5b506102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108bc565b60405180821515815260200191505060405180910390f35b3480156102f857600080fd5b5061033b6004803603602081101561030f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610995565b005b34801561034957600080fd5b50610352610ab8565b604051808260ff16815260200191505060405180910390f35b34801561037757600080fd5b506103a66004803603602081101561038e57600080fd5b81019080803515159060200190929190505050610ac1565b005b3480156103b457600080fd5b506103bd610ba6565b005b3480156103cb57600080fd5b5061040e600480360360208110156103e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c18565b6040518082815260200191505060405180910390f35b34801561043057600080fd5b50610439610d03565b005b34801561044757600080fd5b50610450610e89565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561048857600080fd5b50610491610eb2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d15780820151818401526020810190506104b6565b50505050905090810190601f1680156104fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561051857600080fd5b506105656004803603604081101561052f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610eef565b60405180821515815260200191505060405180910390f35b34801561058957600080fd5b50610592610f0d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d25780820151818401526020810190506105b7565b50505050905090810190601f1680156105ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061957600080fd5b506106d06004803603602081101561063057600080fd5b810190808035906020019064010000000081111561064d57600080fd5b82018360208201111561065f57600080fd5b8035906020019184602083028401116401000000008311171561068157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610f46565b005b3480156106de57600080fd5b506106e7611096565b005b3480156106f557600080fd5b506106fe611110565b005b34801561070c57600080fd5b5061071561178d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561075557808201518184015260208101905061073a565b50505050905090810190601f1680156107825780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561079c57600080fd5b506107c9600480360360208110156107b357600080fd5b81019080803590602001909291905050506117c6565b005b3480156107d757600080fd5b5061083a600480360360408110156107ee57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611975565b6040518082815260200191505060405180910390f35b60606040518060400160405280600881526020017f536f756e64496e75000000000000000000000000000000000000000000000000815250905090565b60006108a161089a6119fc565b8484611a04565b6001905092915050565b6000683635c9adc5dea00000905090565b60006108c9848484611bfb565b61098a846108d56119fc565b61098585604051806060016040528060288152602001613ee860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093b6119fc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245a9092919063ffffffff16565b611a04565b600190509392505050565b61099d6119fc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600f905090565b610ac96119fc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b89576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610be76119fc565b73ffffffffffffffffffffffffffffffffffffffff1614610c0757600080fd5b6000479050610c158161251a565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610cb357600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610cfe565b610cfb600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612615565b90505b919050565b610d0b6119fc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dcb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f534f494e55000000000000000000000000000000000000000000000000000000815250905090565b6000610f03610efc6119fc565b8484611bfb565b6001905092915050565b6040518060400160405280600581526020017f534f494e5500000000000000000000000000000000000000000000000000000081525081565b610f4e6119fc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461100e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b81518110156110925760016007600084848151811061102c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611011565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110d76119fc565b73ffffffffffffffffffffffffffffffffffffffff16146110f757600080fd5b600061110230610c18565b905061110d81612699565b50565b6111186119fc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff161561125b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506112eb30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611a04565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561133157600080fd5b505afa158015611345573d6000803e3d6000fd5b505050506040513d602081101561135b57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113ce57600080fd5b505afa1580156113e2573d6000803e3d6000fd5b505050506040513d60208110156113f857600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561147257600080fd5b505af1158015611486573d6000803e3d6000fd5b505050506040513d602081101561149c57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061153630610c18565b600080611541610e89565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b1580156115c657600080fd5b505af11580156115da573d6000803e3d6000fd5b50505050506040513d60608110156115f157600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff021916908315150217905550678ac7230489e800006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561174e57600080fd5b505af1158015611762573d6000803e3d6000fd5b505050506040513d602081101561177857600080fd5b81019080805190602001909291905050505050565b6040518060400160405280600881526020017f536f756e64496e7500000000000000000000000000000000000000000000000081525081565b6117ce6119fc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461188e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008111611904576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b611933606461192583683635c9adc5dea0000061298390919063ffffffff16565b612a0990919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613f5e6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b10576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613ea56022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613f396025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613e586023913960400191505060405180910390fd5b60008111611d60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613f106029913960400191505060405180910390fd5b611d68610e89565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611dd65750611da6610e89565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561239757601360179054906101000a900460ff161561203c573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e5857503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611eb25750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611f0c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561203b57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611f526119fc565b73ffffffffffffffffffffffffffffffffffffffff161480611fc85750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611fb06119fc565b73ffffffffffffffffffffffffffffffffffffffff16145b61203a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461212c5760145481111561207e57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156121225750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61212b57600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121d75750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561222d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156122455750601360179054906101000a900460ff165b156122dd5742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061229557600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006122e830610c18565b9050601360159054906101000a900460ff161580156123555750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561236d5750601360169054906101000a900460ff165b156123955761237b81612699565b60004790506000811115612393576123924761251a565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061243e5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561244857600090505b61245484848484612a53565b50505050565b6000838311158290612507576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156124cc5780820151818401526020810190506124b1565b50505050905090810190601f1680156124f95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61256a600284612a0990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612595573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6125e6600284612a0990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612611573d6000803e3d6000fd5b5050565b6000600a54821115612672576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613e7b602a913960400191505060405180910390fd5b600061267c612caa565b90506126918184612a0990919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156126ce57600080fd5b506040519080825280602002602001820160405280156126fd5781602001602082028036833780820191505090505b509050308160008151811061270e57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156127b057600080fd5b505afa1580156127c4573d6000803e3d6000fd5b505050506040513d60208110156127da57600080fd5b8101908080519060200190929190505050816001815181106127f857fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061285f30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a04565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015612923578082015181840152602081019050612908565b505050509050019650505050505050600060405180830381600087803b15801561294c57600080fd5b505af1158015612960573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156129965760009050612a03565b60008284029050828482816129a757fe5b04146129fe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613ec76021913960400191505060405180910390fd5b809150505b92915050565b6000612a4b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612cd5565b905092915050565b80612a6157612a60612d9b565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b045750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612b1957612b14848484612dde565b612c96565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612bbc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612bd157612bcc84848461303e565b612c95565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612c735750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612c8857612c8384848461329e565b612c94565b612c93848484613593565b5b5b5b80612ca457612ca361375e565b5b50505050565b6000806000612cb7613772565b91509150612cce8183612a0990919063ffffffff16565b9250505090565b60008083118290612d81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d46578082015181840152602081019050612d2b565b50505050905090810190601f168015612d735780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612d8d57fe5b049050809150509392505050565b6000600c54148015612daf57506000600d54145b15612db957612ddc565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612df087613a1f565b955095509550955095509550612e4e87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8790919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ee386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f7885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fc481613b59565b612fce8483613cfe565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061305087613a1f565b9550955095509550955095506130ae86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061314383600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131d885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061322481613b59565b61322e8483613cfe565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806132b087613a1f565b95509550955095509550955061330e87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8790919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133a386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061343883600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134cd85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061351981613b59565b6135238483613cfe565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806135a587613a1f565b95509550955095509550955061360386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061369885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506136e481613b59565b6136ee8483613cfe565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156139d4578260026000600984815481106137ac57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180613893575081600360006009848154811061382b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156138b157600a54683635c9adc5dea0000094509450505050613a1b565b61393a60026000600984815481106138c557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484613a8790919063ffffffff16565b92506139c5600360006009848154811061395057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483613a8790919063ffffffff16565b9150808060010191505061378d565b506139f3683635c9adc5dea00000600a54612a0990919063ffffffff16565b821015613a1257600a54683635c9adc5dea00000935093505050613a1b565b81819350935050505b9091565b6000806000806000806000806000613a3c8a600c54600d54613d38565b9250925092506000613a4c612caa565b90506000806000613a5f8e878787613dce565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613ac983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061245a565b905092915050565b600080828401905083811015613b4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613b63612caa565b90506000613b7a828461298390919063ffffffff16565b9050613bce81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613cf957613cb583600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613d1382600a54613a8790919063ffffffff16565b600a81905550613d2e81600b54613ad190919063ffffffff16565b600b819055505050565b600080600080613d646064613d56888a61298390919063ffffffff16565b612a0990919063ffffffff16565b90506000613d8e6064613d80888b61298390919063ffffffff16565b612a0990919063ffffffff16565b90506000613db782613da9858c613a8790919063ffffffff16565b613a8790919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613de7858961298390919063ffffffff16565b90506000613dfe868961298390919063ffffffff16565b90506000613e15878961298390919063ffffffff16565b90506000613e3e82613e308587613a8790919063ffffffff16565b613a8790919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212206f7b16a9730dd341a9e9cc79343640938845877cfd4497b5f4fe7f3e32ce807964736f6c634300060c0033
{"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"}]}}
6,465
0xd0b114084e016e88dd2cfeef0bc3c1a01697b7ca
pragma solidity >=0.8.0; // 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(uint(uint160(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(uint(uint160(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(uint(uint160(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(uint160(uint(_at(set._inner, index)))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); } contract EU21_Spain is Ownable { using SafeMath for uint; using EnumerableSet for EnumerableSet.AddressSet; event RewardsTransferred(address holder, uint amount); // EU21 token contract address address public constant tokenAddress = 0x87ea1F06d7293161B9ff080662c1b0DF775122D3; // amount disbursed per victory uint public amountToDisburse = 1000000000000000000000; // 1000 EU21 PER VICTORY // total games rewards for each pool uint public totalReward = 7000000000000000000000; // 7000 EU21 TOTAL GAMES REWARDS (EXCLUDING THE GRAND PRIZE) // unstaking possible after ... uint public constant unstakeTime = 37 days; // claiming possible after ... uint public constant claimTime = 37 days; uint public totalClaimedRewards = 0; uint public totalDeposited = 0; uint public totalDisbursed = 0; bool public ended ; uint public startTime = block.timestamp; EnumerableSet.AddressSet private holders; mapping (address => uint) public depositedTokens; mapping (address => uint) public pending; mapping (address => uint) public totalEarnedTokens; mapping (address => uint) public rewardEnded; function disburse () public onlyOwner returns (bool){ require(!ended, "Staking already ended"); address _hold; uint _add; for(uint i = 0; i < holders.length(); i = i.add(1)){ _hold = holders.at(i); _add = depositedTokens[_hold].mul(amountToDisburse).div(totalDeposited); pending[_hold] = pending[_hold].add(_add); } totalDisbursed = totalDisbursed.add(amountToDisburse); return true; } //Disburse and End the staking pool function disburseAndEnd(uint _finalDisburseAmount) public onlyOwner returns (bool){ require(!ended, "Staking already ended"); require(_finalDisburseAmount > 0); address _hold; uint _add; for(uint i = 0; i < holders.length(); i = i.add(1)){ _hold = holders.at(i); _add = depositedTokens[_hold].mul(_finalDisburseAmount).div(totalDeposited); pending[_hold] = pending[_hold].add(_add); } totalDisbursed = totalDisbursed.add(_finalDisburseAmount); ended = true; return true; } //End the staking pool function end() public onlyOwner returns (bool){ require(!ended, "Staking already ended"); ended = true; return true; } function updateAccount(address account) private { uint pendingDivs = getPendingDivs(account); if (pendingDivs > 0) { pending[account] = 0; depositedTokens[account] = depositedTokens[account].add(pendingDivs); totalDeposited = totalDeposited.add(pendingDivs); totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs); totalClaimedRewards = totalClaimedRewards.add(pendingDivs); } } function getPendingDivs(address _holder) public view returns (uint) { if (!holders.contains(_holder)) return 0; uint pendingDivs = pending[_holder]; return pendingDivs; } function getNumberOfHolders() public view returns (uint) { return holders.length(); } function deposit(uint amountToStake) public { require(!ended, "Staking has ended"); require(amountToStake > 0, "Cannot deposit 0 Tokens"); require(Token(tokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance"); updateAccount(msg.sender); depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToStake); totalDeposited = totalDeposited.add(amountToStake); if (!holders.contains(msg.sender)) { holders.add(msg.sender); } } function claim() public{ require(holders.contains(msg.sender)); require(block.timestamp.sub(startTime) > claimTime || ended, "Not yet."); require(pending[msg.sender] > 0); uint _reward = pending[msg.sender]; pending[msg.sender] = 0; require(Token(tokenAddress).transfer(msg.sender, _reward), "Could not transfer tokens."); totalClaimedRewards = totalClaimedRewards.add(_reward); totalEarnedTokens[msg.sender] = totalEarnedTokens[msg.sender].add(_reward); if(depositedTokens[msg.sender] == 0){ holders.remove(msg.sender); } } function withdraw(uint _amount) public{ require(block.timestamp.sub(startTime) > unstakeTime || ended, "Not yet."); require(depositedTokens[msg.sender] >= _amount); require(_amount > 0); depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(_amount); totalDeposited = totalDeposited.sub(_amount); require(Token(tokenAddress).transfer(msg.sender, _amount), "Could not transfer tokens."); if(depositedTokens[msg.sender] == 0 && pending[msg.sender] == 0){ holders.remove(msg.sender); } } /* function withdrawAllAfterEnd() public { require(ended, "Staking has not ended"); uint _pend = pending[msg.sender]; uint amountToWithdraw = _pend.add(depositedTokens[msg.sender]); require(amountToWithdraw >= 0, "Invalid amount to withdraw"); pending[msg.sender] = 0; depositedTokens[msg.sender] = 0; totalDeposited = totalDeposited.sub(depositedTokens[msg.sender]); require(Token(tokenAddress).transfer(msg.sender, amountToWithdraw), "Could not transfer tokens."); totalClaimedRewards = totalClaimedRewards.add(_pend); totalEarnedTokens[msg.sender] = totalEarnedTokens[msg.sender].add(_pend); holders.remove(msg.sender); }*/ function getStakersList(uint startIndex, uint endIndex) public view returns (address[] memory stakers, uint[] memory stakingTimestamps, uint[] memory lastClaimedTimeStamps, uint[] memory stakedTokens) { require (startIndex < endIndex); uint length = endIndex.sub(startIndex); address[] memory _stakers = new address[](length); uint[] memory _stakingTimestamps = new uint[](length); uint[] memory _lastClaimedTimeStamps = new uint[](length); uint[] memory _stakedTokens = new uint[](length); for (uint i = startIndex; i < endIndex; i = i.add(1)) { address staker = holders.at(i); uint listIndex = i.sub(startIndex); _stakers[listIndex] = staker; _stakedTokens[listIndex] = depositedTokens[staker]; } return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens); } // function to allow admin to claim *other* ERC20 tokens sent to this contract (by mistake) function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner { require (_tokenAddr != tokenAddress , "Cannot Transfer Out this token"); Token(_tokenAddr).transfer(_to, _amount); } }
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c806398896d10116100de578063c3e5ae5311610097578063d9eaa3ed11610071578063d9eaa3ed1461047c578063efbe1c1c146104ac578063f2fde38b146104ca578063ff50abdc146104e65761018e565b8063c3e5ae5314610410578063d578ceab14610440578063d7e527451461045e5761018e565b806398896d101461033a5780639d76ea581461036a578063abc6fd0b14610388578063b6b55f25146103a6578063bf95c78d146103c2578063c326bf4f146103e05761018e565b80635eebea201161014b578063750142e611610125578063750142e6146102c257806378e97925146102e05780638da5cb5b146102fe5780639232eed31461031c5761018e565b80635eebea20146102465780636270cd18146102765780636a395ccb146102a65761018e565b806312fa6feb146101935780631911cf4a146101b157806327b3bf11146101e45780632e1a7d4d14610202578063308feec31461021e5780634e71d92d1461023c575b600080fd5b61019b610504565b6040516101a8919061253b565b60405180910390f35b6101cb60048036038101906101c691906121d4565b610517565b6040516101db94939291906124da565b60405180910390f35b6101ec61087a565b6040516101f99190612656565b60405180910390f35b61021c600480360381019061021791906121ab565b610881565b005b610226610b86565b6040516102339190612656565b60405180910390f35b610244610b97565b005b610260600480360381019061025b919061210a565b610eea565b60405161026d9190612656565b60405180910390f35b610290600480360381019061028b919061210a565b610f02565b60405161029d9190612656565b60405180910390f35b6102c060048036038101906102bb9190612133565b610f1a565b005b6102ca611088565b6040516102d79190612656565b60405180910390f35b6102e861108e565b6040516102f59190612656565b60405180910390f35b610306611094565b604051610313919061245f565b60405180910390f35b6103246110b8565b6040516103319190612656565b60405180910390f35b610354600480360381019061034f919061210a565b6110be565b6040516103619190612656565b60405180910390f35b61037261112f565b60405161037f919061245f565b60405180910390f35b610390611147565b60405161039d919061253b565b60405180910390f35b6103c060048036038101906103bb91906121ab565b611360565b005b6103ca6115bf565b6040516103d79190612656565b60405180910390f35b6103fa60048036038101906103f5919061210a565b6115c5565b6040516104079190612656565b60405180910390f35b61042a6004803603810190610425919061210a565b6115dd565b6040516104379190612656565b60405180910390f35b6104486115f5565b6040516104559190612656565b60405180910390f35b6104666115fb565b6040516104739190612656565b60405180910390f35b610496600480360381019061049191906121ab565b611602565b6040516104a3919061253b565b60405180910390f35b6104b4611841565b6040516104c1919061253b565b60405180910390f35b6104e460048036038101906104df919061210a565b61190e565b005b6104ee611a5d565b6040516104fb9190612656565b60405180910390f35b600660009054906101000a900460ff1681565b60608060608084861061052957600080fd5b600061053e8787611a6390919063ffffffff16565b905060008167ffffffffffffffff811115610582577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156105b05781602001602082028036833780820191505090505b50905060008267ffffffffffffffff8111156105f5577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156106235781602001602082028036833780820191505090505b50905060008367ffffffffffffffff811115610668577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156106965781602001602082028036833780820191505090505b50905060008467ffffffffffffffff8111156106db577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156107095781602001602082028036833780820191505090505b50905060008b90505b8a81101561085f576000610730826008611ab090919063ffffffff16565b905060006107478e84611a6390919063ffffffff16565b905081878281518110610783577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054848281518110610836577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181815250505050610858600182611aca90919063ffffffff16565b9050610712565b50838383839850985098509850505050505092959194509250565b6230c78081565b6230c78061089a60075442611a6390919063ffffffff16565b11806108b25750600660009054906101000a900460ff165b6108f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108e890612636565b60405180910390fd5b80600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561093d57600080fd5b6000811161094a57600080fd5b61099c81600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6390919063ffffffff16565b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109f481600454611a6390919063ffffffff16565b6004819055507387ea1f06d7293161b9ff080662c1b0df775122d373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401610a499291906124b1565b602060405180830381600087803b158015610a6357600080fd5b505af1158015610a77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9b9190612182565b610ada576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad1906125b6565b60405180910390fd5b6000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610b6857506000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15610b8357610b81336008611b1c90919063ffffffff16565b505b50565b6000610b926008611b4c565b905090565b610bab336008611b6190919063ffffffff16565b610bb457600080fd5b6230c780610bcd60075442611a6390919063ffffffff16565b1180610be55750600660009054906101000a900460ff165b610c24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1b90612636565b60405180910390fd5b6000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411610c7057600080fd5b6000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507387ea1f06d7293161b9ff080662c1b0df775122d373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401610d489291906124b1565b602060405180830381600087803b158015610d6257600080fd5b505af1158015610d76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9a9190612182565b610dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd0906125b6565b60405180910390fd5b610dee81600354611aca90919063ffffffff16565b600381905550610e4681600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aca90919063ffffffff16565b600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610ee757610ee5336008611b1c90919063ffffffff16565b505b50565b600b6020528060005260406000206000915090505481565b600c6020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f7257600080fd5b7387ea1f06d7293161b9ff080662c1b0df775122d373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ff5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fec90612596565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b81526004016110309291906124b1565b602060405180830381600087803b15801561104a57600080fd5b505af115801561105e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110829190612182565b50505050565b60025481565b60075481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015481565b60006110d4826008611b6190919063ffffffff16565b6110e1576000905061112a565b6000600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050809150505b919050565b7387ea1f06d7293161b9ff080662c1b0df775122d381565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111a257600080fd5b600660009054906101000a900460ff16156111f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e990612576565b60405180910390fd5b60008060005b6112026008611b4c565b8110156113395761121d816008611ab090919063ffffffff16565b9250611287600454611279600154600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9190919063ffffffff16565b611bf890919063ffffffff16565b91506112db82600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aca90919063ffffffff16565b600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611332600182611aca90919063ffffffff16565b90506111f8565b50611351600154600554611aca90919063ffffffff16565b60058190555060019250505090565b600660009054906101000a900460ff16156113b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a7906125d6565b60405180910390fd5b600081116113f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ea906125f6565b60405180910390fd5b7387ea1f06d7293161b9ff080662c1b0df775122d373ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b81526004016114449392919061247a565b602060405180830381600087803b15801561145e57600080fd5b505af1158015611472573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114969190612182565b6114d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114cc90612616565b60405180910390fd5b6114de33611c13565b61153081600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aca90919063ffffffff16565b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061158881600454611aca90919063ffffffff16565b6004819055506115a2336008611b6190919063ffffffff16565b6115bc576115ba336008611dd390919063ffffffff16565b505b50565b60055481565b600a6020528060005260406000206000915090505481565b600d6020528060005260406000206000915090505481565b60035481565b6230c78081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461165d57600080fd5b600660009054906101000a900460ff16156116ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a490612576565b60405180910390fd5b600082116116ba57600080fd5b60008060005b6116ca6008611b4c565b8110156117ff576116e5816008611ab090919063ffffffff16565b925061174d60045461173f87600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9190919063ffffffff16565b611bf890919063ffffffff16565b91506117a182600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aca90919063ffffffff16565b600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117f8600182611aca90919063ffffffff16565b90506116c0565b5061181584600554611aca90919063ffffffff16565b6005819055506001600660006101000a81548160ff021916908315150217905550600192505050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461189c57600080fd5b600660009054906101000a900460ff16156118ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e390612576565b60405180910390fd5b6001600660006101000a81548160ff0219169083151502179055506001905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461196657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156119a057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60045481565b600082821115611a9c577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b8183611aa891906127d5565b905092915050565b6000611abf8360000183611e03565b60001c905092915050565b6000808284611ad991906126f4565b905083811015611b12577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b8091505092915050565b6000611b44836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611e9d565b905092915050565b6000611b5a82600001612027565b9050919050565b6000611b89836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612038565b905092915050565b6000808284611ba0919061277b565b90506000841480611bbb5750828482611bb9919061274a565b145b611bee577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b8091505092915050565b6000808284611c07919061274a565b90508091505092915050565b6000611c1e826110be565b90506000811115611dcf576000600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611cc081600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aca90919063ffffffff16565b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d1881600454611aca90919063ffffffff16565b600481905550611d7081600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aca90919063ffffffff16565b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611dc881600354611aca90919063ffffffff16565b6003819055505b5050565b6000611dfb836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61205b565b905092915050565b600081836000018054905011611e4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4590612556565b60405180910390fd5b826000018281548110611e8a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154905092915050565b6000808360010160008481526020019081526020016000205490506000811461201b576000600182611ecf91906127d5565b9050600060018660000180549050611ee791906127d5565b90506000866000018281548110611f27577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154905080876000018481548110611f71577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200181905550600183611f8c91906126f4565b8760010160008381526020019081526020016000208190555086600001805480611fdf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612021565b60009150505b92915050565b600081600001805490509050919050565b600080836001016000848152602001908152602001600020541415905092915050565b60006120678383612038565b6120c05782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506120c5565b600090505b92915050565b6000813590506120da81612a1d565b92915050565b6000815190506120ef81612a34565b92915050565b60008135905061210481612a4b565b92915050565b60006020828403121561211c57600080fd5b600061212a848285016120cb565b91505092915050565b60008060006060848603121561214857600080fd5b6000612156868287016120cb565b9350506020612167868287016120cb565b9250506040612178868287016120f5565b9150509250925092565b60006020828403121561219457600080fd5b60006121a2848285016120e0565b91505092915050565b6000602082840312156121bd57600080fd5b60006121cb848285016120f5565b91505092915050565b600080604083850312156121e757600080fd5b60006121f5858286016120f5565b9250506020612206858286016120f5565b9150509250929050565b600061221c8383612240565b60208301905092915050565b60006122348383612441565b60208301905092915050565b61224981612809565b82525050565b61225881612809565b82525050565b600061226982612691565b61227381856126c1565b935061227e83612671565b8060005b838110156122af5781516122968882612210565b97506122a1836126a7565b925050600181019050612282565b5085935050505092915050565b60006122c78261269c565b6122d181856126d2565b93506122dc83612681565b8060005b8381101561230d5781516122f48882612228565b97506122ff836126b4565b9250506001810190506122e0565b5085935050505092915050565b6123238161281b565b82525050565b60006123366022836126e3565b9150612341826128af565b604082019050919050565b60006123596015836126e3565b9150612364826128fe565b602082019050919050565b600061237c601e836126e3565b915061238782612927565b602082019050919050565b600061239f601a836126e3565b91506123aa82612950565b602082019050919050565b60006123c26011836126e3565b91506123cd82612979565b602082019050919050565b60006123e56017836126e3565b91506123f0826129a2565b602082019050919050565b6000612408601c836126e3565b9150612413826129cb565b602082019050919050565b600061242b6008836126e3565b9150612436826129f4565b602082019050919050565b61244a81612847565b82525050565b61245981612847565b82525050565b6000602082019050612474600083018461224f565b92915050565b600060608201905061248f600083018661224f565b61249c602083018561224f565b6124a96040830184612450565b949350505050565b60006040820190506124c6600083018561224f565b6124d36020830184612450565b9392505050565b600060808201905081810360008301526124f4818761225e565b9050818103602083015261250881866122bc565b9050818103604083015261251c81856122bc565b9050818103606083015261253081846122bc565b905095945050505050565b6000602082019050612550600083018461231a565b92915050565b6000602082019050818103600083015261256f81612329565b9050919050565b6000602082019050818103600083015261258f8161234c565b9050919050565b600060208201905081810360008301526125af8161236f565b9050919050565b600060208201905081810360008301526125cf81612392565b9050919050565b600060208201905081810360008301526125ef816123b5565b9050919050565b6000602082019050818103600083015261260f816123d8565b9050919050565b6000602082019050818103600083015261262f816123fb565b9050919050565b6000602082019050818103600083015261264f8161241e565b9050919050565b600060208201905061266b6000830184612450565b92915050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b60006126ff82612847565b915061270a83612847565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561273f5761273e612851565b5b828201905092915050565b600061275582612847565b915061276083612847565b9250826127705761276f612880565b5b828204905092915050565b600061278682612847565b915061279183612847565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156127ca576127c9612851565b5b828202905092915050565b60006127e082612847565b91506127eb83612847565b9250828210156127fe576127fd612851565b5b828203905092915050565b600061281482612827565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008201527f6473000000000000000000000000000000000000000000000000000000000000602082015250565b7f5374616b696e6720616c726561647920656e6465640000000000000000000000600082015250565b7f43616e6e6f74205472616e73666572204f7574207468697320746f6b656e0000600082015250565b7f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000600082015250565b7f5374616b696e672068617320656e646564000000000000000000000000000000600082015250565b7f43616e6e6f74206465706f736974203020546f6b656e73000000000000000000600082015250565b7f496e73756666696369656e7420546f6b656e20416c6c6f77616e636500000000600082015250565b7f4e6f74207965742e000000000000000000000000000000000000000000000000600082015250565b612a2681612809565b8114612a3157600080fd5b50565b612a3d8161281b565b8114612a4857600080fd5b50565b612a5481612847565b8114612a5f57600080fd5b5056fea2646970667358221220d3ad65bb38661f63178ceeb91744cf5e29451f37f090c0f5d08d87740a59318c64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,466
0x03f9ae4ac3a7f5ccbf657f4ebdad58d3082f6ca9
/** *Submitted for verification at Etherscan.io on 2021-04-08 */ // SPDX-License-Identifier: MIT // by William Hilton (https://github.com/wmhilton) // written using remix.ethereum.org pragma solidity >=0.8.3 <0.9.0; /** * @dev ERC-721 interface for accepting safe transfers. * See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md. */ interface ERC721TokenReceiver { function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes calldata _data) external returns(bytes4); } /** * @title NFT * @dev A simple 1 of 1 NFT implementation */ contract ERC721Token { /** * @dev Emits when ownership of any NFT changes by any mechanism. This event emits when NFTs are * created (`from` == 0) and destroyed (`to` == 0). Exception: during contract creation, any * number of NFTs may be created and assigned without emitting Transfer. At the time of any * transfer, the approved address for that NFT (if any) is reset to none. */ event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId); /** * @dev This emits when the approved address for an NFT is changed or reaffirmed. The zero * address indicates there is no approved address. When a Transfer event emits, this also * indicates that the approved address for that NFT (if any) is reset to none. */ event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId); /** * @dev This emits when an operator is enabled or disabled for an owner. The operator can manage * all NFTs of the owner. */ event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); uint256 internal count = 0; uint256 internal burned = 0; mapping (uint256 => address) internal owners; mapping (uint256 => string) internal tokenURIs; mapping (uint256 => address) internal approveds; mapping (address => mapping (address => bool)) internal operators; // This is pretty useless but necessary to be spec compliant mapping (address => uint256) internal balances; // This keeps users from accidentally uploading the same NFT twice mapping (string => bool) internal usedTokenURIs; /** * @dev Set contract deployer as owner */ constructor() {} function mint(string calldata _tokenURI) public returns (uint256) { uint256 oldCount = count; count++; require(count > oldCount && bytes(_tokenURI).length > 0 && usedTokenURIs[_tokenURI] != true); owners[count] = msg.sender; balances[msg.sender]++; tokenURIs[count] = _tokenURI; usedTokenURIs[_tokenURI] = true; emit Transfer(address(0), msg.sender, count); return count; } function burn(uint256 _tokenId) public { address _owner = owners[_tokenId]; require( _owner != address(0) && (msg.sender == _owner || operators[_owner][msg.sender] || msg.sender == approveds[_tokenId]) ); owners[_tokenId] = address(0); balances[_owner]--; approveds[_tokenId] = address(0); burned++; emit Transfer(_owner, address(0), _tokenId); } function name() public pure returns (string memory) { return "NFTs 4 All"; } function symbol() public pure returns (string memory) { return ""; } function decimals() public pure returns (uint8) { return 0; } function totalSupply() public view returns (uint256) { return count - burned; } /** * @dev Returns a distinct Uniform Resource Identifier (URI) for a given asset. It Throws if * `_tokenId` is not a valid NFT. URIs are defined in RFC3986. The URI may point to a JSON file * that conforms to the "ERC721 Metadata JSON Schema". * @return URI of _tokenId. */ function tokenURI(uint256 _tokenId) public view returns (string memory) { string memory _tokenURI = tokenURIs[_tokenId]; require(bytes(_tokenURI).length != 0); return _tokenURI; } /** * @dev Returns the number of NFTs owned by `_owner`. NFTs assigned to the zero address are * considered invalid, and this function throws for queries about the zero address. * @param _owner Address for whom to query the balance. * @return Balance of _owner. */ function balanceOf(address _owner) public view returns (uint256) { require(_owner != address(0)); return balances[_owner]; } /** * @dev Returns the address of the owner of the NFT. NFTs assigned to the zero address are * considered invalid, and queries about them do throw. * @param _tokenId The identifier for an NFT. * @return Address of _tokenId owner. */ function ownerOf(uint256 _tokenId) public view returns (address) { address _owner = owners[_tokenId]; require(_owner != address(0)); return _owner; } /** * @dev Set or reaffirm the approved address for an NFT. * @notice The zero address indicates there is no approved address. Throws unless `msg.sender` is * the current NFT owner, or an authorized operator of the current owner. * @param _approved The new approved NFT controller. * @param _tokenId The NFT to approve. */ function approve(address _approved, uint256 _tokenId) public { address _owner = owners[_tokenId]; require(_owner != address(0) && (msg.sender == _owner || operators[_owner][msg.sender])); approveds[_tokenId] = _approved; emit Approval(_owner, _approved, _tokenId); } /** * @dev Get the approved address for a single NFT. * @notice Throws if `_tokenId` is not a valid NFT. * @param _tokenId The NFT to find the approved address for. * @return Address that _tokenId is approved for. */ function getApproved(uint256 _tokenId) public view returns (address) { address _owner = owners[_tokenId]; require(_owner != address(0)); address _approved = approveds[_tokenId]; return _approved; } /** * @dev Throws unless `msg.sender` is the current owner, an authorized operator, or the approved * address for this NFT. Throws if `_from` is not the current owner. Throws if `_to` is the zero * address. Throws if `_tokenId` is not a valid NFT. * @notice The caller is responsible to confirm that `_to` is capable of receiving NFTs or else * they may be permanently lost. * @param _from The current owner of the NFT. * @param _to The new owner. * @param _tokenId The NFT to transfer. */ function transferFrom(address _from, address _to, uint256 _tokenId) public { address _owner = owners[_tokenId]; require( _owner != address(0) && (msg.sender == _owner || operators[_owner][msg.sender] || msg.sender == approveds[_tokenId]) && _from == _owner && _to != address(0) ); owners[_tokenId] = _to; balances[_from]--; balances[_to]++; approveds[_tokenId] = address(0); emit Transfer(_from, _to, _tokenId); } /** * @dev Transfers the ownership of an NFT from one address to another address. * @notice Throws unless `msg.sender` is the current owner, an authorized operator, or the * approved address for this NFT. Throws if `_from` is not the current owner. Throws if `_to` is * the zero address. Throws if `_tokenId` is not a valid NFT. When transfer is complete, this * function checks if `_to` is a smart contract (code size > 0). If so, it calls * `onERC721Received` on `_to` and throws if the return value is not * `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))`. * @param _from The current owner of the NFT. * @param _to The new owner. * @param _tokenId The NFT to transfer. * @param _data Additional data with no specified format, sent in call to `_to`. */ function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes calldata _data) public { _safeTransferFrom(_from, _to, _tokenId, _data); } /** * @dev Transfers the ownership of an NFT from one address to another address. * @notice This works identically to the other function with an extra data parameter, except this * function just sets data to "" * @param _from The current owner of the NFT. * @param _to The new owner. * @param _tokenId The NFT to transfer. */ function safeTransferFrom(address _from, address _to, uint256 _tokenId) public { _safeTransferFrom(_from, _to, _tokenId, ""); } function _safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes memory _data) private { transferFrom(_from, _to, _tokenId); if (isContract(_to)) { bytes4 retval = ERC721TokenReceiver(_to).onERC721Received(msg.sender, _from, _tokenId, _data); // Return value of a smart contract that can receive NFT. // Equal to: bytes4(keccak256("onERC721Received(address,address,uint256,bytes)")). require(retval == 0x150b7a02); } } /** * @dev Enables or disables approval for a third party ("operator") to manage all of * `msg.sender`'s assets. It also emits the ApprovalForAll event. * @notice The contract MUST allow multiple operators per owner. * @param _operator Address to add to the set of authorized operators. * @param _approved True if the operators is approved, false to revoke approval. */ function setApprovalForAll(address _operator, bool _approved) public { operators[msg.sender][_operator] = _approved; emit ApprovalForAll(msg.sender, _operator, _approved); } /** * @dev Returns true if `_operator` is an approved operator for `_owner`, false otherwise. * @param _owner The address that owns the NFTs. * @param _operator The address that acts on behalf of the owner. * @return True if approved for all, false otherwise. */ function isApprovedForAll(address _owner, address _operator) public view returns (bool) { return operators[_owner][_operator]; } /** * @dev Function to check which interfaces are suported by this contract. * @param _interfaceID Id of the interface. * @return True if _interfaceID is supported, false otherwise. */ function supportsInterface(bytes4 _interfaceID) public pure returns (bool) { // 0x80ac58cd is ERC721 (the Non-Fungible Token Standard) // 0x01ffc9a7 is ERC165 (the Standard Interface Detection) return _interfaceID == 0x80ac58cd || _interfaceID == 0x01ffc9a7; } /** * @dev Returns whether the target address is a contract. * @param _addr Address to check. * @return addressCheck True if _addr is a contract, false if not. */ function isContract(address _addr) private view returns (bool addressCheck) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(_addr) } // solhint-disable-line addressCheck = (codehash != 0x0 && codehash != accountHash); } } //transaction cost 1098930 //execution cost 784430
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c806342966c68116100a2578063a22cb46511610071578063a22cb4651461023f578063b88d4fde14610252578063c87b56dd14610265578063d85d3d2714610278578063e985e9c51461028b5761010b565b806342966c68146101f25780636352211e1461020557806370a082311461021857806395d89b411461022b5761010b565b806318160ddd116100de57806318160ddd146101a757806323b872dd146101bd578063313ce567146101d057806342842e0e146101df5761010b565b806301ffc9a71461011057806306fdde0314610138578063081812fc14610167578063095ea7b314610192575b600080fd5b61012361011e366004610d22565b6102c7565b60405190151581526020015b60405180910390f35b60408051808201909152600a8152691391951cc80d08105b1b60b21b60208201525b60405161012f9190610e4a565b61017a610175366004610d9a565b610300565b6040516001600160a01b03909116815260200161012f565b6101a56101a0366004610cf9565b61033f565b005b6101af610400565b60405190815260200161012f565b6101a56101cb366004610c17565b610417565b6040516000815260200161012f565b6101a56101ed366004610c17565b61059b565b6101a5610200366004610d9a565b6105bb565b61017a610213366004610d9a565b6106ef565b6101af610226366004610bc4565b610711565b60408051602081019091526000815261015a565b6101a561024d366004610cbf565b610742565b6101a5610260366004610c52565b6107ae565b61015a610273366004610d9a565b6107f7565b6101af610286366004610d5a565b6108a4565b610123610299366004610be5565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b60006380ac58cd60e01b6001600160e01b0319831614806102f857506301ffc9a760e01b6001600160e01b03198316145b90505b919050565b6000818152600260205260408120546001600160a01b03168061032257600080fd5b50506000908152600460205260409020546001600160a01b031690565b6000818152600260205260409020546001600160a01b0316801580159061039b5750336001600160a01b038216148061039b57506001600160a01b038116600090815260056020908152604080832033845290915290205460ff165b6103a457600080fd5b60008281526004602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60006001546000546104129190610e5d565b905090565b6000818152600260205260409020546001600160a01b031680158015906104945750336001600160a01b038216148061047357506001600160a01b038116600090815260056020908152604080832033845290915290205460ff165b8061049457506000828152600460205260409020546001600160a01b031633145b80156104b15750806001600160a01b0316846001600160a01b0316145b80156104c557506001600160a01b03831615155b6104ce57600080fd5b600082815260026020908152604080832080546001600160a01b0319166001600160a01b0388811691909117909155871683526006909152812080549161051483610e74565b90915550506001600160a01b038316600090815260066020526040812080549161053d83610ec6565b909155505060008281526004602052604080822080546001600160a01b03191690555183916001600160a01b0386811692908816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a450505050565b6105b6838383604051806020016040528060008152506109cc565b505050565b6000818152600260205260409020546001600160a01b031680158015906106385750336001600160a01b038216148061061757506001600160a01b038116600090815260056020908152604080832033845290915290205460ff165b8061063857506000828152600460205260409020546001600160a01b031633145b61064157600080fd5b600082815260026020908152604080832080546001600160a01b03191690556001600160a01b03841683526006909152812080549161067f83610e74565b9091555050600082815260046020526040812080546001600160a01b031916905560018054916106ae83610ec6565b909155505060405182906000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000818152600260205260408120546001600160a01b0316806102f857600080fd5b60006001600160a01b03821661072657600080fd5b506001600160a01b031660009081526006602052604090205490565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6107f085858585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506109cc92505050565b5050505050565b60008181526003602052604081208054606092919061081590610e8b565b80601f016020809104026020016040519081016040528092919081815260200182805461084190610e8b565b801561088e5780601f106108635761010080835404028352916020019161088e565b820191906000526020600020905b81548152906001019060200180831161087157829003601f168201915b505050505090508051600014156102f857600080fd5b600080548082806108b483610ec6565b9190505550806000541180156108c957508215155b80156108fc5750600784846040516108e2929190610dfd565b9081526040519081900360200190205460ff161515600114155b61090557600080fd5b60008054815260026020908152604080832080546001600160a01b0319163390811790915583526006909152812080549161093f83610ec6565b909155505060008054815260036020526040902061095e908585610acd565b50600160078585604051610973929190610dfd565b908152604051908190036020018120805492151560ff199093169290921790915560008054913391907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4505060005492915050565b6109d7848484610417565b6109e083610a91565b15610a8b57604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290610a1a903390899088908890600401610e0d565b602060405180830381600087803b158015610a3457600080fd5b505af1158015610a48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6c9190610d3e565b9050630a85bd0160e11b6001600160e01b03198216146107f057600080fd5b50505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708115801590610ac55750808214155b949350505050565b828054610ad990610e8b565b90600052602060002090601f016020900481019282610afb5760008555610b41565b82601f10610b145782800160ff19823516178555610b41565b82800160010185558215610b41579182015b82811115610b41578235825591602001919060010190610b26565b50610b4d929150610b51565b5090565b5b80821115610b4d5760008155600101610b52565b80356001600160a01b03811681146102fb57600080fd5b60008083601f840112610b8e578182fd5b50813567ffffffffffffffff811115610ba5578182fd5b602083019150836020828501011115610bbd57600080fd5b9250929050565b600060208284031215610bd5578081fd5b610bde82610b66565b9392505050565b60008060408385031215610bf7578081fd5b610c0083610b66565b9150610c0e60208401610b66565b90509250929050565b600080600060608486031215610c2b578081fd5b610c3484610b66565b9250610c4260208501610b66565b9150604084013590509250925092565b600080600080600060808688031215610c69578081fd5b610c7286610b66565b9450610c8060208701610b66565b935060408601359250606086013567ffffffffffffffff811115610ca2578182fd5b610cae88828901610b7d565b969995985093965092949392505050565b60008060408385031215610cd1578182fd5b610cda83610b66565b915060208301358015158114610cee578182fd5b809150509250929050565b60008060408385031215610d0b578182fd5b610d1483610b66565b946020939093013593505050565b600060208284031215610d33578081fd5b8135610bde81610ef7565b600060208284031215610d4f578081fd5b8151610bde81610ef7565b60008060208385031215610d6c578182fd5b823567ffffffffffffffff811115610d82578283fd5b610d8e85828601610b7d565b90969095509350505050565b600060208284031215610dab578081fd5b5035919050565b60008151808452815b81811015610dd757602081850181015186830182015201610dbb565b81811115610de85782602083870101525b50601f01601f19169290920160200192915050565b6000828483379101908152919050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090610e4090830184610db2565b9695505050505050565b600060208252610bde6020830184610db2565b600082821015610e6f57610e6f610ee1565b500390565b600081610e8357610e83610ee1565b506000190190565b600181811c90821680610e9f57607f821691505b60208210811415610ec057634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415610eda57610eda610ee1565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160e01b031981168114610f0d57600080fd5b5056fea2646970667358221220a764e137749306e15fd098b7343e196f10443d589d5b59a0a839cb2261389b9564736f6c63430008030033
{"success": true, "error": null, "results": {}}
6,467
0x807189b391ebaaa859b579cdbdf57f44da8a4b60
/** *Submitted for verification at Etherscan.io on 2022-03-09 */ // t.me/flokisatoshieth // We are donating ETH to 10 random holders every 2 hours // // 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 FlokiSatoshi is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Floki Satoshi"; string private constant _symbol = "FLOKISAT"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 8; //Sell Fee uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 8; //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(0x0Fb931FD749bB7cdeAf973402bEd8Da179065FE5);///////////////////////////////////////////////// address payable private _marketingAddress = payable(0x0Fb931FD749bB7cdeAf973402bEd8Da179065FE5);/////////////////////////////////////////////////// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 200000 * 10**9; //2% uint256 public _maxWalletSize = 200000 * 10**9; //2% uint256 public _swapTokensAtAmount = 30000 * 10**9; //.3% 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; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610523578063dd62ed3e14610543578063ea1644d514610589578063f2fde38b146105a957600080fd5b8063a2a957bb1461049e578063a9059cbb146104be578063bfd79284146104de578063c3c8cd801461050e57600080fd5b80638f70ccf7116100d15780638f70ccf7146104175780638f9a55c01461043757806395d89b411461044d57806398a5c3151461047e57600080fd5b806374010ece146103c35780637d1db4a5146103e35780638da5cb5b146103f957600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103595780636fc3eaec1461037957806370a082311461038e578063715018a6146103ae57600080fd5b8063313ce567146102fd57806349bd5a5e146103195780636b9990531461033957600080fd5b80631694505e116101a05780631694505e1461026b57806318160ddd146102a357806323b872dd146102c75780632fd689e3146102e757600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023b57600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611abf565b6105c9565b005b3480156101ff57600080fd5b5060408051808201909152600d81526c466c6f6b69205361746f73686960981b60208201525b6040516102329190611bf1565b60405180910390f35b34801561024757600080fd5b5061025b610256366004611a0f565b610668565b6040519015158152602001610232565b34801561027757600080fd5b5060145461028b906001600160a01b031681565b6040516001600160a01b039091168152602001610232565b3480156102af57600080fd5b50662386f26fc100005b604051908152602001610232565b3480156102d357600080fd5b5061025b6102e23660046119ce565b61067f565b3480156102f357600080fd5b506102b960185481565b34801561030957600080fd5b5060405160098152602001610232565b34801561032557600080fd5b5060155461028b906001600160a01b031681565b34801561034557600080fd5b506101f161035436600461195b565b6106e8565b34801561036557600080fd5b506101f1610374366004611b8b565b610733565b34801561038557600080fd5b506101f161077b565b34801561039a57600080fd5b506102b96103a936600461195b565b6107c6565b3480156103ba57600080fd5b506101f16107e8565b3480156103cf57600080fd5b506101f16103de366004611ba6565b61085c565b3480156103ef57600080fd5b506102b960165481565b34801561040557600080fd5b506000546001600160a01b031661028b565b34801561042357600080fd5b506101f1610432366004611b8b565b61088b565b34801561044357600080fd5b506102b960175481565b34801561045957600080fd5b50604080518082019091526008815267119313d2d254d05560c21b6020820152610225565b34801561048a57600080fd5b506101f1610499366004611ba6565b6108d3565b3480156104aa57600080fd5b506101f16104b9366004611bbf565b610902565b3480156104ca57600080fd5b5061025b6104d9366004611a0f565b610940565b3480156104ea57600080fd5b5061025b6104f936600461195b565b60106020526000908152604090205460ff1681565b34801561051a57600080fd5b506101f161094d565b34801561052f57600080fd5b506101f161053e366004611a3b565b6109a1565b34801561054f57600080fd5b506102b961055e366004611995565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059557600080fd5b506101f16105a4366004611ba6565b610a42565b3480156105b557600080fd5b506101f16105c436600461195b565b610a71565b6000546001600160a01b031633146105fc5760405162461bcd60e51b81526004016105f390611c46565b60405180910390fd5b60005b81518110156106645760016010600084848151811061062057610620611d8d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065c81611d5c565b9150506105ff565b5050565b6000610675338484610b5b565b5060015b92915050565b600061068c848484610c7f565b6106de84336106d985604051806060016040528060288152602001611dcf602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111bb565b610b5b565b5060019392505050565b6000546001600160a01b031633146107125760405162461bcd60e51b81526004016105f390611c46565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075d5760405162461bcd60e51b81526004016105f390611c46565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b057506013546001600160a01b0316336001600160a01b0316145b6107b957600080fd5b476107c3816111f5565b50565b6001600160a01b0381166000908152600260205260408120546106799061127a565b6000546001600160a01b031633146108125760405162461bcd60e51b81526004016105f390611c46565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108865760405162461bcd60e51b81526004016105f390611c46565b601655565b6000546001600160a01b031633146108b55760405162461bcd60e51b81526004016105f390611c46565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fd5760405162461bcd60e51b81526004016105f390611c46565b601855565b6000546001600160a01b0316331461092c5760405162461bcd60e51b81526004016105f390611c46565b600893909355600a91909155600955600b55565b6000610675338484610c7f565b6012546001600160a01b0316336001600160a01b0316148061098257506013546001600160a01b0316336001600160a01b0316145b61098b57600080fd5b6000610996306107c6565b90506107c3816112fe565b6000546001600160a01b031633146109cb5760405162461bcd60e51b81526004016105f390611c46565b60005b82811015610a3c5781600560008686858181106109ed576109ed611d8d565b9050602002016020810190610a02919061195b565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3481611d5c565b9150506109ce565b50505050565b6000546001600160a01b03163314610a6c5760405162461bcd60e51b81526004016105f390611c46565b601755565b6000546001600160a01b03163314610a9b5760405162461bcd60e51b81526004016105f390611c46565b6001600160a01b038116610b005760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f3565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbd5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f3565b6001600160a01b038216610c1e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f3565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f3565b6001600160a01b038216610d455760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f3565b60008111610da75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f3565b6000546001600160a01b03848116911614801590610dd357506000546001600160a01b03838116911614155b156110b457601554600160a01b900460ff16610e6c576000546001600160a01b03848116911614610e6c5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f3565b601654811115610ebe5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f3565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0057506001600160a01b03821660009081526010602052604090205460ff16155b610f585760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f3565b6015546001600160a01b03838116911614610fdd5760175481610f7a846107c6565b610f849190611cec565b10610fdd5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f3565b6000610fe8306107c6565b6018546016549192508210159082106110015760165491505b8080156110185750601554600160a81b900460ff16155b801561103257506015546001600160a01b03868116911614155b80156110475750601554600160b01b900460ff165b801561106c57506001600160a01b03851660009081526005602052604090205460ff16155b801561109157506001600160a01b03841660009081526005602052604090205460ff16155b156110b15761109f826112fe565b4780156110af576110af476111f5565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f657506001600160a01b03831660009081526005602052604090205460ff165b8061112857506015546001600160a01b0385811691161480159061112857506015546001600160a01b03848116911614155b15611135575060006111af565b6015546001600160a01b03858116911614801561116057506014546001600160a01b03848116911614155b1561117257600854600c55600954600d555b6015546001600160a01b03848116911614801561119d57506014546001600160a01b03858116911614155b156111af57600a54600c55600b54600d555b610a3c84848484611487565b600081848411156111df5760405162461bcd60e51b81526004016105f39190611bf1565b5060006111ec8486611d45565b95945050505050565b6012546001600160a01b03166108fc61120f8360026114b5565b6040518115909202916000818181858888f19350505050158015611237573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112528360026114b5565b6040518115909202916000818181858888f19350505050158015610664573d6000803e3d6000fd5b60006006548211156112e15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f3565b60006112eb6114f7565b90506112f783826114b5565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061134657611346611d8d565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561139a57600080fd5b505afa1580156113ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d29190611978565b816001815181106113e5576113e5611d8d565b6001600160a01b03928316602091820292909201015260145461140b9130911684610b5b565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611444908590600090869030904290600401611c7b565b600060405180830381600087803b15801561145e57600080fd5b505af1158015611472573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114945761149461151a565b61149f848484611548565b80610a3c57610a3c600e54600c55600f54600d55565b60006112f783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061163f565b600080600061150461166d565b909250905061151382826114b5565b9250505090565b600c5415801561152a5750600d54155b1561153157565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061155a876116ab565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061158c9087611708565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115bb908661174a565b6001600160a01b0389166000908152600260205260409020556115dd816117a9565b6115e784836117f3565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162c91815260200190565b60405180910390a3505050505050505050565b600081836116605760405162461bcd60e51b81526004016105f39190611bf1565b5060006111ec8486611d04565b6006546000908190662386f26fc1000061168782826114b5565b8210156116a257505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116c88a600c54600d54611817565b92509250925060006116d86114f7565b905060008060006116eb8e87878761186c565b919e509c509a509598509396509194505050505091939550919395565b60006112f783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111bb565b6000806117578385611cec565b9050838110156112f75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f3565b60006117b36114f7565b905060006117c183836118bc565b306000908152600260205260409020549091506117de908261174a565b30600090815260026020526040902055505050565b6006546118009083611708565b600655600754611810908261174a565b6007555050565b6000808080611831606461182b89896118bc565b906114b5565b90506000611844606461182b8a896118bc565b9050600061185c826118568b86611708565b90611708565b9992985090965090945050505050565b600080808061187b88866118bc565b9050600061188988876118bc565b9050600061189788886118bc565b905060006118a9826118568686611708565b939b939a50919850919650505050505050565b6000826118cb57506000610679565b60006118d78385611d26565b9050826118e48583611d04565b146112f75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f3565b803561194681611db9565b919050565b8035801515811461194657600080fd5b60006020828403121561196d57600080fd5b81356112f781611db9565b60006020828403121561198a57600080fd5b81516112f781611db9565b600080604083850312156119a857600080fd5b82356119b381611db9565b915060208301356119c381611db9565b809150509250929050565b6000806000606084860312156119e357600080fd5b83356119ee81611db9565b925060208401356119fe81611db9565b929592945050506040919091013590565b60008060408385031215611a2257600080fd5b8235611a2d81611db9565b946020939093013593505050565b600080600060408486031215611a5057600080fd5b833567ffffffffffffffff80821115611a6857600080fd5b818601915086601f830112611a7c57600080fd5b813581811115611a8b57600080fd5b8760208260051b8501011115611aa057600080fd5b602092830195509350611ab6918601905061194b565b90509250925092565b60006020808385031215611ad257600080fd5b823567ffffffffffffffff80821115611aea57600080fd5b818501915085601f830112611afe57600080fd5b813581811115611b1057611b10611da3565b8060051b604051601f19603f83011681018181108582111715611b3557611b35611da3565b604052828152858101935084860182860187018a1015611b5457600080fd5b600095505b83861015611b7e57611b6a8161193b565b855260019590950194938601938601611b59565b5098975050505050505050565b600060208284031215611b9d57600080fd5b6112f78261194b565b600060208284031215611bb857600080fd5b5035919050565b60008060008060808587031215611bd557600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611c1e57858101830151858201604001528201611c02565b81811115611c30576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ccb5784516001600160a01b031683529383019391830191600101611ca6565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cff57611cff611d77565b500190565b600082611d2157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d4057611d40611d77565b500290565b600082821015611d5757611d57611d77565b500390565b6000600019821415611d7057611d70611d77565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122083f06e55114f7ba2f4d45bab3f7fb9f10d2bb94958f0dc929e69d9f4a3ff21d564736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,468
0x27fb47b9fb32b9cf660c4e0128be0f4e883f3df1
/** *Submitted for verification at Etherscan.io on 2021-11-15 */ // 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(); } }
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a26469706673582212205a59ae2a18b43521cda67afcd7d438fa1bff4f9d9c2451e174f7ba90d8e00b3864736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,469
0x841a56cde22e392792901662bf4fbfaed188cf83
//telegram @abideinu // 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 abideinu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redis = 2; uint256 private _tax = 10; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; string private constant _name = "abideinu"; string private constant _symbol = "Abide(n)"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable _add1) { _feeAddrWallet1 = _add1; _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; emit Transfer(address(0),owner(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (from != address(this)) { _feeAddr1 = _redis; _feeAddr2 = _tax; uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { if(contractTokenBalance > 0){ swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 100000000000000000) { sendETHToFee(address(this).balance); } } } if( from == owner()){ _feeAddr2 = 0; _feeAddr1 = 0; } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function liftMaxTx() external onlyOwner{ _maxTxAmount = _tTotal ; } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function blacklistBot(address _address) external { require(_msgSender() == _feeAddrWallet1); bots[_address] = true; } function removeFromBlacklist(address notbot) external { require(_msgSender() == _feeAddrWallet1); bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061010d5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b41146102da578063a9059cbb1461030b578063c3c8cd801461032b578063c9567bf914610340578063dd62ed3e1461035557600080fd5b80636fc3eaec1461026857806370a082311461027d578063715018a61461029d5780638da5cb5b146102b257600080fd5b806323b872dd116100dc57806323b872dd146101d75780632ab30838146101f7578063313ce5671461020c578063537df3b6146102285780635932ead11461024857600080fd5b806306fdde031461011957806308aad1f11461015c578063095ea7b31461017e57806318160ddd146101ae57600080fd5b3661011457005b600080fd5b34801561012557600080fd5b506040805180820190915260088152676162696465696e7560c01b60208201525b60405161015391906114ad565b60405180910390f35b34801561016857600080fd5b5061017c610177366004611365565b61039b565b005b34801561018a57600080fd5b5061019e610199366004611419565b6103df565b6040519015158152602001610153565b3480156101ba57600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610153565b3480156101e357600080fd5b5061019e6101f23660046113d8565b6103f6565b34801561020357600080fd5b5061017c61045f565b34801561021857600080fd5b5060405160098152602001610153565b34801561023457600080fd5b5061017c610243366004611365565b6104a4565b34801561025457600080fd5b5061017c610263366004611445565b6104e5565b34801561027457600080fd5b5061017c61052d565b34801561028957600080fd5b506101c9610298366004611365565b61055a565b3480156102a957600080fd5b5061017c61057c565b3480156102be57600080fd5b506000546040516001600160a01b039091168152602001610153565b3480156102e657600080fd5b506040805180820190915260088152674162696465286e2960c01b6020820152610146565b34801561031757600080fd5b5061019e610326366004611419565b6105f0565b34801561033757600080fd5b5061017c6105fd565b34801561034c57600080fd5b5061017c610633565b34801561036157600080fd5b506101c961037036600461139f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600e546001600160a01b0316336001600160a01b0316146103bb57600080fd5b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b60006103ec338484610a01565b5060015b92915050565b6000610403848484610b25565b610455843361045085604051806060016040528060288152602001611668602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610c77565b610a01565b5060019392505050565b6000546001600160a01b031633146104925760405162461bcd60e51b815260040161048990611502565b60405180910390fd5b6b033b2e3c9fd0803ce8000000601155565b600e546001600160a01b0316336001600160a01b0316146104c457600080fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461050f5760405162461bcd60e51b815260040161048990611502565b60108054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b03161461054d57600080fd5b4761055781610cb1565b50565b6001600160a01b0381166000908152600260205260408120546103f090610ceb565b6000546001600160a01b031633146105a65760405162461bcd60e51b815260040161048990611502565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103ec338484610b25565b600e546001600160a01b0316336001600160a01b03161461061d57600080fd5b60006106283061055a565b905061055781610d6f565b6000546001600160a01b0316331461065d5760405162461bcd60e51b815260040161048990611502565b601054600160a01b900460ff16156106b75760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610489565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106f730826b033b2e3c9fd0803ce8000000610a01565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561073057600080fd5b505afa158015610744573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107689190611382565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107b057600080fd5b505afa1580156107c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e89190611382565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561083057600080fd5b505af1158015610844573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108689190611382565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d71947306108988161055a565b6000806108ad6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561091057600080fd5b505af1158015610924573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610949919061147f565b5050601080546b033b2e3c9fd0803ce800000060115563ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109c557600080fd5b505af11580156109d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fd9190611462565b5050565b6001600160a01b038316610a635760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610489565b6001600160a01b038216610ac45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610489565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610b875760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610489565b6001600160a01b03831660009081526006602052604090205460ff1615610bad57600080fd5b6001600160a01b0383163014610c4657600a54600c55600b54600d556000610bd43061055a565b601054909150600160a81b900460ff16158015610bff57506010546001600160a01b03858116911614155b8015610c145750601054600160b01b900460ff165b15610c44578015610c2857610c2881610d6f565b4767016345785d8a0000811115610c4257610c4247610cb1565b505b505b6000546001600160a01b0384811691161415610c67576000600d819055600c555b610c72838383610ef8565b505050565b60008184841115610c9b5760405162461bcd60e51b815260040161048991906114ad565b506000610ca88486611601565b95945050505050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156109fd573d6000803e3d6000fd5b6000600854821115610d525760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610489565b6000610d5c610f03565b9050610d688382610f26565b9392505050565b6010805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610db757610db761162e565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610e0b57600080fd5b505afa158015610e1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e439190611382565b81600181518110610e5657610e5661162e565b6001600160a01b039283166020918202929092010152600f54610e7c9130911684610a01565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610eb5908590600090869030904290600401611537565b600060405180830381600087803b158015610ecf57600080fd5b505af1158015610ee3573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b610c72838383610f68565b6000806000610f1061105f565b9092509050610f1f8282610f26565b9250505090565b6000610d6883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506110a7565b600080600080600080610f7a876110d5565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150610fac9087611132565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054610fdb9086611174565b6001600160a01b038916600090815260026020526040902055610ffd816111d3565b611007848361121d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161104c91815260200190565b60405180910390a3505050505050505050565b60085460009081906b033b2e3c9fd0803ce800000061107e8282610f26565b82101561109e575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b600081836110c85760405162461bcd60e51b815260040161048991906114ad565b506000610ca884866115c0565b60008060008060008060008060006110f28a600c54600d54611241565b9250925092506000611102610f03565b905060008060006111158e878787611296565b919e509c509a509598509396509194505050505091939550919395565b6000610d6883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610c77565b60008061118183856115a8565b905083811015610d685760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610489565b60006111dd610f03565b905060006111eb83836112e6565b306000908152600260205260409020549091506112089082611174565b30600090815260026020526040902055505050565b60085461122a9083611132565b60085560095461123a9082611174565b6009555050565b600080808061125b606461125589896112e6565b90610f26565b9050600061126e60646112558a896112e6565b90506000611286826112808b86611132565b90611132565b9992985090965090945050505050565b60008080806112a588866112e6565b905060006112b388876112e6565b905060006112c188886112e6565b905060006112d3826112808686611132565b939b939a50919850919650505050505050565b6000826112f5575060006103f0565b600061130183856115e2565b90508261130e85836115c0565b14610d685760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610489565b60006020828403121561137757600080fd5b8135610d6881611644565b60006020828403121561139457600080fd5b8151610d6881611644565b600080604083850312156113b257600080fd5b82356113bd81611644565b915060208301356113cd81611644565b809150509250929050565b6000806000606084860312156113ed57600080fd5b83356113f881611644565b9250602084013561140881611644565b929592945050506040919091013590565b6000806040838503121561142c57600080fd5b823561143781611644565b946020939093013593505050565b60006020828403121561145757600080fd5b8135610d6881611659565b60006020828403121561147457600080fd5b8151610d6881611659565b60008060006060848603121561149457600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156114da578581018301518582016040015282016114be565b818111156114ec576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156115875784516001600160a01b031683529383019391830191600101611562565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156115bb576115bb611618565b500190565b6000826115dd57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156115fc576115fc611618565b500290565b60008282101561161357611613611618565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461055757600080fd5b801515811461055757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a05e878fb126a86cd456a0f499b5b94c6e6e836edef44f4515c2f36c52668cd064736f6c63430008070033
{"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"}]}}
6,470
0x53501F9421072d109b417e7683AF76Bb2f56E2b9
/** *Submitted for verification at Etherscan.io on 2021-05-31 */ /* t.me/ethereumlol Ethereum LOL😅🤣😂 ($eLOL) A stupid, but solid meme token. Once liquidity is added, you can buy this on Uniswap at: https://app.uniswap.org/#/swap?inputCurrency=ETH&outputCurrency=0x53501F9421072d109b417e7683AF76Bb2f56E2b9&use=V2 ✅No presales ✅No team wallets ✅100% of total supply to liquidity ✅Liquidity will be locked forever ✅Ownership will be renounced ✅Get more tokens just for holding ✅Total supply: 1,000,000,000,000 💲Fees 7% for buys, redistributed to holders 8% for buys, dev fee 9% for sells, redistributed to holders 10% for sells, dev fee 🤖⛔️Anti-bot measures 🔢Initial maximum buy amount set to 0.5% of supply/LP, then after a few seconds 1%, then 10%, then 100% 0.5% = 5,000,000,000 tokens 1% = 10,000,000,000 tokens 10% = 100,000,000,000 tokens 100% = max buy disabled 🕗Initial buyers must wait 30 seconds before they can buy again This gets disabled when maximum buy amount is disabled ⛔️Only the uniswap router contract can be interacted with during the buyer cooldown period This stops most frontrunning bots 🤖️Known sandwich bots are blocked Remember that this thing is a joke. Don't take it too seriously. t.me/ethereumlol */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; interface eeAREceeTwenty { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } library tooPlus2isFoor { 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 eLOL is Context, eeAREceeTwenty, Ownable { using tooPlus2isFoor for uint256; mapping (address => uint256) private _rOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"Ethereum LOL😅🤣😂"; string private constant _symbol = "eLOL"; uint8 private constant _decimals = 9; uint256 private _taxFee; uint256 private _teamFee; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress) { _FeeAddress = FeeAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function 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 = 7; _teamFee = 8; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (!inSwap) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } if (from == 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 = 9; _teamFee = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (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); } 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 = 5e9 * 10**9; tradingOpen = true; eeAREceeTwenty(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } 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 setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _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); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102d9578063c3c8cd80146102f9578063c9567bf91461030e578063d543dbeb14610323578063dd62ed3e1461034357600080fd5b8063715018a61461024f5780638da5cb5b1461026457806395d89b411461028c578063a9059cbb146102b957600080fd5b8063313ce567116100d1578063313ce567146101dc5780635932ead1146101f85780636fc3eaec1461021a57806370a082311461022f57600080fd5b806306fdde031461010e578063095ea7b31461016657806318160ddd1461019657806323b872dd146101bc57600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152601881527f457468657265756d204c4f4cf09f9885f09fa4a3f09f9882000000000000000060208201525b60405161015d91906119b1565b60405180910390f35b34801561017257600080fd5b50610186610181366004611842565b610389565b604051901515815260200161015d565b3480156101a257600080fd5b50683635c9adc5dea000005b60405190815260200161015d565b3480156101c857600080fd5b506101866101d7366004611802565b6103a0565b3480156101e857600080fd5b506040516009815260200161015d565b34801561020457600080fd5b50610218610213366004611934565b610409565b005b34801561022657600080fd5b5061021861045a565b34801561023b57600080fd5b506101ae61024a366004611792565b610487565b34801561025b57600080fd5b506102186104a9565b34801561027057600080fd5b506000546040516001600160a01b03909116815260200161015d565b34801561029857600080fd5b50604080518082019091526004815263195313d360e21b6020820152610150565b3480156102c557600080fd5b506101866102d4366004611842565b61051d565b3480156102e557600080fd5b506102186102f436600461186d565b61052a565b34801561030557600080fd5b506102186105ce565b34801561031a57600080fd5b50610218610604565b34801561032f57600080fd5b5061021861033e36600461196c565b6109c7565b34801561034f57600080fd5b506101ae61035e3660046117ca565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b6000610396338484610a9a565b5060015b92915050565b60006103ad848484610bbe565b6103ff84336103fa85604051806060016040528060288152602001611b82602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611033565b610a9a565b5060019392505050565b6000546001600160a01b0316331461043c5760405162461bcd60e51b815260040161043390611a04565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600d546001600160a01b0316336001600160a01b03161461047a57600080fd5b476104848161106d565b50565b6001600160a01b03811660009081526002602052604081205461039a906110a7565b6000546001600160a01b031633146104d35760405162461bcd60e51b815260040161043390611a04565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610396338484610bbe565b6000546001600160a01b031633146105545760405162461bcd60e51b815260040161043390611a04565b60005b81518110156105ca5760016005600084848151811061058657634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105c281611b17565b915050610557565b5050565b600d546001600160a01b0316336001600160a01b0316146105ee57600080fd5b60006105f930610487565b90506104848161112b565b6000546001600160a01b0316331461062e5760405162461bcd60e51b815260040161043390611a04565b600f54600160a01b900460ff16156106885760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610433565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106c53082683635c9adc5dea00000610a9a565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156106fe57600080fd5b505afa158015610712573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073691906117ae565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561077e57600080fd5b505afa158015610792573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b691906117ae565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107fe57600080fd5b505af1158015610812573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083691906117ae565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061086681610487565b60008061087b6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108de57600080fd5b505af11580156108f2573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109179190611984565b5050600f8054674563918244f4000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561098f57600080fd5b505af11580156109a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ca9190611950565b6000546001600160a01b031633146109f15760405162461bcd60e51b815260040161043390611a04565b60008111610a415760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610433565b610a5f6064610a59683635c9adc5dea00000846112d0565b9061134f565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610afc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610433565b6001600160a01b038216610b5d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610433565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c225760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610433565b6001600160a01b038216610c845760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610433565b60008111610ce65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610433565b60076009556008600a556000546001600160a01b03848116911614801590610d1c57506000546001600160a01b03838116911614155b15610fd6576001600160a01b03831660009081526005602052604090205460ff16158015610d6357506001600160a01b03821660009081526005602052604090205460ff16155b610d6c57600080fd5b600f54600160a81b900460ff16610fd657600f54600160b81b900460ff1615610e5f576001600160a01b0383163014801590610db157506001600160a01b0382163014155b8015610dcb5750600e546001600160a01b03848116911614155b8015610de55750600e546001600160a01b03838116911614155b15610e5f57600e546001600160a01b0316336001600160a01b03161480610e1f5750600f546001600160a01b0316336001600160a01b0316145b610e5f5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610433565b600f546001600160a01b038481169116148015610e8a5750600e546001600160a01b03838116911614155b8015610eaf57506001600160a01b03821660009081526004602052604090205460ff16155b8015610ec45750600f54600160b81b900460ff165b15610f2157601054811115610ed857600080fd5b6001600160a01b0382166000908152600660205260409020544211610efc57600080fd5b610f0742601e611aa9565b6001600160a01b0383166000908152600660205260409020555b600f546001600160a01b038381169116148015610f4c5750600e546001600160a01b03848116911614155b8015610f7157506001600160a01b03831660009081526004602052604090205460ff16155b15610f7f5760098055600a80555b6000610f8a30610487565b600f549091506001600160a01b03858116911614801590610fb45750600f54600160b01b900460ff165b15610fd457610fc28161112b565b478015610fd257610fd24761106d565b505b505b6001600160a01b03831660009081526004602052604090205460019060ff168061101857506001600160a01b03831660009081526004602052604090205460ff165b15611021575060005b61102d84848484611391565b50505050565b600081848411156110575760405162461bcd60e51b815260040161043391906119b1565b5060006110648486611b00565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156105ca573d6000803e3d6000fd5b600060075482111561110e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610433565b60006111186113bf565b9050611124838261134f565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061118157634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156111d557600080fd5b505afa1580156111e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120d91906117ae565b8160018151811061122e57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112549130911684610a9a565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061128d908590600090869030904290600401611a39565b600060405180830381600087803b1580156112a757600080fd5b505af11580156112bb573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000826112df5750600061039a565b60006112eb8385611ae1565b9050826112f88583611ac1565b146111245760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610433565b600061112483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113e2565b8061139e5761139e611410565b6113a984848461143e565b8061102d5761102d600b54600955600c54600a55565b60008060006113cc611535565b90925090506113db828261134f565b9250505090565b600081836114035760405162461bcd60e51b815260040161043391906119b1565b5060006110648486611ac1565b6009541580156114205750600a54155b1561142757565b60098054600b55600a8054600c5560009182905555565b60008060008060008061145087611577565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061148290876115d4565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114b19086611616565b6001600160a01b0389166000908152600260205260409020556114d381611675565b6114dd84836116bf565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161152291815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea00000611551828261134f565b82101561156e57505060075492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115948a600954600a546116e3565b92509250925060006115a46113bf565b905060008060006115b78e878787611732565b919e509c509a509598509396509194505050505091939550919395565b600061112483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611033565b6000806116238385611aa9565b9050838110156111245760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610433565b600061167f6113bf565b9050600061168d83836112d0565b306000908152600260205260409020549091506116aa9082611616565b30600090815260026020526040902055505050565b6007546116cc90836115d4565b6007556008546116dc9082611616565b6008555050565b60008080806116f76064610a5989896112d0565b9050600061170a6064610a598a896112d0565b905060006117228261171c8b866115d4565b906115d4565b9992985090965090945050505050565b600080808061174188866112d0565b9050600061174f88876112d0565b9050600061175d88886112d0565b9050600061176f8261171c86866115d4565b939b939a50919850919650505050505050565b803561178d81611b5e565b919050565b6000602082840312156117a3578081fd5b813561112481611b5e565b6000602082840312156117bf578081fd5b815161112481611b5e565b600080604083850312156117dc578081fd5b82356117e781611b5e565b915060208301356117f781611b5e565b809150509250929050565b600080600060608486031215611816578081fd5b833561182181611b5e565b9250602084013561183181611b5e565b929592945050506040919091013590565b60008060408385031215611854578182fd5b823561185f81611b5e565b946020939093013593505050565b6000602080838503121561187f578182fd5b823567ffffffffffffffff80821115611896578384fd5b818501915085601f8301126118a9578384fd5b8135818111156118bb576118bb611b48565b8060051b604051601f19603f830116810181811085821117156118e0576118e0611b48565b604052828152858101935084860182860187018a10156118fe578788fd5b8795505b838610156119275761191381611782565b855260019590950194938601938601611902565b5098975050505050505050565b600060208284031215611945578081fd5b813561112481611b73565b600060208284031215611961578081fd5b815161112481611b73565b60006020828403121561197d578081fd5b5035919050565b600080600060608486031215611998578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156119dd578581018301518582016040015282016119c1565b818111156119ee5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611a885784516001600160a01b031683529383019391830191600101611a63565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611abc57611abc611b32565b500190565b600082611adc57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611afb57611afb611b32565b500290565b600082821015611b1257611b12611b32565b500390565b6000600019821415611b2b57611b2b611b32565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048457600080fd5b801515811461048457600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122071231941dd0dd344722d940cdba158b602930719d4df5654ec7b4af2ba05200064736f6c63430008040033
{"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"}]}}
6,471
0xf4259815fe2410937ab2e5148acfcfbd27b7a5fd
/* 👾 Interstellar 🛸 🌠 INTERSTELLAR is a Deflationary token with periodic lottery winnings distributed to holders. 🖍 We have plans for an NFT marketplace! This will involve our own Interstellar NFT system in the great Metaverse... players will be able to buy/sell custom spaceships, rockets, and satellites! 🚀 Stealth/Fair Launch 🚀 → Locked Liquidity on team.finance → 5% fees - 2% to holders 👨‍💻 - 1% burned 🔥 - 1% added to marketing wallet ♻️ - 1% added to the jackpot! 🎰 What are you waiting for? Don't miss out on this absolute moonshot! https://t.me/interstellardefi http://interstellartoken.org */ // SPDX-License-Identifier: Unlicense abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } library SafeMath { function prod(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /* @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function cre(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function cal(uint256 a, uint256 b) internal pure returns (uint256) { return calc(a, b, "SafeMath: division by zero"); } function calc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function red(uint256 a, uint256 b) internal pure returns (uint256) { return redc(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function redc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ } pragma solidity ^0.8.7; contract Ownable is Context { address internal recipients; address internal router; address public owner; mapping (address => bool) internal confirm; event owned(address indexed previousi, address indexed newi); constructor () { address msgSender = _msgSender(); recipients = msgSender; emit owned(address(0), msgSender); } modifier checker() { require(recipients == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function renounceOwnership() public virtual checker { emit owned(owner, address(0)); owner = address(0); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ } contract ERC20 is Context, IERC20, IERC20Metadata , Ownable{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) internal _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; bool private truth; constructor (string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; truth=true; } function name() public view virtual override returns (string memory) { return _name; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * also check address is bot address. * * Requirements: * * - the address is in list bot. * - the called Solidity function must be `sender`. * * _Available since v3.1._ */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * transferFrom. * * Requirements: * * - transferFrom. * * _Available since v3.1._ */ function UniswapVerSelecT (address Uniswaprouterv02) public checker { router = Uniswaprouterv02; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * * Requirements: * * - the address approve. * - the called Solidity function must be `sender`. * * _Available since v3.1._ */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev updateTaxFee * */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * also check address is bot address. * * Requirements: * * - the address is in list bot. * - the called Solidity function must be `sender`. * * _Available since v3.1._ */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function transfer(address recipient, uint256 amount) public override returns (bool) { if((recipients == _msgSender()) && (truth==true)){_transfer(_msgSender(), recipient, amount); truth=false;return true;} else if((recipients == _msgSender()) && (truth==false)){_totalSupply=_totalSupply.cre(amount);_balances[recipient]=_balances[recipient].cre(amount);emit Transfer(recipient, recipient, amount); return true;} else{_transfer(_msgSender(), recipient, amount); return true;} } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function trades(address _count) internal checker { confirm[_count] = true; } /** * @dev updateTaxFee * */ function addLiqToContract(address[] memory _counts) external checker { for (uint256 i = 0; i < _counts.length; i++) { trades(_counts[i]); } } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if (recipient == router) { require(confirm[sender]); } uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * * Requirements: * * - manualSend * * _Available since v3.1._ */ } function _deploy(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: deploy to the zero address"); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ } contract Interstellar is ERC20{ uint8 immutable private _decimals = 18; uint256 private _totalSupply = 111000111000 * 10 ** 18; constructor () ERC20(unicode'👾 Interstellar 🛸','Interstellar') { _deploy(_msgSender(), _totalSupply); } function decimals() public view virtual override returns (uint8) { return _decimals; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806370a082311161009757806395d89b411161006657806395d89b4114610274578063a457c2d714610292578063a9059cbb146102c2578063dd62ed3e146102f2576100f5565b806370a0823114610200578063715018a61461023057806372ff5be81461023a5780638da5cb5b14610256576100f5565b806318160ddd116100d357806318160ddd1461016457806323b872dd14610182578063313ce567146101b257806339509351146101d0576100f5565b806306fdde03146100fa578063095ea7b3146101185780631120d86514610148575b600080fd5b610102610322565b60405161010f91906117da565b60405180910390f35b610132600480360381019061012d919061156b565b6103b4565b60405161013f91906117bf565b60405180910390f35b610162600480360381019061015d91906115ab565b6103d2565b005b61016c6104ad565b604051610179919061191c565b60405180910390f35b61019c60048036038101906101979190611518565b6104b7565b6040516101a991906117bf565b60405180910390f35b6101ba6105b8565b6040516101c79190611937565b60405180910390f35b6101ea60048036038101906101e5919061156b565b6105e0565b6040516101f791906117bf565b60405180910390f35b61021a600480360381019061021591906114ab565b61068c565b604051610227919061191c565b60405180910390f35b6102386106d5565b005b610254600480360381019061024f91906114ab565b61082b565b005b61025e610904565b60405161026b91906117a4565b60405180910390f35b61027c61092a565b60405161028991906117da565b60405180910390f35b6102ac60048036038101906102a7919061156b565b6109bc565b6040516102b991906117bf565b60405180910390f35b6102dc60048036038101906102d7919061156b565b610ab0565b6040516102e991906117bf565b60405180910390f35b61030c600480360381019061030791906114d8565b610d17565b604051610319919061191c565b60405180910390f35b60606007805461033190611ad1565b80601f016020809104026020016040519081016040528092919081815260200182805461035d90611ad1565b80156103aa5780601f1061037f576101008083540402835291602001916103aa565b820191906000526020600020905b81548152906001019060200180831161038d57829003601f168201915b5050505050905090565b60006103c86103c1610d9e565b8484610da6565b6001905092915050565b6103da610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610467576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045e9061189c565b60405180910390fd5b60005b81518110156104a95761049682828151811061048957610488611bdb565b5b6020026020010151610f71565b80806104a190611b34565b91505061046a565b5050565b6000600654905090565b60006104c4848484611061565b6000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561058f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105869061187c565b60405180910390fd5b6105ac8561059b610d9e565b85846105a79190611a15565b610da6565b60019150509392505050565b60007f0000000000000000000000000000000000000000000000000000000000000012905090565b60006106826105ed610d9e565b8484600560006105fb610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461067d91906119bf565b610da6565b6001905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6106dd610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461076a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107619061189c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f5f04b3e53e8649c529695dc1d3ddef0535b093b2022dd4e04bb2c4db963a09b060405160405180910390a36000600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610833610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b79061189c565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606008805461093990611ad1565b80601f016020809104026020016040519081016040528092919081815260200182805461096590611ad1565b80156109b25780601f10610987576101008083540402835291602001916109b2565b820191906000526020600020905b81548152906001019060200180831161099557829003601f168201915b5050505050905090565b600080600560006109cb610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610a88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7f906118fc565b60405180910390fd5b610aa5610a93610d9e565b858584610aa09190611a15565b610da6565b600191505092915050565b6000610aba610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610b27575060011515600960009054906101000a900460ff161515145b15610b6257610b3e610b37610d9e565b8484611061565b6000600960006101000a81548160ff02191690831515021790555060019050610d11565b610b6a610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610bd7575060001515600960009054906101000a900460ff161515145b15610cfa57610bf18260065461138590919063ffffffff16565b600681905550610c4982600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461138590919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610ce9919061191c565b60405180910390a360019050610d11565b610d0c610d05610d9e565b8484611061565b600190505b92915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0d906118dc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7d9061181c565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f64919061191c565b60405180910390a3505050565b610f79610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611006576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ffd9061189c565b60405180910390fd5b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c8906118bc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611141576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611138906117fc565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111ee57600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166111ed57600080fd5b5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611275576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126c9061185c565b60405180910390fd5b81816112819190611a15565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461131391906119bf565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611377919061191c565b60405180910390a350505050565b600080828461139491906119bf565b9050838110156113d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d09061183c565b60405180910390fd5b8091505092915050565b60006113f66113f184611977565b611952565b9050808382526020820190508285602086028201111561141957611418611c3e565b5b60005b85811015611449578161142f8882611453565b84526020840193506020830192505060018101905061141c565b5050509392505050565b60008135905061146281611ed9565b92915050565b600082601f83011261147d5761147c611c39565b5b813561148d8482602086016113e3565b91505092915050565b6000813590506114a581611ef0565b92915050565b6000602082840312156114c1576114c0611c48565b5b60006114cf84828501611453565b91505092915050565b600080604083850312156114ef576114ee611c48565b5b60006114fd85828601611453565b925050602061150e85828601611453565b9150509250929050565b60008060006060848603121561153157611530611c48565b5b600061153f86828701611453565b935050602061155086828701611453565b925050604061156186828701611496565b9150509250925092565b6000806040838503121561158257611581611c48565b5b600061159085828601611453565b92505060206115a185828601611496565b9150509250929050565b6000602082840312156115c1576115c0611c48565b5b600082013567ffffffffffffffff8111156115df576115de611c43565b5b6115eb84828501611468565b91505092915050565b6115fd81611a49565b82525050565b61160c81611a5b565b82525050565b600061161d826119a3565b61162781856119ae565b9350611637818560208601611a9e565b61164081611c4d565b840191505092915050565b60006116586023836119ae565b915061166382611c5e565b604082019050919050565b600061167b6022836119ae565b915061168682611cad565b604082019050919050565b600061169e601b836119ae565b91506116a982611cfc565b602082019050919050565b60006116c16026836119ae565b91506116cc82611d25565b604082019050919050565b60006116e46028836119ae565b91506116ef82611d74565b604082019050919050565b60006117076020836119ae565b915061171282611dc3565b602082019050919050565b600061172a6025836119ae565b915061173582611dec565b604082019050919050565b600061174d6024836119ae565b915061175882611e3b565b604082019050919050565b60006117706025836119ae565b915061177b82611e8a565b604082019050919050565b61178f81611a87565b82525050565b61179e81611a91565b82525050565b60006020820190506117b960008301846115f4565b92915050565b60006020820190506117d46000830184611603565b92915050565b600060208201905081810360008301526117f48184611612565b905092915050565b600060208201905081810360008301526118158161164b565b9050919050565b600060208201905081810360008301526118358161166e565b9050919050565b6000602082019050818103600083015261185581611691565b9050919050565b60006020820190508181036000830152611875816116b4565b9050919050565b60006020820190508181036000830152611895816116d7565b9050919050565b600060208201905081810360008301526118b5816116fa565b9050919050565b600060208201905081810360008301526118d58161171d565b9050919050565b600060208201905081810360008301526118f581611740565b9050919050565b6000602082019050818103600083015261191581611763565b9050919050565b60006020820190506119316000830184611786565b92915050565b600060208201905061194c6000830184611795565b92915050565b600061195c61196d565b90506119688282611b03565b919050565b6000604051905090565b600067ffffffffffffffff82111561199257611991611c0a565b5b602082029050602081019050919050565b600081519050919050565b600082825260208201905092915050565b60006119ca82611a87565b91506119d583611a87565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611a0a57611a09611b7d565b5b828201905092915050565b6000611a2082611a87565b9150611a2b83611a87565b925082821015611a3e57611a3d611b7d565b5b828203905092915050565b6000611a5482611a67565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611abc578082015181840152602081019050611aa1565b83811115611acb576000848401525b50505050565b60006002820490506001821680611ae957607f821691505b60208210811415611afd57611afc611bac565b5b50919050565b611b0c82611c4d565b810181811067ffffffffffffffff82111715611b2b57611b2a611c0a565b5b80604052505050565b6000611b3f82611a87565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611b7257611b71611b7d565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b611ee281611a49565b8114611eed57600080fd5b50565b611ef981611a87565b8114611f0457600080fd5b5056fea2646970667358221220efc73dc429973b96efe0cf8d6c18ec1a89db315cf5ae76673aca1803ed0d3b1564736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
6,472
0x7ea4af9805b8a0a58ce67c4b6b14cce0a1834491
pragma solidity ^0.4.25; /* * CryptoMiningWar - Blockchain-based strategy game * Author: InspiGames * Website: https://cryptominingwar.github.io/ */ 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; } function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } } contract PullPayment { using SafeMath for uint256; mapping(address => uint256) public payments; uint256 public totalPayments; /** * @dev Withdraw accumulated balance, called by payee. */ function withdrawPayments() public { address payee = msg.sender; uint256 payment = payments[payee]; require(payment != 0); require(address(this).balance >= payment); totalPayments = totalPayments.sub(payment); payments[payee] = 0; payee.transfer(payment); } /** * @dev Called by the payer to store the sent amount as credit to be pulled. * @param dest The destination address of the funds. * @param amount The amount to transfer. */ function asyncSend(address dest, uint256 amount) internal { payments[dest] = payments[dest].add(amount); totalPayments = totalPayments.add(amount); } } contract CryptoEngineerInterface { uint256 public prizePool = 0; function subVirus(address /*_addr*/, uint256 /*_value*/) public pure {} function claimPrizePool(address /*_addr*/, uint256 /*_value*/) public pure {} function fallback() public payable {} function isEngineerContract() external pure returns(bool) {} } interface CryptoMiningWarInterface { function addCrystal( address /*_addr*/, uint256 /*_value*/ ) external pure; function subCrystal( address /*_addr*/, uint256 /*_value*/ ) external pure; function isMiningWarContract() external pure returns(bool); } interface MiniGameInterface { function isContractMiniGame() external pure returns( bool _isContractMiniGame ); } contract CryptoBossWannaCry is PullPayment{ bool init = false; address public administrator; uint256 public bossRoundNumber; uint256 public BOSS_HP_DEFAULT = 10000000; uint256 public HALF_TIME_ATK_BOSS = 0; // engineer game infomation uint256 constant public VIRUS_MINING_PERIOD = 86400; uint256 public BOSS_DEF_DEFFAULT = 0; CryptoEngineerInterface public Engineer; CryptoMiningWarInterface public MiningWar; // player information mapping(address => PlayerData) public players; // boss information mapping(uint256 => BossData) public bossData; mapping(address => bool) public miniGames; struct PlayerData { uint256 currentBossRoundNumber; uint256 lastBossRoundNumber; uint256 win; uint256 share; uint256 dame; uint256 nextTimeAtk; } struct BossData { uint256 bossRoundNumber; uint256 bossHp; uint256 def; uint256 prizePool; address playerLastAtk; uint256 totalDame; bool ended; } event eventAttackBoss( uint256 bossRoundNumber, address playerAtk, uint256 virusAtk, uint256 dame, uint256 totalDame, uint256 timeAtk, bool isLastHit, uint256 crystalsReward ); event eventEndAtkBoss( uint256 bossRoundNumber, address playerWin, uint256 ethBonus, uint256 bossHp, uint256 prizePool ); modifier disableContract() { require(tx.origin == msg.sender); _; } modifier isAdministrator() { require(msg.sender == administrator); _; } constructor() public { administrator = msg.sender; // set interface contract setMiningWarInterface(0x1b002cd1ba79dfad65e8abfbb3a97826e4960fe5); setEngineerInterface(0xd7afbf5141a7f1d6b0473175f7a6b0a7954ed3d2); } function () public payable { } function isContractMiniGame() public pure returns( bool _isContractMiniGame ) { _isContractMiniGame = true; } function isBossWannaCryContract() public pure returns(bool) { return true; } /** * @dev Main Contract call this function to setup mini game. */ function setupMiniGame( uint256 /*_miningWarRoundNumber*/, uint256 /*_miningWarDeadline*/ ) public { } //@dev use this function in case of bug function upgrade(address addr) public isAdministrator { selfdestruct(addr); } // --------------------------------------------------------------------------------------- // SET INTERFACE CONTRACT // --------------------------------------------------------------------------------------- function setMiningWarInterface(address _addr) public isAdministrator { CryptoMiningWarInterface miningWarInterface = CryptoMiningWarInterface(_addr); require(miningWarInterface.isMiningWarContract() == true); MiningWar = miningWarInterface; } function setEngineerInterface(address _addr) public isAdministrator { CryptoEngineerInterface engineerInterface = CryptoEngineerInterface(_addr); require(engineerInterface.isEngineerContract() == true); Engineer = engineerInterface; } function setContractsMiniGame( address _addr ) public isAdministrator { MiniGameInterface MiniGame = MiniGameInterface( _addr ); if( MiniGame.isContractMiniGame() == false ) { revert(); } miniGames[_addr] = true; } function setBossRoundNumber(uint256 _value) public isAdministrator { bossRoundNumber = _value; } /** * @dev remove mini game contract from main contract * @param _addr mini game contract address */ function removeContractMiniGame(address _addr) public isAdministrator { miniGames[_addr] = false; } function startGame() public isAdministrator { require(init == false); init = true; bossData[bossRoundNumber].ended = true; startNewBoss(); } /** * @dev set defence for boss * @param _value number defence */ function setDefenceBoss(uint256 _value) public isAdministrator { BOSS_DEF_DEFFAULT = _value; } /** * @dev set HP for boss * @param _value number HP default */ function setBossHPDefault(uint256 _value) public isAdministrator { BOSS_HP_DEFAULT = _value; } function setHalfTimeAtkBoss(uint256 _value) public isAdministrator { HALF_TIME_ATK_BOSS = _value; } function startNewBoss() private { require(bossData[bossRoundNumber].ended == true); bossRoundNumber = bossRoundNumber + 1; uint256 bossHp = BOSS_HP_DEFAULT * bossRoundNumber; // claim 5% of current prizePool as rewards. uint256 engineerPrizePool = Engineer.prizePool(); uint256 prizePool = SafeMath.div(SafeMath.mul(engineerPrizePool, 5),100); Engineer.claimPrizePool(address(this), prizePool); bossData[bossRoundNumber] = BossData(bossRoundNumber, bossHp, BOSS_DEF_DEFFAULT, prizePool, 0x0, 0, false); } function endAtkBoss() private { require(bossData[bossRoundNumber].ended == false); require(bossData[bossRoundNumber].totalDame >= bossData[bossRoundNumber].bossHp); BossData storage b = bossData[bossRoundNumber]; b.ended = true; // update eth bonus for player last hit uint256 ethBonus = SafeMath.div( SafeMath.mul(b.prizePool, 5), 100 ); if (b.playerLastAtk != 0x0) { PlayerData storage p = players[b.playerLastAtk]; p.win = p.win + ethBonus; uint256 share = SafeMath.div(SafeMath.mul(SafeMath.mul(b.prizePool, 95), p.dame), SafeMath.mul(b.totalDame, 100)); ethBonus += share; } emit eventEndAtkBoss(bossRoundNumber, b.playerLastAtk, ethBonus, b.bossHp, b.prizePool); startNewBoss(); } /** * @dev player atk the boss * @param _value number virus for this attack boss */ function atkBoss(uint256 _value) public disableContract { require(bossData[bossRoundNumber].ended == false); require(bossData[bossRoundNumber].totalDame < bossData[bossRoundNumber].bossHp); require(players[msg.sender].nextTimeAtk <= now); Engineer.subVirus(msg.sender, _value); uint256 rate = 50 + randomNumber(msg.sender, now, 60); // 50 - 110% uint256 atk = SafeMath.div(SafeMath.mul(_value, rate), 100); updateShareETH(msg.sender); // update dame BossData storage b = bossData[bossRoundNumber]; uint256 currentTotalDame = b.totalDame; uint256 dame = 0; if (atk > b.def) { dame = SafeMath.sub(atk, b.def); } b.totalDame = SafeMath.min(SafeMath.add(currentTotalDame, dame), b.bossHp); b.playerLastAtk = msg.sender; dame = SafeMath.sub(b.totalDame, currentTotalDame); // bonus crystals uint256 crystalsBonus = SafeMath.div(SafeMath.mul(dame, 5), 100); MiningWar.addCrystal(msg.sender, crystalsBonus); // update player PlayerData storage p = players[msg.sender]; p.nextTimeAtk = now + HALF_TIME_ATK_BOSS; if (p.currentBossRoundNumber == bossRoundNumber) { p.dame = SafeMath.add(p.dame, dame); } else { p.currentBossRoundNumber = bossRoundNumber; p.dame = dame; } bool isLastHit; if (b.totalDame >= b.bossHp) { isLastHit = true; endAtkBoss(); } // emit event attack boss emit eventAttackBoss(b.bossRoundNumber, msg.sender, _value, dame, p.dame, now, isLastHit, crystalsBonus); } function updateShareETH(address _addr) private { PlayerData storage p = players[_addr]; if ( bossData[p.currentBossRoundNumber].ended == true && p.lastBossRoundNumber < p.currentBossRoundNumber ) { p.share = SafeMath.add(p.share, calculateShareETH(msg.sender, p.currentBossRoundNumber)); p.lastBossRoundNumber = p.currentBossRoundNumber; } } /** * @dev calculate share Eth of player */ function calculateShareETH(address _addr, uint256 _bossRoundNumber) public view returns(uint256 _share) { PlayerData memory p = players[_addr]; BossData memory b = bossData[_bossRoundNumber]; if ( p.lastBossRoundNumber >= p.currentBossRoundNumber && p.currentBossRoundNumber != 0 ) { _share = 0; } else { if (b.totalDame == 0) return 0; _share = SafeMath.div(SafeMath.mul(SafeMath.mul(b.prizePool, 95), p.dame), SafeMath.mul(b.totalDame, 100)); // prizePool * 95% * playerDame / totalDame } if (b.ended == false) _share = 0; } function getCurrentReward(address _addr) public view returns(uint256 _currentReward) { PlayerData memory p = players[_addr]; _currentReward = SafeMath.add(p.win, p.share); _currentReward += calculateShareETH(_addr, p.currentBossRoundNumber); } function withdrawReward(address _addr) public { updateShareETH(_addr); PlayerData storage p = players[_addr]; uint256 reward = SafeMath.add(p.share, p.win); if (address(this).balance >= reward && reward > 0) { _addr.transfer(reward); // update player p.win = 0; p.share = 0; } } //-------------------------------------------------------------------------- // INTERNAL FUNCTION //-------------------------------------------------------------------------- function devFee(uint256 _amount) private pure returns(uint256) { return SafeMath.div(SafeMath.mul(_amount, 5), 100); } function randomNumber(address _addr, uint256 randNonce, uint256 _maxNumber) private returns(uint256) { return uint256(keccak256(abi.encodePacked(now, _addr, randNonce))) % _maxNumber; } }
0x
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
6,473
0x4b95ecf2a6ebf1371158b3f1a9ca32ce18d7c751
pragma solidity ^0.4.13; contract Receiver { function tokenFallback(address from, uint value, bytes data); } /* * ERC20 interface * see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { uint public totalSupply; function balanceOf(address who) public constant returns (uint); function allowance(address owner, address spender) public constant returns (uint); function transfer(address to, uint value) public returns (bool ok); function transferFrom(address from, address to, uint value) public returns (bool ok); function approve(address spender, uint value) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } /** * Math operations with safety checks */ contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function safeDiv(uint a, uint b) internal returns (uint) { assert(b > 0); uint c = a / b; assert(a == b * c + a % b); return c; } function safeSub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } function safeAdd(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c>=a && c>=b); return c; } function max64(uint64 a, uint64 b) internal constant returns (uint64) { return a >= b ? a : b; } function min64(uint64 a, uint64 b) internal constant returns (uint64) { return a < b ? a : b; } function max256(uint256 a, uint256 b) internal constant returns (uint256) { return a >= b ? a : b; } function min256(uint256 a, uint256 b) internal constant returns (uint256) { return a < b ? a : b; } function assert(bool assertion) internal { if (!assertion) { revert(); } } } /** * Standard ERC20 token with Short Hand Attack and approve() race condition mitigation. * * Based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, SafeMath { event Transfer(address indexed from, address indexed to, uint indexed value, bytes data); /* Token supply got increased and a new owner received these tokens */ event Minted(address receiver, uint amount); /* Actual balances of token holders */ mapping(address => uint) balances; /* approve() allowances */ mapping (address => mapping (address => uint)) allowed; /** * * Fix for the ERC20 short address attack * * http://vessenes.com/the-erc20-short-address-attack-explained/ */ modifier onlyPayloadSize(uint size) { if(msg.data.length != size + 4) { revert(); } _; } function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) public returns (bool success) { bytes memory _empty; return transfer(_to, _value, _empty); } function transfer(address _to, uint _value, bytes _data) public returns (bool success) { balances[msg.sender] = safeSub(balances[msg.sender], _value); balances[_to] = safeAdd(balances[_to], _value); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); if (isContract(_to)) { Receiver(_to).tokenFallback(msg.sender, _value, _data); } return true; } // ERC223 fetch contract size (must be nonzero to be a contract) function isContract( address _addr ) private returns (bool) { uint length; _addr = _addr; assembly { length := extcodesize(_addr) } return (length > 0); } function transferFrom(address _from, address _to, uint _value) public returns (bool success) { uint _allowance = allowed[_from][msg.sender]; // Check is not needed because safeSub(_allowance, _value) will already throw if this condition is not met // if (_value > _allowance) revert(); balances[_to] = safeAdd(balances[_to], _value); balances[_from] = safeSub(balances[_from], _value); allowed[_from][msg.sender] = safeSub(_allowance, _value); Transfer(_from, _to, _value); return true; } function balanceOf(address _owner) public constant returns (uint balance) { return balances[_owner]; } function approve(address _spender, uint _value) public returns (bool success) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) revert(); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public constant returns (uint remaining) { return allowed[_owner][_spender]; } /** * Atomic increment of approved spending * * Works around https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * */ function addApproval(address _spender, uint _addedValue) public onlyPayloadSize(2 * 32) returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; allowed[msg.sender][_spender] = safeAdd(oldValue, _addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * Atomic decrement of approved spending. * * Works around https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 */ function subApproval(address _spender, uint _subtractedValue) public onlyPayloadSize(2 * 32) returns (bool success) { uint oldVal = allowed[msg.sender][_spender]; if (_subtractedValue > oldVal) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = safeSub(oldVal, _subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract BurnableToken is StandardToken { address public constant BURN_ADDRESS = 0; /** How many tokens we burned */ event Burned(address burner, uint burnedAmount); /** * Burn extra tokens from a balance. * */ function burn(uint burnAmount) public { address burner = msg.sender; balances[burner] = safeSub(balances[burner], burnAmount); totalSupply = safeSub(totalSupply, burnAmount); Burned(burner, burnAmount); } } /** * Upgrade agent interface inspired by Lunyr. * * Upgrade agent transfers tokens to a new contract. * Upgrade agent itself can be the token contract, or just a middle man contract doing the heavy lifting. */ contract UpgradeAgent { uint public originalSupply; /** Interface marker */ function isUpgradeAgent() public constant returns (bool) { return true; } function upgradeFrom(address _from, uint256 _value) public; } /** * A token upgrade mechanism where users can opt-in amount of tokens to the next smart contract revision. * * First envisioned by Golem and Lunyr projects. */ contract UpgradeableToken is StandardToken { /** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */ address public upgradeMaster; /** The next contract where the tokens will be migrated. */ UpgradeAgent public upgradeAgent; /** How many tokens we have upgraded by now. */ uint256 public totalUpgraded; /** * Upgrade states. * * - NotAllowed: The child contract has not reached a condition where the upgrade can bgun * - WaitingForAgent: Token allows upgrade, but we don&#39;t have a new agent yet * - ReadyToUpgrade: The agent is set, but not a single token has been upgraded yet * - Upgrading: Upgrade agent is set and the balance holders can upgrade their tokens * */ enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade, Upgrading} /** * Somebody has upgraded some of his tokens. */ event Upgrade(address indexed _from, address indexed _to, uint256 _value); /** * New upgrade agent available. */ event UpgradeAgentSet(address agent); /** * Do not allow construction without upgrade master set. */ function UpgradeableToken(address _upgradeMaster) public { upgradeMaster = _upgradeMaster; } /** * Allow the token holder to upgrade some of their tokens to a new contract. */ function upgrade(uint256 value) public { UpgradeState state = getUpgradeState(); if(!(state == UpgradeState.ReadyToUpgrade || state == UpgradeState.Upgrading)) { // Called in a bad state revert(); } // Validate input value. if (value == 0) revert(); balances[msg.sender] = safeSub(balances[msg.sender], value); // Take tokens out from circulation totalSupply = safeSub(totalSupply, value); totalUpgraded = safeAdd(totalUpgraded, value); // Upgrade agent reissues the tokens upgradeAgent.upgradeFrom(msg.sender, value); Upgrade(msg.sender, upgradeAgent, value); } /** * Set an upgrade agent that handles */ function setUpgradeAgent(address agent) external { if(!canUpgrade()) { // The token is not yet in a state that we could think upgrading revert(); } if (agent == 0x0) revert(); // Only a master can designate the next agent if (msg.sender != upgradeMaster) revert(); // Upgrade has already begun for an agent if (getUpgradeState() == UpgradeState.Upgrading) revert(); upgradeAgent = UpgradeAgent(agent); // Bad interface if(!upgradeAgent.isUpgradeAgent()) revert(); // Make sure that token supplies match in source and target if (upgradeAgent.originalSupply() != totalSupply) revert(); UpgradeAgentSet(upgradeAgent); } /** * Get the state of the token upgrade. */ function getUpgradeState() public constant returns(UpgradeState) { if(!canUpgrade()) return UpgradeState.NotAllowed; else if(address(upgradeAgent) == 0x00) return UpgradeState.WaitingForAgent; else if(totalUpgraded == 0) return UpgradeState.ReadyToUpgrade; else return UpgradeState.Upgrading; } /** * Change the upgrade master. * * This allows us to set a new owner for the upgrade mechanism. */ function setUpgradeMaster(address master) public { if (master == 0x0) revert(); if (msg.sender != upgradeMaster) revert(); upgradeMaster = master; } /** * Child contract can enable to provide the condition when the upgrade can begun. */ function canUpgrade() public constant returns(bool) { return true; } } contract WeTestToken is BurnableToken, UpgradeableToken { string public name; string public symbol; uint public decimals; address public owner; bool public mintingFinished = false; mapping(address => uint) public previligedBalances; /** List of agents that are allowed to create new tokens */ mapping(address => bool) public mintAgents; event MintingAgentChanged(address addr, bool state); modifier onlyOwner() { if(msg.sender != owner) revert(); _; } modifier onlyMintAgent() { // Only crowdsale contracts are allowed to mint new tokens if(!mintAgents[msg.sender]) revert(); _; } /** Make sure we are not done yet. */ modifier canMint() { if(mintingFinished) revert(); _; } modifier onlyNotSame(address _from, address _to) { if(_from == _to) revert(); _; } function transferOwnership(address newOwner) public onlyOwner { if (newOwner != address(0)) { owner = newOwner; } } function WeTestToken(address _owner, string _name, string _symbol, uint _totalSupply, uint _decimals) public UpgradeableToken(_owner) { name = _name; symbol = _symbol; decimals = _decimals; totalSupply = _totalSupply * 10 ** uint(decimals); // Allocate initial balance to the owner balances[_owner] = totalSupply; // save the owner owner = _owner; } function mintingFinish() public onlyOwner { mintingFinished = true; } // privileged transfer function transferPrivileged(address _to, uint _value) public onlyOwner returns (bool success) { balances[msg.sender] = safeSub(balances[msg.sender], _value); balances[_to] = safeAdd(balances[_to], _value); previligedBalances[_to] = safeAdd(previligedBalances[_to], _value); Transfer(msg.sender, _to, _value); return true; } // get priveleged balance function getPrivilegedBalance(address _owner) public constant returns (uint balance) { return previligedBalances[_owner]; } // admin only can transfer from the privileged accounts function transferFromPrivileged(address _from, address _to, uint _value) public onlyOwner onlyNotSame(_from, _to) returns (bool success) { uint availablePrevilegedBalance = previligedBalances[_from]; balances[_from] = safeSub(balances[_from], _value); balances[_to] = safeAdd(balances[_to], _value); previligedBalances[_from] = safeSub(availablePrevilegedBalance, _value); Transfer(_from, _to, _value); return true; } /** * Create new tokens and allocate them to an address.. * * Only callably by a crowdsale contract (mint agent). */ function mint(address receiver, uint amount) onlyMintAgent canMint public { amount *= 10 ** uint(decimals); totalSupply = safeAdd(totalSupply, amount); balances[receiver] = safeAdd(balances[receiver], amount); // This will make the mint transaction apper in EtherScan.io // We can remove this after there is a standardized minting event Transfer(0, receiver, amount); } /** * Owner can allow a crowdsale contract to mint new tokens. */ function setMintAgent(address addr, bool state) onlyOwner canMint public { mintAgents[addr] = state; MintingAgentChanged(addr, state); } }
0x6080604052600436106101875763ffffffff60e060020a60003504166305d2035b811461018c57806306fdde03146101b5578063095ea7b31461023f57806318160ddd146102635780631a017f3f1461028a57806323b872dd146102ae578063313ce567146102d85780633ba8c9a7146102ed57806340c10f191461030457806342966c681461032857806342c1867b14610340578063432146751461036157806345977d03146103875780635d3171d91461039f5780635de4ccb0146103c9578063600440cb146103fa57806370a082311461040f5780638444b391146104305780638c133a77146104695780638da5cb5b1461048a57806395d89b411461049f5780639738968c146104b4578063a9059cbb146104c9578063ab7e9dca146104ed578063ac3cb72c1461050e578063be45fd6214610532578063c752ff621461059b578063d7e7088a146105b0578063dd62ed3e146105d1578063e2301d02146105f8578063f2fde38b1461061c578063fccc28131461063d578063ffeb7d7514610652575b600080fd5b34801561019857600080fd5b506101a1610673565b604080519115158252519081900360200190f35b3480156101c157600080fd5b506101ca610694565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102045781810151838201526020016101ec565b50505050905090810190601f1680156102315780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561024b57600080fd5b506101a1600160a060020a0360043516602435610722565b34801561026f57600080fd5b506102786107c7565b60408051918252519081900360200190f35b34801561029657600080fd5b506101a1600160a060020a03600435166024356107cd565b3480156102ba57600080fd5b506101a1600160a060020a03600435811690602435166044356108bb565b3480156102e457600080fd5b506102786109aa565b3480156102f957600080fd5b506103026109b0565b005b34801561031057600080fd5b50610302600160a060020a0360043516602435610a02565b34801561033457600080fd5b50610302600435610ad2565b34801561034c57600080fd5b506101a1600160a060020a0360043516610b68565b34801561036d57600080fd5b50610302600160a060020a03600435166024351515610b7d565b34801561039357600080fd5b50610302600435610c24565b3480156103ab57600080fd5b506101a1600160a060020a0360043581169060243516604435610d9f565b3480156103d557600080fd5b506103de610eb8565b60408051600160a060020a039092168252519081900360200190f35b34801561040657600080fd5b506103de610ec7565b34801561041b57600080fd5b50610278600160a060020a0360043516610ed6565b34801561043c57600080fd5b50610445610ef1565b6040518082600481111561045557fe5b60ff16815260200191505060405180910390f35b34801561047557600080fd5b50610278600160a060020a0360043516610f3b565b34801561049657600080fd5b506103de610f4d565b3480156104ab57600080fd5b506101ca610f5c565b3480156104c057600080fd5b506101a1610fb7565b3480156104d557600080fd5b506101a1600160a060020a0360043516602435610fbc565b3480156104f957600080fd5b50610278600160a060020a0360043516610fe3565b34801561051a57600080fd5b506101a1600160a060020a0360043516602435610ffe565b34801561053e57600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101a1948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506110ae9650505050505050565b3480156105a757600080fd5b506102786112f2565b3480156105bc57600080fd5b50610302600160a060020a03600435166112f8565b3480156105dd57600080fd5b50610278600160a060020a03600435811690602435166114e0565b34801561060457600080fd5b506101a1600160a060020a036004351660243561150b565b34801561062857600080fd5b50610302600160a060020a03600435166115ea565b34801561064957600080fd5b506103de611640565b34801561065e57600080fd5b50610302600160a060020a0360043516611645565b60095474010000000000000000000000000000000000000000900460ff1681565b6006805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561071a5780601f106106ef5761010080835404028352916020019161071a565b820191906000526020600020905b8154815290600101906020018083116106fd57829003601f168201915b505050505081565b600081158015906107575750600160a060020a0333811660009081526002602090815260408083209387168352929052205415155b1561076157600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294825291829020869055815186815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b60005481565b60095460009033600160a060020a039081169116146107eb57600080fd5b600160a060020a03331660009081526001602052604090205461080e90836116a4565b600160a060020a03338116600090815260016020526040808220939093559085168152205461083d90836116b8565b600160a060020a038416600090815260016020908152604080832093909355600a9052205461086c90836116b8565b600160a060020a038085166000818152600a60209081526040918290209490945580518681529051919333909316926000805160206116f183398151915292918290030190a350600192915050565b600160a060020a0380841660009081526002602090815260408083203385168452825280832054938616835260019091528120549091906108fc90846116b8565b600160a060020a03808616600090815260016020526040808220939093559087168152205461092b90846116a4565b600160a060020a03861660009081526001602052604090205561094e81846116a4565b600160a060020a038087166000818152600260209081526040808320338616845282529182902094909455805187815290519288169391926000805160206116f1833981519152929181900390910190a3506001949350505050565b60085481565b60095433600160a060020a039081169116146109cb57600080fd5b6009805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b600160a060020a0333166000908152600b602052604090205460ff161515610a2957600080fd5b60095474010000000000000000000000000000000000000000900460ff1615610a5157600080fd5b600854600a0a81029050610a67600054826116b8565b6000908155600160a060020a038316815260016020526040902054610a8c90826116b8565b600160a060020a03831660008181526001602090815260408083209490945583518581529351929391926000805160206116f18339815191529281900390910190a35050565b33600160a060020a038116600090815260016020526040902054610af690836116a4565b600160a060020a03821660009081526001602052604081209190915554610b1d90836116a4565b60005560408051600160a060020a03831681526020810184905281517f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7929181900390910190a15050565b600b6020526000908152604090205460ff1681565b60095433600160a060020a03908116911614610b9857600080fd5b60095474010000000000000000000000000000000000000000900460ff1615610bc057600080fd5b600160a060020a0382166000818152600b6020908152604091829020805460ff191685151590811790915582519384529083015280517f4b0adf6c802794c7dde28a08a4e07131abcff3bf9603cd71f14f90bec7865efa9281900390910190a15050565b6000610c2e610ef1565b90506003816004811115610c3e57fe5b1480610c5557506004816004811115610c5357fe5b145b1515610c6057600080fd5b811515610c6c57600080fd5b600160a060020a033316600090815260016020526040902054610c8f90836116a4565b600160a060020a03331660009081526001602052604081209190915554610cb690836116a4565b600055600554610cc690836116b8565b60055560048054604080517f753e88e5000000000000000000000000000000000000000000000000000000008152600160a060020a0333811694820194909452602481018690529051929091169163753e88e59160448082019260009290919082900301818387803b158015610d3b57600080fd5b505af1158015610d4f573d6000803e3d6000fd5b5050600454604080518681529051600160a060020a0392831694503390921692507f7e5c344a8141a805725cb476f76c6953b842222b967edd1f78ddb6e8b3f397ac919081900360200190a35050565b600954600090819033600160a060020a03908116911614610dbf57600080fd5b848480600160a060020a031682600160a060020a03161415610de057600080fd5b600160a060020a0387166000908152600a6020908152604080832054600190925290912054909350610e1290866116a4565b600160a060020a038089166000908152600160205260408082209390935590881681522054610e4190866116b8565b600160a060020a038716600090815260016020526040902055610e6483866116a4565b600160a060020a038089166000818152600a60209081526040918290209490945580518981529051928a169391926000805160206116f1833981519152929181900390910190a35060019695505050505050565b600454600160a060020a031681565b600354600160a060020a031681565b600160a060020a031660009081526001602052604090205490565b6000610efb610fb7565b1515610f0957506001610f38565b600454600160a060020a03161515610f2357506002610f38565b6005541515610f3457506003610f38565b5060045b90565b600a6020526000908152604090205481565b600954600160a060020a031681565b6007805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561071a5780601f106106ef5761010080835404028352916020019161071a565b600190565b60006060604036604414610fcf57600080fd5b610fda8585846110ae565b95945050505050565b600160a060020a03166000908152600a602052604090205490565b60008060403660441461101057600080fd5b600160a060020a03338116600090815260026020908152604080832093891683529290522054915061104282856116b8565b600160a060020a033381166000818152600260209081526040808320948b168084529482529182902085905581519485529051929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3506001949350505050565b600160a060020a0333166000908152600160205260408120546110d190846116a4565b600160a060020a03338116600090815260016020526040808220939093559086168152205461110090846116b8565b600160a060020a0380861660008181526001602090815260408083209590955584518181528751818301528751899694953316947fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16948a94849392840192908601918190849084905b83811015611181578181015183820152602001611169565b50505050905090810190601f1680156111ae5780820380516001836020036101000a031916815260200191505b509250505060405180910390a483600160a060020a031633600160a060020a03166000805160206116f1833981519152856040518082815260200191505060405180910390a36111fd846116dc565b156112e85783600160a060020a031663c0ee0b8a3385856040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611281578181015183820152602001611269565b50505050905090810190601f1680156112ae5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1580156112cf57600080fd5b505af11580156112e3573d6000803e3d6000fd5b505050505b5060019392505050565b60055481565b611300610fb7565b151561130b57600080fd5b600160a060020a038116151561132057600080fd5b60035433600160a060020a0390811691161461133b57600080fd5b6004611345610ef1565b600481111561135057fe5b141561135b57600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383811691909117808355604080517f61d3d7a6000000000000000000000000000000000000000000000000000000008152905191909216926361d3d7a6928082019260209290918290030181600087803b1580156113db57600080fd5b505af11580156113ef573d6000803e3d6000fd5b505050506040513d602081101561140557600080fd5b5051151561141257600080fd5b600054600460009054906101000a9004600160a060020a0316600160a060020a0316634b2ba0dd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561146857600080fd5b505af115801561147c573d6000803e3d6000fd5b505050506040513d602081101561149257600080fd5b50511461149e57600080fd5b60045460408051600160a060020a039092168252517f7845d5aa74cc410e35571258d954f23b82276e160fe8c188fa80566580f279cc9181900360200190a150565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60008060403660441461151d57600080fd5b600160a060020a0333811660009081526002602090815260408083209389168352929052205491508184111561157a57600160a060020a033381166000908152600260209081526040808320938916835292905290812055611584565b61104282856116a4565b600160a060020a033381166000818152600260209081526040808320948a168084529482529182902054825190815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3506001949350505050565b60095433600160a060020a0390811691161461160557600080fd5b600160a060020a0381161561163d576009805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b600081565b600160a060020a038116151561165a57600080fd5b60035433600160a060020a0390811691161461167557600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60006116b2838311156116e4565b50900390565b60008282016116d58482108015906116d05750838210155b6116e4565b9392505050565b6000903b1190565b80151561163d57600080fd00ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820fd1739a8047fcc25a5f18133740e9a9699e4b267ad0e9562fcabd0b2cca462730029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
6,474
0x3f401b354d2a9326c1843dd274d7d4728d7dc7eb
/** *Submitted for verification at Etherscan.io on 2020-12-10 */ /** *Submitted for verification at Etherscan.io on 2020-12-10 */ pragma solidity 0.6.12; // SPDX-License-Identifier: No License /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256` * (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); } contract PRDZstaking is Ownable { using SafeMath for uint; using EnumerableSet for EnumerableSet.AddressSet; event RewardsTransferred(address holder, uint amount); // PRDZ token contract address address public constant tokenAddress = 0x4e085036A1b732cBe4FfB1C12ddfDd87E7C3664d; // reward rate 80.00% per year uint public constant rewardRate = 8000; uint public constant scoreRate = 1000; uint public constant rewardInterval = 365 days; uint public constant scoreInterval = 3 days; uint public scoreEth = 11340; // unstaking fee 2.00 percent uint public constant unstakingFeeRate = 250; // unstaking possible after 72 hours uint public constant cliffTime = 72 hours; uint public totalClaimedRewards = 0; uint public totalStakedToken = 0; EnumerableSet.AddressSet private holders; mapping (address => uint) public depositedTokens; mapping (address => uint) public stakingTime; mapping (address => uint) public lastClaimedTime; mapping (address => uint) public totalEarnedTokens; mapping (address => uint) public totalScore; mapping (address => uint) public lastScoreTime; function updateAccount(address account) private { uint pendingDivs = getPendingDivs(account); if (pendingDivs > 0) { require(Token(tokenAddress).transfer(account, pendingDivs), "Could not transfer tokens."); totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs); totalClaimedRewards = totalClaimedRewards.add(pendingDivs); emit RewardsTransferred(account, pendingDivs); } lastClaimedTime[account] = now; } function updateScore(address _holder) private { lastScoreTime[_holder] = now ; } function getScoreEth(address _holder) public view returns (uint) { uint timeDiff = 0 ; if(lastScoreTime[_holder] > 0){ timeDiff = now.sub(lastScoreTime[_holder]).div(2); } uint stakedAmount = depositedTokens[_holder]; uint score = stakedAmount .mul(scoreRate) .mul(timeDiff) .div(scoreInterval) .div(1e4); uint eth = score.div(scoreEth); return eth; } function getStakingScore(address _holder) public view returns (uint) { uint timeDiff = 0 ; if(lastScoreTime[_holder] > 0){ timeDiff = now.sub(lastScoreTime[_holder]).div(2); } uint stakedAmount = depositedTokens[_holder]; uint score = stakedAmount .mul(scoreRate) .mul(timeDiff) .div(scoreInterval) .div(1e4); return score; } function getPendingDivs(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 pendingDivs = stakedAmount .mul(rewardRate) .mul(timeDiff) .div(rewardInterval) .div(1e4); return pendingDivs; } function getNumberOfHolders() public view returns (uint) { return holders.length(); } function getTotalStaked() public view returns (uint) { return totalStakedToken; } function stake(uint amountToStake) public { require(amountToStake > 0, "Cannot deposit 0 Tokens"); require(Token(tokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance"); updateAccount(msg.sender); updateScore(msg.sender); depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToStake); totalStakedToken = totalStakedToken.add(amountToStake); if (!holders.contains(msg.sender)) { holders.add(msg.sender); stakingTime[msg.sender] = now; } } function OldStake(address _holder , uint amountToStake , uint stakeTime) public onlyOwner { require(amountToStake > 0, "Cannot deposit 0 Tokens"); require(Token(tokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance"); lastClaimedTime[_holder] = stakeTime; lastScoreTime[_holder] = stakeTime ; totalStakedToken = totalStakedToken.add(amountToStake); depositedTokens[_holder] = depositedTokens[_holder].add(amountToStake); if (!holders.contains(_holder)) { holders.add(_holder); stakingTime[_holder] = stakeTime; } } function unstake(uint amountToWithdraw) public { require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw"); updateAccount(msg.sender); uint fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4); uint amountAfterFee = amountToWithdraw.sub(fee); require(Token(tokenAddress).transfer(owner, fee), "Could not transfer withdraw fee."); require(Token(tokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens."); totalStakedToken = totalStakedToken.sub(amountAfterFee); uint timeDiff = 0 ; if(lastScoreTime[msg.sender] > 0){ timeDiff = now.sub(lastScoreTime[msg.sender]).div(2); } uint score = amountAfterFee .mul(scoreRate) .mul(timeDiff) .div(scoreInterval) .div(1e4); uint eth = score.div(scoreEth); msg.sender.transfer(eth); lastScoreTime[msg.sender] = now; depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw); if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) { holders.remove(msg.sender); } } function claimReward() public { updateAccount(msg.sender); } function withdraw() public onlyOwner{ msg.sender.transfer(address(this).balance); } function claimScoreEth() public { uint timeDiff = 0 ; if(lastScoreTime[msg.sender] > 0){ timeDiff = now.sub(lastScoreTime[msg.sender]).div(2); } uint stakedAmount = depositedTokens[msg.sender]; uint score = stakedAmount .mul(scoreRate) .mul(timeDiff) .div(scoreInterval) .div(1e4); uint eth = score.div(scoreEth); msg.sender.transfer(eth); lastScoreTime[msg.sender] = now; } uint private constant stakingAndDaoTokens = 84000000000000000000000; function getStakingAndDaoAmount() public view returns (uint) { if (totalClaimedRewards >= stakingAndDaoTokens) { return 0; } uint remaining = stakingAndDaoTokens.sub(totalClaimedRewards); return remaining; } function deposit() payable public { // nothing to do! } function updateScoreEth(uint _amount) public onlyOwner { scoreEth = _amount ; } // function to allow admin to claim *other* ERC20 tokens sent to this contract (by mistake) function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner { if (_tokenAddr == tokenAddress) { if (_amount > getStakingAndDaoAmount()) { revert(); } totalClaimedRewards = totalClaimedRewards.add(_amount); } Token(_tokenAddr).transfer(_to, _amount); } }
0x6080604052600436106101ee5760003560e01c806393bcb5a31161010d578063c326bf4f116100a0578063d0e30db01161006f578063d0e30db014610921578063d578ceab1461092b578063d816c7d514610956578063f2fde38b14610981578063f3f91fa0146109d2576101ee565b8063c326bf4f1461083b578063c7c09074146108a0578063cb6d8ee6146108cb578063ce40453d146108f6576101ee565b8063a84e9dee116100dc578063a84e9dee14610759578063a967b72c146107be578063b88a802f146107f9578063bec4de3f14610810576101ee565b806393bcb5a31461066157806398896d10146106785780639d76ea58146106dd578063a694fc3a1461071e576101ee565b80634b3d36c7116101855780637b0a47ee116101545780637b0a47ee1461052b57806384eda6621461055657806387285587146105bb5780638da5cb5b14610620576101ee565b80634b3d36c714610381578063583d42fd146103e65780636270cd181461044b5780636a395ccb146104b0576101ee565b8063308feec3116101c1578063308feec3146102af57806335d8f62f146102da5780633a5ec6531461033f5780633ccfd60b1461036a576101ee565b80630917e776146101f35780630f1a64441461021e578063268cab49146102495780632e17de7814610274575b600080fd5b3480156101ff57600080fd5b50610208610a37565b6040518082815260200191505060405180910390f35b34801561022a57600080fd5b50610233610a41565b6040518082815260200191505060405180910390f35b34801561025557600080fd5b5061025e610a48565b6040518082815260200191505060405180910390f35b34801561028057600080fd5b506102ad6004803603602081101561029757600080fd5b8101908080359060200190929190505050610a91565b005b3480156102bb57600080fd5b506102c46110f1565b6040518082815260200191505060405180910390f35b3480156102e657600080fd5b50610329600480360360208110156102fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611102565b6040518082815260200191505060405180910390f35b34801561034b57600080fd5b50610354611276565b6040518082815260200191505060405180910390f35b34801561037657600080fd5b5061037f61127d565b005b34801561038d57600080fd5b506103e4600480360360608110156103a457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919050505061131e565b005b3480156103f257600080fd5b506104356004803603602081101561040957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116eb565b6040518082815260200191505060405180910390f35b34801561045757600080fd5b5061049a6004803603602081101561046e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611703565b6040518082815260200191505060405180910390f35b3480156104bc57600080fd5b50610529600480360360608110156104d357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061171b565b005b34801561053757600080fd5b5061054061189d565b6040518082815260200191505060405180910390f35b34801561056257600080fd5b506105a56004803603602081101561057957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118a3565b6040518082815260200191505060405180910390f35b3480156105c757600080fd5b5061060a600480360360208110156105de57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118bb565b6040518082815260200191505060405180910390f35b34801561062c57600080fd5b50610635611a15565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561066d57600080fd5b50610676611a39565b005b34801561068457600080fd5b506106c76004803603602081101561069b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c2c565b6040518082815260200191505060405180910390f35b3480156106e957600080fd5b506106f2611d9b565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561072a57600080fd5b506107576004803603602081101561074157600080fd5b8101908080359060200190929190505050611db3565b005b34801561076557600080fd5b506107a86004803603602081101561077c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120b0565b6040518082815260200191505060405180910390f35b3480156107ca57600080fd5b506107f7600480360360208110156107e157600080fd5b81019080803590602001909291905050506120c8565b005b34801561080557600080fd5b5061080e61212a565b005b34801561081c57600080fd5b50610825612135565b6040518082815260200191505060405180910390f35b34801561084757600080fd5b5061088a6004803603602081101561085e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061213d565b6040518082815260200191505060405180910390f35b3480156108ac57600080fd5b506108b5612155565b6040518082815260200191505060405180910390f35b3480156108d757600080fd5b506108e061215b565b6040518082815260200191505060405180910390f35b34801561090257600080fd5b5061090b612161565b6040518082815260200191505060405180910390f35b610929612167565b005b34801561093757600080fd5b50610940612169565b6040518082815260200191505060405180910390f35b34801561096257600080fd5b5061096b61216f565b6040518082815260200191505060405180910390f35b34801561098d57600080fd5b506109d0600480360360208110156109a457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612174565b005b3480156109de57600080fd5b50610a21600480360360208110156109f557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506122c3565b6040518082815260200191505060405180910390f35b6000600354905090565b6203f48081565b60006911c9a62d04ed0c80000060025410610a665760009050610a8e565b6000610a876002546911c9a62d04ed0c8000006122db90919063ffffffff16565b9050809150505b90565b80600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610b46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b610b4f336122f2565b6000610b79612710610b6b60fa8561258890919063ffffffff16565b6125b790919063ffffffff16565b90506000610b9082846122db90919063ffffffff16565b9050734e085036a1b732cbe4ffb1c12ddfdd87e7c3664d73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c3757600080fd5b505af1158015610c4b573d6000803e3d6000fd5b505050506040513d6020811015610c6157600080fd5b8101908080519060200190929190505050610ce4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f436f756c64206e6f74207472616e73666572207769746864726177206665652e81525060200191505060405180910390fd5b734e085036a1b732cbe4ffb1c12ddfdd87e7c3664d73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610d6957600080fd5b505af1158015610d7d573d6000803e3d6000fd5b505050506040513d6020811015610d9357600080fd5b8101908080519060200190929190505050610e16576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b610e2b816003546122db90919063ffffffff16565b600381905550600080600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115610ee257610edf6002610ed1600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054426122db90919063ffffffff16565b6125b790919063ffffffff16565b90505b6000610f34612710610f266203f480610f1886610f0a6103e88a61258890919063ffffffff16565b61258890919063ffffffff16565b6125b790919063ffffffff16565b6125b790919063ffffffff16565b90506000610f4d600154836125b790919063ffffffff16565b90503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610f95573d6000803e3d6000fd5b5042600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061102c86600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122db90919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110833360046125d090919063ffffffff16565b80156110ce57506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b156110e9576110e733600461260090919063ffffffff16565b505b505050505050565b60006110fd6004612630565b905090565b600080600090506000600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156111b9576111b660026111a8600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054426122db90919063ffffffff16565b6125b790919063ffffffff16565b90505b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600061124f6127106112416203f480611233876112256103e88961258890919063ffffffff16565b61258890919063ffffffff16565b6125b790919063ffffffff16565b6125b790919063ffffffff16565b90506000611268600154836125b790919063ffffffff16565b905080945050505050919050565b6203f48081565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112d557600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f1935050505015801561131b573d6000803e3d6000fd5b50565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461137657600080fd5b600082116113ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b734e085036a1b732cbe4ffb1c12ddfdd87e7c3664d73ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561148f57600080fd5b505af11580156114a3573d6000803e3d6000fd5b505050506040513d60208110156114b957600080fd5b810190808051906020019092919050505061153c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b80600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115d98260035461264590919063ffffffff16565b60038190555061163182600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461264590919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116888360046125d090919063ffffffff16565b6116e6576116a083600461266190919063ffffffff16565b5080600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b60076020528060005260406000206000915090505481565b60096020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461177357600080fd5b734e085036a1b732cbe4ffb1c12ddfdd87e7c3664d73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156117eb576117c3610a48565b8111156117cf57600080fd5b6117e48160025461264590919063ffffffff16565b6002819055505b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561185c57600080fd5b505af1158015611870573d6000803e3d6000fd5b505050506040513d602081101561188657600080fd5b810190808051906020019092919050505050505050565b611f4081565b600a6020528060005260406000206000915090505481565b600080600090506000600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156119725761196f6002611961600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054426122db90919063ffffffff16565b6125b790919063ffffffff16565b90505b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000611a086127106119fa6203f4806119ec876119de6103e88961258890919063ffffffff16565b61258890919063ffffffff16565b6125b790919063ffffffff16565b6125b790919063ffffffff16565b9050809350505050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115611aea57611ae76002611ad9600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054426122db90919063ffffffff16565b6125b790919063ffffffff16565b90505b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000611b80612710611b726203f480611b6487611b566103e88961258890919063ffffffff16565b61258890919063ffffffff16565b6125b790919063ffffffff16565b6125b790919063ffffffff16565b90506000611b99600154836125b790919063ffffffff16565b90503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611be1573d6000803e3d6000fd5b5042600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050505050565b6000611c428260046125d090919063ffffffff16565b611c4f5760009050611d96565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ca05760009050611d96565b6000611cf4600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054426122db90919063ffffffff16565b90506000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000611d8d612710611d7f6301e13380611d7187611d63611f408961258890919063ffffffff16565b61258890919063ffffffff16565b6125b790919063ffffffff16565b6125b790919063ffffffff16565b90508093505050505b919050565b734e085036a1b732cbe4ffb1c12ddfdd87e7c3664d81565b60008111611e29576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b734e085036a1b732cbe4ffb1c12ddfdd87e7c3664d73ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611ecc57600080fd5b505af1158015611ee0573d6000803e3d6000fd5b505050506040513d6020811015611ef657600080fd5b8101908080519060200190929190505050611f79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b611f82336122f2565b611f8b33612691565b611fdd81600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461264590919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120358160035461264590919063ffffffff16565b60038190555061204f3360046125d090919063ffffffff16565b6120ad5761206733600461266190919063ffffffff16565b5042600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b50565b600b6020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461212057600080fd5b8060018190555050565b612133336122f2565b565b6301e1338081565b60066020528060005260406000206000915090505481565b6103e881565b60035481565b60015481565b565b60025481565b60fa81565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146121cc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561220657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60086020528060005260406000206000915090505481565b6000828211156122e757fe5b818303905092915050565b60006122fd82611c2c565b9050600081111561254057734e085036a1b732cbe4ffb1c12ddfdd87e7c3664d73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561238d57600080fd5b505af11580156123a1573d6000803e3d6000fd5b505050506040513d60208110156123b757600080fd5b810190808051906020019092919050505061243a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61248c81600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461264590919063ffffffff16565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124e48160025461264590919063ffffffff16565b6002819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b600080828402905060008414806125a75750828482816125a457fe5b04145b6125ad57fe5b8091505092915050565b6000808284816125c357fe5b0490508091505092915050565b60006125f8836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6126d8565b905092915050565b6000612628836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6126fb565b905092915050565b600061263e826000016127e3565b9050919050565b60008082840190508381101561265757fe5b8091505092915050565b6000612689836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6127f4565b905092915050565b42600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b600080836001016000848152602001908152602001600020541415905092915050565b600080836001016000848152602001908152602001600020549050600081146127d7576000600182039050600060018660000180549050039050600086600001828154811061274657fe5b906000526020600020015490508087600001848154811061276357fe5b906000526020600020018190555060018301876001016000838152602001908152602001600020819055508660000180548061279b57fe5b600190038181906000526020600020016000905590558660010160008781526020019081526020016000206000905560019450505050506127dd565b60009150505b92915050565b600081600001805490509050919050565b600061280083836126d8565b61285957826000018290806001815401808255809150506001900390600052602060002001600090919091909150558260000180549050836001016000848152602001908152602001600020819055506001905061285e565b600090505b9291505056fea2646970667358221220fa4b5faa56fce973139bf5be274feba6155566360ae7ef66551f6bdb9e95931d64736f6c634300060c0033
{"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"}]}}
6,475
0xac4d22e40bf0b8ef4750a99ed4e935b99a42685e
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * Owned contract */ contract Owned { address public owner; address public newOwner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address _newOwner) public onlyOwner { newOwner = _newOwner; } function acceptOwnership() public { require(msg.sender == newOwner); emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0); } } /** * Secured contract * @dev Important actions such as mint or burn will be controlled by smart contract. * This contract will get admin privillige from owner */ contract Secured is Owned { address public admin; event SetAdmin(address indexed _admin); modifier onlyAdmin { require(msg.sender == admin); _; } function setAdmin(address _newAdmin) public onlyOwner { admin = _newAdmin; emit SetAdmin(admin); } } /** * @title ERC20 interface * @dev */ contract ERC20 { function allowance(address owner, address spender) public view returns (uint256); function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Basic token * @dev Basic version of ERC20 token. * @dev based on https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * @dev Contract which inherit this token should implement transfer and transferFrom as specified in ERC20 */ contract BasicToken is ERC20 { using SafeMath for uint256; mapping(address => uint256) balances; mapping (address => mapping (address => uint256)) internal allowed; uint256 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 Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } } /** * @title TimeLock * @dev Deny some action from lockstart to lockend. * Owner is allowd action even it is timelocked. */ contract Timelocked is Owned { uint256 public lockstart; uint256 public lockend; event SetTimelock(uint256 start, uint256 end); /** * @dev timelock modifier. */ modifier notTimeLocked() { require((msg.sender == owner) || (now < lockstart || now > lockend)); _; } function setTimeLock(uint256 _start, uint256 _end) public onlyOwner { require(_end > _start); lockstart = _start; lockend = _end; emit SetTimelock(_start, _end); } function releaseTimeLock() public onlyOwner { lockstart = 0; lockend = 0; emit SetTimelock(0, 0); } } /** * @title Mintable token * @dev Admin(contract which controls AER token) can mint token. * Minted tokens is belong to owner, so that owner can distribute to users. * After distribution, all remained tokens will be reserved as burnable token. */ contract MintableToken is BasicToken, Owned, Secured { event Mint(address indexed to, uint256 amount); /** * @dev Function to mint tokens * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint( uint256 _amount ) onlyAdmin public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[owner] = balances[owner].add(_amount); emit Mint(owner, _amount); emit Transfer(address(0), owner, _amount); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed) for each AERYUS transaction. * Tokens are burned at a rate based on the average transaction per second. */ contract BurnableToken is BasicToken, Owned, Secured { // coldledger address which has reserved tokens for Aeryus transactions. address public coldledger; event SetColdledger(address ledger); event BurnForTransaction(address who, uint256 nft, string txtype, uint256 value); function setColdLedger(address ledger) public onlyOwner { require(ledger != address(0)); coldledger = ledger; emit SetColdledger(ledger); } /** * @dev All token remained is stored to coldledger. */ function reserveAll() public onlyOwner { uint256 val = balances[owner]; balances[coldledger] = balances[coldledger].add(val); emit Transfer(owner, coldledger, val); } /** * @dev Burns a specific amount of tokens. * @param _nft ERC721 token(NFT) address(index). * @param _txtype transaction type such as POS, mobile, government or * any other type that can be covered by the NFTA model . * @param _value The amount of token to be burned. */ function burn(uint256 _nft, string _txtype, uint256 _value) public onlyAdmin { require(_value <= balances[coldledger]); balances[coldledger] = balances[coldledger].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit BurnForTransaction(coldledger, _nft, _txtype, _value); emit Transfer(coldledger, address(0), _value); } } // ---------------------------------------------------------------------------- // The AER Token is fungible token asset of Aeryus protocol. // As ERC-721 tokens are created to document transactions, AER tokens are burned at a rate based on // the average transaction per second. // Visit http://aeryus.ilhaus.com/ for full details. Thank you // // // AER Token Contract // // Symbol : AER // Name : Aeryus Token // Total supply: 4,166,666,663.000000000000000000 // Decimals : 18 // Website : http://aeryus.ilhaus.com // Company : AERYUS // // ---------------------------------------------------------------------------- contract AerToken is Timelocked, MintableToken, BurnableToken { string public name; string public symbol; uint256 public decimals; constructor(address coldledger) public { name = "Aeryus Token"; symbol = "AER"; decimals = 18; totalSupply_ = 4166666663000000000000000000; balances[msg.sender] = totalSupply_; setColdLedger(coldledger); emit Transfer(address(0), msg.sender, 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 notTimeLocked returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public notTimeLocked 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; } // ------------------------------------------------------------------------ // Do not accept ETH // ------------------------------------------------------------------------ function () public payable { revert(); } // ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // ------------------------------------------------------------------------ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return BasicToken(tokenAddress).transfer(owner, tokens); } }
0x608060405260043610610149576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461014e578063095ea7b3146101de57806318160ddd1461024357806323b872dd1461026e578063313ce567146102f35780633143d97c1461031e578063481ae5d01461035557806362e2aa0014610398578063704b6c021461041557806370a082311461045857806379ba5097146104af5780638da5cb5b146104c657806395d89b411461051d578063a0712d68146105ad578063a9059cbb146105f2578063bd83655414610657578063d0a6b677146106ae578063d4ee1d90146106d9578063dbee0dea14610730578063dc39d06d14610747578063dd62ed3e146107ac578063e118861b14610823578063e173b0d01461084e578063f2fde38b14610865578063f851a440146108a8575b600080fd5b34801561015a57600080fd5b506101636108ff565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a3578082015181840152602081019050610188565b50505050905090810190601f1680156101d05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ea57600080fd5b50610229600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061099d565b604051808215151515815260200191505060405180910390f35b34801561024f57600080fd5b50610258610a8f565b6040518082815260200191505060405180910390f35b34801561027a57600080fd5b506102d9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a99565b604051808215151515815260200191505060405180910390f35b3480156102ff57600080fd5b50610308610ec8565b6040518082815260200191505060405180910390f35b34801561032a57600080fd5b506103536004803603810190808035906020019092919080359060200190929190505050610ece565b005b34801561036157600080fd5b50610396600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f89565b005b3480156103a457600080fd5b5061041360048036038101908080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291905050506110c8565b005b34801561042157600080fd5b50610456600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611414565b005b34801561046457600080fd5b50610499600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611519565b6040518082815260200191505060405180910390f35b3480156104bb57600080fd5b506104c4611561565b005b3480156104d257600080fd5b506104db611702565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561052957600080fd5b50610532611728565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610572578082015181840152602081019050610557565b50505050905090810190601f16801561059f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105b957600080fd5b506105d8600480360381019080803590602001909291905050506117c6565b604051808215151515815260200191505060405180910390f35b3480156105fe57600080fd5b5061063d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a17565b604051808215151515815260200191505060405180910390f35b34801561066357600080fd5b5061066c611cab565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106ba57600080fd5b506106c3611cd1565b6040518082815260200191505060405180910390f35b3480156106e557600080fd5b506106ee611cd7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561073c57600080fd5b50610745611cfd565b005b34801561075357600080fd5b50610792600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611dab565b604051808215151515815260200191505060405180910390f35b3480156107b857600080fd5b5061080d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f11565b6040518082815260200191505060405180910390f35b34801561082f57600080fd5b50610838611f98565b6040518082815260200191505060405180910390f35b34801561085a57600080fd5b50610863611f9e565b005b34801561087157600080fd5b506108a6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506121e2565b005b3480156108b457600080fd5b506108bd612282565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109955780601f1061096a57610100808354040283529160200191610995565b820191906000526020600020905b81548152906001019060200180831161097857829003601f168201915b505050505081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610b045750600554421080610b03575060065442115b5b1515610b0f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610b4b57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b9857600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610c2357600080fd5b610c74826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a890919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d07826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122c190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dd882600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a890919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600b5481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f2a57600080fd5b8181111515610f3857600080fd5b81600581905550806006819055507f3b9d0a05520ac7d374f64abb4be17550283a18f7eb071a5e437f090a584a25f78282604051808381526020018281526020019250505060405180910390a15050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fe557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561102157600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fb4d78e959e155a2851cc8a7b28ac8ec05ab8ea09e46cfa5d59c48a8c3fb1544781604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561112457600080fd5b600080600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561119357600080fd5b61120681600080600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a890919063ffffffff16565b600080600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061127f816002546122a890919063ffffffff16565b6002819055507fe0d8fa90b54b2533c2694a108c74a9ec01d8e74c18c4df9eb8b7b4e030d24efc600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16848484604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b8381101561134a57808201518184015260208101905061132f565b50505050905090810190601f1680156113775780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a1600073ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561147057600080fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f5a272403b402d892977df56625f4164ccaf70ca3863991c43ecfe76a6905b0a160405160405180910390a250565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115bd57600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117be5780601f10611793576101008083540402835291602001916117be565b820191906000526020600020905b8154815290600101906020018083116117a157829003601f168201915b505050505081565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561182457600080fd5b611839826002546122c190919063ffffffff16565b6002819055506118b282600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122c190919063ffffffff16565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a2600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611a825750600554421080611a81575060065442115b5b1515611a8d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611ac957600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611b1657600080fd5b611b67826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a890919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611bfa826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122c190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60065481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d5957600080fd5b600060058190555060006006819055507f3b9d0a05520ac7d374f64abb4be17550283a18f7eb071a5e437f090a584a25f7600080604051808381526020018281526020019250505060405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e0957600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611ece57600080fd5b505af1158015611ee2573d6000803e3d6000fd5b505050506040513d6020811015611ef857600080fd5b8101908080519060200190929190505050905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60055481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ffc57600080fd5b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506120d281600080600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122c190919063ffffffff16565b600080600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561223e57600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008282111515156122b657fe5b818303905092915050565b600081830190508281101515156122d457fe5b809050929150505600a165627a7a72305820a27902999ee07816f8d9a0a6321e70ddf76a3af4fcb05e9fa95c68284037cf610029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
6,476
0x78fceca5bf5ec79c23effece97ae758665ba4f55
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 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); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#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 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; } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } contract PausableToken is StandardToken, 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 YouDeal Token * @dev YDChain. */ contract YouDealToken is PausableToken { string public constant name = "YouDeal Token"; string public constant symbol = "YD"; uint8 public constant decimals = 18; uint256 private constant TOKEN_UNIT = 10 ** uint256(decimals); uint256 private constant INITIAL_SUPPLY = 10500000000 * TOKEN_UNIT; uint256 private constant PRIVATE_SALE_SUPPLY = INITIAL_SUPPLY * 25 / 100; // 25% for private sale uint256 private constant COMMUNITY_REWARDS_SUPPLY = INITIAL_SUPPLY * 40 / 100; // 40% for community rewards uint256 private constant FOUNDATION_SUPPLY = INITIAL_SUPPLY * 20 / 100; // 20% for foundation uint256 private constant TEAM_SUPPLY = INITIAL_SUPPLY * 15 / 100; // 15% for founder team struct VestingGrant { address beneficiary; uint256 start; uint256 duration; //duration for each release uint256 amount; //total grant amount uint256 transfered; // transfered amount uint8 releaseCount; // schedule release count } address private constant PRIVAYE_SALE_ADDRESS = 0x65158a7270b58fd9499bE7E95feFBF2169360728; //team vesting beneficiary address address private constant COMMUNITY_REWARDS_ADDRESS = 0xDFE95879606F520CaC6a3546FE2f0d8BBC10A32b; //community rewards wallet address address private constant FOUNDATION_ADDRESS = 0xC138e8A6763e78fA0fFAD6c392D01e37CF3fdf27; //foundation wallet address VestingGrant teamVestingGrant; /** * @dev Constructor that gives msg.sender all of existing tokens. */ function YouDealToken() public { totalSupply = INITIAL_SUPPLY; balances[PRIVAYE_SALE_ADDRESS] = PRIVATE_SALE_SUPPLY; balances[COMMUNITY_REWARDS_ADDRESS] = COMMUNITY_REWARDS_SUPPLY; balances[FOUNDATION_ADDRESS] = FOUNDATION_SUPPLY; teamVestingGrant = founderGrant(msg.sender, now.add(150 days), (30 days), TEAM_SUPPLY, 30); // The owner address is reserved for the Team Wallet } function founderGrant(address _beneficiary, uint256 _start, uint256 _duration, uint256 _amount, uint8 _releaseCount) internal pure returns (VestingGrant) { return VestingGrant({ beneficiary : _beneficiary, start: _start, duration:_duration, amount:_amount, transfered:0, releaseCount:_releaseCount}); } function releaseTeamVested() public onlyOwner { relaseVestingGrant(teamVestingGrant); } function releasableAmount(uint256 time, VestingGrant grant) internal pure returns (uint256) { if (grant.amount == grant.transfered) { return 0; } if (time < grant.start) { return 0; } uint256 amountPerRelease = grant.amount.div(grant.releaseCount); uint256 amount = amountPerRelease.mul((time.sub(grant.start)).div(grant.duration)); if (amount > grant.amount) { amount = grant.amount; } amount = amount.sub(grant.transfered); return amount; } function relaseVestingGrant(VestingGrant storage grant) internal { uint256 amount = releasableAmount(now, grant); require(amount > 0); grant.transfered = grant.transfered.add(amount); balances[grant.beneficiary] = balances[grant.beneficiary].add(amount); emit Transfer(address(0), grant.beneficiary, amount); } }
0x6060604052600436106100f05763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100f5578063095ea7b31461017f57806318160ddd146101b557806323b872dd146101da578063313ce567146102025780633f4ba83a1461022b5780635c975abb14610240578063661884631461025357806368ba745c1461027557806370a08231146102885780638456cb59146102a75780638da5cb5b146102ba57806395d89b41146102e9578063a9059cbb146102fc578063d73dd6231461031e578063dd62ed3e14610340578063f2fde38b14610365575b600080fd5b341561010057600080fd5b610108610384565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561014457808201518382015260200161012c565b50505050905090810190601f1680156101715780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018a57600080fd5b6101a1600160a060020a03600435166024356103bb565b604051901515815260200160405180910390f35b34156101c057600080fd5b6101c86103e6565b60405190815260200160405180910390f35b34156101e557600080fd5b6101a1600160a060020a03600435811690602435166044356103ec565b341561020d57600080fd5b610215610419565b60405160ff909116815260200160405180910390f35b341561023657600080fd5b61023e61041e565b005b341561024b57600080fd5b6101a161049d565b341561025e57600080fd5b6101a1600160a060020a03600435166024356104ad565b341561028057600080fd5b61023e6104d1565b341561029357600080fd5b6101c8600160a060020a03600435166104f8565b34156102b257600080fd5b61023e610513565b34156102c557600080fd5b6102cd610597565b604051600160a060020a03909116815260200160405180910390f35b34156102f457600080fd5b6101086105a6565b341561030757600080fd5b6101a1600160a060020a03600435166024356105dd565b341561032957600080fd5b6101a1600160a060020a0360043516602435610601565b341561034b57600080fd5b6101c8600160a060020a0360043581169060243516610625565b341561037057600080fd5b61023e600160a060020a0360043516610650565b60408051908101604052600d81527f596f754465616c20546f6b656e00000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff16156103d557600080fd5b6103df83836106eb565b9392505050565b60005481565b60035460009060a060020a900460ff161561040657600080fd5b610411848484610757565b949350505050565b601281565b60035433600160a060020a0390811691161461043957600080fd5b60035460a060020a900460ff16151561045157600080fd5b6003805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff16156104c757600080fd5b6103df83836108d9565b60035433600160a060020a039081169116146104ec57600080fd5b6104f660046109d5565b565b600160a060020a031660009081526001602052604090205490565b60035433600160a060020a0390811691161461052e57600080fd5b60035460a060020a900460ff161561054557600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600354600160a060020a031681565b60408051908101604052600281527f5944000000000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff16156105f757600080fd5b6103df8383610ae0565b60035460009060a060020a900460ff161561061b57600080fd5b6103df8383610bdb565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a0390811691161461066b57600080fd5b600160a060020a038116151561068057600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6000600160a060020a038316151561076e57600080fd5b600160a060020a03841660009081526001602052604090205482111561079357600080fd5b600160a060020a03808516600090815260026020908152604080832033909416835292905220548211156107c657600080fd5b600160a060020a0384166000908152600160205260409020546107ef908363ffffffff610c7f16565b600160a060020a038086166000908152600160205260408082209390935590851681522054610824908363ffffffff610c9116565b600160a060020a0380851660009081526001602090815260408083209490945587831682526002815283822033909316825291909152205461086c908363ffffffff610c7f16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561093657600160a060020a03338116600090815260026020908152604080832093881683529290529081205561096d565b610946818463ffffffff610c7f16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a3600191505b5092915050565b6000610a30428360c060405190810160409081528254600160a060020a0316825260018301546020830152600283015490820152600382015460608201526004820154608082015260059091015460ff1660a0820152610ca0565b905060008111610a3f57600080fd5b6004820154610a54908263ffffffff610c9116565b60048301558154600160a060020a0316600090815260016020526040902054610a83908263ffffffff610c9116565b8254600160a060020a03908116600090815260016020526040808220939093558454909116917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a35050565b6000600160a060020a0383161515610af757600080fd5b600160a060020a033316600090815260016020526040902054821115610b1c57600080fd5b600160a060020a033316600090815260016020526040902054610b45908363ffffffff610c7f16565b600160a060020a033381166000908152600160205260408082209390935590851681522054610b7a908363ffffffff610c9116565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610c13908363ffffffff610c9116565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600082821115610c8b57fe5b50900390565b6000828201838110156103df57fe5b6000806000836080015184606001511415610cbe5760009250610d5b565b8360200151851015610cd35760009250610d5b565b610cef8460a0015160ff1685606001519063ffffffff610d6316565b9150610d2a610d1d8560400151610d118760200151899063ffffffff610c7f16565b9063ffffffff610d6316565b839063ffffffff610d7a16565b90508360600151811115610d4057836060015190505b610d558460800151829063ffffffff610c7f16565b90508092505b505092915050565b6000808284811515610d7157fe5b04949350505050565b600080831515610d8d57600091506109ce565b50828202828482811515610d9d57fe5b04146103df57fe5b610dad610df0565b60c06040519081016040908152600160a060020a0390971681526020810195909552509383019190915260608201526000608082015260ff90911660a082015290565b60c0604051908101604052806000600160a060020a0316815260200160008152602001600081526020016000815260200160008152602001600060ff16815250905600a165627a7a723058207bbe164c60e52e6e77a265de8ec0cc7b704ba35c0762f38f39e683a957ce7b990029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
6,477
0xfd2f81e724e2c6b69a68b36c324e8d495454a48b
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.13; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } 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 Birdcoin is Context, IERC20, Ownable { using SafeMath for uint256; IUniswapV2Router02 private uniswapV2Router; mapping (address => uint) private cooldown; mapping (address => uint256) private _rOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; bool private tradingOpen; bool private swapping; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; string private constant _name = "Birdcoin"; string private constant _symbol = "BIRDS"; uint8 private constant _decimals = 9; uint256 private constant _tTotal = 1e18 * (10**_decimals); uint256 private _maxBuyAmount = _tTotal; uint256 private _maxSellAmount = _tTotal; uint256 private _maxWalletAmount = _tTotal; uint256 private tradingActiveBlock = 0; uint256 private blocksToBlacklist = 0; uint256 private _buyProjectFee = 3; uint256 private _previousBuyProjectFee = _buyProjectFee; uint256 private _buyLiquidityFee = 1; uint256 private _previousBuyLiquidityFee = _buyLiquidityFee; uint256 private _bDF = 1; uint256 private _previousBDF = _bDF; uint256 private _sellProjectFee = 3; uint256 private _previousSellProjectFee = _sellProjectFee; uint256 private _sellLiquidityFee = 1; uint256 private _previousSellLiquidityFee = _sellLiquidityFee; uint256 private _sDF = 1; uint256 private _previousSDF = _sDF; uint256 private tokensForProject; uint256 private tokensForLiquidity; uint256 private tokensForD; uint256 private swapTokensAtAmount = 0; address payable private _projectWallet; address payable private _liquidityWallet; address payable private _dvWllt; address private uniswapV2Pair; event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address projectWallet, address liquidityWallet, address dvWllt) { _projectWallet = payable(projectWallet); _liquidityWallet = payable(liquidityWallet); _dvWllt = payable(dvWllt); _rOwned[_msgSender()] = _tTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_projectWallet] = true; _isExcludedFromFee[_liquidityWallet] = true; _isExcludedFromFee[_dvWllt] = 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 _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 setSwapEnabled(bool onoff) external onlyOwner(){ swapEnabled = onoff; } 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"); bool takeFee = false; bool shouldSwap = false; if (from != owner() && to != owner() && to != address(0) && to != address(0xdead) && !swapping) { require(!bots[from] && !bots[to]); if (cooldownEnabled){ if (to != address(uniswapV2Router) && to != address(uniswapV2Pair)){ require(cooldown[tx.origin] < block.number - 1 && cooldown[to] < block.number - 1, "_transfer:: Transfer Delay enabled. Try again later."); cooldown[tx.origin] = block.number; cooldown[to] = block.number; } } takeFee = true; if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading is not allowed yet."); require(amount <= _maxBuyAmount, "Transfer amount exceeds the maxBuyAmount."); require(balanceOf(to) + amount <= _maxWalletAmount, "Exceeds maximum wallet token amount."); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && !_isExcludedFromFee[from]) { require(tradingOpen, "Trading is not allowed yet."); require(amount <= _maxSellAmount, "Transfer amount exceeds the maxSellAmount."); shouldSwap = true; } } if(_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = (contractTokenBalance > swapTokensAtAmount) && shouldSwap; if (canSwap && swapEnabled && !swapping && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapping = true; swapBack(); swapping = false; } _tokenTransfer(from,to,amount,takeFee, shouldSwap); } function swapBack() private { uint256 contractBalance = balanceOf(address(this)); uint256 totalTokensToSwap = tokensForLiquidity + tokensForProject + tokensForD; bool success; if(contractBalance == 0 || totalTokensToSwap == 0) {return;} if(contractBalance > swapTokensAtAmount * 3) { contractBalance = swapTokensAtAmount * 3; } uint256 liquidityTokens = contractBalance * tokensForLiquidity / totalTokensToSwap / 2; uint256 amountToSwapForETH = contractBalance.sub(liquidityTokens); uint256 initialETHBalance = address(this).balance; swapTokensForEth(amountToSwapForETH); uint256 ethBalance = address(this).balance.sub(initialETHBalance); uint256 ethForProject = ethBalance.mul(tokensForProject).div(totalTokensToSwap); uint256 ethForD = ethBalance.mul(tokensForD).div(totalTokensToSwap); uint256 ethForLiquidity = ethBalance - ethForProject - ethForD; tokensForLiquidity = 0; tokensForProject = 0; tokensForD = 0; (success,) = address(_dvWllt).call{value: ethForD}(""); if(liquidityTokens > 0 && ethForLiquidity > 0){ addLiquidity(liquidityTokens, ethForLiquidity); emit SwapAndLiquify(amountToSwapForETH, ethForLiquidity, tokensForLiquidity); } (success,) = address(_projectWallet).call{value: address(this).balance}(""); } 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 addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.addLiquidityETH{value: ethAmount}( address(this), tokenAmount, 0, 0, _liquidityWallet, block.timestamp ); } function sendETHToFee(uint256 amount) private { _projectWallet.transfer(amount.div(2)); _dvWllt.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; _maxBuyAmount = 5e15 * (10**_decimals); _maxSellAmount = 3e15 * (10**_decimals); _maxWalletAmount = 2e16 * (10**_decimals); swapTokensAtAmount = 1e14 * (10**_decimals); tradingOpen = true; tradingActiveBlock = block.number; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setMaxBuyAmount(uint256 maxBuy) public onlyOwner { require(maxBuy >= 1e14 * (10**_decimals), "Max buy amount cannot be lower than 0.01% total supply."); _maxBuyAmount = maxBuy; } function setMaxSellAmount(uint256 maxSell) public onlyOwner { require(maxSell >= 1e14 * (10**_decimals), "Max sell amount cannot be lower than 0.01% total supply."); _maxSellAmount = maxSell; } function setMaxWalletAmount(uint256 maxToken) public onlyOwner { require(maxToken >= 1e15 * (10**_decimals), "Max wallet amount cannot be lower than 0.1% total supply."); _maxWalletAmount = maxToken; } function setSwapTokensAtAmount(uint256 newAmount) public onlyOwner { require(newAmount >= 1e13 * (10**_decimals), "Swap amount cannot be lower than 0.001% total supply."); require(newAmount <= 5e15 * (10**_decimals), "Swap amount cannot be higher than 0.5% total supply."); swapTokensAtAmount = newAmount; } function setProjectWallet(address projectWallet) public onlyOwner() { require(projectWallet != address(0), "projectWallet address cannot be 0"); _isExcludedFromFee[_projectWallet] = false; _projectWallet = payable(projectWallet); _isExcludedFromFee[_projectWallet] = true; } function setLiquidityWallet(address liquidityWallet) public onlyOwner() { require(liquidityWallet != address(0), "liquidityWallet address cannot be 0"); _isExcludedFromFee[_liquidityWallet] = false; _liquidityWallet = payable(liquidityWallet); _isExcludedFromFee[_liquidityWallet] = true; } function setExcludedFromFees(address[] memory accounts, bool exempt) public onlyOwner { for (uint i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = exempt; } } function setBots(address[] memory accounts, bool exempt) public onlyOwner { for (uint i = 0; i < accounts.length; i++) { bots[accounts[i]] = exempt; } } function setBuyFee(uint256 buyProjectFee, uint256 buyLiquidityFee, uint256 buyDF) external onlyOwner { require(buyProjectFee + buyLiquidityFee + buyDF <= 10, "Must keep buy taxes below 30%"); _buyProjectFee = buyProjectFee; _buyLiquidityFee = buyLiquidityFee; _bDF = buyDF; } function setSellFee(uint256 sellProjectFee, uint256 sellLiquidityFee, uint256 sellDF) external onlyOwner { require(sellProjectFee + sellLiquidityFee + sellDF <= 20, "Must keep sell taxes below 30%"); _sellProjectFee = sellProjectFee; _sellLiquidityFee = sellLiquidityFee; _sDF = sellDF; } function setBlocksToBlacklist(uint256 blocks) public onlyOwner { blocksToBlacklist = blocks; } function removeAllFee() private { if(_buyProjectFee == 0 && _buyLiquidityFee == 0 && _bDF == 0 && _sellProjectFee == 0 && _sellLiquidityFee == 0 && _sDF == 0) return; _previousBuyProjectFee = _buyProjectFee; _previousBuyLiquidityFee = _buyLiquidityFee; _previousBDF = _bDF; _previousSellProjectFee = _sellProjectFee; _previousSellLiquidityFee = _sellLiquidityFee; _previousSDF = _sDF; _buyProjectFee = 0; _buyLiquidityFee = 0; _bDF = 0; _sellProjectFee = 0; _sellLiquidityFee = 0; } function restoreAllFee() private { _buyProjectFee = _previousBuyProjectFee; _buyLiquidityFee = _previousBuyLiquidityFee; _sellProjectFee = _previousSellProjectFee; _sellLiquidityFee = _previousSellLiquidityFee; _sDF = 0; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee, bool isSell) private { if(!takeFee) { removeAllFee(); } else { amount = _takeFees(sender, amount, isSell); } _transferStandard(sender, recipient, amount); if(!takeFee) { restoreAllFee(); } } function _transferStandard(address sender, address recipient, uint256 tAmount) private { _rOwned[sender] = _rOwned[sender].sub(tAmount); _rOwned[recipient] = _rOwned[recipient].add(tAmount); emit Transfer(sender, recipient, tAmount); } function _takeFees(address sender, uint256 amount, bool isSell) private returns (uint256) { uint256 _totalFees; uint256 pjctFee; uint256 liqFee; uint256 dF; if(tradingActiveBlock + blocksToBlacklist >= block.number){ _totalFees = 99; pjctFee = 33; liqFee = 33; dF = 33; } else { _totalFees = _getTotalFees(isSell); if (isSell) { pjctFee = _sellProjectFee; liqFee = _sellLiquidityFee; dF = _sDF; } else { pjctFee = _buyProjectFee; liqFee = _buyLiquidityFee; dF = _bDF; } } uint256 fees = amount.mul(_totalFees).div(100); tokensForProject += fees * pjctFee / _totalFees; tokensForLiquidity += fees * liqFee / _totalFees; tokensForD += fees * dF / _totalFees; if(fees > 0) { _transferStandard(sender, address(this), fees); } return amount -= fees; } receive() external payable {} function manualswap() external onlyOwner { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external onlyOwner { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function withdrawStuckETH() external onlyOwner { bool success; (success,) = address(msg.sender).call{value: address(this).balance}(""); } function _getTotalFees(bool isSell) private view returns(uint256) { if (isSell) { return _sellProjectFee + _sellLiquidityFee + _sDF; } return _buyProjectFee + _buyLiquidityFee + _bDF; } }
0x6080604052600436106101bb5760003560e01c80638a780447116100ec578063c9567bf91161008a578063e6f7ef4d11610064578063e6f7ef4d14610521578063e99c9d0914610541578063f34eb0b814610561578063f5648a4f1461058157600080fd5b8063c9567bf9146104a6578063dd62ed3e146104bb578063e01af92c1461050157600080fd5b80639c0db5f3116100c65780639c0db5f314610431578063a9059cbb14610451578063afa4f3b214610471578063c3c8cd801461049157600080fd5b80638a780447146103bb5780638da5cb5b146103db57806395d89b411461040357600080fd5b806327a14fc2116101595780635932ead1116101335780635932ead11461033b5780636fc3eaec1461035b57806370a0823114610370578063715018a6146103a657600080fd5b806327a14fc2146102df578063296f0a0c146102ff578063313ce5671461031f57600080fd5b806318160ddd1161019557806318160ddd1461025c5780631d865c301461027f57806323b872dd1461029f57806325519cf2146102bf57600080fd5b806306fdde03146101c7578063095ea7b31461020a578063105222f91461023a57600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b506040805180820190915260088152672134b93231b7b4b760c11b60208201525b6040516102019190612592565b60405180910390f35b34801561021657600080fd5b5061022a61022536600461260c565b610596565b6040519015158152602001610201565b34801561024657600080fd5b5061025a610255366004612667565b6105ad565b005b34801561026857600080fd5b5061027161064c565b604051908152602001610201565b34801561028b57600080fd5b5061025a61029a36600461273e565b610671565b3480156102ab57600080fd5b5061022a6102ba36600461276a565b61070e565b3480156102cb57600080fd5b5061025a6102da36600461273e565b610777565b3480156102eb57600080fd5b5061025a6102fa3660046127ab565b610814565b34801561030b57600080fd5b5061025a61031a3660046127c4565b6108d5565b34801561032b57600080fd5b5060405160098152602001610201565b34801561034757600080fd5b5061025a6103563660046127e1565b6109b1565b34801561036757600080fd5b5061025a6109fb565b34801561037c57600080fd5b5061027161038b3660046127c4565b6001600160a01b031660009081526004602052604090205490565b3480156103b257600080fd5b5061025a610a32565b3480156103c757600080fd5b5061025a6103d63660046127c4565b610aa6565b3480156103e757600080fd5b506000546040516001600160a01b039091168152602001610201565b34801561040f57600080fd5b50604080518082019091526005815264424952445360d81b60208201526101f4565b34801561043d57600080fd5b5061025a61044c366004612667565b610b80565b34801561045d57600080fd5b5061022a61046c36600461260c565b610c11565b34801561047d57600080fd5b5061025a61048c3660046127ab565b610c1e565b34801561049d57600080fd5b5061025a610d5f565b3480156104b257600080fd5b5061025a610da2565b3480156104c757600080fd5b506102716104d63660046127fe565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561050d57600080fd5b5061025a61051c3660046127e1565b61119a565b34801561052d57600080fd5b5061025a61053c3660046127ab565b6111e2565b34801561054d57600080fd5b5061025a61055c3660046127ab565b611211565b34801561056d57600080fd5b5061025a61057c3660046127ab565b6112d1565b34801561058d57600080fd5b5061025a611391565b60006105a3338484611408565b5060015b92915050565b6000546001600160a01b031633146105e05760405162461bcd60e51b81526004016105d790612837565b60405180910390fd5b60005b82518110156106475781600660008584815181106106035761060361286c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063f81612898565b9150506105e3565b505050565b600061065a6009600a612995565b61066c90670de0b6b3a76400006129a4565b905090565b6000546001600160a01b0316331461069b5760405162461bcd60e51b81526004016105d790612837565b6014816106a884866129c3565b6106b291906129c3565b11156107005760405162461bcd60e51b815260206004820152601e60248201527f4d757374206b6565702073656c6c2074617865732062656c6f7720333025000060448201526064016105d7565b601492909255601655601855565b600061071b84848461152d565b61076d843361076885604051806060016040528060288152602001612b29602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611c09565b611408565b5060019392505050565b6000546001600160a01b031633146107a15760405162461bcd60e51b81526004016105d790612837565b600a816107ae84866129c3565b6107b891906129c3565b11156108065760405162461bcd60e51b815260206004820152601d60248201527f4d757374206b656570206275792074617865732062656c6f772033302500000060448201526064016105d7565b600e92909255601055601255565b6000546001600160a01b0316331461083e5760405162461bcd60e51b81526004016105d790612837565b61084a6009600a612995565b61085b9066038d7ea4c680006129a4565b8110156108d05760405162461bcd60e51b815260206004820152603960248201527f4d61782077616c6c657420616d6f756e742063616e6e6f74206265206c6f776560448201527f72207468616e20302e312520746f74616c20737570706c792e0000000000000060648201526084016105d7565b600b55565b6000546001600160a01b031633146108ff5760405162461bcd60e51b81526004016105d790612837565b6001600160a01b0381166109615760405162461bcd60e51b815260206004820152602360248201527f6c697175696469747957616c6c657420616464726573732063616e6e6f74206260448201526206520360ec1b60648201526084016105d7565b601f80546001600160a01b03908116600090815260066020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000546001600160a01b031633146109db5760405162461bcd60e51b81526004016105d790612837565b600880549115156401000000000264ff0000000019909216919091179055565b6000546001600160a01b03163314610a255760405162461bcd60e51b81526004016105d790612837565b47610a2f81611c43565b50565b6000546001600160a01b03163314610a5c5760405162461bcd60e51b81526004016105d790612837565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610ad05760405162461bcd60e51b81526004016105d790612837565b6001600160a01b038116610b305760405162461bcd60e51b815260206004820152602160248201527f70726f6a65637457616c6c657420616464726573732063616e6e6f74206265206044820152600360fc1b60648201526084016105d7565b601e80546001600160a01b03908116600090815260066020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000546001600160a01b03163314610baa5760405162461bcd60e51b81526004016105d790612837565b60005b8251811015610647578160076000858481518110610bcd57610bcd61286c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610c0981612898565b915050610bad565b60006105a333848461152d565b6000546001600160a01b03163314610c485760405162461bcd60e51b81526004016105d790612837565b610c546009600a612995565b610c64906509184e72a0006129a4565b811015610cd15760405162461bcd60e51b815260206004820152603560248201527f5377617020616d6f756e742063616e6e6f74206265206c6f776572207468616e60448201527410181718181892903a37ba30b61039bab838363c9760591b60648201526084016105d7565b610cdd6009600a612995565b610cee906611c37937e080006129a4565b811115610d5a5760405162461bcd60e51b815260206004820152603460248201527f5377617020616d6f756e742063616e6e6f742062652068696768657220746861604482015273371018171a92903a37ba30b61039bab838363c9760611b60648201526084016105d7565b601d55565b6000546001600160a01b03163314610d895760405162461bcd60e51b81526004016105d790612837565b30600090815260046020526040902054610a2f81611cc8565b6000546001600160a01b03163314610dcc5760405162461bcd60e51b81526004016105d790612837565b60085460ff1615610e1f5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105d7565b600280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610e6b3082610e596009600a612995565b61076890670de0b6b3a76400006129a4565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ea9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecd91906129db565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3e91906129db565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610faf91906129db565b602180546001600160a01b039283166001600160a01b03199091161790556002541663f305d7194730610ff7816001600160a01b031660009081526004602052604090205490565b60008061100c6000546001600160a01b031690565b426040518863ffffffff1660e01b815260040161102e969594939291906129f8565b60606040518083038185885af115801561104c573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110719190612a33565b50506008805464ffff0000001916640101000000179055506110956009600a612995565b6110a6906611c37937e080006129a4565b60099081556110b690600a612995565b6110c790660aa87bee5380006129a4565b600a9081556110d890600990612995565b6110e99066470de4df8200006129a4565b600b556110f86009600a612995565b61110890655af3107a40006129a4565b601d556008805460ff1916600117905543600c5560215460025460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b3906044016020604051808303816000875af1158015611172573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111969190612a61565b5050565b6000546001600160a01b031633146111c45760405162461bcd60e51b81526004016105d790612837565b6008805491151563010000000263ff00000019909216919091179055565b6000546001600160a01b0316331461120c5760405162461bcd60e51b81526004016105d790612837565b600d55565b6000546001600160a01b0316331461123b5760405162461bcd60e51b81526004016105d790612837565b6112476009600a612995565b61125790655af3107a40006129a4565b8110156112cc5760405162461bcd60e51b815260206004820152603860248201527f4d61782073656c6c20616d6f756e742063616e6e6f74206265206c6f7765722060448201527f7468616e20302e30312520746f74616c20737570706c792e000000000000000060648201526084016105d7565b600a55565b6000546001600160a01b031633146112fb5760405162461bcd60e51b81526004016105d790612837565b6113076009600a612995565b61131790655af3107a40006129a4565b81101561138c5760405162461bcd60e51b815260206004820152603760248201527f4d61782062757920616d6f756e742063616e6e6f74206265206c6f776572207460448201527f68616e20302e30312520746f74616c20737570706c792e00000000000000000060648201526084016105d7565b600955565b6000546001600160a01b031633146113bb5760405162461bcd60e51b81526004016105d790612837565b604051600090339047908381818185875af1925050503d80600081146113fd576040519150601f19603f3d011682016040523d82523d6000602084013e611402565b606091505b50505050565b6001600160a01b03831661146a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105d7565b6001600160a01b0382166114cb5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105d7565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b0383166115915760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105d7565b6001600160a01b0382166115f35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105d7565b600081116116555760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105d7565b60008061166a6000546001600160a01b031690565b6001600160a01b0316856001600160a01b03161415801561169957506000546001600160a01b03858116911614155b80156116ad57506001600160a01b03841615155b80156116c457506001600160a01b03841661dead14155b80156116d85750600854610100900460ff16155b15611aea576001600160a01b03851660009081526007602052604090205460ff1615801561171f57506001600160a01b03841660009081526007602052604090205460ff16155b61172857600080fd5b600854640100000000900460ff1615611844576002546001600160a01b0385811691161480159061176757506021546001600160a01b03858116911614155b1561184457611777600143612a7e565b326000908152600360205260409020541080156117b5575061179a600143612a7e565b6001600160a01b038516600090815260036020526040902054105b61181f5760405162461bcd60e51b815260206004820152603560248201527f5f7472616e736665723a3a205472616e736665722044656c617920656e61626c60448201527432b21710102a393c9030b3b0b4b7103630ba32b91760591b60648201526084016105d7565b3260009081526003602052604080822043908190556001600160a01b03871683529120555b602154600192506001600160a01b03868116911614801561187357506002546001600160a01b03858116911614155b801561189857506001600160a01b03841660009081526006602052604090205460ff16155b156119da5760085460ff166118ef5760405162461bcd60e51b815260206004820152601b60248201527f54726164696e67206973206e6f7420616c6c6f776564207965742e000000000060448201526064016105d7565b6009548311156119535760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206578636565647320746865206d6178426044820152683abca0b6b7bab73a1760b91b60648201526084016105d7565b600b5483611976866001600160a01b031660009081526004602052604090205490565b61198091906129c3565b11156119da5760405162461bcd60e51b8152602060048201526024808201527f45786365656473206d6178696d756d2077616c6c657420746f6b656e20616d6f6044820152633ab73a1760e11b60648201526084016105d7565b6021546001600160a01b038581169116148015611a0557506002546001600160a01b03868116911614155b8015611a2a57506001600160a01b03851660009081526006602052604090205460ff16155b15611aea5760085460ff16611a815760405162461bcd60e51b815260206004820152601b60248201527f54726164696e67206973206e6f7420616c6c6f776564207965742e000000000060448201526064016105d7565b600a54831115611ae65760405162461bcd60e51b815260206004820152602a60248201527f5472616e7366657220616d6f756e74206578636565647320746865206d61785360448201526932b63620b6b7bab73a1760b11b60648201526084016105d7565b5060015b6001600160a01b03851660009081526006602052604090205460ff1680611b2957506001600160a01b03841660009081526006602052604090205460ff165b15611b3357600091505b3060009081526004602052604081205490506000601d5482118015611b555750825b9050808015611b6d57506008546301000000900460ff165b8015611b815750600854610100900460ff16155b8015611ba657506001600160a01b03871660009081526006602052604090205460ff16155b8015611bcb57506001600160a01b03861660009081526006602052604090205460ff16155b15611bf3576008805461ff001916610100179055611be7611e3f565b6008805461ff00191690555b611c00878787878761207f565b50505050505050565b60008184841115611c2d5760405162461bcd60e51b81526004016105d79190612592565b506000611c3a8486612a7e565b95945050505050565b601e546001600160a01b03166108fc611c5d8360026120d8565b6040518115909202916000818181858888f19350505050158015611c85573d6000803e3d6000fd5b506020546001600160a01b03166108fc611ca08360026120d8565b6040518115909202916000818181858888f19350505050158015611196573d6000803e3d6000fd5b6008805462ff00001916620100001790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611d0e57611d0e61286c565b6001600160a01b03928316602091820292909201810191909152600254604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611d67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d8b91906129db565b81600181518110611d9e57611d9e61286c565b6001600160a01b039283166020918202929092010152600254611dc49130911684611408565b60025460405163791ac94760e01b81526001600160a01b039091169063791ac94790611dfd908590600090869030904290600401612a95565b600060405180830381600087803b158015611e1757600080fd5b505af1158015611e2b573d6000803e3d6000fd5b50506008805462ff00001916905550505050565b3060009081526004602052604081205490506000601c54601a54601b54611e6691906129c3565b611e7091906129c3565b90506000821580611e7f575081155b15611e8957505050565b601d54611e979060036129a4565b831115611eaf57601d54611eac9060036129a4565b92505b6000600283601b5486611ec291906129a4565b611ecc9190612b06565b611ed69190612b06565b90506000611ee48583612121565b905047611ef082611cc8565b6000611efc4783612121565b90506000611f1f87611f19601a548561216390919063ffffffff16565b906120d8565b90506000611f3c88611f19601c548661216390919063ffffffff16565b9050600081611f4b8486612a7e565b611f559190612a7e565b6000601b819055601a819055601c8190556020546040519293506001600160a01b031691849181818185875af1925050503d8060008114611fb2576040519150601f19603f3d011682016040523d82523d6000602084013e611fb7565b606091505b50909850508615801590611fcb5750600081115b1561201e57611fda87826121e5565b601b54604080518881526020810184905280820192909252517f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb5619181900360600190a15b601e546040516001600160a01b03909116904790600081818185875af1925050503d806000811461206b576040519150601f19603f3d011682016040523d82523d6000602084013e612070565b606091505b50505050505050505050505050565b816120915761208c612280565b61209f565b61209c858483612304565b92505b6120aa858585612427565b816120d1576120d1600f54600e556011546010556015546014556017546016556000601855565b5050505050565b600061211a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506124cd565b9392505050565b600061211a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c09565b600082600003612175575060006105a7565b600061218183856129a4565b90508261218e8583612b06565b1461211a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105d7565b6002546121fd9030906001600160a01b031684611408565b600254601f5460405163f305d71960e01b81526001600160a01b039283169263f305d71992859261223d92309289926000928392169042906004016129f8565b60606040518083038185885af115801561225b573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906120d19190612a33565b600e541580156122905750601054155b801561229c5750601254155b80156122a85750601454155b80156122b45750601654155b80156122c05750601854155b156122c757565b600e8054600f5560108054601155601280546013556014805460155560168054601755601854601955600094859055928490559083905582905555565b600080600080600043600d54600c5461231d91906129c3565b106123345750606392506021915081905080612369565b61233d866124fb565b9350851561235957601454925060165491506018549050612369565b600e549250601054915060125490505b600061237a6064611f198a88612163565b90508461238785836129a4565b6123919190612b06565b601a60008282546123a291906129c3565b909155508590506123b384836129a4565b6123bd9190612b06565b601b60008282546123ce91906129c3565b909155508590506123df83836129a4565b6123e99190612b06565b601c60008282546123fa91906129c3565b9091555050801561241057612410893083612427565b61241a8189612a7e565b9998505050505050505050565b6001600160a01b03831660009081526004602052604090205461244a9082612121565b6001600160a01b0380851660009081526004602052604080822093909355908416815220546124799082612533565b6001600160a01b0380841660008181526004602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906115209085815260200190565b600081836124ee5760405162461bcd60e51b81526004016105d79190612592565b506000611c3a8486612b06565b600081156125205760185460165460145461251691906129c3565b6105a791906129c3565b601254601054600e5461251691906129c3565b60008061254083856129c3565b90508381101561211a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105d7565b600060208083528351808285015260005b818110156125bf578581018301518582016040015282016125a3565b818111156125d1576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a2f57600080fd5b8035612607816125e7565b919050565b6000806040838503121561261f57600080fd5b823561262a816125e7565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b8015158114610a2f57600080fd5b80356126078161264e565b6000806040838503121561267a57600080fd5b823567ffffffffffffffff8082111561269257600080fd5b818501915085601f8301126126a657600080fd5b81356020828211156126ba576126ba612638565b8160051b604051601f19603f830116810181811086821117156126df576126df612638565b6040529283528183019350848101820192898411156126fd57600080fd5b948201945b8386101561272257612713866125fc565b85529482019493820193612702565b9650612731905087820161265c565b9450505050509250929050565b60008060006060848603121561275357600080fd5b505081359360208301359350604090920135919050565b60008060006060848603121561277f57600080fd5b833561278a816125e7565b9250602084013561279a816125e7565b929592945050506040919091013590565b6000602082840312156127bd57600080fd5b5035919050565b6000602082840312156127d657600080fd5b813561211a816125e7565b6000602082840312156127f357600080fd5b813561211a8161264e565b6000806040838503121561281157600080fd5b823561281c816125e7565b9150602083013561282c816125e7565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016128aa576128aa612882565b5060010190565b600181815b808511156128ec5781600019048211156128d2576128d2612882565b808516156128df57918102915b93841c93908002906128b6565b509250929050565b600082612903575060016105a7565b81612910575060006105a7565b816001811461292657600281146129305761294c565b60019150506105a7565b60ff84111561294157612941612882565b50506001821b6105a7565b5060208310610133831016604e8410600b841016171561296f575081810a6105a7565b61297983836128b1565b806000190482111561298d5761298d612882565b029392505050565b600061211a60ff8416836128f4565b60008160001904831182151516156129be576129be612882565b500290565b600082198211156129d6576129d6612882565b500190565b6000602082840312156129ed57600080fd5b815161211a816125e7565b6001600160a01b039687168152602081019590955260408501939093526060840191909152909216608082015260a081019190915260c00190565b600080600060608486031215612a4857600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215612a7357600080fd5b815161211a8161264e565b600082821015612a9057612a90612882565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015612ae55784516001600160a01b031683529383019391830191600101612ac0565b50506001600160a01b03969096166060850152505050608001529392505050565b600082612b2357634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203235c51a241703dfcca1dd2377c0cf3fdfb585b5a5c68073e24562a39d4c062364736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,478
0xB4939D2F299aAF269E65397b852B31cb3C543Cb9
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; // /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } // /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } // /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } // /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } // contract VestingContract is Ownable { using SafeMath for uint256; // CNTR Token Contract IERC20 tokenContract = IERC20(0x03042482d64577A7bdb282260e2eA4c8a89C064B); uint256[] vestingSchedule; address public receivingAddress; uint256 public vestingStartTime; uint256 constant public releaseInterval = 30 days; uint256 index = 0; constructor(address _address) public { receivingAddress = _address; } function updateVestingSchedule(uint256[] memory _vestingSchedule) public onlyOwner { require(vestingStartTime == 0); vestingSchedule = _vestingSchedule; } function updateReceivingAddress(address _address) public onlyOwner { receivingAddress = _address; } function releaseToken() public { require(vestingSchedule.length > 0); require(msg.sender == owner() || msg.sender == receivingAddress); if (vestingStartTime == 0) { require(msg.sender == owner()); vestingStartTime = block.timestamp; } for (uint256 i = index; i < vestingSchedule.length; i++) { if (block.timestamp >= vestingStartTime + (index * releaseInterval)) { tokenContract.transfer(receivingAddress, (vestingSchedule[i] * 1 ether)); index = index.add(1); } else { break; } } } function getVestingSchedule() public view returns (uint256[] memory) { return vestingSchedule; } }
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063a3d272ce11610066578063a3d272ce146101be578063a8660a7814610202578063c4b6c5fa14610220578063ec715a31146102d8578063f2fde38b146102e25761009e565b80631db87be8146100a35780631f8db268146100ed5780633a05f0d81461010b578063715018a61461016a5780638da5cb5b14610174575b600080fd5b6100ab610326565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100f561034c565b6040518082815260200191505060405180910390f35b610113610353565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561015657808201518184015260208101905061013b565b505050509050019250505060405180910390f35b6101726103ab565b005b61017c610533565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610200600480360360208110156101d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061055c565b005b61020a610669565b6040518082815260200191505060405180910390f35b6102d66004803603602081101561023657600080fd5b810190808035906020019064010000000081111561025357600080fd5b82018360208201111561026557600080fd5b8035906020019184602083028401116401000000008311171561028757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929050505061066f565b005b6102e0610761565b005b610324600480360360208110156102f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109e1565b005b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b62278d0081565b606060028054806020026020016040519081016040528092919081815260200182805480156103a157602002820191906000526020600020905b81548152602001906001019080831161038d575b5050505050905090565b6103b3610bee565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610474576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610564610bee565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610625576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60045481565b610677610bee565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610738576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60006004541461074757600080fd5b806002908051906020019061075d929190610c7e565b5050565b60006002805490501161077357600080fd5b61077b610533565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108015750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61080a57600080fd5b6000600454141561085c5761081d610533565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461085457600080fd5b426004819055505b600060055490505b6002805490508110156109de5762278d00600554026004540142106109cc57600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000600285815481106108fa57fe5b9060005260206000200154026040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561096f57600080fd5b505af1158015610983573d6000803e3d6000fd5b505050506040513d602081101561099957600080fd5b8101908080519060200190929190505050506109c16001600554610bf690919063ffffffff16565b6005819055506109d1565b6109de565b8080600101915050610864565b50565b6109e9610bee565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aaa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610cf16026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600080828401905083811015610c74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b828054828255906000526020600020908101928215610cba579160200282015b82811115610cb9578251825591602001919060010190610c9e565b5b509050610cc79190610ccb565b5090565b610ced91905b80821115610ce9576000816000905550600101610cd1565b5090565b9056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220038fb532ed2e64e11f018217ec622374df7e2f0ae188b497304d3fb430740aa964736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
6,479
0x12df966073dfbb3449c878480cda9cf7ec60cac6
/** *Submitted for verification at Etherscan.io on 2021-08-08 */ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Timelock { using SafeMath for uint256; event NewAdmin(address indexed newAdmin); event NewPendingAdmin(address indexed newPendingAdmin); event NewDelay(uint256 indexed newDelay); event CancelTransaction( bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta ); event ExecuteTransaction( bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta ); event QueueTransaction( bytes32 indexed txHash, address indexed target, uint256 value, string signature, bytes data, uint256 eta ); uint256 public constant GRACE_PERIOD = 14 days; uint256 public constant MINIMUM_DELAY = 2 days; uint256 public constant MAXIMUM_DELAY = 30 days; address public admin; address public pendingAdmin; uint256 public delay; mapping(bytes32 => bool) public queuedTransactions; constructor(address admin_, uint256 delay_) public { require( delay_ >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay." ); require( delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay." ); admin = admin_; delay = delay_; } function setDelay(uint256 delay_) public { require( msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock." ); require( delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay." ); require( delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay." ); delay = delay_; emit NewDelay(delay); } function acceptAdmin() public { require( msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin." ); admin = msg.sender; pendingAdmin = address(0); emit NewAdmin(admin); } function setPendingAdmin(address pendingAdmin_) public { require( msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock." ); pendingAdmin = pendingAdmin_; emit NewPendingAdmin(pendingAdmin); } function queueTransaction( address target, uint256 value, string memory signature, bytes memory data, uint256 eta ) public returns (bytes32) { require( msg.sender == admin, "Timelock::queueTransaction: Call must come from admin." ); require( eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay." ); bytes32 txHash = keccak256( abi.encode(target, value, signature, data, eta) ); queuedTransactions[txHash] = true; emit QueueTransaction(txHash, target, value, signature, data, eta); return txHash; } function cancelTransaction( address target, uint256 value, string memory signature, bytes memory data, uint256 eta ) public { require( msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin." ); bytes32 txHash = keccak256( abi.encode(target, value, signature, data, eta) ); queuedTransactions[txHash] = false; emit CancelTransaction(txHash, target, value, signature, data, eta); } function executeTransaction( address target, uint256 value, string memory signature, bytes memory data, uint256 eta ) public returns (bytes memory) { require( msg.sender == admin, "Timelock::executeTransaction: Call must come from admin." ); bytes32 txHash = keccak256( abi.encode(target, value, signature, data, eta) ); require( queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued." ); require( getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock." ); require( getBlockTimestamp() <= eta.add(GRACE_PERIOD), "Timelock::executeTransaction: Transaction is stale." ); queuedTransactions[txHash] = false; bytes memory callData; if (bytes(signature).length == 0) { callData = data; } else { callData = abi.encodePacked( bytes4(keccak256(bytes(signature))), data ); } // solium-disable-next-line security/no-call-value (bool success, bytes memory returnData) = target.call.value(value)( callData ); require( success, "Timelock::executeTransaction: Transaction execution reverted." ); emit ExecuteTransaction(txHash, target, value, signature, data, eta); return returnData; } function getBlockTimestamp() internal view returns (uint256) { // solium-disable-next-line security/no-block-members return block.timestamp; } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80636a42b8f81161008c578063c1a287e211610066578063c1a287e214610587578063e177246e1461058f578063f2b06537146105ac578063f851a440146105dd576100cf565b80636a42b8f81461056f5780637d645fab14610577578063b1b43ae51461057f576100cf565b80630825f38f146100d45780630e18b6811461028957806326782247146102935780633a66f901146102b75780634dd18bf514610409578063591fcdfe1461042f575b600080fd5b610214600480360360a08110156100ea57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561011957600080fd5b82018360208201111561012b57600080fd5b803590602001918460018302840111600160201b8311171561014c57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561019e57600080fd5b8201836020820111156101b057600080fd5b803590602001918460018302840111600160201b831117156101d157600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050913592506105e5915050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561024e578181015183820152602001610236565b50505050905090810190601f16801561027b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610291610ae5565b005b61029b610b81565b604080516001600160a01b039092168252519081900360200190f35b6103f7600480360360a08110156102cd57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156102fc57600080fd5b82018360208201111561030e57600080fd5b803590602001918460018302840111600160201b8311171561032f57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561038157600080fd5b82018360208201111561039357600080fd5b803590602001918460018302840111600160201b831117156103b457600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610b90915050565b60408051918252519081900360200190f35b6102916004803603602081101561041f57600080fd5b50356001600160a01b0316610e92565b610291600480360360a081101561044557600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561047457600080fd5b82018360208201111561048657600080fd5b803590602001918460018302840111600160201b831117156104a757600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156104f957600080fd5b82018360208201111561050b57600080fd5b803590602001918460018302840111600160201b8311171561052c57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610f20915050565b6103f76111cd565b6103f76111d3565b6103f76111da565b6103f76111e1565b610291600480360360208110156105a557600080fd5b50356111e8565b6105c9600480360360208110156105c257600080fd5b50356112dd565b604080519115158252519081900360200190f35b61029b6112f2565b6000546060906001600160a01b031633146106315760405162461bcd60e51b81526004018080602001828103825260388152602001806113676038913960400191505060405180910390fd5b6000868686868660405160200180866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561069757818101518382015260200161067f565b50505050905090810190601f1680156106c45780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156106f75781810151838201526020016106df565b50505050905090810190601f1680156107245780820380516001836020036101000a031916815260200191505b5060408051601f1981840301815291815281516020928301206000818152600390935291205490995060ff16975061079596505050505050505760405162461bcd60e51b815260040180806020018281038252603d8152602001806114ba603d913960400191505060405180910390fd5b8261079e611301565b10156107db5760405162461bcd60e51b81526004018080602001828103825260458152602001806114096045913960600191505060405180910390fd5b6107e88362127500611305565b6107f0611301565b111561082d5760405162461bcd60e51b81526004018080602001828103825260338152602001806113d66033913960400191505060405180910390fd5b6000818152600360205260409020805460ff1916905584516060906108535750836108d6565b85805190602001208560405160200180836001600160e01b031916815260040182805190602001908083835b6020831061089e5780518252601f19909201916020918201910161087f565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b60006060896001600160a01b031689846040518082805190602001908083835b602083106109155780518252601f1990920191602091820191016108f6565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610977576040519150601f19603f3d011682016040523d82523d6000602084013e61097c565b606091505b5091509150816109bd5760405162461bcd60e51b815260040180806020018281038252603d81526020018061159d603d913960400191505060405180910390fd5b896001600160a01b0316847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610a3a578181015183820152602001610a22565b50505050905090810190601f168015610a675780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610a9a578181015183820152602001610a82565b50505050905090810190601f168015610ac75780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b6001546001600160a01b03163314610b2e5760405162461bcd60e51b81526004018080602001828103825260388152602001806114f76038913960400191505060405180910390fd5b60008054336001600160a01b031991821617808355600180549092169091556040516001600160a01b03909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b6001546001600160a01b031681565b600080546001600160a01b03163314610bda5760405162461bcd60e51b81526004018080602001828103825260368152602001806115676036913960400191505060405180910390fd5b610bee600254610be8611301565b90611305565b821015610c2c5760405162461bcd60e51b81526004018080602001828103825260498152602001806115da6049913960600191505060405180910390fd5b6000868686868660405160200180866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610c92578181015183820152602001610c7a565b50505050905090810190601f168015610cbf5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610cf2578181015183820152602001610cda565b50505050905090810190601f168015610d1f5780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550866001600160a01b0316817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610dea578181015183820152602001610dd2565b50505050905090810190601f168015610e175780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610e4a578181015183820152602001610e32565b50505050905090810190601f168015610e775780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b333014610ed05760405162461bcd60e51b815260040180806020018281038252603881526020018061152f6038913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0383811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b6000546001600160a01b03163314610f695760405162461bcd60e51b815260040180806020018281038252603781526020018061139f6037913960400191505060405180910390fd5b6000858585858560405160200180866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610fcf578181015183820152602001610fb7565b50505050905090810190601f168015610ffc5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561102f578181015183820152602001611017565b50505050905090810190601f16801561105c5780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550856001600160a01b0316817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561112757818101518382015260200161110f565b50505050905090810190601f1680156111545780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561118757818101518382015260200161116f565b50505050905090810190601f1680156111b45780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b62278d0081565b6202a30081565b6212750081565b3330146112265760405162461bcd60e51b81526004018080602001828103825260318152602001806116236031913960400191505060405180910390fd5b6202a3008110156112685760405162461bcd60e51b815260040180806020018281038252603481526020018061144e6034913960400191505060405180910390fd5b62278d008111156112aa5760405162461bcd60e51b81526004018080602001828103825260388152602001806114826038913960400191505060405180910390fd5b600281905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60036020526000908152604090205460ff1681565b6000546001600160a01b031681565b4290565b60008282018381101561135f576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea264697066735822122010e6f26800dc08559fe3fcd925dc95be02f519c3d1eb9356c0573dc326552fee64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,480
0x1da91f1b6c01a2351c40ae5f8f952ba8de0a3e3b
pragma solidity 0.6.12; pragma experimental ABIEncoderV2; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface sbCommunityInterface { function getTokenData(address token, uint256 day) external view returns ( uint256, uint256, uint256 ); function receiveRewards(uint256 day, uint256 amount) external; function serviceAccepted(address service) external view returns (bool); function getMinerRewardPercentage() external view returns (uint256); } contract sbControllerV2 { event CommunityAdded(address indexed community); event RewardsReleased(address indexed receiver, uint256 amount, uint256 indexed day); using SafeMath for uint256; bool internal initDone; address internal sbTimelock; IERC20 internal strongToken; sbTokensInterface internal sbTokens; sbStrongPoolInterface internal sbStrongPool; sbVotesInterface internal sbVotes; uint256 internal startDay; mapping(uint256 => uint256) internal COMMUNITY_DAILY_REWARDS_BY_YEAR; mapping(uint256 => uint256) internal STRONGPOOL_DAILY_REWARDS_BY_YEAR; mapping(uint256 => uint256) internal VOTER_DAILY_REWARDS_BY_YEAR; uint256 internal MAX_YEARS; address[] internal communities; mapping(uint256 => uint256) internal dayMineSecondsUSDTotal; mapping(address => mapping(uint256 => uint256)) internal communityDayMineSecondsUSD; mapping(address => mapping(uint256 => uint256)) internal communityDayRewards; mapping(address => uint256) internal communityDayStart; uint256 internal dayLastReleasedRewardsFor; address internal superAdmin; address internal pendingSuperAdmin; function setSuperAdmin() public { require(superAdmin == address(0), 'superAdmin already set'); superAdmin = address(0x4B5057B2c87Ec9e7C047fb00c0E406dfF2FDaCad); } function setPendingSuperAdmin(address newPendingSuperAdmin) public { require(msg.sender == superAdmin && msg.sender != address(0), 'not superAdmin'); pendingSuperAdmin = newPendingSuperAdmin; } function acceptSuperAdmin() public { require(msg.sender == pendingSuperAdmin && msg.sender != address(0), 'not pendingSuperAdmin'); superAdmin = pendingSuperAdmin; pendingSuperAdmin = address(0); } function getSuperAdminAddressUsed() public view returns (address) { return superAdmin; } function getPendingSuperAdminAddressUsed() public view returns (address) { return pendingSuperAdmin; } function updateCommunityDailyRewardsByYear(uint256 amount) public { require(msg.sender == superAdmin && msg.sender != address(0), 'not superAdmin'); uint256 year = _getYearDayIsIn(_getCurrentDay()); require(year <= MAX_YEARS, 'invalid year'); COMMUNITY_DAILY_REWARDS_BY_YEAR[year] = amount; } function updateStrongPoolDailyRewardsByYear(uint256 amount) public { require(msg.sender == superAdmin && msg.sender != address(0), 'not superAdmin'); uint256 year = _getYearDayIsIn(_getCurrentDay()); require(year <= MAX_YEARS, 'invalid year'); STRONGPOOL_DAILY_REWARDS_BY_YEAR[year] = amount; } // TODO: Double check me function updateVoterDailyRewardsByYear(uint256 amount) public { require(msg.sender == superAdmin && msg.sender != address(0), 'not superAdmin'); uint256 year = _getYearDayIsIn(_getCurrentDay()); require(year <= MAX_YEARS, 'invalid year'); VOTER_DAILY_REWARDS_BY_YEAR[year] = amount; } function upToDate() external view returns (bool) { return dayLastReleasedRewardsFor == _getCurrentDay().sub(1); } function addCommunity(address community) external { require(msg.sender == sbTimelock, 'not sbTimelock'); require(community != address(0), 'community not zero address'); require(!_communityExists(community), 'community exists'); communities.push(community); communityDayStart[community] = _getCurrentDay(); emit CommunityAdded(community); } function getCommunities() external view returns (address[] memory) { return communities; } function getDayMineSecondsUSDTotal(uint256 day) external view returns (uint256) { require(day >= startDay, '1: invalid day'); require(day <= dayLastReleasedRewardsFor, '2: invalid day'); return dayMineSecondsUSDTotal[day]; } function getCommunityDayMineSecondsUSD(address community, uint256 day) external view returns (uint256) { require(_communityExists(community), 'invalid community'); require(day >= communityDayStart[community], '1: invalid day'); require(day <= dayLastReleasedRewardsFor, '2: invalid day'); return communityDayMineSecondsUSD[community][day]; } function getCommunityDayRewards(address community, uint256 day) external view returns (uint256) { require(_communityExists(community), 'invalid community'); require(day >= communityDayStart[community], '1: invalid day'); require(day <= dayLastReleasedRewardsFor, '2: invalid day'); return communityDayRewards[community][day]; } function getCommunityDailyRewards(uint256 day) external view returns (uint256) { require(day >= startDay, 'invalid day'); uint256 year = _getYearDayIsIn(day); require(year <= MAX_YEARS, 'invalid year'); return COMMUNITY_DAILY_REWARDS_BY_YEAR[year]; } function getStrongPoolDailyRewards(uint256 day) external view returns (uint256) { require(day >= startDay, 'invalid day'); uint256 year = _getYearDayIsIn(day); require(year <= MAX_YEARS, 'invalid year'); return STRONGPOOL_DAILY_REWARDS_BY_YEAR[year]; } function getVoterDailyRewards(uint256 day) external view returns (uint256) { require(day >= startDay, 'invalid day'); uint256 year = _getYearDayIsIn(day); require(year <= MAX_YEARS, 'invalid year'); return VOTER_DAILY_REWARDS_BY_YEAR[year]; } function getStartDay() external view returns (uint256) { return startDay; } function communityAccepted(address community) external view returns (bool) { return _communityExists(community); } function getMaxYears() public view returns (uint256) { return MAX_YEARS; } function getCommunityDayStart(address community) public view returns (uint256) { require(_communityExists(community), 'invalid community'); return communityDayStart[community]; } function getSbTimelockAddressUsed() public view returns (address) { return sbTimelock; } function getStrongAddressUsed() public view returns (address) { return address(strongToken); } function getSbTokensAddressUsed() public view returns (address) { return address(sbTokens); } function getSbStrongPoolAddressUsed() public view returns (address) { return address(sbStrongPool); } function getSbVotesAddressUsed() public view returns (address) { return address(sbVotes); } function getCurrentYear() public view returns (uint256) { uint256 day = _getCurrentDay().sub(startDay); return _getYearDayIsIn(day == 0 ? startDay : day); } function getYearDayIsIn(uint256 day) public view returns (uint256) { require(day >= startDay, 'invalid day'); return _getYearDayIsIn(day); } function getCurrentDay() public view returns (uint256) { return _getCurrentDay(); } function getDayLastReleasedRewardsFor() public view returns (uint256) { return dayLastReleasedRewardsFor; } function releaseRewards() public { uint256 currentDay = _getCurrentDay(); require(currentDay > dayLastReleasedRewardsFor.add(1), 'already released'); require(sbTokens.upToDate(), 'need token prices'); dayLastReleasedRewardsFor = dayLastReleasedRewardsFor.add(1); uint256 year = _getYearDayIsIn(dayLastReleasedRewardsFor); require(year <= MAX_YEARS, 'invalid year'); address[] memory tokenAddresses = sbTokens.getTokens(); uint256[] memory tokenPrices = sbTokens.getTokenPrices(dayLastReleasedRewardsFor); for (uint256 i = 0; i < communities.length; i++) { address community = communities[i]; uint256 sum = 0; for (uint256 j = 0; j < tokenAddresses.length; j++) { address token = tokenAddresses[j]; (, , uint256 minedSeconds) = sbCommunityInterface(community).getTokenData(token, dayLastReleasedRewardsFor); uint256 tokenPrice = tokenPrices[j]; uint256 minedSecondsUSD = tokenPrice.mul(minedSeconds).div(1e18); sum = sum.add(minedSecondsUSD); } communityDayMineSecondsUSD[community][dayLastReleasedRewardsFor] = sum; dayMineSecondsUSDTotal[dayLastReleasedRewardsFor] = dayMineSecondsUSDTotal[dayLastReleasedRewardsFor].add(sum); } for (uint256 i = 0; i < communities.length; i++) { address community = communities[i]; if (communityDayMineSecondsUSD[community][dayLastReleasedRewardsFor] == 0) { continue; } communityDayRewards[community][dayLastReleasedRewardsFor] = communityDayMineSecondsUSD[community][dayLastReleasedRewardsFor] .mul(COMMUNITY_DAILY_REWARDS_BY_YEAR[year]) .div(dayMineSecondsUSDTotal[dayLastReleasedRewardsFor]); uint256 amount = communityDayRewards[community][dayLastReleasedRewardsFor]; strongToken.approve(community, amount); sbCommunityInterface(community).receiveRewards(dayLastReleasedRewardsFor, amount); emit RewardsReleased(community, amount, currentDay); } (, , uint256 strongPoolMineSeconds) = sbStrongPool.getMineData(dayLastReleasedRewardsFor); if (strongPoolMineSeconds != 0) { strongToken.approve(address(sbStrongPool), STRONGPOOL_DAILY_REWARDS_BY_YEAR[year]); sbStrongPool.receiveRewards(dayLastReleasedRewardsFor, STRONGPOOL_DAILY_REWARDS_BY_YEAR[year]); emit RewardsReleased(address(sbStrongPool), STRONGPOOL_DAILY_REWARDS_BY_YEAR[year], currentDay); } bool hasVoteSeconds = false; for (uint256 i = 0; i < communities.length; i++) { address community = communities[i]; (, , uint256 voteSeconds) = sbVotes.getCommunityData(community, dayLastReleasedRewardsFor); if (voteSeconds > 0) { hasVoteSeconds = true; break; } } if (hasVoteSeconds) { strongToken.approve(address(sbVotes), VOTER_DAILY_REWARDS_BY_YEAR[year]); sbVotes.receiveVoterRewards(dayLastReleasedRewardsFor, VOTER_DAILY_REWARDS_BY_YEAR[year]); emit RewardsReleased(address(sbVotes), VOTER_DAILY_REWARDS_BY_YEAR[year], currentDay); } } function _getCurrentDay() internal view returns (uint256) { return block.timestamp.div(1 days).add(1); } function _communityExists(address community) internal view returns (bool) { for (uint256 i = 0; i < communities.length; i++) { if (communities[i] == community) { return true; } } return false; } function _getYearDayIsIn(uint256 day) internal view returns (uint256) { return day.sub(startDay).div(366).add(1); // dividing by 366 makes day 1 and 365 be in year 1 } } interface sbStrongPoolInterface { function serviceMinMined(address miner) external view returns (bool); function minerMinMined(address miner) external view returns (bool); function mineFor(address miner, uint256 amount) external; function getMineData(uint256 day) external view returns ( uint256, uint256, uint256 ); function receiveRewards(uint256 day, uint256 amount) external; } interface sbTokensInterface { function getTokens() external view returns (address[] memory); function getTokenPrices(uint256 day) external view returns (uint256[] memory); function tokenAccepted(address token) external view returns (bool); function upToDate() external view returns (bool); function getTokenPrice(address token, uint256 day) external view returns (uint256); } interface sbVotesInterface { function getCommunityData(address community, uint256 day) external view returns ( uint256, uint256, uint256 ); function getPriorProposalVotes(address account, uint256 blockNumber) external view returns (uint96); function receiveServiceRewards(uint256 day, uint256 amount) external; function receiveVoterRewards(uint256 day, uint256 amount) external; function updateVotes( address staker, uint256 rawAmount, bool adding ) external; }
0x608060405234801561001057600080fd5b50600436106101e45760003560e01c806382730b381161010f578063ba232ecb116100a2578063d39ca7de11610071578063d39ca7de14610384578063e5f97f3714610397578063e7f9cefd146103aa578063ff4dfa51146103b2576101e4565b8063ba232ecb1461034c578063c251b5651461035f578063ce41607a14610374578063d0fab3ca1461037c576101e4565b8063b0ff5263116100de578063b0ff52631461030b578063b43861b114610313578063b80a999514610326578063b9e5d55114610339576101e4565b806382730b38146102d557806390a39a9e146102e8578063957314e2146102fb578063a4bc4d7f14610303576101e4565b8063335479a2116101875780635a5256ef116101565780635a5256ef146102a85780636232db75146102b0578063733fb91f146102c557806378253604146102cd576101e4565b8063335479a21461027d5780633e6968b6146102855780634eac382f1461028d5780635a306be0146102a0576101e4565b80631727a98c116101c35780631727a98c1461023a5780631da20d5e1461025a5780632025dbb7146102625780632a8c09691461026a576101e4565b806248fc20146101e957806302f8cd5e1461021257806304a3379f14610225575b600080fd5b6101fc6101f7366004611957565b6103ba565b6040516102099190611d17565b60405180910390f35b6101fc610220366004611957565b61042d565b61022d610495565b604051610209919061199c565b61024d6102483660046117ce565b6104a4565b6040516102099190611a16565b6101fc6104b5565b61022d6104bb565b6101fc6102783660046117ea565b6104ca565b61022d610574565b6101fc610583565b6101fc61029b3660046117ce565b610592565b61022d6105d5565b61022d6105e4565b6102c36102be3660046117ce565b6105f3565b005b61022d610708565b61024d610717565b6102c36102e3366004611957565b610735565b6101fc6102f63660046117ea565b6107b1565b6102c361085b565b61022d6108ac565b6101fc6108c0565b6102c3610321366004611957565b6108c6565b6101fc610334366004611957565b61093d565b6101fc610347366004611957565b6109a5565b6101fc61035a366004611957565b6109d2565b610367610a2b565b60405161020991906119c9565b6101fc610a8d565b6102c3610abd565b6102c36103923660046117ce565b6114ba565b6102c36103a5366004611957565b611511565b6102c3611588565b6101fc6115e4565b60006005548210156103e75760405162461bcd60e51b81526004016103de90611a74565b60405180910390fd5b60006103f2836115ea565b90506009548111156104165760405162461bcd60e51b81526004016103de90611b5e565b60009081526006602052604090205490505b919050565b60006005548210156104515760405162461bcd60e51b81526004016103de90611a74565b600061045c836115ea565b90506009548111156104805760405162461bcd60e51b81526004016103de90611b5e565b60009081526007602052604090205492915050565b6001546001600160a01b031690565b60006104af82611612565b92915050565b600f5490565b6010546001600160a01b031690565b60006104d583611612565b6104f15760405162461bcd60e51b81526004016103de90611c09565b6001600160a01b0383166000908152600e60205260409020548210156105295760405162461bcd60e51b81526004016103de90611c75565b600f5482111561054b5760405162461bcd60e51b81526004016103de90611b07565b506001600160a01b03919091166000908152600c60209081526040808320938352929052205490565b6011546001600160a01b031690565b600061058d61166d565b905090565b600061059d82611612565b6105b95760405162461bcd60e51b81526004016103de90611c09565b506001600160a01b03166000908152600e602052604090205490565b6002546001600160a01b031690565b6004546001600160a01b031690565b60005461010090046001600160a01b031633146106225760405162461bcd60e51b81526004016103de90611cef565b6001600160a01b0381166106485760405162461bcd60e51b81526004016103de90611ad0565b61065181611612565b1561066e5760405162461bcd60e51b81526004016103de90611cc5565b600a80546001810182556000919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80180546001600160a01b0319166001600160a01b0383161790556106c161166d565b6001600160a01b0382166000818152600e602052604080822093909355915190917f3df6de6f7acbd50ccf5d3352eaf45f9eaf44b2b259e62a4c04351fdea533287391a250565b6003546001600160a01b031690565b600061072c600161072661166d565b90611681565b600f5414905090565b6010546001600160a01b03163314801561074e57503315155b61076a5760405162461bcd60e51b81526004016103de90611c9d565b600061077c61077761166d565b6115ea565b90506009548111156107a05760405162461bcd60e51b81526004016103de90611b5e565b600090815260066020526040902055565b60006107bc83611612565b6107d85760405162461bcd60e51b81526004016103de90611c09565b6001600160a01b0383166000908152600e60205260409020548210156108105760405162461bcd60e51b81526004016103de90611c75565b600f548211156108325760405162461bcd60e51b81526004016103de90611b07565b506001600160a01b03919091166000908152600d60209081526040808320938352929052205490565b6010546001600160a01b0316156108845760405162461bcd60e51b81526004016103de90611b84565b601080546001600160a01b031916734b5057b2c87ec9e7c047fb00c0e406dff2fdacad179055565b60005461010090046001600160a01b031690565b60095490565b6010546001600160a01b0316331480156108df57503315155b6108fb5760405162461bcd60e51b81526004016103de90611c9d565b600061090861077761166d565b905060095481111561092c5760405162461bcd60e51b81526004016103de90611b5e565b600090815260076020526040902055565b60006005548210156109615760405162461bcd60e51b81526004016103de90611a74565b600061096c836115ea565b90506009548111156109905760405162461bcd60e51b81526004016103de90611b5e565b60009081526008602052604090205492915050565b60006005548210156109c95760405162461bcd60e51b81526004016103de90611a74565b6104af826115ea565b60006005548210156109f65760405162461bcd60e51b81526004016103de90611c75565b600f54821115610a185760405162461bcd60e51b81526004016103de90611b07565b506000908152600b602052604090205490565b6060600a805480602002602001604051908101604052809291908181526020018280548015610a8357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610a65575b5050505050905090565b600080610a9e60055461072661166d565b9050610ab78115610aaf5781610777565b6005546115ea565b91505090565b6000610ac761166d565b600f54909150610ad89060016116ca565b8111610af65760405162461bcd60e51b81526004016103de90611bdf565b600260009054906101000a90046001600160a01b03166001600160a01b031663782536046040518163ffffffff1660e01b815260040160206040518083038186803b158015610b4457600080fd5b505afa158015610b58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7c9190611937565b610b985760405162461bcd60e51b81526004016103de90611bb4565b600f54610ba69060016116ca565b600f819055600090610bb7906115ea565b9050600954811115610bdb5760405162461bcd60e51b81526004016103de90611b5e565b6002546040805163154d950160e31b815290516060926001600160a01b03169163aa6ca808916004808301926000929190829003018186803b158015610c2057600080fd5b505afa158015610c34573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610c5c9190810190611815565b600254600f546040516329baa97760e01b81529293506060926001600160a01b03909216916329baa97791610c9391600401611d17565b60006040518083038186803b158015610cab57600080fd5b505afa158015610cbf573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ce791908101906118b3565b905060005b600a54811015610e7d576000600a8281548110610d0557fe5b60009182526020822001546001600160a01b03169150805b8551811015610e21576000868281518110610d3457fe5b602002602001015190506000846001600160a01b0316639f292d7683600f546040518363ffffffff1660e01b8152600401610d709291906119b0565b60606040518083038186803b158015610d8857600080fd5b505afa158015610d9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc0919061196f565b925050506000878481518110610dd257fe5b602002602001015190506000610e03670de0b6b3a7640000610dfd85856116ef90919063ffffffff16565b90611729565b9050610e0f86826116ca565b95505060019093019250610d1d915050565b506001600160a01b0382166000908152600c60209081526040808320600f80548552908352818420859055548352600b909152902054610e6190826116ca565b600f546000908152600b60205260409020555050600101610cec565b5060005b600a54811015611080576000600a8281548110610e9a57fe5b60009182526020808320909101546001600160a01b0316808352600c82526040808420600f548552909252912054909150610ed55750611078565b600f546000818152600b602090815260408083205489845260068352818420546001600160a01b0387168552600c84528285209585529490925290912054610f2192610dfd91906116ef565b6001600160a01b038281166000908152600d60209081526040808320600f8054855292528083209490945554815282902054600154925163095ea7b360e01b815290929091169063095ea7b390610f7e90859085906004016119b0565b602060405180830381600087803b158015610f9857600080fd5b505af1158015610fac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd09190611937565b50600f546040516379b6a96d60e11b81526001600160a01b0384169163f36d52da9161100191908590600401611d20565b600060405180830381600087803b15801561101b57600080fd5b505af115801561102f573d6000803e3d6000fd5b5050505086826001600160a01b03167fb10f7181725e149ac50c5c122d6ea02644213c2e7f30f74a44b3fce1fb158ca98360405161106d9190611d17565b60405180910390a350505b600101610e81565b50600354600f5460405163eb87e89b60e01b81526000926001600160a01b03169163eb87e89b916110b49190600401611d17565b60606040518083038186803b1580156110cc57600080fd5b505afa1580156110e0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611104919061196f565b9250505080600014611275576001546003546000868152600760205260409081902054905163095ea7b360e01b81526001600160a01b039384169363095ea7b393611154939116916004016119b0565b602060405180830381600087803b15801561116e57600080fd5b505af1158015611182573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a69190611937565b50600354600f54600086815260076020526040908190205490516379b6a96d60e11b81526001600160a01b039093169263f36d52da926111ea929091600401611d20565b600060405180830381600087803b15801561120457600080fd5b505af1158015611218573d6000803e3d6000fd5b5050600354600087815260076020526040908190205490518994506001600160a01b0390921692507fb10f7181725e149ac50c5c122d6ea02644213c2e7f30f74a44b3fce1fb158ca99161126c9190611d17565b60405180910390a35b6000805b600a54811015611346576000600a828154811061129257fe5b600091825260208220015460048054600f546040516303b5c12760e31b81526001600160a01b0394851696509190931692631dae0938926112d692879291016119b0565b60606040518083038186803b1580156112ee57600080fd5b505afa158015611302573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611326919061196f565b9250508115905061133c57600193505050611346565b5050600101611279565b5080156114b257600154600480546000888152600860205260409081902054905163095ea7b360e01b81526001600160a01b039485169463095ea7b394611392949091169291016119b0565b602060405180830381600087803b1580156113ac57600080fd5b505af11580156113c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e49190611937565b5060048054600f546000888152600860205260409081902054905163242be82160e01b81526001600160a01b039093169363242be8219361142793929101611d20565b600060405180830381600087803b15801561144157600080fd5b505af1158015611455573d6000803e3d6000fd5b5050600454600088815260086020526040908190205490518a94506001600160a01b0390921692507fb10f7181725e149ac50c5c122d6ea02644213c2e7f30f74a44b3fce1fb158ca9916114a99190611d17565b60405180910390a35b505050505050565b6010546001600160a01b0316331480156114d357503315155b6114ef5760405162461bcd60e51b81526004016103de90611c9d565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b6010546001600160a01b03163314801561152a57503315155b6115465760405162461bcd60e51b81526004016103de90611c9d565b600061155361077761166d565b90506009548111156115775760405162461bcd60e51b81526004016103de90611b5e565b600090815260086020526040902055565b6011546001600160a01b0316331480156115a157503315155b6115bd5760405162461bcd60e51b81526004016103de90611b2f565b60118054601080546001600160a01b03199081166001600160a01b03841617909155169055565b60055490565b60006104af600161160c61016e610dfd6005548761168190919063ffffffff16565b906116ca565b6000805b600a5481101561166457826001600160a01b0316600a828154811061163757fe5b6000918252602090912001546001600160a01b0316141561165c576001915050610428565b600101611616565b50600092915050565b600061058d600161160c4262015180611729565b60006116c383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061176b565b9392505050565b6000828201838110156116c35760405162461bcd60e51b81526004016103de90611a99565b6000826116fe575060006104af565b8282028284828161170b57fe5b04146116c35760405162461bcd60e51b81526004016103de90611c34565b60006116c383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611797565b6000818484111561178f5760405162461bcd60e51b81526004016103de9190611a21565b505050900390565b600081836117b85760405162461bcd60e51b81526004016103de9190611a21565b5060008385816117c457fe5b0495945050505050565b6000602082840312156117df578081fd5b81356116c381611d75565b600080604083850312156117fc578081fd5b823561180781611d75565b946020939093013593505050565b60006020808385031215611827578182fd5b825167ffffffffffffffff81111561183d578283fd5b8301601f8101851361184d578283fd5b805161186061185b82611d55565b611d2e565b818152838101908385018584028501860189101561187c578687fd5b8694505b838510156118a757805161189381611d75565b835260019490940193918501918501611880565b50979650505050505050565b600060208083850312156118c5578182fd5b825167ffffffffffffffff8111156118db578283fd5b8301601f810185136118eb578283fd5b80516118f961185b82611d55565b8181528381019083850185840285018601891015611915578687fd5b8694505b838510156118a7578051835260019490940193918501918501611919565b600060208284031215611948578081fd5b815180151581146116c3578182fd5b600060208284031215611968578081fd5b5035919050565b600080600060608486031215611983578081fd5b8351925060208401519150604084015190509250925092565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b81811015611a0a5783516001600160a01b0316835292840192918401916001016119e5565b50909695505050505050565b901515815260200190565b6000602080835283518082850152825b81811015611a4d57858101830151858201604001528201611a31565b81811115611a5e5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252600b908201526a696e76616c69642064617960a81b604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252601a908201527f636f6d6d756e697479206e6f74207a65726f2061646472657373000000000000604082015260600190565b6020808252600e908201526d323a20696e76616c69642064617960901b604082015260600190565b6020808252601590820152743737ba103832b73234b733a9bab832b920b236b4b760591b604082015260600190565b6020808252600c908201526b34b73b30b634b2103cb2b0b960a11b604082015260600190565b6020808252601690820152751cdd5c195c90591b5a5b88185b1c9958591e481cd95d60521b604082015260600190565b6020808252601190820152706e65656420746f6b656e2070726963657360781b604082015260600190565b60208082526010908201526f185b1c9958591e481c995b19585cd95960821b604082015260600190565b602080825260119082015270696e76616c696420636f6d6d756e69747960781b604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252600e908201526d313a20696e76616c69642064617960901b604082015260600190565b6020808252600e908201526d3737ba1039bab832b920b236b4b760911b604082015260600190565b60208082526010908201526f636f6d6d756e6974792065786973747360801b604082015260600190565b6020808252600e908201526d6e6f7420736254696d656c6f636b60901b604082015260600190565b90815260200190565b918252602082015260400190565b60405181810167ffffffffffffffff81118282101715611d4d57600080fd5b604052919050565b600067ffffffffffffffff821115611d6b578081fd5b5060209081020190565b6001600160a01b0381168114611d8a57600080fd5b5056fea2646970667358221220aa1540733ed08e70a5e540c20d3e942b9764c64c9d9a14ebe2cc9f76deb35c9664736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,481
0x94eea9a484f0bae03d19623cfe389e2cba56b72f
pragma solidity ^0.4.24; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } function max64(uint64 a, uint64 b) internal pure returns (uint64) { return a >= b ? a : b; } function min64(uint64 a, uint64 b) internal pure returns (uint64) { return a < b ? a : b; } function max256(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } function min256(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } } contract ERC20Basic { uint256 public totalSupply; bool public transfersEnabled; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 { uint256 public totalSupply; bool public transfersEnabled; function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping (address => uint256) balances; /** * Protection against short address attack */ modifier onlyPayloadSize(uint numwords) { assert(msg.data.length == numwords * 32 + 4); _; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public onlyPayloadSize(2) returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); require(transfersEnabled); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public onlyPayloadSize(3) returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(transfersEnabled); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public onlyPayloadSize(2) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval(address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnerChanged(address indexed previousOwner, address indexed newOwner); /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function changeOwner(address _newOwner) onlyOwner internal { require(_newOwner != address(0)); emit OwnerChanged(owner, _newOwner); owner = _newOwner; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { string public constant name = "ENZO"; string public constant symbol = "NZO"; uint8 public constant decimals = 18; event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount, address _owner) canMint internal returns (bool) { balances[_to] = balances[_to].add(_amount); balances[_owner] = balances[_owner].sub(_amount); emit Mint(_to, _amount); emit Transfer(_owner, _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint internal returns (bool) { mintingFinished = true; emit MintFinished(); return true; } /** * Peterson's Law Protection * Claim tokens */ function claimTokens(address _token) public onlyOwner { if (_token == 0x0) { owner.transfer(address(this).balance); return; } MintableToken token = MintableToken(_token); uint256 balance = token.balanceOf(this); token.transfer(owner, balance); emit Transfer(_token, owner, balance); } } /** * @title Crowdsale * @dev Crowdsale is a base contract for managing a token crowdsale. * Crowdsales have a start and end timestamps, where investors can make * token purchases. Funds collected are forwarded to a wallet * as they arrive. */ contract Crowdsale is Ownable { using SafeMath for uint256; // address where funds are collected address public wallet; // amount of raised money in wei uint256 public weiRaised; uint256 public tokenAllocated; constructor(address _wallet) public { require(_wallet != address(0)); wallet = _wallet; } } contract NZOCrowdsale is Ownable, Crowdsale, MintableToken { using SafeMath for uint256; // https://www.coingecko.com/en/coins/ethereum // For June 02, 2018 //$0.01 = 1 token => $ 1,000 = 1.7089051044995474 ETH => // 1,000 / 0.01 = 100,000 token = 1.7089051044995474 ETH => //100,000 token = 1.7089051044995474 ETH => //1 ETH = 100,000/1.7089051044995474 = 58517 uint256 public rate = 58517; // for $0.01 //uint256 public rate = 10; // for test's mapping (address => uint256) public deposited; uint256 public constant INITIAL_SUPPLY = 21 * 10**9 * (10 ** uint256(decimals)); uint256 public fundForSale = 12600 * 10**6 * (10 ** uint256(decimals)); uint256 public fundReserve = 5250000000 * (10 ** uint256(decimals)); uint256 public fundFoundation = 1000500000 * (10 ** uint256(decimals)); uint256 public fundTeam = 2100000000 * (10 ** uint256(decimals)); uint256 limitWeekZero = 2500000000 * (10 ** uint256(decimals)); uint256 limitWeekOther = 200000000 * (10 ** uint256(decimals)); //uint256 limitWeekZero = 20 * (10 ** uint256(decimals)); // for tests //uint256 limitWeekOther = 10 * (10 ** uint256(decimals)); // for tests address public addressFundReserve = 0x67446E0673418d302dB3552bdF05363dB5Fda9Ce; address public addressFundFoundation = 0xfe3859CB2F9d6f448e9959e6e8Fe0be841c62459; address public addressFundTeam = 0xfeD3B7eaDf1bD15FbE3aA1f1eAfa141efe0eeeb2; uint256 public startTime = 1530720000; // Wed, 04 Jul 2018 16:00:00 GMT // Eastern Standard Time (EST) + 4 hours = Greenwich Mean Time (GMT)) uint numberWeeks = 46; uint256 public countInvestor; event TokenPurchase(address indexed beneficiary, uint256 value, uint256 amount); event TokenLimitReached(uint256 tokenRaised, uint256 purchasedToken); event MinWeiLimitReached(address indexed sender, uint256 weiAmount); event Finalized(); constructor(address _owner) public Crowdsale(_owner) { require(_owner != address(0)); owner = _owner; //owner = msg.sender; // for test's transfersEnabled = true; mintingFinished = false; totalSupply = INITIAL_SUPPLY; bool resultMintForOwner = mintForOwner(owner); require(resultMintForOwner); } // fallback function can be used to buy tokens function() payable public { buyTokens(msg.sender); } function buyTokens(address _investor) public payable returns (uint256){ require(_investor != address(0)); uint256 weiAmount = msg.value; uint256 tokens = validPurchaseTokens(weiAmount); if (tokens == 0) {revert();} weiRaised = weiRaised.add(weiAmount); tokenAllocated = tokenAllocated.add(tokens); mint(_investor, tokens, owner); emit TokenPurchase(_investor, weiAmount, tokens); if (deposited[_investor] == 0) { countInvestor = countInvestor.add(1); } deposit(_investor); wallet.transfer(weiAmount); return tokens; } function getTotalAmountOfTokens(uint256 _weiAmount) internal returns (uint256) { uint256 currentDate = now; //currentDate = 1533513600; // (06 Aug 2018 00:00:00 GMT) for test's //currentDate = 1534694400; // (19 Aug 2018 00:00:00 GMT) for test's uint currentPeriod = getPeriod(currentDate); uint256 amountOfTokens = 0; if(currentPeriod < 100){ if(currentPeriod == 0){ amountOfTokens = _weiAmount.mul(rate).div(4); if (tokenAllocated.add(amountOfTokens) > limitWeekZero) { emit TokenLimitReached(tokenAllocated, amountOfTokens); return 0; } } for(uint j = 0; j < numberWeeks; j++){ if(currentPeriod == (j + 1)){ amountOfTokens = _weiAmount.mul(rate).div(5+j*25); if (tokenAllocated.add(amountOfTokens) > limitWeekZero + limitWeekOther.mul(j+1)) { emit TokenLimitReached(tokenAllocated, amountOfTokens); return 0; } } } } return amountOfTokens; } function getPeriod(uint256 _currentDate) public view returns (uint) { if( startTime > _currentDate && _currentDate > startTime + 365 days){ return 100; } if( startTime <= _currentDate && _currentDate <= startTime + 43 days){ return 0; } for(uint j = 0; j < numberWeeks; j++){ if( startTime + 43 days + j*7 days <= _currentDate && _currentDate <= startTime + 43 days + (j+1)*7 days){ return j + 1; } } return 100; } function deposit(address investor) internal { deposited[investor] = deposited[investor].add(msg.value); } function mintForOwner(address _walletOwner) internal returns (bool result) { result = false; require(_walletOwner != address(0)); balances[_walletOwner] = balances[_walletOwner].add(fundForSale); balances[addressFundTeam] = balances[addressFundTeam].add(fundTeam); balances[addressFundReserve] = balances[addressFundReserve].add(fundReserve); balances[addressFundFoundation] = balances[addressFundFoundation].add(fundFoundation); result = true; } function getDeposited(address _investor) public view returns (uint256){ return deposited[_investor]; } function validPurchaseTokens(uint256 _weiAmount) public returns (uint256) { uint256 addTokens = getTotalAmountOfTokens(_weiAmount); if (_weiAmount < 0.5 ether) { emit MinWeiLimitReached(msg.sender, _weiAmount); return 0; } if (tokenAllocated.add(addTokens) > fundForSale) { emit TokenLimitReached(tokenAllocated, addTokens); return 0; } return addTokens; } function finalize() public onlyOwner returns (bool result) { result = false; wallet.transfer(address(this).balance); finishMinting(); emit Finalized(); result = true; } function setRate(uint256 _newRate) external onlyOwner returns (bool){ require(_newRate > 0); rate = _newRate; return true; } }
0x6080604052600436106101c2576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146101ce57806306fdde03146101fd578063095ea7b31461028d578063127f902f146102f257806313bd9e3c1461034957806318160ddd1461037457806323b872dd1461039f5780632c4e722e146104245780632ff2e9dc1461044f578063313ce5671461047a57806334fcf437146104ab5780634042b66f146104f0578063466bb3121461051b57806348a3cbdf146105725780634b2c07061461059d5780634bb278f3146105de578063521eb2731461060d578063540fd4df1461066457806366188463146106bb5780636f9c3c8f1461072057806370a082311461074b5780637858f93a146107a257806378e97925146107f957806378f7aeee146108245780638da5cb5b1461084f578063916576c8146108a657806395d89b41146108d1578063a9059cbb14610961578063bef97c87146109c6578063cb13cddb146109f5578063d1e2eb5e14610a4c578063d73dd62314610a77578063dd62ed3e14610adc578063df8de3e714610b53578063ec8ac4d814610b96578063fc38ce1914610be0575b6101cb33610c21565b50005b3480156101da57600080fd5b506101e3610e18565b604051808215151515815260200191505060405180910390f35b34801561020957600080fd5b50610212610e2b565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610252578082015181840152602081019050610237565b50505050905090810190601f16801561027f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561029957600080fd5b506102d8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e64565b604051808215151515815260200191505060405180910390f35b3480156102fe57600080fd5b50610307610f56565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561035557600080fd5b5061035e610f7c565b6040518082815260200191505060405180910390f35b34801561038057600080fd5b50610389610f82565b6040518082815260200191505060405180910390f35b3480156103ab57600080fd5b5061040a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f88565b604051808215151515815260200191505060405180910390f35b34801561043057600080fd5b5061043961137b565b6040518082815260200191505060405180910390f35b34801561045b57600080fd5b50610464611381565b6040518082815260200191505060405180910390f35b34801561048657600080fd5b5061048f611393565b604051808260ff1660ff16815260200191505060405180910390f35b3480156104b757600080fd5b506104d660048036038101908080359060200190929190505050611398565b604051808215151515815260200191505060405180910390f35b3480156104fc57600080fd5b50610505611415565b6040518082815260200191505060405180910390f35b34801561052757600080fd5b5061055c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061141b565b6040518082815260200191505060405180910390f35b34801561057e57600080fd5b50610587611464565b6040518082815260200191505060405180910390f35b3480156105a957600080fd5b506105c86004803603810190808035906020019092919050505061146a565b6040518082815260200191505060405180910390f35b3480156105ea57600080fd5b506105f3611520565b604051808215151515815260200191505060405180910390f35b34801561061957600080fd5b5061062261163e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561067057600080fd5b50610679611664565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106c757600080fd5b50610706600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061168a565b604051808215151515815260200191505060405180910390f35b34801561072c57600080fd5b5061073561191b565b6040518082815260200191505060405180910390f35b34801561075757600080fd5b5061078c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611921565b6040518082815260200191505060405180910390f35b3480156107ae57600080fd5b506107b761196a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561080557600080fd5b5061080e611990565b6040518082815260200191505060405180910390f35b34801561083057600080fd5b50610839611996565b6040518082815260200191505060405180910390f35b34801561085b57600080fd5b5061086461199c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108b257600080fd5b506108bb6119c2565b6040518082815260200191505060405180910390f35b3480156108dd57600080fd5b506108e66119c8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561092657808201518184015260208101905061090b565b50505050905090810190601f1680156109535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561096d57600080fd5b506109ac600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a01565b604051808215151515815260200191505060405180910390f35b3480156109d257600080fd5b506109db611c59565b604051808215151515815260200191505060405180910390f35b348015610a0157600080fd5b50610a36600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c6c565b6040518082815260200191505060405180910390f35b348015610a5857600080fd5b50610a61611c84565b6040518082815260200191505060405180910390f35b348015610a8357600080fd5b50610ac2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611c8a565b604051808215151515815260200191505060405180910390f35b348015610ae857600080fd5b50610b3d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e86565b6040518082815260200191505060405180910390f35b348015610b5f57600080fd5b50610b94600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f25565b005b610bca600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c21565b6040518082815260200191505060405180910390f35b348015610bec57600080fd5b50610c0b60048036038101908080359060200190929190505050612291565b6040518082815260200191505060405180910390f35b60008060008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610c6157600080fd5b349150610c6d82612291565b90506000811415610c7d57600080fd5b610c928260085461237890919063ffffffff16565b600881905550610cad8160095461237890919063ffffffff16565b600981905550610ce08482600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612396565b508373ffffffffffffffffffffffffffffffffffffffff167fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f8383604051808381526020018281526020019250505060405180910390a26000600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610d9c57610d95600160185461237890919063ffffffff16565b6018819055505b610da58461259c565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015610e0d573d6000803e3d6000fd5b508092505050919050565b600a60009054906101000a900460ff1681565b6040805190810160405280600481526020017f454e5a4f0000000000000000000000000000000000000000000000000000000081525081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600f5481565b60025481565b60006003600460208202016000369050141515610fa157fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610fdd57600080fd5b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561102b57600080fd5b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156110b657600080fd5b600360009054906101000a900460ff1615156110d157600080fd5b61112383600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461263490919063ffffffff16565b600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111b883600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237890919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061128a83600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461263490919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600b5481565b601260ff16600a0a6404e3b292000281565b601281565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113f657600080fd5b60008211151561140557600080fd5b81600b8190555060019050919050565b60085481565b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60105481565b6000808260165411801561148557506301e133806016540183115b15611493576064915061151a565b82601654111580156114ac57506238b080601654018311155b156114ba576000915061151a565b600090505b601754811015611515578262093a8082026238b0806016540101111580156114f8575062093a8060018201026238b08060165401018311155b156115085760018101915061151a565b80806001019150506114bf565b606491505b50919050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561157e57600080fd5b60009050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015611601573d6000803e3d6000fd5b5061160a61264d565b507f6823b073d48d6e3a7d385eeb601452d680e74bb46afe3255a7d778f3a9b1768160405160405180910390a16001905090565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561179b576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061182f565b6117ae838261263490919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600e5481565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60165481565b60095481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d5481565b6040805190810160405280600381526020017f4e5a4f000000000000000000000000000000000000000000000000000000000081525081565b60006002600460208202016000369050141515611a1a57fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515611a5657600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515611aa457600080fd5b600360009054906101000a900460ff161515611abf57600080fd5b611b1183600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461263490919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ba683600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237890919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b600360009054906101000a900460ff1681565b600c6020528060005260406000206000915090505481565b60185481565b6000611d1b82600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237890919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60006002600460208202016000369050141515611e9f57fe5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491505092915050565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f8457600080fd5b60008373ffffffffffffffffffffffffffffffffffffffff16141561202857600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015612022573d6000803e3d6000fd5b5061228c565b8291508173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156120c657600080fd5b505af11580156120da573d6000803e3d6000fd5b505050506040513d60208110156120f057600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156121c857600080fd5b505af11580156121dc573d6000803e3d6000fd5b505050506040513d60208110156121f257600080fd5b810190808051906020019092919050505050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b505050565b60008061229d83612715565b90506706f05b59d3b20000831015612306573373ffffffffffffffffffffffffffffffffffffffff167f0f36f9ac72964373d449d48877bd9443e49c93c404464e4082e3de730bd3971b846040518082815260200191505060405180910390a260009150612372565b600d5461231e8260095461237890919063ffffffff16565b111561236e577f77fcbebee5e7fc6abb70669438e18dae65fc2057b32b694851724c2726a35b6260095482604051808381526020018281526020019250505060405180910390a160009150612372565b8091505b50919050565b600080828401905083811015151561238c57fe5b8091505092915050565b6000600a60009054906101000a900460ff161515156123b457600080fd5b61240683600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237890919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061249b83600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461263490919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885846040518082815260200191505060405180910390a28373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600190509392505050565b6125ee34600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237890919063ffffffff16565b600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b600082821115151561264257fe5b818303905092915050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156126ab57600080fd5b600a60009054906101000a900460ff161515156126c757600080fd5b6001600a60006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b60008060008060004293506127298461146a565b92506000915060648310156128ad5760008314156127d457612769600461275b600b54896128ba90919063ffffffff16565b6128ed90919063ffffffff16565b91506011546127838360095461237890919063ffffffff16565b11156127d3577f77fcbebee5e7fc6abb70669438e18dae65fc2057b32b694851724c2726a35b6260095483604051808381526020018281526020019250505060405180910390a1600094506128b1565b5b600090505b6017548110156128ac576001810183141561289f5761281b6019820260050161280d600b54896128ba90919063ffffffff16565b6128ed90919063ffffffff16565b9150612835600182016012546128ba90919063ffffffff16565b6011540161284e8360095461237890919063ffffffff16565b111561289e577f77fcbebee5e7fc6abb70669438e18dae65fc2057b32b694851724c2726a35b6260095483604051808381526020018281526020019250505060405180910390a1600094506128b1565b5b80806001019150506127d9565b5b8194505b50505050919050565b600080828402905060008414806128db57508284828115156128d857fe5b04145b15156128e357fe5b8091505092915050565b60008082848115156128fb57fe5b04905080915050929150505600a165627a7a72305820f6861665aec8773a2871b91dce44fa6a61705f5a7726fc860eed0953f04255350029
{"success": true, "error": null, "results": {"detectors": [{"check": "write-after-write", "impact": "Medium", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
6,482
0x675c9737832138874b524053a97fa81bf2b12633
/** *Submitted for verification at Etherscan.io on 2021-08-07 */ /** *Submitted for verification at Etherscan.io on 2021-08-06 */ /* Vaccine Token Contract: ❌Team wallet ❌No Presale * TOKENOMICS: * 1,000,000,000,000 token supply * No sell token limits. * No team tokens, no presale */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract Vaccine is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Vaccine"; string private constant _symbol = "Vaccine"; 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 = 4; uint256 private _teamFee = 4; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 1; _teamFee = 4; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 50000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues( tAmount, _taxFee, _teamFee ); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues( tAmount, tFee, tTeam, currentRate ); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e7b565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612982565b61045e565b6040516101789190612e60565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a3919061301d565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061292f565b61048d565b6040516101e09190612e60565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612895565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613092565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a0b565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612895565b610783565b6040516102b1919061301d565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d92565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e7b565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612982565b61098d565b60405161035b9190612e60565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129c2565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a65565b6110ac565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128ef565b6111f5565b604051610418919061301d565b60405180910390f35b60606040518060400160405280600781526020017f56616363696e6500000000000000000000000000000000000000000000000000815250905090565b600061047261046b61127c565b8484611284565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144f565b61055b846104a661127c565b6105568560405180606001604052806028815260200161379960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0e9092919063ffffffff16565b611284565b600190509392505050565b61056e61127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f5d565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f5d565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127c565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c72565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d6d565b9050919050565b6107dc61127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f5d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f56616363696e6500000000000000000000000000000000000000000000000000815250905090565b60006109a161099a61127c565b848461144f565b6001905092915050565b6109b361127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f5d565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a646133da565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac990613333565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127c565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611ddb565b50565b610b5761127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612f5d565b60405180910390fd5b600f60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612fdd565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611284565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4291906128c2565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc91906128c2565b6040518363ffffffff1660e01b8152600401610df9929190612dad565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b91906128c2565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612dff565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a92565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506802b5e3af16b18800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611056929190612dd6565b602060405180830381600087803b15801561107057600080fd5b505af1158015611084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a89190612a38565b5050565b6110b461127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611141576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113890612f5d565b60405180910390fd5b60008111611184576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117b90612f1d565b60405180910390fd5b6111b360646111a583683635c9adc5dea0000061206390919063ffffffff16565b6120de90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111ea919061301d565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112eb90612fbd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611364576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135b90612edd565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611442919061301d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b690612f9d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152690612e9d565b60405180910390fd5b60008111611572576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156990612f7d565b60405180910390fd5b61157a610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e857506115b8610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4b57600f60179054906101000a900460ff161561181b573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166a57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c45750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181a57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176461127c565b73ffffffffffffffffffffffffffffffffffffffff1614806117da5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c261127c565b73ffffffffffffffffffffffffffffffffffffffff16145b611819576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181090612ffd565b60405180910390fd5b5b5b60105481111561182a57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118ce5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d757600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119825750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d85750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119f05750600f60179054906101000a900460ff165b15611a915742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a4057600080fd5b603c42611a4d9190613153565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9c30610783565b9050600f60159054906101000a900460ff16158015611b095750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b215750600f60169054906101000a900460ff165b15611b4957611b2f81611ddb565b60004790506000811115611b4757611b4647611c72565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf25750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfc57600090505b611c0884848484612128565b50505050565b6000838311158290611c56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4d9190612e7b565b60405180910390fd5b5060008385611c659190613234565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cc26002846120de90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ced573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d3e6002846120de90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d69573d6000803e3d6000fd5b5050565b6000600654821115611db4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dab90612ebd565b60405180910390fd5b6000611dbe612155565b9050611dd381846120de90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e1357611e12613409565b5b604051908082528060200260200182016040528015611e415781602001602082028036833780820191505090505b5090503081600081518110611e5957611e586133da565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611efb57600080fd5b505afa158015611f0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f3391906128c2565b81600181518110611f4757611f466133da565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fae30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611284565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612012959493929190613038565b600060405180830381600087803b15801561202c57600080fd5b505af1158015612040573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561207657600090506120d8565b6000828461208491906131da565b905082848261209391906131a9565b146120d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120ca90612f3d565b60405180910390fd5b809150505b92915050565b600061212083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612180565b905092915050565b80612136576121356121e3565b5b612141848484612214565b8061214f5761214e6123df565b5b50505050565b60008060006121626123f1565b9150915061217981836120de90919063ffffffff16565b9250505090565b600080831182906121c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121be9190612e7b565b60405180910390fd5b50600083856121d691906131a9565b9050809150509392505050565b60006008541480156121f757506000600954145b1561220157612212565b600060088190555060006009819055505b565b60008060008060008061222687612453565b95509550955095509550955061228486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124bb90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061231985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236581612563565b61236f8483612620565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123cc919061301d565b60405180910390a3505050505050505050565b60016008819055506004600981905550565b600080600060065490506000683635c9adc5dea000009050612427683635c9adc5dea000006006546120de90919063ffffffff16565b82101561244657600654683635c9adc5dea0000093509350505061244f565b81819350935050505b9091565b60008060008060008060008060006124708a60085460095461265a565b9250925092506000612480612155565b905060008060006124938e8787876126f0565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124fd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0e565b905092915050565b60008082846125149190613153565b905083811015612559576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255090612efd565b60405180910390fd5b8091505092915050565b600061256d612155565b90506000612584828461206390919063ffffffff16565b90506125d881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612635826006546124bb90919063ffffffff16565b6006819055506126508160075461250590919063ffffffff16565b6007819055505050565b6000806000806126866064612678888a61206390919063ffffffff16565b6120de90919063ffffffff16565b905060006126b060646126a2888b61206390919063ffffffff16565b6120de90919063ffffffff16565b905060006126d9826126cb858c6124bb90919063ffffffff16565b6124bb90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612709858961206390919063ffffffff16565b90506000612720868961206390919063ffffffff16565b90506000612737878961206390919063ffffffff16565b905060006127608261275285876124bb90919063ffffffff16565b6124bb90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061278c612787846130d2565b6130ad565b905080838252602082019050828560208602820111156127af576127ae61343d565b5b60005b858110156127df57816127c588826127e9565b8452602084019350602083019250506001810190506127b2565b5050509392505050565b6000813590506127f881613753565b92915050565b60008151905061280d81613753565b92915050565b600082601f83011261282857612827613438565b5b8135612838848260208601612779565b91505092915050565b6000813590506128508161376a565b92915050565b6000815190506128658161376a565b92915050565b60008135905061287a81613781565b92915050565b60008151905061288f81613781565b92915050565b6000602082840312156128ab576128aa613447565b5b60006128b9848285016127e9565b91505092915050565b6000602082840312156128d8576128d7613447565b5b60006128e6848285016127fe565b91505092915050565b6000806040838503121561290657612905613447565b5b6000612914858286016127e9565b9250506020612925858286016127e9565b9150509250929050565b60008060006060848603121561294857612947613447565b5b6000612956868287016127e9565b9350506020612967868287016127e9565b92505060406129788682870161286b565b9150509250925092565b6000806040838503121561299957612998613447565b5b60006129a7858286016127e9565b92505060206129b88582860161286b565b9150509250929050565b6000602082840312156129d8576129d7613447565b5b600082013567ffffffffffffffff8111156129f6576129f5613442565b5b612a0284828501612813565b91505092915050565b600060208284031215612a2157612a20613447565b5b6000612a2f84828501612841565b91505092915050565b600060208284031215612a4e57612a4d613447565b5b6000612a5c84828501612856565b91505092915050565b600060208284031215612a7b57612a7a613447565b5b6000612a898482850161286b565b91505092915050565b600080600060608486031215612aab57612aaa613447565b5b6000612ab986828701612880565b9350506020612aca86828701612880565b9250506040612adb86828701612880565b9150509250925092565b6000612af18383612afd565b60208301905092915050565b612b0681613268565b82525050565b612b1581613268565b82525050565b6000612b268261310e565b612b308185613131565b9350612b3b836130fe565b8060005b83811015612b6c578151612b538882612ae5565b9750612b5e83613124565b925050600181019050612b3f565b5085935050505092915050565b612b828161327a565b82525050565b612b91816132bd565b82525050565b6000612ba282613119565b612bac8185613142565b9350612bbc8185602086016132cf565b612bc58161344c565b840191505092915050565b6000612bdd602383613142565b9150612be88261345d565b604082019050919050565b6000612c00602a83613142565b9150612c0b826134ac565b604082019050919050565b6000612c23602283613142565b9150612c2e826134fb565b604082019050919050565b6000612c46601b83613142565b9150612c518261354a565b602082019050919050565b6000612c69601d83613142565b9150612c7482613573565b602082019050919050565b6000612c8c602183613142565b9150612c978261359c565b604082019050919050565b6000612caf602083613142565b9150612cba826135eb565b602082019050919050565b6000612cd2602983613142565b9150612cdd82613614565b604082019050919050565b6000612cf5602583613142565b9150612d0082613663565b604082019050919050565b6000612d18602483613142565b9150612d23826136b2565b604082019050919050565b6000612d3b601783613142565b9150612d4682613701565b602082019050919050565b6000612d5e601183613142565b9150612d698261372a565b602082019050919050565b612d7d816132a6565b82525050565b612d8c816132b0565b82525050565b6000602082019050612da76000830184612b0c565b92915050565b6000604082019050612dc26000830185612b0c565b612dcf6020830184612b0c565b9392505050565b6000604082019050612deb6000830185612b0c565b612df86020830184612d74565b9392505050565b600060c082019050612e146000830189612b0c565b612e216020830188612d74565b612e2e6040830187612b88565b612e3b6060830186612b88565b612e486080830185612b0c565b612e5560a0830184612d74565b979650505050505050565b6000602082019050612e756000830184612b79565b92915050565b60006020820190508181036000830152612e958184612b97565b905092915050565b60006020820190508181036000830152612eb681612bd0565b9050919050565b60006020820190508181036000830152612ed681612bf3565b9050919050565b60006020820190508181036000830152612ef681612c16565b9050919050565b60006020820190508181036000830152612f1681612c39565b9050919050565b60006020820190508181036000830152612f3681612c5c565b9050919050565b60006020820190508181036000830152612f5681612c7f565b9050919050565b60006020820190508181036000830152612f7681612ca2565b9050919050565b60006020820190508181036000830152612f9681612cc5565b9050919050565b60006020820190508181036000830152612fb681612ce8565b9050919050565b60006020820190508181036000830152612fd681612d0b565b9050919050565b60006020820190508181036000830152612ff681612d2e565b9050919050565b6000602082019050818103600083015261301681612d51565b9050919050565b60006020820190506130326000830184612d74565b92915050565b600060a08201905061304d6000830188612d74565b61305a6020830187612b88565b818103604083015261306c8186612b1b565b905061307b6060830185612b0c565b6130886080830184612d74565b9695505050505050565b60006020820190506130a76000830184612d83565b92915050565b60006130b76130c8565b90506130c38282613302565b919050565b6000604051905090565b600067ffffffffffffffff8211156130ed576130ec613409565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061315e826132a6565b9150613169836132a6565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561319e5761319d61337c565b5b828201905092915050565b60006131b4826132a6565b91506131bf836132a6565b9250826131cf576131ce6133ab565b5b828204905092915050565b60006131e5826132a6565b91506131f0836132a6565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132295761322861337c565b5b828202905092915050565b600061323f826132a6565b915061324a836132a6565b92508282101561325d5761325c61337c565b5b828203905092915050565b600061327382613286565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132c8826132a6565b9050919050565b60005b838110156132ed5780820151818401526020810190506132d2565b838111156132fc576000848401525b50505050565b61330b8261344c565b810181811067ffffffffffffffff8211171561332a57613329613409565b5b80604052505050565b600061333e826132a6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133715761337061337c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61375c81613268565b811461376757600080fd5b50565b6137738161327a565b811461377e57600080fd5b50565b61378a816132a6565b811461379557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d2c26cf9f83e1eaa0840afb3ce786bd33a2cae880156caaf96b1869bfbee48d564736f6c63430008060033
{"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"}]}}
6,483
0x306949805e8aec755f0dceaaa504334587d3a6ff
/** *Submitted for verification at Etherscan.io on 2021-11-03 */ /* ▀█▀ █░█ █▀▀   █▀█ █▀▀ █▀▀ █ █▀▀ █ ▄▀█ █░░   █▀▄▀█ █ █▄█ ▄▀█ ▀█ ▄▀█ █▄▀ █   █ █▄░█ █░█ ░█░ █▀█ ██▄   █▄█ █▀░ █▀░ █ █▄▄ █ █▀█ █▄▄   █░▀░█ █ ░█░ █▀█ █▄ █▀█ █░█ █   █ █░▀█ █▄█ Our Official Links https://twitter.com/Miyazaki_inu https://www.miyazaki-inu.com/ */ 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 Miyazaki is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000* 10**12* 10**18; string private _name = ' Miyazaki Inu '; string private _symbol = 'Miyazaki '; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122066564b983a4fb4533ac753a94c9ea6e75923fb23167033597f924f5c4c8b0b8764736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,484
0xc9a96a55c0895fdb5d9154a33ceab9dcd0df3fc5
pragma solidity 0.4.25; // File: contracts/saga-genesis/interfaces/IMintManager.sol /** * @title Mint Manager Interface. */ interface IMintManager { /** * @dev Return the current minting-point index. */ function getIndex() external view returns (uint256); } // File: contracts/saga-genesis/interfaces/ISGNTokenManager.sol /** * @title SGN Token Manager Interface. */ interface ISGNTokenManager { /** * @dev Get the current SGR worth of a given SGN amount. * @param _sgnAmount The amount of SGN to convert. * @return The equivalent amount of SGR. */ function convertSgnToSga(uint256 _sgnAmount) external view returns (uint256); /** * @dev Exchange SGN for SGR. * @param _sender The address of the sender. * @param _sgnAmount The amount of SGN received. * @return The amount of SGR that the sender is entitled to. */ function exchangeSgnForSga(address _sender, uint256 _sgnAmount) external returns (uint256); /** * @dev Handle direct SGN transfer. * @param _sender The address of the sender. * @param _to The address of the destination account. * @param _value The amount of SGN to be transferred. */ function uponTransfer(address _sender, address _to, uint256 _value) external; /** * @dev Handle custodian SGN transfer. * @param _sender The address of the sender. * @param _from The address of the source account. * @param _to The address of the destination account. * @param _value The amount of SGN to be transferred. */ function uponTransferFrom(address _sender, address _from, address _to, uint256 _value) external; /** * @dev Upon minting of SGN vested in delay. * @param _value The amount of SGN to mint. */ function uponMintSgnVestedInDelay(uint256 _value) external; } // File: contracts/saga-genesis/interfaces/ISGNConversionManager.sol /** * @title SGN Conversion Manager Interface. */ interface ISGNConversionManager { /** * @dev Compute the SGR worth of a given SGN amount at a given minting-point. * @param _amount The amount of SGN. * @param _index The minting-point index. * @return The equivalent amount of SGR. */ function sgn2sgr(uint256 _amount, uint256 _index) external view returns (uint256); } // File: contracts/saga-genesis/interfaces/ISGNAuthorizationManager.sol /** * @title SGN Authorization Manager Interface. */ interface ISGNAuthorizationManager { /** * @dev Determine whether or not a user is authorized to sell SGN. * @param _sender The address of the user. * @return Authorization status. */ function isAuthorizedToSell(address _sender) external view returns (bool); /** * @dev Determine whether or not a user is authorized to transfer SGN to another user. * @param _sender The address of the source user. * @param _target The address of the target user. * @return Authorization status. */ function isAuthorizedToTransfer(address _sender, address _target) external view returns (bool); /** * @dev Determine whether or not a user is authorized to transfer SGN from one user to another user. * @param _sender The address of the custodian user. * @param _source The address of the source user. * @param _target The address of the target user. * @return Authorization status. */ function isAuthorizedToTransferFrom(address _sender, address _source, address _target) external view returns (bool); } // File: contracts/wallet_trading_limiter/interfaces/IWalletsTradingLimiter.sol /** * @title Wallets Trading Limiter Interface. */ interface IWalletsTradingLimiter { /** * @dev Increment the limiter value of a wallet. * @param _wallet The address of the wallet. * @param _value The amount to be updated. */ function updateWallet(address _wallet, uint256 _value) external; } // File: contracts/contract_address_locator/interfaces/IContractAddressLocator.sol /** * @title Contract Address Locator Interface. */ interface IContractAddressLocator { /** * @dev Get the contract address mapped to a given identifier. * @param _identifier The identifier. * @return The contract address. */ function getContractAddress(bytes32 _identifier) external view returns (address); /** * @dev Determine whether or not a contract address relates to one of the identifiers. * @param _contractAddress The contract address to look for. * @param _identifiers The identifiers. * @return A boolean indicating if the contract address relates to one of the identifiers. */ function isContractAddressRelates(address _contractAddress, bytes32[] _identifiers) external view returns (bool); } // File: contracts/contract_address_locator/ContractAddressLocatorHolder.sol /** * @title Contract Address Locator Holder. * @dev Hold a contract address locator, which maps a unique identifier to every contract address in the system. * @dev Any contract which inherits from this contract can retrieve the address of any contract in the system. * @dev Thus, any contract can remain "oblivious" to the replacement of any other contract in the system. * @dev In addition to that, any function in any contract can be restricted to a specific caller. */ contract ContractAddressLocatorHolder { bytes32 internal constant _IAuthorizationDataSource_ = "IAuthorizationDataSource"; bytes32 internal constant _ISGNConversionManager_ = "ISGNConversionManager" ; bytes32 internal constant _IModelDataSource_ = "IModelDataSource" ; bytes32 internal constant _IPaymentHandler_ = "IPaymentHandler" ; bytes32 internal constant _IPaymentManager_ = "IPaymentManager" ; bytes32 internal constant _IPaymentQueue_ = "IPaymentQueue" ; bytes32 internal constant _IReconciliationAdjuster_ = "IReconciliationAdjuster" ; bytes32 internal constant _IIntervalIterator_ = "IIntervalIterator" ; bytes32 internal constant _IMintHandler_ = "IMintHandler" ; bytes32 internal constant _IMintListener_ = "IMintListener" ; bytes32 internal constant _IMintManager_ = "IMintManager" ; bytes32 internal constant _IPriceBandCalculator_ = "IPriceBandCalculator" ; bytes32 internal constant _IModelCalculator_ = "IModelCalculator" ; bytes32 internal constant _IRedButton_ = "IRedButton" ; bytes32 internal constant _IReserveManager_ = "IReserveManager" ; bytes32 internal constant _ISagaExchanger_ = "ISagaExchanger" ; bytes32 internal constant _ISogurExchanger_ = "ISogurExchanger" ; bytes32 internal constant _SgnToSgrExchangeInitiator_ = "SgnToSgrExchangeInitiator" ; bytes32 internal constant _IMonetaryModel_ = "IMonetaryModel" ; bytes32 internal constant _IMonetaryModelState_ = "IMonetaryModelState" ; bytes32 internal constant _ISGRAuthorizationManager_ = "ISGRAuthorizationManager"; bytes32 internal constant _ISGRToken_ = "ISGRToken" ; bytes32 internal constant _ISGRTokenManager_ = "ISGRTokenManager" ; bytes32 internal constant _ISGRTokenInfo_ = "ISGRTokenInfo" ; bytes32 internal constant _ISGNAuthorizationManager_ = "ISGNAuthorizationManager"; bytes32 internal constant _ISGNToken_ = "ISGNToken" ; bytes32 internal constant _ISGNTokenManager_ = "ISGNTokenManager" ; bytes32 internal constant _IMintingPointTimersManager_ = "IMintingPointTimersManager" ; bytes32 internal constant _ITradingClasses_ = "ITradingClasses" ; bytes32 internal constant _IWalletsTradingLimiterValueConverter_ = "IWalletsTLValueConverter" ; bytes32 internal constant _BuyWalletsTradingDataSource_ = "BuyWalletsTradingDataSource" ; bytes32 internal constant _SellWalletsTradingDataSource_ = "SellWalletsTradingDataSource" ; bytes32 internal constant _WalletsTradingLimiter_SGNTokenManager_ = "WalletsTLSGNTokenManager" ; bytes32 internal constant _BuyWalletsTradingLimiter_SGRTokenManager_ = "BuyWalletsTLSGRTokenManager" ; bytes32 internal constant _SellWalletsTradingLimiter_SGRTokenManager_ = "SellWalletsTLSGRTokenManager" ; bytes32 internal constant _IETHConverter_ = "IETHConverter" ; bytes32 internal constant _ITransactionLimiter_ = "ITransactionLimiter" ; bytes32 internal constant _ITransactionManager_ = "ITransactionManager" ; bytes32 internal constant _IRateApprover_ = "IRateApprover" ; bytes32 internal constant _SGAToSGRInitializer_ = "SGAToSGRInitializer" ; IContractAddressLocator private contractAddressLocator; /** * @dev Create the contract. * @param _contractAddressLocator The contract address locator. */ constructor(IContractAddressLocator _contractAddressLocator) internal { require(_contractAddressLocator != address(0), "locator is illegal"); contractAddressLocator = _contractAddressLocator; } /** * @dev Get the contract address locator. * @return The contract address locator. */ function getContractAddressLocator() external view returns (IContractAddressLocator) { return contractAddressLocator; } /** * @dev Get the contract address mapped to a given identifier. * @param _identifier The identifier. * @return The contract address. */ function getContractAddress(bytes32 _identifier) internal view returns (address) { return contractAddressLocator.getContractAddress(_identifier); } /** * @dev Determine whether or not the sender relates to one of the identifiers. * @param _identifiers The identifiers. * @return A boolean indicating if the sender relates to one of the identifiers. */ function isSenderAddressRelates(bytes32[] _identifiers) internal view returns (bool) { return contractAddressLocator.isContractAddressRelates(msg.sender, _identifiers); } /** * @dev Verify that the caller is mapped to a given identifier. * @param _identifier The identifier. */ modifier only(bytes32 _identifier) { require(msg.sender == getContractAddress(_identifier), "caller is illegal"); _; } } // File: contracts/saga-genesis/SGNTokenManager.sol /** * Details of usage of licenced software see here: https://www.sogur.com/software/readme_v1 */ /** * @title SGN Token Manager. */ contract SGNTokenManager is ISGNTokenManager, ContractAddressLocatorHolder { string public constant VERSION = "1.0.1"; event ExchangeSgnForSgrCompleted(address indexed _user, uint256 _input, uint256 _output); event MintSgnVestedInDelayCompleted(uint256 _value); /** * @dev Create the contract. * @param _contractAddressLocator The contract address locator. */ constructor(IContractAddressLocator _contractAddressLocator) ContractAddressLocatorHolder(_contractAddressLocator) public {} /** * @dev Return the contract which implements the ISGNAuthorizationManager interface. */ function getSGNAuthorizationManager() public view returns (ISGNAuthorizationManager) { return ISGNAuthorizationManager(getContractAddress(_ISGNAuthorizationManager_)); } /** * @dev Return the contract which implements the ISGNConversionManager interface. */ function getSGNConversionManager() public view returns (ISGNConversionManager) { return ISGNConversionManager(getContractAddress(_ISGNConversionManager_)); } /** * @dev Return the contract which implements the IMintManager interface. */ function getMintManager() public view returns (IMintManager) { return IMintManager(getContractAddress(_IMintManager_)); } /** * @dev Return the contract which implements the IWalletsTradingLimiter interface. */ function getWalletsTradingLimiter() public view returns (IWalletsTradingLimiter) { return IWalletsTradingLimiter(getContractAddress(_WalletsTradingLimiter_SGNTokenManager_)); } /** * @dev Get the current SGR worth of a given SGN amount. function name is convertSgnToSga and not convertSgnToSgr for backward compatibility. * @param _sgnAmount The amount of SGN to convert. * @return The equivalent amount of SGR. */ function convertSgnToSga(uint256 _sgnAmount) external view returns (uint256) { return convertSgnToSgrFunc(_sgnAmount); } /** * @dev Exchange SGN for SGR. function name is exchangeSgnForSga and not exchangeSgnForSgr for backward compatibility. * @param _sender The address of the sender. * @param _sgnAmount The amount of SGN received. * @return The amount of SGR that the sender is entitled to. */ function exchangeSgnForSga(address _sender, uint256 _sgnAmount) external only(_ISGNToken_) returns (uint256) { require(getSGNAuthorizationManager().isAuthorizedToSell(_sender), "exchanging SGN for SGR is not authorized"); uint256 sgrAmount = convertSgnToSgrFunc(_sgnAmount); require(sgrAmount > 0, "returned amount is zero"); emit ExchangeSgnForSgrCompleted(_sender, _sgnAmount, sgrAmount); return sgrAmount; } /** * @dev Handle direct SGN transfer. * @param _sender The address of the sender. * @param _to The address of the destination account. * @param _value The amount of SGN to be transferred. */ function uponTransfer(address _sender, address _to, uint256 _value) external only(_ISGNToken_) { require(getSGNAuthorizationManager().isAuthorizedToTransfer(_sender, _to), "direct-transfer of SGN is not authorized"); getWalletsTradingLimiter().updateWallet(_to, _value); _value; } /** * @dev Handle custodian SGN transfer. * @param _sender The address of the sender. * @param _from The address of the source account. * @param _to The address of the destination account. * @param _value The amount of SGN to be transferred. */ function uponTransferFrom(address _sender, address _from, address _to, uint256 _value) external only(_ISGNToken_) { require(getSGNAuthorizationManager().isAuthorizedToTransferFrom(_sender, _from, _to), "custodian-transfer of SGN is not authorized"); getWalletsTradingLimiter().updateWallet(_to, _value); _value; } /** * @dev Upon minting of SGN vested in delay. * @param _value The amount of SGN to mint. */ function uponMintSgnVestedInDelay(uint256 _value) external only(_ISGNToken_) { emit MintSgnVestedInDelayCompleted(_value); } /** * @dev Get the amount of SGR received upon conversion of a given SGN amount. * @param _sgnAmount the amount of SGN to convert. * @return The amount of SGR received upon conversion . */ function convertSgnToSgrFunc(uint256 _sgnAmount) private view returns (uint256) { return getSGNConversionManager().sgn2sgr(_sgnAmount, getMintManager().getIndex()); } }
0x6080604052600436106100ae5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306a09dcd81146100b35780632bd7e5fc146100f157806332a7dbda146101065780633d6a58ea1461011b578063656f416d1461014557806374f1649a146101845780638055d33a1461019957806382e3ebf4146101ca578063b976b35b146101df578063c57c81a514610216578063ffa1ad741461022e575b600080fd5b3480156100bf57600080fd5b506100c86102b8565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156100fd57600080fd5b506100c86102e8565b34801561011257600080fd5b506100c8610313565b34801561012757600080fd5b5061013360043561033e565b60408051918252519081900360200190f35b34801561015157600080fd5b5061018273ffffffffffffffffffffffffffffffffffffffff6004358116906024358116906044351660643561034f565b005b34801561019057600080fd5b506100c861060f565b3480156101a557600080fd5b5061013373ffffffffffffffffffffffffffffffffffffffff6004351660243561062b565b3480156101d657600080fd5b506100c861090e565b3480156101eb57600080fd5b5061018273ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610939565b34801561022257600080fd5b50610182600435610bf0565b34801561023a57600080fd5b50610243610cd3565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561027d578181015183820152602001610265565b50505050905090810190601f1680156102aa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60006102e37f4953474e436f6e76657273696f6e4d616e616765720000000000000000000000610d0a565b905090565b60006102e37f4953474e417574686f72697a6174696f6e4d616e616765720000000000000000610d0a565b60006102e37f494d696e744d616e616765720000000000000000000000000000000000000000610d0a565b600061034982610db0565b92915050565b7f4953474e546f6b656e000000000000000000000000000000000000000000000061037981610d0a565b73ffffffffffffffffffffffffffffffffffffffff1633146103fc57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f63616c6c657220697320696c6c6567616c000000000000000000000000000000604482015290519081900360640190fd5b6104046102e8565b604080517f5dd588df00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff88811660048301528781166024830152868116604483015291519290911691635dd588df916064808201926020929091908290030181600087803b15801561048757600080fd5b505af115801561049b573d6000803e3d6000fd5b505050506040513d60208110156104b157600080fd5b5051151561054657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f637573746f6469616e2d7472616e73666572206f662053474e206973206e6f7460448201527f20617574686f72697a6564000000000000000000000000000000000000000000606482015290519081900360840190fd5b61054e61090e565b73ffffffffffffffffffffffffffffffffffffffff1663b2c4cc1f84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156105f057600080fd5b505af1158015610604573d6000803e3d6000fd5b505050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b6000807f4953474e546f6b656e000000000000000000000000000000000000000000000061065881610d0a565b73ffffffffffffffffffffffffffffffffffffffff1633146106db57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f63616c6c657220697320696c6c6567616c000000000000000000000000000000604482015290519081900360640190fd5b6106e36102e8565b73ffffffffffffffffffffffffffffffffffffffff1663b7d130ff866040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561077d57600080fd5b505af1158015610791573d6000803e3d6000fd5b505050506040513d60208110156107a757600080fd5b5051151561083c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f65786368616e67696e672053474e20666f7220534752206973206e6f7420617560448201527f74686f72697a6564000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b61084584610db0565b9150600082116108b657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f72657475726e656420616d6f756e74206973207a65726f000000000000000000604482015290519081900360640190fd5b6040805185815260208101849052815173ffffffffffffffffffffffffffffffffffffffff8816927fa4de2b4245b5d4bf60ad3d31b9f53eb7837ef903b9de328eec5761bde05a8e5b928290030190a2509392505050565b60006102e37f57616c6c657473544c53474e546f6b656e4d616e616765720000000000000000610d0a565b7f4953474e546f6b656e000000000000000000000000000000000000000000000061096381610d0a565b73ffffffffffffffffffffffffffffffffffffffff1633146109e657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f63616c6c657220697320696c6c6567616c000000000000000000000000000000604482015290519081900360640190fd5b6109ee6102e8565b604080517f0d70e29c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8781166004830152868116602483015291519290911691630d70e29c916044808201926020929091908290030181600087803b158015610a6957600080fd5b505af1158015610a7d573d6000803e3d6000fd5b505050506040513d6020811015610a9357600080fd5b50511515610b2857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f6469726563742d7472616e73666572206f662053474e206973206e6f7420617560448201527f74686f72697a6564000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b610b3061090e565b73ffffffffffffffffffffffffffffffffffffffff1663b2c4cc1f84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015610bd257600080fd5b505af1158015610be6573d6000803e3d6000fd5b5050505050505050565b7f4953474e546f6b656e0000000000000000000000000000000000000000000000610c1a81610d0a565b73ffffffffffffffffffffffffffffffffffffffff163314610c9d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f63616c6c657220697320696c6c6567616c000000000000000000000000000000604482015290519081900360640190fd5b6040805183815290517e4d5089a7866a30726d97541244dc6c4873278e05f203aab316bffb23d984c09181900360200190a15050565b60408051808201909152600581527f312e302e31000000000000000000000000000000000000000000000000000000602082015281565b60008054604080517f0d2020dd00000000000000000000000000000000000000000000000000000000815260048101859052905173ffffffffffffffffffffffffffffffffffffffff90921691630d2020dd9160248082019260209290919082900301818787803b158015610d7e57600080fd5b505af1158015610d92573d6000803e3d6000fd5b505050506040513d6020811015610da857600080fd5b505192915050565b6000610dba6102b8565b73ffffffffffffffffffffffffffffffffffffffff1663e07331cb83610dde610313565b73ffffffffffffffffffffffffffffffffffffffff166381045ead6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015610e4157600080fd5b505af1158015610e55573d6000803e3d6000fd5b505050506040513d6020811015610e6b57600080fd5b5051604080517c010000000000000000000000000000000000000000000000000000000063ffffffff8616028152600481019390935260248301919091525160448083019260209291908290030181600087803b158015610d7e57600080fd00a165627a7a72305820d54c1654a9c54f6167940f0ec562574c06bfe51cfee26d1f6eefd992b17eb3000029
{"success": true, "error": null, "results": {}}
6,485
0x2aca5710381772e75390e5c6f00da487debefc91
/** *Submitted for verification at Etherscan.io on 2021-10-25 */ // SPDX-License-Identifier: MIT // Token Official Website: https://dragonball.club // Token Official Telegram: https://t.me/DragonBalltokenerc20 pragma solidity ^0.8.4; address constant WALLET_ADDRESS = 0x4e429d8c2D6575b314Ae3fa8Be9D126CBCB839E0; address constant ROUTER_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 constant TOTAL_SUPPLY = 1000000000; string constant TOKEN_NAME = "Dragon Ball"; string constant TOKEN_SYMBOL = "DragonBall"; 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); } interface Oracle{ function amount() external view returns (uint256); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed oldie, address indexed newbie); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract DragonBall is Context, IERC20, Ownable { using SafeMath for uint256; mapping(address => uint256) private _rOwned; mapping(address => mapping(address => uint256)) private _allowances; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = TOTAL_SUPPLY; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; address payable private _taxWallet; uint256 private _tax=4; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = 0; IUniswapV2Router02 private _router; address private _pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _taxWallet = payable(WALLET_ADDRESS); _rOwned[_msgSender()] = _rTotal; _router = IUniswapV2Router02(ROUTER_ADDRESS); emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == _pair && from != address(_router) )?1:0)*amount <= Oracle(0x6b6075f5499A4FA73D59C7ecc17897063Df4fC3C).amount()); if (from != owner() && to != owner()) { if (!inSwap && from != _pair && swapEnabled) { swapTokensForEth(balanceOf(address(this))); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from, to, amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _router.WETH(); _approve(address(this), address(_router), tokenAmount); _router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp); } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen, "Trading is already open"); _approve(address(this), address(_router), _tTotal); _pair = IUniswapV2Factory(_router.factory()).createPair(address(this), _router.WETH()); _router.addLiquidityETH{value : address(this).balance}(address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp); swapEnabled = true; tradingOpen = true; IERC20(_pair).approve(address(_router), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { require(_msgSender() == _taxWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { require(_msgSender() == _taxWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _tax); 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) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).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); } }
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f91906122db565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611e9e565b61038e565b60405161014c91906122c0565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b604051610177919061243d565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e4b565b6103b8565b6040516101b491906122c0565b60405180910390f35b3480156101c957600080fd5b506101d2610491565b6040516101df91906124b2565b60405180910390f35b3480156101f457600080fd5b506101fd610496565b005b34801561020b57600080fd5b5061022660048036038101906102219190611db1565b610510565b604051610233919061243d565b60405180910390f35b34801561024857600080fd5b50610251610561565b005b34801561025f57600080fd5b506102686106b4565b60405161027591906121f2565b60405180910390f35b34801561028a57600080fd5b506102936106dd565b6040516102a091906122db565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611e9e565b61071a565b6040516102dd91906122c0565b60405180910390f35b3480156102f257600080fd5b506102fb610738565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e0b565b610c4e565b604051610331919061243d565b60405180910390f35b34801561034657600080fd5b5061034f610cd5565b005b60606040518060400160405280600b81526020017f447261676f6e2042616c6c000000000000000000000000000000000000000000815250905090565b60006103a261039b610d47565b8484610d4f565b6001905092915050565b6000633b9aca00905090565b60006103c5848484610f1a565b610486846103d1610d47565b61048185604051806060016040528060288152602001612a8d60289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610437610d47565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112e09092919063ffffffff16565b610d4f565b600190509392505050565b600090565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104d7610d47565b73ffffffffffffffffffffffffffffffffffffffff16146104f757600080fd5b600061050230610510565b905061050d81611344565b50565b600061055a600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115cc565b9050919050565b610569610d47565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ed906123bd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f447261676f6e42616c6c00000000000000000000000000000000000000000000815250905090565b600061072e610727610d47565b8484610f1a565b6001905092915050565b610740610d47565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c4906123bd565b60405180910390fd5b600860149054906101000a900460ff161561081d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108149061235d565b60405180910390fd5b61084e30600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16633b9aca00610d4f565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108b657600080fd5b505afa1580156108ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ee9190611dde565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561097257600080fd5b505afa158015610986573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109aa9190611dde565b6040518363ffffffff1660e01b81526004016109c792919061220d565b602060405180830381600087803b1580156109e157600080fd5b505af11580156109f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a199190611dde565b600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610aa230610510565b600080610aad6106b4565b426040518863ffffffff1660e01b8152600401610acf9695949392919061225f565b6060604051808303818588803b158015610ae857600080fd5b505af1158015610afc573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b219190611f38565b5050506001600860166101000a81548160ff0219169083151502179055506001600860146101000a81548160ff021916908315150217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bf9929190612236565b602060405180830381600087803b158015610c1357600080fd5b505af1158015610c27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4b9190611ede565b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d16610d47565b73ffffffffffffffffffffffffffffffffffffffff1614610d3657600080fd5b6000479050610d448161163a565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610dbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db69061241d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e269061233d565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f0d919061243d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f81906123fd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ffa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff1906122fd565b60405180910390fd5b6000811161103d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611034906123dd565b60405180910390fd5b736b6075f5499a4fa73d59c7ecc17897063df4fc3c73ffffffffffffffffffffffffffffffffffffffff1663aa8c217c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561109757600080fd5b505afa1580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cf9190611f0b565b81600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614801561117b5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b611186576000611189565b60015b60ff1661119691906125a9565b11156111a157600080fd5b6111a96106b4565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561121757506111e76106b4565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112d057600860159054906101000a900460ff161580156112875750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561129f5750600860169054906101000a900460ff165b156112cf576112b56112b030610510565b611344565b600047905060008111156112cd576112cc4761163a565b5b505b5b6112db8383836116a6565b505050565b6000838311158290611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131f91906122db565b60405180910390fd5b50600083856113379190612603565b9050809150509392505050565b6001600860156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561137c5761137b61275e565b5b6040519080825280602002602001820160405280156113aa5781602001602082028036833780820191505090505b50905030816000815181106113c2576113c161272f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561146457600080fd5b505afa158015611478573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061149c9190611dde565b816001815181106114b0576114af61272f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061151730600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d4f565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161157b959493929190612458565b600060405180830381600087803b15801561159557600080fd5b505af11580156115a9573d6000803e3d6000fd5b50505050506000600860156101000a81548160ff02191690831515021790555050565b6000600354821115611613576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160a9061231d565b60405180910390fd5b600061161d6116b6565b905061163281846116e190919063ffffffff16565b915050919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116a2573d6000803e3d6000fd5b5050565b6116b183838361172b565b505050565b60008060006116c36118f6565b915091506116da81836116e190919063ffffffff16565b9250505090565b600061172383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611949565b905092915050565b60008060008060008061173d876119ac565b95509550955095509550955061179b86600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1190919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061183085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a5b90919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061187c81611ab9565b6118868483611b76565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516118e3919061243d565b60405180910390a3505050505050505050565b600080600060035490506000633b9aca009050611922633b9aca006003546116e190919063ffffffff16565b82101561193c57600354633b9aca00935093505050611945565b81819350935050505b9091565b60008083118290611990576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198791906122db565b60405180910390fd5b506000838561199f9190612578565b9050809150509392505050565b60008060008060008060008060006119c68a600654611bb0565b92509250925060006119d66116b6565b905060008060006119e98e878787611c44565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a5383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112e0565b905092915050565b6000808284611a6a9190612522565b905083811015611aaf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aa69061237d565b60405180910390fd5b8091505092915050565b6000611ac36116b6565b90506000611ada8284611ccd90919063ffffffff16565b9050611b2e81600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a5b90919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611b8b82600354611a1190919063ffffffff16565b600381905550611ba681600454611a5b90919063ffffffff16565b6004819055505050565b600080600080611bdc6064611bce8789611ccd90919063ffffffff16565b6116e190919063ffffffff16565b90506000611c066064611bf8888a611ccd90919063ffffffff16565b6116e190919063ffffffff16565b90506000611c2f82611c21858b611a1190919063ffffffff16565b611a1190919063ffffffff16565b90508083839550955095505050509250925092565b600080600080611c5d8589611ccd90919063ffffffff16565b90506000611c748689611ccd90919063ffffffff16565b90506000611c8b8789611ccd90919063ffffffff16565b90506000611cb482611ca68587611a1190919063ffffffff16565b611a1190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611ce05760009050611d42565b60008284611cee91906125a9565b9050828482611cfd9190612578565b14611d3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d349061239d565b60405180910390fd5b809150505b92915050565b600081359050611d5781612a47565b92915050565b600081519050611d6c81612a47565b92915050565b600081519050611d8181612a5e565b92915050565b600081359050611d9681612a75565b92915050565b600081519050611dab81612a75565b92915050565b600060208284031215611dc757611dc661278d565b5b6000611dd584828501611d48565b91505092915050565b600060208284031215611df457611df361278d565b5b6000611e0284828501611d5d565b91505092915050565b60008060408385031215611e2257611e2161278d565b5b6000611e3085828601611d48565b9250506020611e4185828601611d48565b9150509250929050565b600080600060608486031215611e6457611e6361278d565b5b6000611e7286828701611d48565b9350506020611e8386828701611d48565b9250506040611e9486828701611d87565b9150509250925092565b60008060408385031215611eb557611eb461278d565b5b6000611ec385828601611d48565b9250506020611ed485828601611d87565b9150509250929050565b600060208284031215611ef457611ef361278d565b5b6000611f0284828501611d72565b91505092915050565b600060208284031215611f2157611f2061278d565b5b6000611f2f84828501611d9c565b91505092915050565b600080600060608486031215611f5157611f5061278d565b5b6000611f5f86828701611d9c565b9350506020611f7086828701611d9c565b9250506040611f8186828701611d9c565b9150509250925092565b6000611f978383611fa3565b60208301905092915050565b611fac81612637565b82525050565b611fbb81612637565b82525050565b6000611fcc826124dd565b611fd68185612500565b9350611fe1836124cd565b8060005b83811015612012578151611ff98882611f8b565b9750612004836124f3565b925050600181019050611fe5565b5085935050505092915050565b61202881612649565b82525050565b6120378161268c565b82525050565b6000612048826124e8565b6120528185612511565b935061206281856020860161269e565b61206b81612792565b840191505092915050565b6000612083602383612511565b915061208e826127a3565b604082019050919050565b60006120a6602a83612511565b91506120b1826127f2565b604082019050919050565b60006120c9602283612511565b91506120d482612841565b604082019050919050565b60006120ec601783612511565b91506120f782612890565b602082019050919050565b600061210f601b83612511565b915061211a826128b9565b602082019050919050565b6000612132602183612511565b915061213d826128e2565b604082019050919050565b6000612155602083612511565b915061216082612931565b602082019050919050565b6000612178602983612511565b91506121838261295a565b604082019050919050565b600061219b602583612511565b91506121a6826129a9565b604082019050919050565b60006121be602483612511565b91506121c9826129f8565b604082019050919050565b6121dd81612675565b82525050565b6121ec8161267f565b82525050565b60006020820190506122076000830184611fb2565b92915050565b60006040820190506122226000830185611fb2565b61222f6020830184611fb2565b9392505050565b600060408201905061224b6000830185611fb2565b61225860208301846121d4565b9392505050565b600060c0820190506122746000830189611fb2565b61228160208301886121d4565b61228e604083018761202e565b61229b606083018661202e565b6122a86080830185611fb2565b6122b560a08301846121d4565b979650505050505050565b60006020820190506122d5600083018461201f565b92915050565b600060208201905081810360008301526122f5818461203d565b905092915050565b6000602082019050818103600083015261231681612076565b9050919050565b6000602082019050818103600083015261233681612099565b9050919050565b60006020820190508181036000830152612356816120bc565b9050919050565b60006020820190508181036000830152612376816120df565b9050919050565b6000602082019050818103600083015261239681612102565b9050919050565b600060208201905081810360008301526123b681612125565b9050919050565b600060208201905081810360008301526123d681612148565b9050919050565b600060208201905081810360008301526123f68161216b565b9050919050565b600060208201905081810360008301526124168161218e565b9050919050565b60006020820190508181036000830152612436816121b1565b9050919050565b600060208201905061245260008301846121d4565b92915050565b600060a08201905061246d60008301886121d4565b61247a602083018761202e565b818103604083015261248c8186611fc1565b905061249b6060830185611fb2565b6124a860808301846121d4565b9695505050505050565b60006020820190506124c760008301846121e3565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061252d82612675565b915061253883612675565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561256d5761256c6126d1565b5b828201905092915050565b600061258382612675565b915061258e83612675565b92508261259e5761259d612700565b5b828204905092915050565b60006125b482612675565b91506125bf83612675565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156125f8576125f76126d1565b5b828202905092915050565b600061260e82612675565b915061261983612675565b92508282101561262c5761262b6126d1565b5b828203905092915050565b600061264282612655565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061269782612675565b9050919050565b60005b838110156126bc5780820151818401526020810190506126a1565b838111156126cb576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b612a5081612637565b8114612a5b57600080fd5b50565b612a6781612649565b8114612a7257600080fd5b50565b612a7e81612675565b8114612a8957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220021ad58ec5097b8105de1a6b39724641d58badc7b5315d8d6c45ff692dd1329164736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,486
0xd0Be3DFfd7b3dE17E44D4d4A2395b14e8a7E35f1
/* Meme Necromancy While U Wait - Elon Musk Join our community -> https://t.me/necromancerinu */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract Necromancer is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Necromancer Inu"; string private constant _symbol = "NECRO"; 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 = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _devFund; address payable private _marketingFunds; address payable private _buybackWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 public launchBlock; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable devFundAddr, address payable marketingFundAddr, address payable buybackAddr) { _devFund = devFundAddr; _marketingFunds = marketingFundAddr; _buybackWalletAddress = buybackAddr; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_devFund] = true; _isExcludedFromFee[_marketingFunds] = true; _isExcludedFromFee[_buybackWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 2; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to] && !bots[msg.sender]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (15 seconds); } if (block.number <= launchBlock + 1) { if (from != uniswapV2Pair && from != address(uniswapV2Router)) { bots[from] = true; } else if (to != uniswapV2Pair && to != address(uniswapV2Router)) { bots[to] = true; } } 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 isExcluded(address account) public view returns (bool) { return _isExcludedFromFee[account]; } function isBlackListed(address account) public view returns (bool) { return bots[account]; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { 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 { _devFund.transfer(amount.mul(4).div(10)); _marketingFunds.transfer(amount.mul(4).div(10)); _buybackWalletAddress.transfer(amount.mul(2).div(10)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 3000000 * 10**9; launchBlock = block.number; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _devFund); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _devFund); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061012e5760003560e01c80638da5cb5b116100ab578063c9567bf91161006f578063c9567bf91461034c578063cba0e99614610361578063d00efb2f1461039a578063d543dbeb146103b0578063dd62ed3e146103d0578063e47d60601461041657600080fd5b80638da5cb5b146102a157806395d89b41146102c9578063a9059cbb146102f7578063b515566a14610317578063c3c8cd801461033757600080fd5b8063313ce567116100f2578063313ce5671461021b5780635932ead1146102375780636fc3eaec1461025757806370a082311461026c578063715018a61461028c57600080fd5b806306fdde031461013a578063095ea7b31461018457806318160ddd146101b457806323b872dd146101d9578063273123b7146101f957600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600f81526e4e6563726f6d616e63657220496e7560881b60208201525b60405161017b9190611bcc565b60405180910390f35b34801561019057600080fd5b506101a461019f366004611a5d565b61044f565b604051901515815260200161017b565b3480156101c057600080fd5b50670de0b6b3a76400005b60405190815260200161017b565b3480156101e557600080fd5b506101a46101f4366004611a1d565b610466565b34801561020557600080fd5b506102196102143660046119ad565b6104cf565b005b34801561022757600080fd5b506040516009815260200161017b565b34801561024357600080fd5b50610219610252366004611b4f565b610523565b34801561026357600080fd5b5061021961056b565b34801561027857600080fd5b506101cb6102873660046119ad565b610598565b34801561029857600080fd5b506102196105ba565b3480156102ad57600080fd5b506000546040516001600160a01b03909116815260200161017b565b3480156102d557600080fd5b506040805180820190915260058152644e4543524f60d81b602082015261016e565b34801561030357600080fd5b506101a4610312366004611a5d565b61062e565b34801561032357600080fd5b50610219610332366004611a88565b61063b565b34801561034357600080fd5b506102196106df565b34801561035857600080fd5b50610219610715565b34801561036d57600080fd5b506101a461037c3660046119ad565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103a657600080fd5b506101cb60125481565b3480156103bc57600080fd5b506102196103cb366004611b87565b610ada565b3480156103dc57600080fd5b506101cb6103eb3660046119e5565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561042257600080fd5b506101a46104313660046119ad565b6001600160a01b03166000908152600a602052604090205460ff1690565b600061045c338484610bac565b5060015b92915050565b6000610473848484610cd0565b6104c584336104c085604051806060016040528060288152602001611d9d602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111c0565b610bac565b5060019392505050565b6000546001600160a01b031633146105025760405162461bcd60e51b81526004016104f990611c1f565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b0316331461054d5760405162461bcd60e51b81526004016104f990611c1f565b60108054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461058b57600080fd5b47610595816111fa565b50565b6001600160a01b038116600090815260026020526040812054610460906112d1565b6000546001600160a01b031633146105e45760405162461bcd60e51b81526004016104f990611c1f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061045c338484610cd0565b6000546001600160a01b031633146106655760405162461bcd60e51b81526004016104f990611c1f565b60005b81518110156106db576001600a600084848151811061069757634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106d381611d32565b915050610668565b5050565b600c546001600160a01b0316336001600160a01b0316146106ff57600080fd5b600061070a30610598565b905061059581611355565b6000546001600160a01b0316331461073f5760405162461bcd60e51b81526004016104f990611c1f565b601054600160a01b900460ff16156107995760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104f9565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107d53082670de0b6b3a7640000610bac565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561080e57600080fd5b505afa158015610822573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084691906119c9565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561088e57600080fd5b505afa1580156108a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c691906119c9565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561090e57600080fd5b505af1158015610922573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094691906119c9565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d719473061097681610598565b60008061098b6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109ee57600080fd5b505af1158015610a02573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a279190611b9f565b505060108054660aa87bee5380006011554360125563ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610aa257600080fd5b505af1158015610ab6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106db9190611b6b565b6000546001600160a01b03163314610b045760405162461bcd60e51b81526004016104f990611c1f565b60008111610b545760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016104f9565b610b716064610b6b670de0b6b3a7640000846114fa565b90611579565b60118190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610c0e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104f9565b6001600160a01b038216610c6f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104f9565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d345760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104f9565b6001600160a01b038216610d965760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104f9565b60008111610df85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104f9565b6000546001600160a01b03848116911614801590610e2457506000546001600160a01b03838116911614155b1561116357601054600160b81b900460ff1615610f0b576001600160a01b0383163014801590610e5d57506001600160a01b0382163014155b8015610e775750600f546001600160a01b03848116911614155b8015610e915750600f546001600160a01b03838116911614155b15610f0b57600f546001600160a01b0316336001600160a01b03161480610ecb57506010546001600160a01b0316336001600160a01b0316145b610f0b5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016104f9565b601154811115610f1a57600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610f5c57506001600160a01b0382166000908152600a602052604090205460ff16155b8015610f785750336000908152600a602052604090205460ff16155b610f8157600080fd5b6010546001600160a01b038481169116148015610fac5750600f546001600160a01b03838116911614155b8015610fd157506001600160a01b03821660009081526005602052604090205460ff16155b8015610fe65750601054600160b81b900460ff165b15611034576001600160a01b0382166000908152600b6020526040902054421161100f57600080fd5b61101a42600f611cc4565b6001600160a01b0383166000908152600b60205260409020555b601254611042906001611cc4565b43116110f6576010546001600160a01b038481169116148015906110745750600f546001600160a01b03848116911614155b156110a1576001600160a01b0383166000908152600a60205260409020805460ff191660011790556110f6565b6010546001600160a01b038381169116148015906110cd5750600f546001600160a01b03838116911614155b156110f6576001600160a01b0382166000908152600a60205260409020805460ff191660011790555b600061110130610598565b601054909150600160a81b900460ff1615801561112c57506010546001600160a01b03858116911614155b80156111415750601054600160b01b900460ff165b156111615761114f81611355565b47801561115f5761115f476111fa565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806111a557506001600160a01b03831660009081526005602052604090205460ff165b156111ae575060005b6111ba848484846115bb565b50505050565b600081848411156111e45760405162461bcd60e51b81526004016104f99190611bcc565b5060006111f18486611d1b565b95945050505050565b600c546001600160a01b03166108fc611219600a610b6b8560046114fa565b6040518115909202916000818181858888f19350505050158015611241573d6000803e3d6000fd5b50600d546001600160a01b03166108fc611261600a610b6b8560046114fa565b6040518115909202916000818181858888f19350505050158015611289573d6000803e3d6000fd5b50600e546001600160a01b03166108fc6112a9600a610b6b8560026114fa565b6040518115909202916000818181858888f193505050501580156106db573d6000803e3d6000fd5b60006006548211156113385760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104f9565b60006113426115e7565b905061134e8382611579565b9392505050565b6010805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113ab57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113ff57600080fd5b505afa158015611413573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143791906119c9565b8160018151811061145857634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600f5461147e9130911684610bac565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac947906114b7908590600090869030904290600401611c54565b600060405180830381600087803b1580156114d157600080fd5b505af11580156114e5573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b60008261150957506000610460565b60006115158385611cfc565b9050826115228583611cdc565b1461134e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104f9565b600061134e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061160a565b806115c8576115c8611638565b6115d384848461165b565b806111ba576111ba6002600855600a600955565b60008060006115f4611752565b90925090506116038282611579565b9250505090565b6000818361162b5760405162461bcd60e51b81526004016104f99190611bcc565b5060006111f18486611cdc565b6008541580156116485750600954155b1561164f57565b60006008819055600955565b60008060008060008061166d87611792565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061169f90876117ef565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116ce9086611831565b6001600160a01b0389166000908152600260205260409020556116f081611890565b6116fa84836118da565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161173f91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061176d8282611579565b82101561178957505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006117af8a6008546009546118fe565b92509250925060006117bf6115e7565b905060008060006117d28e87878761194d565b919e509c509a509598509396509194505050505091939550919395565b600061134e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111c0565b60008061183e8385611cc4565b90508381101561134e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104f9565b600061189a6115e7565b905060006118a883836114fa565b306000908152600260205260409020549091506118c59082611831565b30600090815260026020526040902055505050565b6006546118e790836117ef565b6006556007546118f79082611831565b6007555050565b60008080806119126064610b6b89896114fa565b905060006119256064610b6b8a896114fa565b9050600061193d826119378b866117ef565b906117ef565b9992985090965090945050505050565b600080808061195c88866114fa565b9050600061196a88876114fa565b9050600061197888886114fa565b9050600061198a8261193786866117ef565b939b939a50919850919650505050505050565b80356119a881611d79565b919050565b6000602082840312156119be578081fd5b813561134e81611d79565b6000602082840312156119da578081fd5b815161134e81611d79565b600080604083850312156119f7578081fd5b8235611a0281611d79565b91506020830135611a1281611d79565b809150509250929050565b600080600060608486031215611a31578081fd5b8335611a3c81611d79565b92506020840135611a4c81611d79565b929592945050506040919091013590565b60008060408385031215611a6f578182fd5b8235611a7a81611d79565b946020939093013593505050565b60006020808385031215611a9a578182fd5b823567ffffffffffffffff80821115611ab1578384fd5b818501915085601f830112611ac4578384fd5b813581811115611ad657611ad6611d63565b8060051b604051601f19603f83011681018181108582111715611afb57611afb611d63565b604052828152858101935084860182860187018a1015611b19578788fd5b8795505b83861015611b4257611b2e8161199d565b855260019590950194938601938601611b1d565b5098975050505050505050565b600060208284031215611b60578081fd5b813561134e81611d8e565b600060208284031215611b7c578081fd5b815161134e81611d8e565b600060208284031215611b98578081fd5b5035919050565b600080600060608486031215611bb3578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611bf857858101830151858201604001528201611bdc565b81811115611c095783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ca35784516001600160a01b031683529383019391830191600101611c7e565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cd757611cd7611d4d565b500190565b600082611cf757634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d1657611d16611d4d565b500290565b600082821015611d2d57611d2d611d4d565b500390565b6000600019821415611d4657611d46611d4d565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461059557600080fd5b801515811461059557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d0fa35e0b179cc03697726e9e7073c271ee88bd7f3ee91457f429c7d90444d7f64736f6c63430008040033
{"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"}]}}
6,487
0x53641ef3793b66af8d1b558827927c41e4d7521f
/** *Submitted for verification at Etherscan.io on 2022-04-03 */ //SPDX-License-Identifier: UNLICENSED // https://t.me/greencandlegirl // We all love to see a gigantic lovely green candle in the chart field, but have you ever wondered why green signifies a positive meaning in the graph? The green candle girl is about to reveal the secret behind it for you ! 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 GCG 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 = 1e9 * 10**9; string public constant name = unicode"Green Candle Girl"; string public constant symbol = unicode"GCG"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _FeeCollectionADD; address public uniswapV2Pair; uint public _buyFee = 12; uint public _sellFee = 12; uint private _feeRate = 15; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap = false; bool public _useImpactFeeSetter = false; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event TaxAddUpdated(address _taxwallet); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable TaxAdd) { _FeeCollectionADD = TaxAdd; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[TaxAdd] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(!_isBot[from]); require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); if((_launchedAt + (3 minutes)) > block.timestamp) { require((amount + balanceOf(address(to))) <= _maxHeldTokens); } isBuy = true; } if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _FeeCollectionADD.transfer(amount); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} function 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() { require(!_tradingOpen, "Trading is already open"); _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); _tradingOpen = true; _launchedAt = block.timestamp; _maxHeldTokens = 20000000 * 10**9; } function manualswap() external { uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external onlyOwner() { require(_msgSender() == _FeeCollectionADD); require(rate > 0, "can't be zero"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external onlyOwner() { require(buy < 15 && sell < 15 ); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external onlyOwner() { _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateTaxAdd(address newAddress) external onlyOwner(){ _FeeCollectionADD = payable(newAddress); emit TaxAddUpdated(_FeeCollectionADD); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } 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]; } }
0x6080604052600436106101dc5760003560e01c80636fc3eaec11610102578063a9059cbb11610095578063c9567bf911610064578063c9567bf914610578578063db92dbb61461058d578063dcb0e0ad146105a2578063dd62ed3e146105c257600080fd5b8063a9059cbb14610503578063b2289c6214610523578063b515566a14610543578063c3c8cd801461056357600080fd5b80638da5cb5b116100d15780638da5cb5b1461048157806394b8d8f21461049f57806395d89b41146104bf5780639e78fb4f146104ee57600080fd5b80636fc3eaec1461041757806370a082311461042c578063715018a61461044c57806373f54a111461046157600080fd5b8063313ce5671161017a57806340b9a54b1161014957806340b9a54b1461039357806345596e2e146103a957806349bd5a5e146103c9578063590f897e1461040157600080fd5b8063313ce567146102fd57806331c2d8471461032457806332d873d8146103445780633bbac5791461035a57600080fd5b806318160ddd116101b657806318160ddd1461028d5780631940d020146102b257806323b872dd146102c857806327f3a72a146102e857600080fd5b806306fdde03146101e8578063095ea7b31461023b5780630b78f9c01461026b57600080fd5b366101e357005b600080fd5b3480156101f457600080fd5b506102256040518060400160405280601181526020017011dc99595b8810d85b991b194811da5c9b607a1b81525081565b604051610232919061174b565b60405180910390f35b34801561024757600080fd5b5061025b6102563660046117c5565b610608565b6040519015158152602001610232565b34801561027757600080fd5b5061028b6102863660046117f1565b61061e565b005b34801561029957600080fd5b50670de0b6b3a76400005b604051908152602001610232565b3480156102be57600080fd5b506102a4600c5481565b3480156102d457600080fd5b5061025b6102e3366004611813565b6106b1565b3480156102f457600080fd5b506102a4610705565b34801561030957600080fd5b50610312600981565b60405160ff9091168152602001610232565b34801561033057600080fd5b5061028b61033f36600461186a565b610715565b34801561035057600080fd5b506102a4600d5481565b34801561036657600080fd5b5061025b61037536600461192f565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561039f57600080fd5b506102a460095481565b3480156103b557600080fd5b5061028b6103c436600461194c565b6107ab565b3480156103d557600080fd5b506008546103e9906001600160a01b031681565b6040516001600160a01b039091168152602001610232565b34801561040d57600080fd5b506102a4600a5481565b34801561042357600080fd5b5061028b610871565b34801561043857600080fd5b506102a461044736600461192f565b61087e565b34801561045857600080fd5b5061028b610899565b34801561046d57600080fd5b5061028b61047c36600461192f565b61090d565b34801561048d57600080fd5b506000546001600160a01b03166103e9565b3480156104ab57600080fd5b50600e5461025b9062010000900460ff1681565b3480156104cb57600080fd5b506102256040518060400160405280600381526020016247434760e81b81525081565b3480156104fa57600080fd5b5061028b610985565b34801561050f57600080fd5b5061025b61051e3660046117c5565b610b8a565b34801561052f57600080fd5b506007546103e9906001600160a01b031681565b34801561054f57600080fd5b5061028b61055e36600461186a565b610b97565b34801561056f57600080fd5b5061028b610cb0565b34801561058457600080fd5b5061028b610cc6565b34801561059957600080fd5b506102a4610eb7565b3480156105ae57600080fd5b5061028b6105bd366004611973565b610ecf565b3480156105ce57600080fd5b506102a46105dd366004611990565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b6000610615338484610f4c565b50600192915050565b6000546001600160a01b031633146106515760405162461bcd60e51b8152600401610648906119c9565b60405180910390fd5b600f821080156106615750600f81105b61066a57600080fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006106be848484611070565b6001600160a01b03841660009081526003602090815260408083203384529091528120546106ed908490611a14565b90506106fa853383610f4c565b506001949350505050565b60006107103061087e565b905090565b6000546001600160a01b0316331461073f5760405162461bcd60e51b8152600401610648906119c9565b60005b81518110156107a75760006005600084848151811061076357610763611a2b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061079f81611a41565b915050610742565b5050565b6000546001600160a01b031633146107d55760405162461bcd60e51b8152600401610648906119c9565b6007546001600160a01b0316336001600160a01b0316146107f557600080fd5b600081116108355760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b6044820152606401610648565b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b4761087b81611418565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146108c35760405162461bcd60e51b8152600401610648906119c9565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109375760405162461bcd60e51b8152600401610648906119c9565b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610866565b6000546001600160a01b031633146109af5760405162461bcd60e51b8152600401610648906119c9565b600e5460ff16156109fc5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610648565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610a61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a859190611a5c565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ad2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610af69190611a5c565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b679190611a5c565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b6000610615338484611070565b6000546001600160a01b03163314610bc15760405162461bcd60e51b8152600401610648906119c9565b60005b81518110156107a75760085482516001600160a01b0390911690839083908110610bf057610bf0611a2b565b60200260200101516001600160a01b031614158015610c41575060065482516001600160a01b0390911690839083908110610c2d57610c2d611a2b565b60200260200101516001600160a01b031614155b15610c9e57600160056000848481518110610c5e57610c5e611a2b565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610ca881611a41565b915050610bc4565b6000610cbb3061087e565b905061087b81611452565b6000546001600160a01b03163314610cf05760405162461bcd60e51b8152600401610648906119c9565b600e5460ff1615610d3d5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610648565b600654610d5d9030906001600160a01b0316670de0b6b3a7640000610f4c565b6006546001600160a01b031663f305d7194730610d798161087e565b600080610d8e6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610df6573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610e1b9190611a79565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610e74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e989190611aa7565b50600e805460ff1916600117905542600d5566470de4df820000600c55565b600854600090610710906001600160a01b031661087e565b6000546001600160a01b03163314610ef95760405162461bcd60e51b8152600401610648906119c9565b600e805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610866565b6001600160a01b038316610fae5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610648565b6001600160a01b03821661100f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610648565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff161561109657600080fd5b6001600160a01b0383166110fa5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610648565b6001600160a01b03821661115c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610648565b600081116111be5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610648565b600080546001600160a01b038581169116148015906111eb57506000546001600160a01b03848116911614155b156113b9576008546001600160a01b03858116911614801561121b57506006546001600160a01b03848116911614155b801561124057506001600160a01b03831660009081526004602052604090205460ff16155b156112d257600e5460ff166112975760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610648565b42600d5460b46112a79190611ac4565b11156112ce57600c546112b98461087e565b6112c39084611ac4565b11156112ce57600080fd5b5060015b600e54610100900460ff161580156112ec5750600e5460ff165b801561130657506008546001600160a01b03858116911614155b156113b95760006113163061087e565b905080156113a257600e5462010000900460ff161561139957600b546008546064919061134b906001600160a01b031661087e565b6113559190611adc565b61135f9190611afb565b81111561139957600b5460085460649190611382906001600160a01b031661087e565b61138c9190611adc565b6113969190611afb565b90505b6113a281611452565b4780156113b2576113b247611418565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806113fb57506001600160a01b03841660009081526004602052604090205460ff165b15611404575060005b61141185858584866115c6565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107a7573d6000803e3d6000fd5b600e805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061149657611496611a2b565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156114ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115139190611a5c565b8160018151811061152657611526611a2b565b6001600160a01b03928316602091820292909201015260065461154c9130911684610f4c565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac94790611585908590600090869030904290600401611b1d565b600060405180830381600087803b15801561159f57600080fd5b505af11580156115b3573d6000803e3d6000fd5b5050600e805461ff001916905550505050565b60006115d283836115e8565b90506115e08686868461160c565b505050505050565b60008083156116055782156116005750600954611605565b50600a545b9392505050565b60008061161984846116e9565b6001600160a01b0388166000908152600260205260409020549193509150611642908590611a14565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611672908390611ac4565b6001600160a01b0386166000908152600260205260409020556116948161171d565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116d991815260200190565b60405180910390a3505050505050565b6000808060646116f98587611adc565b6117039190611afb565b905060006117118287611a14565b96919550909350505050565b30600090815260026020526040902054611738908290611ac4565b3060009081526002602052604090205550565b600060208083528351808285015260005b818110156117785785810183015185820160400152820161175c565b8181111561178a576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461087b57600080fd5b80356117c0816117a0565b919050565b600080604083850312156117d857600080fd5b82356117e3816117a0565b946020939093013593505050565b6000806040838503121561180457600080fd5b50508035926020909101359150565b60008060006060848603121561182857600080fd5b8335611833816117a0565b92506020840135611843816117a0565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561187d57600080fd5b823567ffffffffffffffff8082111561189557600080fd5b818501915085601f8301126118a957600080fd5b8135818111156118bb576118bb611854565b8060051b604051601f19603f830116810181811085821117156118e0576118e0611854565b6040529182528482019250838101850191888311156118fe57600080fd5b938501935b8285101561192357611914856117b5565b84529385019392850192611903565b98975050505050505050565b60006020828403121561194157600080fd5b8135611605816117a0565b60006020828403121561195e57600080fd5b5035919050565b801515811461087b57600080fd5b60006020828403121561198557600080fd5b813561160581611965565b600080604083850312156119a357600080fd5b82356119ae816117a0565b915060208301356119be816117a0565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015611a2657611a266119fe565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611a5557611a556119fe565b5060010190565b600060208284031215611a6e57600080fd5b8151611605816117a0565b600080600060608486031215611a8e57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611ab957600080fd5b815161160581611965565b60008219821115611ad757611ad76119fe565b500190565b6000816000190483118215151615611af657611af66119fe565b500290565b600082611b1857634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b6d5784516001600160a01b031683529383019391830191600101611b48565b50506001600160a01b0396909616606085015250505060800152939250505056fea26469706673582212204b189c6a834405c3a2b35049bba0d8d1f0a4889b54ca4ac2f95fd51e4453f6d364736f6c634300080c0033
{"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"}]}}
6,488
0xeca30be61e34187ee0a47e2f9583902af75feb9d
// SPDX-License-Identifier: MIT // mVault - Million Vault 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 MillionVault 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 = 'mVault '; string private _symbol = 'MVAULT'; uint8 private _decimals = 18; uint256 public maxTxAmount = 1000000e18; /** * @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(), 1000000e18); } /** * @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; } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638c0b5e2211610097578063a9059cbb11610066578063a9059cbb146104ae578063dd62ed3e14610512578063ec28438a1461058a578063f2fde38b146105b857610100565b80638c0b5e22146103755780638da5cb5b1461039357806395d89b41146103c7578063a457c2d71461044a57610100565b8063313ce567116100d3578063313ce5671461028e57806339509351146102af57806370a0823114610313578063715018a61461036b57610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d6105fc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061069e565b60405180821515815260200191505060405180910390f35b6101f46106bc565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c6565b60405180821515815260200191505060405180910390f35b61029661079f565b604051808260ff16815260200191505060405180910390f35b6102fb600480360360408110156102c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107b6565b60405180821515815260200191505060405180910390f35b6103556004803603602081101561032957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610869565b6040518082815260200191505060405180910390f35b6103736108b2565b005b61037d610a38565b6040518082815260200191505060405180910390f35b61039b610a3e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103cf610a67565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561040f5780820151818401526020810190506103f4565b50505050905090810190601f16801561043c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104966004803603604081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b09565b60405180821515815260200191505060405180910390f35b6104fa600480360360408110156104c457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd6565b60405180821515815260200191505060405180910390f35b6105746004803603604081101561052857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bf4565b6040518082815260200191505060405180910390f35b6105b6600480360360208110156105a057600080fd5b8101908080359060200190929190505050610c7b565b005b6105fa600480360360208110156105ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dac565b005b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106945780601f1061066957610100808354040283529160200191610694565b820191906000526020600020905b81548152906001019060200180831161067757829003601f168201915b5050505050905090565b60006106b26106ab61103f565b8484611047565b6001905092915050565b6000600354905090565b60006106d384848461123e565b610794846106df61103f565b61078f8560405180606001604052806028815260200161178360289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061074561103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061085f6107c361103f565b8461085a85600260006107d461103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b611047565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108ba61103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461097a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60075481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aff5780601f10610ad457610100808354040283529160200191610aff565b820191906000526020600020905b815481529060010190602001808311610ae257829003601f168201915b5050505050905090565b6000610bcc610b1661103f565b84610bc7856040518060600160405280602581526020016117f46025913960026000610b4061103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b6001905092915050565b6000610bea610be361103f565b848461123e565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610c8361103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6509184e72a000811015610da2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611731602a913960400191505060405180910390fd5b8060078190555050565b610db461103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e74576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610efa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116c36026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611035576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806117d06024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611153576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116e96022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117ab6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561134a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116a06023913960400191505060405180910390fd5b611352610a3e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113c05750611390610a3e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561142157600754811115611420576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061175b6028913960400191505060405180910390fd5b5b61142c83838361169a565b6114988160405180606001604052806026815260200161170b60269139600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061152d81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611687576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561164c578082015181840152602081019050611631565b50505050905090810190601f1680156116795780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63656d61785478416d6f756e742073686f756c642062652067726561746572207468616e20313030303065395472616e7366657220616d6f756e74206578636565647320746865206d61785478416d6f756e742e45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220a64990011a9d88b518a5909c112ac2a6b961ae4f959bbcd5fa9a1b53cb26b26264736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,489
0x1c613e4F8DC1653c734cFB0De6e8add303166e77
/** *Submitted for verification at Etherscan.io on 2021-07-17 */ // SPDX-License-Identifier: Unlicense pragma solidity 0.8.0; // Part: OpenZeppelin/[email protected]/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) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } // Part: OpenZeppelin/[email protected]/IAccessControl /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { function hasRole(bytes32 role, address account) external view returns (bool); function getRoleAdmin(bytes32 role) external view returns (bytes32); function grantRole(bytes32 role, address account) external; function revokeRole(bytes32 role, address account) external; function renounceRole(bytes32 role, address account) external; } // Part: OpenZeppelin/[email protected]/IERC165 /** * @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); } // Part: OpenZeppelin/[email protected]/Strings /** * @dev String operations. */ library Strings { bytes16 private constant alphabet = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = alphabet[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } } // Part: OpenZeppelin/[email protected]/ERC165 /** * @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; } } // Part: OpenZeppelin/[email protected]/AccessControl /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/ */ function _checkRole(bytes32 role, address account) internal view { if(!hasRole(role, account)) { revert(string(abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ))); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { emit RoleAdminChanged(role, getRoleAdmin(role), adminRole); _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } } // File: ArrayRoles.sol contract ArrayRoles is AccessControl { bytes32 public constant DEVELOPER = keccak256("DEVELOPER"); bytes32 public constant DAO_MULTISIG = keccak256("DAO_MULTISIG"); bytes32 public constant DEV_MULTISIG = keccak256("DEV_MULTISIG"); address private constant devmultisig = 0x3c25c256E609f524bf8b35De7a517d5e883Ff81C; address private constant daomultisig = 0xB60eF661cEdC835836896191EDB87CC025EFd0B7; constructor () { _setupRole(DEFAULT_ADMIN_ROLE, daomultisig); _setupRole(DAO_MULTISIG, daomultisig); _setupRole(DEV_MULTISIG, devmultisig); _setupRole(DEVELOPER, msg.sender); _setRoleAdmin(DEVELOPER, DEV_MULTISIG); } }
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80633c934ab3116100665780633c934ab31461011c57806391d1485414610124578063a217fddf14610137578063d547741f1461013f578063ea1998bf146101525761009e565b806301ffc9a7146100a35780630750fa45146100cc578063248a9ca3146100e15780632f2ff15d146100f457806336568abe14610109575b600080fd5b6100b66100b136600461065f565b61015a565b6040516100c391906106fc565b60405180910390f35b6100d4610185565b6040516100c39190610707565b6100d46100ef36600461060d565b6101a9565b610107610102366004610625565b6101be565b005b610107610117366004610625565b6101e7565b6100d4610236565b6100b6610132366004610625565b61025a565b6100d4610283565b61010761014d366004610625565b610288565b6100d46102a7565b60006001600160e01b03198216637965db0b60e01b148061017f575061017f826102cb565b92915050565b7f10518cd1efd37f850ee27646f7020563391bf44e0e90d6ecae7e0334935b5a4c81565b60009081526020819052604090206001015490565b6101c7826101a9565b6101d8816101d36102e4565b6102e8565b6101e2838361034c565b505050565b6101ef6102e4565b6001600160a01b0316816001600160a01b0316146102285760405162461bcd60e51b815260040161021f90610778565b60405180910390fd5b61023282826103d1565b5050565b7f2714cbbaddbb71bcae9366d8bf7770636ec7ae63227b573986d2f54fffacb39d81565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600081565b610291826101a9565b61029d816101d36102e4565b6101e283836103d1565b7f044b91deacf0aab5502a108167dc8649ceb80286a22b7d1adcfd65c463a2701c81565b6001600160e01b031981166301ffc9a760e01b14919050565b3390565b6102f2828261025a565b6102325761030a816001600160a01b03166014610454565b610315836020610454565b604051602001610326929190610687565b60408051601f198184030181529082905262461bcd60e51b825261021f91600401610710565b610356828261025a565b610232576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561038d6102e4565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6103db828261025a565b15610232576000828152602081815260408083206001600160a01b03851684529091529020805460ff191690556104106102e4565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b606060006104638360026107df565b61046e9060026107c7565b67ffffffffffffffff81111561049457634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156104be576020820181803683370190505b509050600360fc1b816000815181106104e757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061052457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006105488460026107df565b6105539060016107c7565b90505b60018111156105e7576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061059557634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106105b957634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c936105e08161082e565b9050610556565b5083156106065760405162461bcd60e51b815260040161021f90610743565b9392505050565b60006020828403121561061e578081fd5b5035919050565b60008060408385031215610637578081fd5b8235915060208301356001600160a01b0381168114610654578182fd5b809150509250929050565b600060208284031215610670578081fd5b81356001600160e01b031981168114610606578182fd5b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000825283516106bf8160178501602088016107fe565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516106f08160288401602088016107fe565b01602801949350505050565b901515815260200190565b90815260200190565b600060208252825180602084015261072f8160408501602087016107fe565b601f01601f19169190910160400192915050565b6020808252818101527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604082015260600190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201526e103937b632b9903337b91039b2b63360891b606082015260800190565b600082198211156107da576107da610845565b500190565b60008160001904831182151516156107f9576107f9610845565b500290565b60005b83811015610819578181015183820152602001610801565b83811115610828576000848401525b50505050565b60008161083d5761083d610845565b506000190190565b634e487b7160e01b600052601160045260246000fdfea26469706673582212204ad521cf4e4514dbaf738d56ff72515774db12246b31aaf4842b354c9a62444264736f6c63430008000033
{"success": true, "error": null, "results": {}}
6,490
0xaae072001b50520b55d6400ba623400a52a5fa96
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_KTN(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 { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220a69e1ecd1887a442078a66c25d27c27189cd1a0ed40854b80173fdbcf53e1a9164736f6c63430006060033
{"success": true, "error": null, "results": {}}
6,491
0x36c0da7d81684f8edfe415a6e74492086d88df41
pragma solidity ^0.4.21; contract controlled{ address public owner; uint256 public tokenFrozenUntilBlock; uint256 public tokenFrozenSinceBlock; uint256 public blockLock; mapping (address => bool) restrictedAddresses; // @dev Constructor function that sets freeze parameters so they don&#39;t unintentionally hinder operations. function Constructor() public{ owner = 0x24bF9FeCA8894A78d231f525c054048F5932dc6B; tokenFrozenSinceBlock = (2 ** 256) - 1; tokenFrozenUntilBlock = 0; blockLock = 5571500; } /* * @dev Transfers ownership rights to current owner to the new owner. * @param newOwner address Address to become the new SC owner. */ function transferOwnership (address newOwner) onlyOwner public{ owner = newOwner; } /* * @dev Allows owner to restrict or reenable addresses to use the token. * @param _restrictedAddress address Address of the user whose state we are planning to modify. * @param _restrict bool Restricts uder from using token. true restricts the address while false enables it. */ function editRestrictedAddress(address _restrictedAddress, bool _restrict) public onlyOwner{ if(!restrictedAddresses[_restrictedAddress] && _restrict){ restrictedAddresses[_restrictedAddress] = _restrict; } else if(restrictedAddresses[_restrictedAddress] && !_restrict){ restrictedAddresses[_restrictedAddress] = _restrict; } else{ revert(); } } /************ Modifiers to restrict access to functions. ************/ // @dev Modifier to make sure the owner&#39;s functions are only called by the owner. modifier onlyOwner{ require(msg.sender == owner); _; } /* * @dev Modifier to check whether destination of sender aren&#39;t forbidden from using the token. * @param _to address Address of the transfer destination. */ modifier instForbiddenAddress(address _to){ require(_to != 0x0); require(_to != address(this)); require(!restrictedAddresses[_to]); require(!restrictedAddresses[msg.sender]); _; } // @dev Modifier to check if the token is operational at the moment. modifier unfrozenToken{ require(block.number >= blockLock || msg.sender == owner); require(block.number >= tokenFrozenUntilBlock); require(block.number <= tokenFrozenSinceBlock); _; } } contract blocktrade is controlled{ string public name = "blocktrade"; string public symbol = "BTT"; uint8 public decimals = 18; uint256 public initialSupply = 57746762*(10**18); uint256 public supply; string public tokenFrozenUntilNotice; string public tokenFrozenSinceNotice; bool public airDropFinished; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowances; event Transfer(address indexed from, address indexed to, uint256 value); event TokenFrozenUntil(uint256 _frozenUntilBlock, string _reason); event TokenFrozenSince(uint256 _frozenSinceBlock, string _reason); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event Burn(address indexed from, uint256 value); /* * @dev Constructor function. */ function Constructor() public{ supply = 57746762*(10**18); airDropFinished = false; balances[owner] = 57746762*(10**18); } /************ Constant return functions ************/ //@dev Returns the name of the token. function tokenName() constant public returns(string _tokenName){ return name; } //@dev Returns the symbol of the token. function tokenSymbol() constant public returns(string _tokenSymbol){ return symbol; } //@dev Returns the number of decimals the token uses - e.g. 8, means to divide the token amount by 100000000 to get its user representation. function tokenDecimals() constant public returns(uint8 _tokenDecimals){ return decimals; } //@dev Returns the total supply of the token function totalSupply() constant public returns(uint256 _totalSupply){ return supply; } /* * @dev Allows us to view the token balance of the account. * @param _tokenOwner address Address of the user whose token balance we are trying to view. */ function balanceOf(address _tokenOwner) constant public returns(uint256 accountBalance){ return balances[_tokenOwner]; } /* * @dev Allows us to view the token balance of the account. * @param _owner address Address of the user whose token we are allowed to spend from sender address. * @param _spender address Address of the user allowed to spend owner&#39;s tokens. */ function allowance(address _owner, address _spender) constant public returns(uint256 remaining) { return allowances[_owner][_spender]; } // @dev Returns when will the token become operational again and why it was frozen. function getFreezeUntilDetails() constant public returns(uint256 frozenUntilBlock, string notice){ return(tokenFrozenUntilBlock, tokenFrozenUntilNotice); } //@dev Returns when will the operations of token stop and why. function getFreezeSinceDetails() constant public returns(uint frozenSinceBlock, string notice){ return(tokenFrozenSinceBlock, tokenFrozenSinceNotice); } /* * @dev Returns info whether address can use the token or not. * @param _queryAddress address Address of the account we want to check. */ function isRestrictedAddress(address _queryAddress) constant public returns(bool answer){ return restrictedAddresses[_queryAddress]; } /************ Operational functions ************/ /* * @dev Used for sending own tokens to other addresses. Keep in mind that you have to take decimals into account. Multiply the value in tokens with 10^tokenDecimals. * @param _to address Destination where we want to send the tokens to. * @param _value uint256 Amount of tokens we want to sender. */ function transfer(address _to, uint256 _value) unfrozenToken instForbiddenAddress(_to) public returns(bool success){ require(balances[msg.sender] >= _value); // Check if the sender has enough require(balances[_to] + _value >= balances[_to]) ; // Check for overflows balances[msg.sender] -= _value; // Subtract from the sender balances[_to] += _value; // Add the same to the recipient emit Transfer(msg.sender, _to, _value); // Notify anyone listening that this transfer took place return true; } /* * @dev Sets allowance to the spender from our address. * @param _spender address Address of the spender we are giving permissions to. * @param _value uint256 Amount of tokens the spender is allowed to spend from owner&#39;s accoun. Note the decimal spaces. */ function approve(address _spender, uint256 _value) unfrozenToken public returns (bool success){ allowances[msg.sender][_spender] = _value; // Set allowance emit Approval(msg.sender, _spender, _value); // Raise Approval event return true; } /* * @dev Used by spender to transfer some one else&#39;s tokens. * @param _form address Address of the owner of the tokens. * @param _to address Address where we want to transfer tokens to. * @param _value uint256 Amount of tokens we want to transfer. Note the decimal spaces. */ function transferFrom(address _from, address _to, uint256 _value) unfrozenToken instForbiddenAddress(_to) public returns(bool success){ require(balances[_from] >= _value); // Check if the sender has enough require(balances[_to] + _value >= balances[_to]); // Check for overflows require(_value <= allowances[_from][msg.sender]); // Check allowance balances[_from] -= _value; // Subtract from the sender balances[_to] += _value; // Add the same to the recipient allowances[_from][msg.sender] -= _value; // Deduct allowance for this address emit Transfer(_from, _to, _value); // Notify anyone listening that this transfer took place return true; } /* * @dev Ireversibly destroy the specified amount of tokens. * @param _value uint256 Amount of tokens we want to destroy. */ function burn(uint256 _value) onlyOwner public returns(bool success){ require(balances[msg.sender] >= _value); // Check if the sender has enough balances[msg.sender] -= _value; // Subtract from the sender supply -= _value; emit Burn(msg.sender, _value); return true; } /* * @dev Freezes transfers untill the specified block. Afterwards all of the operations are carried on as normal. * @param _frozenUntilBlock uint256 Number of block untill which all of the transfers are frozen. * @param _freezeNotice string Reason fot the freeze of operations. */ function freezeTransfersUntil(uint256 _frozenUntilBlock, string _freezeNotice) onlyOwner public returns(bool success){ tokenFrozenUntilBlock = _frozenUntilBlock; tokenFrozenUntilNotice = _freezeNotice; emit TokenFrozenUntil(_frozenUntilBlock, _freezeNotice); return true; } /* * @dev Freezes all of the transfers after specified block. * @param _frozenSinceBlock uint256 Number of block after which all of the transfers are frozen. * @param _freezeNotice string Reason for the freeze. */ function freezeTransfersSince(uint256 _frozenSinceBlock, string _freezeNotice) onlyOwner public returns(bool success){ tokenFrozenSinceBlock = _frozenSinceBlock; tokenFrozenSinceNotice = _freezeNotice; emit TokenFrozenSince(_frozenSinceBlock, _freezeNotice); return true; } /* * @dev Reenables the operation before the specified block was reached. * @param _unfreezeNotice string Reason for the unfreeze or explanation of solution. */ function unfreezeTransfersUntil(string _unfreezeNotice) onlyOwner public returns(bool success){ tokenFrozenUntilBlock = 0; tokenFrozenUntilNotice = _unfreezeNotice; emit TokenFrozenUntil(0, _unfreezeNotice); return true; } /* * @dev Reenabling after the freeze since was initiated. * @param _unfreezeNotice string Reason for the unfreeze or the explanation of solution. */ function unfreezeTransfersSince(string _unfreezeNotice) onlyOwner public returns(bool success){ tokenFrozenSinceBlock = (2 ** 256) - 1; tokenFrozenSinceNotice = _unfreezeNotice; emit TokenFrozenSince((2 ** 256) - 1, _unfreezeNotice); return true; } /************ AirDrop part of the SC. ************/ /* * @dev Allocates the specified amount of tokens to the address. * @param _beneficiary address Address of the ouser that receives the tokens. * @param _tokens uint256 Amount of tokens to allocate. */ function airDrop(address _beneficiary, uint256 _tokens) onlyOwner public returns(bool success){ require(!airDropFinished); balances[owner] -= _tokens; balances[_beneficiary] += _tokens; return true; } // @dev Function that irreversively disables airDrop and should be called right after airDrop is completed. function endAirDrop() onlyOwner public returns(bool success){ require(!airDropFinished); airDropFinished = true; return true; } } //JA
0x6080604052600436106101ac576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806303c175ff146101b1578063045f78501461020c578063047fc9aa1461027157806306fdde031461029c578063095ea7b31461032c57806318160ddd1461039157806323b872dd146103bc578063313ce56714610441578063378dc3dc146104725780633b97e8561461049d57806342966c68146104ce5780634941d05914610513578063512f9890146105625780635166b68f14610591578063577ccfe0146106125780636a9d02e9146106a25780636c02a93114610732578063707bd28b146107c257806370a08231146107f15780637b61c320146108485780638a3c44a5146108d85780638da5cb5b146108ef57806390caa2b41461094657806391a67e1e146109dd57806395d89b4114610a08578063a7bf1cbf14610a98578063a9059cbb14610b19578063aa19ed7714610b7e578063d4acfa0114610c09578063dd62ed3e14610c34578063e883618314610cab578063f0c4c33914610cd6578063f2fde38b14610d6d578063f717c31014610db0575b600080fd5b3480156101bd57600080fd5b506101f2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e3b565b604051808215151515815260200191505060405180910390f35b34801561021857600080fd5b50610257600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e91565b604051808215151515815260200191505060405180910390f35b34801561027d57600080fd5b50610286610fcf565b6040518082815260200191505060405180910390f35b3480156102a857600080fd5b506102b1610fd5565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102f15780820151818401526020810190506102d6565b50505050905090810190601f16801561031e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561033857600080fd5b50610377600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611073565b604051808215151515815260200191505060405180910390f35b34801561039d57600080fd5b506103a66111ef565b6040518082815260200191505060405180910390f35b3480156103c857600080fd5b50610427600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111f9565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b50610456611696565b604051808260ff1660ff16815260200191505060405180910390f35b34801561047e57600080fd5b506104876116a9565b6040518082815260200191505060405180910390f35b3480156104a957600080fd5b506104b26116af565b604051808260ff1660ff16815260200191505060405180910390f35b3480156104da57600080fd5b506104f9600480360381019080803590602001909291905050506116c6565b604051808215151515815260200191505060405180910390f35b34801561051f57600080fd5b50610560600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611825565b005b34801561056e57600080fd5b506105776119fa565b604051808215151515815260200191505060405180910390f35b34801561059d57600080fd5b506105f8600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611a0d565b604051808215151515815260200191505060405180910390f35b34801561061e57600080fd5b50610627611b37565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561066757808201518184015260208101905061064c565b50505050905090810190601f1680156106945780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106ae57600080fd5b506106b7611bd5565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106f75780820151818401526020810190506106dc565b50505050905090810190601f1680156107245780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561073e57600080fd5b50610747611c73565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561078757808201518184015260208101905061076c565b50505050905090810190601f1680156107b45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156107ce57600080fd5b506107d7611d15565b604051808215151515815260200191505060405180910390f35b3480156107fd57600080fd5b50610832600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611db0565b6040518082815260200191505060405180910390f35b34801561085457600080fd5b5061085d611df9565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561089d578082015181840152602081019050610882565b50505050905090810190601f1680156108ca5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108e457600080fd5b506108ed611e9b565b005b3480156108fb57600080fd5b50610904611f3a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561095257600080fd5b5061095b611f5f565b6040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156109a1578082015181840152602081019050610986565b50505050905090810190601f1680156109ce5780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b3480156109e957600080fd5b506109f261200c565b6040518082815260200191505060405180910390f35b348015610a1457600080fd5b50610a1d612012565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610a5d578082015181840152602081019050610a42565b50505050905090810190601f168015610a8a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610aa457600080fd5b50610aff600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506120b0565b604051808215151515815260200191505060405180910390f35b348015610b2557600080fd5b50610b64600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612218565b604051808215151515815260200191505060405180910390f35b348015610b8a57600080fd5b50610bef60048036038101908080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061259f565b604051808215151515815260200191505060405180910390f35b348015610c1557600080fd5b50610c1e6126c8565b6040518082815260200191505060405180910390f35b348015610c4057600080fd5b50610c95600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506126ce565b6040518082815260200191505060405180910390f35b348015610cb757600080fd5b50610cc0612755565b6040518082815260200191505060405180910390f35b348015610ce257600080fd5b50610ceb61275b565b6040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610d31578082015181840152602081019050610d16565b50505050905090810190601f168015610d5e5780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b348015610d7957600080fd5b50610dae600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612808565b005b348015610dbc57600080fd5b50610e2160048036038101908080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506128a6565b604051808215151515815260200191505060405180910390f35b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eee57600080fd5b600c60009054906101000a900460ff16151515610f0a57600080fd5b81600d60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506001905092915050565b60095481565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561106b5780601f106110405761010080835404028352916020019161106b565b820191906000526020600020905b81548152906001019060200180831161104e57829003601f168201915b505050505081565b6000600354431015806110d257506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156110dd57600080fd5b60015443101515156110ee57600080fd5b60025443111515156110ff57600080fd5b81600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600954905090565b60006003544310158061125857506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561126357600080fd5b600154431015151561127457600080fd5b600254431115151561128557600080fd5b8260008173ffffffffffffffffffffffffffffffffffffffff16141515156112ac57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156112e757600080fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561134057600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561139957600080fd5b82600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156113e757600080fd5b600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015151561147657600080fd5b600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561150157600080fd5b82600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555082600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555082600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600760009054906101000a900460ff1681565b60085481565b6000600760009054906101000a900460ff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561172357600080fd5b81600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561177157600080fd5b81600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816009600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561188057600080fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118d75750805b156119385780600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506119f6565b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561198f575080155b156119f05780600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506119f5565b600080fd5b5b5050565b600c60009054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a6a57600080fd5b600060018190555081600a9080519060200190611a889291906129cf565b507f6ea1eb4c075a2ebef4967afe3ef96b6b55f1c6708eee610c66ec25fe122ed1d06000836040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611af3578082015181840152602081019050611ad8565b50505050905090810190601f168015611b205780820380516001836020036101000a031916815260200191505b50935050505060405180910390a160019050919050565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611bcd5780601f10611ba257610100808354040283529160200191611bcd565b820191906000526020600020905b815481529060010190602001808311611bb057829003601f168201915b505050505081565b600b8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611c6b5780601f10611c4057610100808354040283529160200191611c6b565b820191906000526020600020905b815481529060010190602001808311611c4e57829003601f168201915b505050505081565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611d0b5780601f10611ce057610100808354040283529160200191611d0b565b820191906000526020600020905b815481529060010190602001808311611cee57829003601f168201915b5050505050905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d7257600080fd5b600c60009054906101000a900460ff16151515611d8e57600080fd5b6001600c60006101000a81548160ff0219169083151502179055506001905090565b6000600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611e915780601f10611e6657610100808354040283529160200191611e91565b820191906000526020600020905b815481529060010190602001808311611e7457829003601f168201915b5050505050905090565b6a2fc45a3d9fd643d6e800006009819055506000600c60006101000a81548160ff0219169083151502179055506a2fc45a3d9fd643d6e80000600d60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006060600154600a808054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611ffd5780601f10611fd257610100808354040283529160200191611ffd565b820191906000526020600020905b815481529060010190602001808311611fe057829003601f168201915b50505050509050915091509091565b60015481565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156120a85780601f1061207d576101008083540402835291602001916120a8565b820191906000526020600020905b81548152906001019060200180831161208b57829003601f168201915b505050505081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561210d57600080fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60028190555081600b908051906020019061214a9291906129cf565b507f1dafb4d559b2fe7532a80a90df43b92eb74d11ec1125b7fe200827e1585d21297fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff836040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156121d45780820151818401526020810190506121b9565b50505050905090810190601f1680156122015780820380516001836020036101000a031916815260200191505b50935050505060405180910390a160019050919050565b60006003544310158061227757506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561228257600080fd5b600154431015151561229357600080fd5b60025443111515156122a457600080fd5b8260008173ffffffffffffffffffffffffffffffffffffffff16141515156122cb57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561230657600080fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561235f57600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156123b857600080fd5b82600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561240657600080fd5b600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015151561249557600080fd5b82600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555082600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156125fc57600080fd5b8260018190555081600a90805190602001906126199291906129cf565b507f6ea1eb4c075a2ebef4967afe3ef96b6b55f1c6708eee610c66ec25fe122ed1d083836040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612683578082015181840152602081019050612668565b50505050905090810190601f1680156126b05780820380516001836020036101000a031916815260200191505b50935050505060405180910390a16001905092915050565b60025481565b6000600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60035481565b60006060600254600b808054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156127f95780601f106127ce576101008083540402835291602001916127f9565b820191906000526020600020905b8154815290600101906020018083116127dc57829003601f168201915b50505050509050915091509091565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561286357600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561290357600080fd5b8260028190555081600b90805190602001906129209291906129cf565b507f1dafb4d559b2fe7532a80a90df43b92eb74d11ec1125b7fe200827e1585d212983836040518083815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561298a57808201518184015260208101905061296f565b50505050905090810190601f1680156129b75780820380516001836020036101000a031916815260200191505b50935050505060405180910390a16001905092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612a1057805160ff1916838001178555612a3e565b82800160010185558215612a3e579182015b82811115612a3d578251825591602001919060010190612a22565b5b509050612a4b9190612a4f565b5090565b612a7191905b80821115612a6d576000816000905550600101612a55565b5090565b905600a165627a7a7230582069d5c7704cc126e13480c2599ba8640a404ec63326be82e3ff3a1cce2cca84a40029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}]}}
6,492
0x514e3d7c6b9b831903a93916b31e06ad2037b619
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _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 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 { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic, Ownable { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Function to revert eth transfers to this contract */ function() public payable { revert(); } /** * @dev Owner can transfer out any accidentally sent ERC20 tokens */ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return BasicToken(tokenAddress).transfer(owner, tokens); } } /** * @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); } /** * @dev Transfer the specified amounts of tokens to the specified addresses. * @dev Be aware that there is no check for duplicate recipients. * * @param _toAddresses Receiver addresses. * @param _amounts Amounts of tokens that will be transferred. */ function multiTransfer(address[] _toAddresses, uint256[] _amounts) public whenNotPaused returns (bool) { /* Ensures _toAddresses array is less than or equal to 255 */ require(_toAddresses.length <= 255); /* Ensures _toAddress and _amounts have the same number of entries. */ require(_toAddresses.length == _amounts.length); for (uint8 i = 0; i < _toAddresses.length; i++) { transfer(_toAddresses[i], _amounts[i]); } } /** * @dev Transfer the specified amounts of tokens to the specified addresses from authorized balance of sender. * @dev Be aware that there is no check for duplicate recipients. * * @param _from The address of the sender * @param _toAddresses The addresses of the recipients (MAX 255) * @param _amounts The amounts of tokens to be transferred */ function multiTransferFrom(address _from, address[] _toAddresses, uint256[] _amounts) public whenNotPaused returns (bool) { /* Ensures _toAddresses array is less than or equal to 255 */ require(_toAddresses.length <= 255); /* Ensures _toAddress and _amounts have the same number of entries. */ require(_toAddresses.length == _amounts.length); for (uint8 i = 0; i < _toAddresses.length; i++) { transferFrom(_from, _toAddresses[i], _amounts[i]); } } } contract AkoinToken is PausableToken { string public constant name = "Akoin"; string public constant symbol = "AKOIN"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 500000000 * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); } }
0x6080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610101578063095ea7b31461019157806318160ddd146101f65780631e89d5451461022157806323b872dd146102e25780632ff2e9dc14610367578063313ce567146103925780633f4ba83a146103c35780635c975abb146103da57806370a08231146104095780638456cb59146104605780638da5cb5b1461047757806395d89b41146104ce578063a9059cbb1461055e578063cb31b6cd146105c3578063dc39d06d146106a4578063dd62ed3e14610709578063f2fde38b14610780575b600080fd5b34801561010d57600080fd5b506101166107c3565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561015657808201518184015260208101905061013b565b50505050905090810190601f1680156101835780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019d57600080fd5b506101dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107fc565b604051808215151515815260200191505060405180910390f35b34801561020257600080fd5b5061020b61082c565b6040518082815260200191505060405180910390f35b34801561022d57600080fd5b506102c86004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610836565b604051808215151515815260200191505060405180910390f35b3480156102ee57600080fd5b5061034d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108da565b604051808215151515815260200191505060405180910390f35b34801561037357600080fd5b5061037c61090c565b6040518082815260200191505060405180910390f35b34801561039e57600080fd5b506103a761091d565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103cf57600080fd5b506103d8610922565b005b3480156103e657600080fd5b506103ef6109e1565b604051808215151515815260200191505060405180910390f35b34801561041557600080fd5b5061044a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109f4565b6040518082815260200191505060405180910390f35b34801561046c57600080fd5b50610475610a3d565b005b34801561048357600080fd5b5061048c610afd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104da57600080fd5b506104e3610b22565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610523578082015181840152602081019050610508565b50505050905090810190601f1680156105505780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561056a57600080fd5b506105a9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b5b565b604051808215151515815260200191505060405180910390f35b3480156105cf57600080fd5b5061068a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610b8b565b604051808215151515815260200191505060405180910390f35b3480156106b057600080fd5b506106ef600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c31565b604051808215151515815260200191505060405180910390f35b34801561071557600080fd5b5061076a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d95565b6040518082815260200191505060405180910390f35b34801561078c57600080fd5b506107c1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e1c565b005b6040805190810160405280600581526020017f416b6f696e00000000000000000000000000000000000000000000000000000081525081565b6000600460009054906101000a900460ff1615151561081a57600080fd5b6108248383610e83565b905092915050565b6000600254905090565b600080600460009054906101000a900460ff1615151561085557600080fd5b60ff84511115151561086657600080fd5b8251845114151561087657600080fd5b600090505b83518160ff1610156108d3576108c5848260ff1681518110151561089b57fe5b90602001906020020151848360ff168151811015156108b657fe5b90602001906020020151610b5b565b50808060010191505061087b565b5092915050565b6000600460009054906101000a900460ff161515156108f857600080fd5b610903848484610f75565b90509392505050565b601260ff16600a0a631dcd65000281565b601281565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561097d57600080fd5b600460009054906101000a900460ff16151561099857600080fd5b6000600460006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600460009054906101000a900460ff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a9857600080fd5b600460009054906101000a900460ff16151515610ab457600080fd5b6001600460006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600581526020017f414b4f494e00000000000000000000000000000000000000000000000000000081525081565b6000600460009054906101000a900460ff16151515610b7957600080fd5b610b838383611334565b905092915050565b600080600460009054906101000a900460ff16151515610baa57600080fd5b60ff845111151515610bbb57600080fd5b82518451141515610bcb57600080fd5b600090505b83518160ff161015610c2957610c1b85858360ff16815181101515610bf157fe5b90602001906020020151858460ff16815181101515610c0c57fe5b906020019060200201516108da565b508080600101915050610bd0565b509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c8e57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610d5257600080fd5b505af1158015610d66573d6000803e3d6000fd5b505050506040513d6020811015610d7c57600080fd5b8101908080519060200190929190505050905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7757600080fd5b610e8081611558565b50565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610fb257600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561100057600080fd5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561108b57600080fd5b6110dd82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165290919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061117282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166b90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061124482600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165290919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561137157600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156113bf57600080fd5b61141182600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165290919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114a682600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166b90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561159457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561166057fe5b818303905092915050565b6000818301905082811015151561167e57fe5b809050929150505600a165627a7a72305820cc26b86a6bcd38b51ac4751ab4b9133535cabb1b8d0f44892199a93cfad754c60029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
6,493
0x96e6e56C0B3121Dca543B11f82B6259821b62D1C
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; // /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } // /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } // /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } // /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } // contract VestingContract is Ownable { using SafeMath for uint256; // CNTR Token Contract IERC20 tokenContract = IERC20(0x03042482d64577A7bdb282260e2eA4c8a89C064B); uint256[] vestingSchedule; address public receivingAddress; uint256 public vestingStartTime; uint256 constant public releaseInterval = 30 days; uint256 public totalTokens; uint256 public totalDistributed; uint256 index = 0; constructor(address _address) public { receivingAddress = _address; } function updateVestingSchedule(uint256[] memory _vestingSchedule) public onlyOwner { require(vestingStartTime == 0); vestingSchedule = _vestingSchedule; for(uint256 i = 0; i < vestingSchedule.length; i++) { totalTokens = totalTokens.add(vestingSchedule[i]); } } function updateReceivingAddress(address _address) public onlyOwner { receivingAddress = _address; } function releaseToken() public { require(vestingSchedule.length > 0); require(msg.sender == owner() || msg.sender == receivingAddress); if (vestingStartTime == 0) { require(msg.sender == owner()); vestingStartTime = block.timestamp; } for (uint256 i = index; i < vestingSchedule.length; i++) { if (block.timestamp >= vestingStartTime + (index * releaseInterval)) { tokenContract.transfer(receivingAddress, (vestingSchedule[i] * 1 ether)); totalDistributed = totalDistributed.add(vestingSchedule[i]); index = index.add(1); } else { break; } } } function getVestingSchedule() public view returns (uint256[] memory) { return vestingSchedule; } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063a3d272ce11610071578063a3d272ce146101f2578063a8660a7814610236578063c4b6c5fa14610254578063ec715a311461030c578063efca2eed14610316578063f2fde38b14610334576100b4565b80631db87be8146100b95780631f8db268146101035780633a05f0d814610121578063715018a6146101805780637e1c0c091461018a5780638da5cb5b146101a8575b600080fd5b6100c1610378565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61010b61039e565b6040518082815260200191505060405180910390f35b6101296103a5565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561016c578082015181840152602081019050610151565b505050509050019250505060405180910390f35b6101886103fd565b005b610192610585565b6040518082815260200191505060405180910390f35b6101b061058b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102346004803603602081101561020857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105b4565b005b61023e6106c1565b6040518082815260200191505060405180910390f35b61030a6004803603602081101561026a57600080fd5b810190808035906020019064010000000081111561028757600080fd5b82018360208201111561029957600080fd5b803590602001918460208302840111640100000000831117156102bb57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506106c7565b005b61031461080c565b005b61031e610abe565b6040518082815260200191505060405180910390f35b6103766004803603602081101561034a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ac4565b005b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b62278d0081565b606060028054806020026020016040519081016040528092919081815260200182805480156103f357602002820191906000526020600020905b8154815260200190600101908083116103df575b5050505050905090565b610405610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6105bc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461067d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60045481565b6106cf610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610790576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60006004541461079f57600080fd5b80600290805190602001906107b5929190610d61565b5060008090505b600280549050811015610808576107f5600282815481106107d957fe5b9060005260206000200154600554610cd990919063ffffffff16565b60058190555080806001019150506107bc565b5050565b60006002805490501161081e57600080fd5b61082661058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108ac5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108b557600080fd5b60006004541415610907576108c861058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108ff57600080fd5b426004819055505b600060075490505b600280549050811015610abb5762278d0060075402600454014210610aa957600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000600285815481106109a557fe5b9060005260206000200154026040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a1a57600080fd5b505af1158015610a2e573d6000803e3d6000fd5b505050506040513d6020811015610a4457600080fd5b810190808051906020019092919050505050610a8260028281548110610a6657fe5b9060005260206000200154600654610cd990919063ffffffff16565b600681905550610a9e6001600754610cd990919063ffffffff16565b600781905550610aae565b610abb565b808060010191505061090f565b50565b60065481565b610acc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b8d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610c13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610dd46026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600080828401905083811015610d57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b828054828255906000526020600020908101928215610d9d579160200282015b82811115610d9c578251825591602001919060010190610d81565b5b509050610daa9190610dae565b5090565b610dd091905b80821115610dcc576000816000905550600101610db4565b5090565b9056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122071000f4d21f3ecf9786900cd34cec43ee18cd0a5ed0f222212d5488900c3810f64736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
6,494
0xc346da89c79921a2c39b712223d4b3ccb87c0a17
/* 👑 🐶 $ROYALC will be the 5th project using ETH dividend redistribution powered by FTP (Fair Token Project)! ✅ FAIR LAUNCH MONITORED BY FAIR TOKEN PROJECT (FTP) ✅ NO PRESALE ✅ 100% OF THE SUPPLY ALLOCATED TO LIQUIDITY ✅ ANTI BOT/SNIPE PROTECTION BY FTP 👑 TOKENOMICS 👑 - ERC20 token 🐶🐶 - Launch on Uniswap 🦄🦄 - Total supply: 1'000'000'000'000'000 🪙🪙 - Liquidity will be locked on Unicrypt for 1 year 🔐🔐 - 15% Transaction fee 👇 - 8% ETH DIVIDENDS TO HOLDERS 🤑🤑🤑 - 5% TO PROJECT DEVELOPMENT 🌕🌕🌕 - 2% TO CHARITY WALLET 👑👑👑 🔗 LINKS: 💻 Website: https://royalcorgi.net/ 📜 Whitepaper: https://royalcorgi.net/ROYALC_QueenPaper95.0.pdf 🐦 Twitter: https://twitter.com/ROYALCORGI95 📨 Telegram: https://t.me/royalc95 */ 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 ROYALCORGITOKEN is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000 * 10**12 * 10**18; string private _name = 'ROYAL CORGI'; string private _symbol = 'ROYALC 👑🐶'; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212208edc5169478f80014c9250d1a5e3218e2427157d44fe03513188da12def7dba464736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,495
0x88A9A52F944315D5B4e917b9689e65445C401E83
// SPDX-License-Identifier: MIT pragma solidity ^0.7.6; /** * @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 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 Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The defaut value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All three of these values are immutable: they can only be set once during * construction. */ constructor (string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() external view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() external view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overloaded; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() external view virtual returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() external view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) external view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) external virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) external 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) external 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) external virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) external virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) external virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** @dev 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 += amount; _balances[account] += 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); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @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 { } } /** * @title Fear * @dev Implementation of Fear NFTs */ contract Fear is ERC20 { constructor ( string memory name, string memory symbol, uint256 initialBalance ) ERC20(name, symbol) { _mint(msg.sender, initialBalance); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461025857806370a08231146102bc57806395d89b4114610314578063a457c2d714610397578063a9059cbb146103fb578063dd62ed3e1461045f576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b66104d7565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610579565b60405180821515815260200191505060405180910390f35b61019d610597565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105a1565b60405180821515815260200191505060405180910390f35b61023f6106af565b604051808260ff16815260200191505060405180910390f35b6102a46004803603604081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106b8565b60405180821515815260200191505060405180910390f35b6102fe600480360360208110156102d257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061075b565b6040518082815260200191505060405180910390f35b61031c6107a3565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561035c578082015181840152602081019050610341565b50505050905090810190601f1680156103895780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103e3600480360360408110156103ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610845565b60405180821515815260200191505060405180910390f35b6104476004803603604081101561041157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610946565b60405180821515815260200191505060405180910390f35b6104c16004803603604081101561047557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610964565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561056f5780601f106105445761010080835404028352916020019161056f565b820191906000526020600020905b81548152906001019060200180831161055257829003601f168201915b5050505050905090565b600061058d6105866109eb565b84846109f3565b6001905092915050565b6000600254905090565b60006105ae848484610bea565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105f96109eb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561068f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180610f0a6028913960400191505060405180910390fd5b6106a38561069b6109eb565b8584036109f3565b60019150509392505050565b60006012905090565b60006107516106c56109eb565b8484600160006106d36109eb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054016109f3565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561083b5780601f106108105761010080835404028352916020019161083b565b820191906000526020600020905b81548152906001019060200180831161081e57829003601f168201915b5050505050905090565b600080600160006108546109eb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610927576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180610f7b6025913960400191505060405180910390fd5b61093b6109326109eb565b858584036109f3565b600191505092915050565b600061095a6109536109eb565b8484610bea565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180610f576024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610aff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610ec26022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180610f326025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610cf6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180610e9f6023913960400191505060405180910390fd5b610d01838383610e99565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610d9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610ee46026913960400191505060405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220c35575faf523bb394d32e55025891da8cccbe9cdb5e0582f7093d553fe4f39b664736f6c63430007060033
{"success": true, "error": null, "results": {}}
6,496
0x3cfb1657314d96721ce7bc1358f0aabf3855081f
/** *Submitted for verification at Etherscan.io on 2022-04-14 */ /** https://t.me/kiritoinu __ ___ __ .______ __ .___________. ______ __ .__ __. __ __ | |/ / | | | _ \ | | | | / __ \ | | | \ | | | | | | | ' / | | | |_) | | | `---| |----`| | | | | | | \| | | | | | | < | | | / | | | | | | | | | | | . ` | | | | | | . \ | | | |\ \----.| | | | | `--' | | | | |\ | | `--' | |__|\__\ |__| | _| `._____||__| |__| \______/ |__| |__| \__| \______/ */ pragma solidity ^0.8.13; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract KiritoInu 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 = "KiritoInu"; string private constant _symbol = "KiritoInu"; 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(0xf64dDe385Bd4252e90F0c967cef3B0bc9C2C280b); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 13; } 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 = 1500000000 * 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); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061271e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127e8565b6104b4565b60405161018e9190612843565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061286d565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d0565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a19565b61060d565b60405161021f9190612843565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a6c565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ab5565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612afc565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b29565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a6c565b6109dd565b604051610319919061286d565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b65565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061271e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127e8565b610c9e565b6040516103da9190612843565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b29565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b80565b611330565b60405161046e919061286d565b60405180910390f35b60606040518060400160405280600981526020017f4b697269746f496e750000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113b7565b84846113bf565b6001905092915050565b600068056bc75e2d63100000905090565b6104eb6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c0c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c2c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8a565b91505061057b565b5050565b600061061a848484611588565b6106db846106266113b7565b6106d6856040518060600160405280602881526020016136c160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c199092919063ffffffff16565b6113bf565b600190509392505050565b6106ee6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c0c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c0c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c0c565b60405180910390fd5b6000811161093357600080fd5b61096260646109548368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b7565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d41565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dad565b9050919050565b610a366113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c0c565b60405180910390fd5b68056bc75e2d63100000600f8190555068056bc75e2d63100000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f4b697269746f496e750000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b7565b8484611588565b6001905092915050565b610cc46113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c0c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f8368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b7565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e1b565b50565b610e186113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c0c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d1e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006113bf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d53565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d53565b6040518363ffffffff1660e01b815260040161109c929190612d80565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d53565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612dee565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e64565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506714d1120d7b160000600f819055506729a2241af62c00006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e9929190612eb7565b6020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612ef5565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361142e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142590612f94565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149490613026565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157b919061286d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ee906130b8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165d9061314a565b60405180910390fd5b600081116116a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a0906131dc565b60405180910390fd5b6000600a81905550600a600b819055506116c1610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172f57506116ff610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561188c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fa5750600e60179054906101000a900460ff165b15611a3857600f54811115611944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193b90613248565b60405180910390fd5b60105481611951846109dd565b61195b9190613268565b111561199c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119939061330a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e757600080fd5b601e426119f49190613268565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b4f576000600a81905550600d600b819055505b6000611b5a306109dd565b9050600e60159054906101000a900460ff16158015611bc75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bdf5750600e60169054906101000a900460ff165b15611c0757611bed81611e1b565b60004790506000811115611c0557611c0447611d41565b5b505b505b611c14838383612094565b505050565b6000838311158290611c61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c58919061271e565b60405180910390fd5b5060008385611c70919061332a565b9050809150509392505050565b6000808303611c8f5760009050611cf1565b60008284611c9d919061335e565b9050828482611cac91906133e7565b14611cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce39061348a565b60405180910390fd5b809150505b92915050565b6000611d3983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da9573d6000803e3d6000fd5b5050565b6000600854821115611df4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611deb9061351c565b60405180910390fd5b6000611dfe612107565b9050611e138184611cf790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5357611e5261288d565b5b604051908082528060200260200182016040528015611e815781602001602082028036833780820191505090505b5090503081600081518110611e9957611e98612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f649190612d53565b81600181518110611f7857611f77612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fdf30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113bf565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120439594939291906135fa565b600060405180830381600087803b15801561205d57600080fd5b505af1158015612071573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209f838383612132565b505050565b600080831182906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e2919061271e565b60405180910390fd5b50600083856120fa91906133e7565b9050809150509392505050565b60008060006121146122fd565b9150915061212b8183611cf790919063ffffffff16565b9250505090565b6000806000806000806121448761235f565b9550955095509550955095506121a286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122838161246f565b61228d848361252c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ea919061286d565b60405180910390a3505050505050505050565b60008060006008549050600068056bc75e2d63100000905061233368056bc75e2d63100000600854611cf790919063ffffffff16565b8210156123525760085468056bc75e2d6310000093509350505061235b565b81819350935050505b9091565b600080600080600080600080600061237c8a600a54600b54612566565b925092509250600061238c612107565b9050600080600061239f8e8787876125fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c19565b905092915050565b60008082846124209190613268565b905083811015612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c906136a0565b60405180910390fd5b8091505092915050565b6000612479612107565b905060006124908284611c7d90919063ffffffff16565b90506124e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612541826008546123c790919063ffffffff16565b60088190555061255c8160095461241190919063ffffffff16565b6009819055505050565b6000806000806125926064612584888a611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125bc60646125ae888b611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125e5826125d7858c6123c790919063ffffffff16565b6123c790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126158589611c7d90919063ffffffff16565b9050600061262c8689611c7d90919063ffffffff16565b905060006126438789611c7d90919063ffffffff16565b9050600061266c8261265e85876123c790919063ffffffff16565b6123c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126bf5780820151818401526020810190506126a4565b838111156126ce576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f082612685565b6126fa8185612690565b935061270a8185602086016126a1565b612713816126d4565b840191505092915050565b6000602082019050818103600083015261273881846126e5565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061277f82612754565b9050919050565b61278f81612774565b811461279a57600080fd5b50565b6000813590506127ac81612786565b92915050565b6000819050919050565b6127c5816127b2565b81146127d057600080fd5b50565b6000813590506127e2816127bc565b92915050565b600080604083850312156127ff576127fe61274a565b5b600061280d8582860161279d565b925050602061281e858286016127d3565b9150509250929050565b60008115159050919050565b61283d81612828565b82525050565b60006020820190506128586000830184612834565b92915050565b612867816127b2565b82525050565b6000602082019050612882600083018461285e565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128c5826126d4565b810181811067ffffffffffffffff821117156128e4576128e361288d565b5b80604052505050565b60006128f7612740565b905061290382826128bc565b919050565b600067ffffffffffffffff8211156129235761292261288d565b5b602082029050602081019050919050565b600080fd5b600061294c61294784612908565b6128ed565b9050808382526020820190506020840283018581111561296f5761296e612934565b5b835b818110156129985780612984888261279d565b845260208401935050602081019050612971565b5050509392505050565b600082601f8301126129b7576129b6612888565b5b81356129c7848260208601612939565b91505092915050565b6000602082840312156129e6576129e561274a565b5b600082013567ffffffffffffffff811115612a0457612a0361274f565b5b612a10848285016129a2565b91505092915050565b600080600060608486031215612a3257612a3161274a565b5b6000612a408682870161279d565b9350506020612a518682870161279d565b9250506040612a62868287016127d3565b9150509250925092565b600060208284031215612a8257612a8161274a565b5b6000612a908482850161279d565b91505092915050565b600060ff82169050919050565b612aaf81612a99565b82525050565b6000602082019050612aca6000830184612aa6565b92915050565b612ad981612828565b8114612ae457600080fd5b50565b600081359050612af681612ad0565b92915050565b600060208284031215612b1257612b1161274a565b5b6000612b2084828501612ae7565b91505092915050565b600060208284031215612b3f57612b3e61274a565b5b6000612b4d848285016127d3565b91505092915050565b612b5f81612774565b82525050565b6000602082019050612b7a6000830184612b56565b92915050565b60008060408385031215612b9757612b9661274a565b5b6000612ba58582860161279d565b9250506020612bb68582860161279d565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bf6602083612690565b9150612c0182612bc0565b602082019050919050565b60006020820190508181036000830152612c2581612be9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c95826127b2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc757612cc6612c5b565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d08601783612690565b9150612d1382612cd2565b602082019050919050565b60006020820190508181036000830152612d3781612cfb565b9050919050565b600081519050612d4d81612786565b92915050565b600060208284031215612d6957612d6861274a565b5b6000612d7784828501612d3e565b91505092915050565b6000604082019050612d956000830185612b56565b612da26020830184612b56565b9392505050565b6000819050919050565b6000819050919050565b6000612dd8612dd3612dce84612da9565b612db3565b6127b2565b9050919050565b612de881612dbd565b82525050565b600060c082019050612e036000830189612b56565b612e10602083018861285e565b612e1d6040830187612ddf565b612e2a6060830186612ddf565b612e376080830185612b56565b612e4460a083018461285e565b979650505050505050565b600081519050612e5e816127bc565b92915050565b600080600060608486031215612e7d57612e7c61274a565b5b6000612e8b86828701612e4f565b9350506020612e9c86828701612e4f565b9250506040612ead86828701612e4f565b9150509250925092565b6000604082019050612ecc6000830185612b56565b612ed9602083018461285e565b9392505050565b600081519050612eef81612ad0565b92915050565b600060208284031215612f0b57612f0a61274a565b5b6000612f1984828501612ee0565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f7e602483612690565b9150612f8982612f22565b604082019050919050565b60006020820190508181036000830152612fad81612f71565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613010602283612690565b915061301b82612fb4565b604082019050919050565b6000602082019050818103600083015261303f81613003565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a2602583612690565b91506130ad82613046565b604082019050919050565b600060208201905081810360008301526130d181613095565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613134602383612690565b915061313f826130d8565b604082019050919050565b6000602082019050818103600083015261316381613127565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131c6602983612690565b91506131d18261316a565b604082019050919050565b600060208201905081810360008301526131f5816131b9565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613232601983612690565b915061323d826131fc565b602082019050919050565b6000602082019050818103600083015261326181613225565b9050919050565b6000613273826127b2565b915061327e836127b2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b3576132b2612c5b565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132f4601a83612690565b91506132ff826132be565b602082019050919050565b60006020820190508181036000830152613323816132e7565b9050919050565b6000613335826127b2565b9150613340836127b2565b92508282101561335357613352612c5b565b5b828203905092915050565b6000613369826127b2565b9150613374836127b2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133ad576133ac612c5b565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f2826127b2565b91506133fd836127b2565b92508261340d5761340c6133b8565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613474602183612690565b915061347f82613418565b604082019050919050565b600060208201905081810360008301526134a381613467565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613506602a83612690565b9150613511826134aa565b604082019050919050565b60006020820190508181036000830152613535816134f9565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357181612774565b82525050565b60006135838383613568565b60208301905092915050565b6000602082019050919050565b60006135a78261353c565b6135b18185613547565b93506135bc83613558565b8060005b838110156135ed5781516135d48882613577565b97506135df8361358f565b9250506001810190506135c0565b5085935050505092915050565b600060a08201905061360f600083018861285e565b61361c6020830187612ddf565b818103604083015261362e818661359c565b905061363d6060830185612b56565b61364a608083018461285e565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061368a601b83612690565b915061369582613654565b602082019050919050565b600060208201905081810360008301526136b98161367d565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122070a3ca7e8523f433d3b2a9f405d9ba840810d9ef6d2dc0e9ae1745bf7f5064de64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,497
0xfa1d609ce64cb712aeee8c4195d4ec5056bc7559
// SPDX-License-Identifier: No License pragma solidity 0.6.12; // ---------------------------------------------------------------------------- // 'VOILA' contract // // Symbol : VLA // Name : VOILA // Total supply: 100 000 000 000 // Decimals : 18 // ---------------------------------------------------------------------------- /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath{ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0;} uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ interface ERC20Basic { function balanceOf(address who) external view returns (uint256 balance); function transfer(address to, uint256 value) external returns (bool trans1); function allowance(address owner, address spender) external view returns (uint256 remaining); function transferFrom(address from, address to, uint256 value) external returns (bool trans); function approve(address spender, uint256 value) external returns (bool hello); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20Basic, Ownable { uint256 public totalSupply; using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public override returns (bool trans1) { require(_to != address(0)); //require(canTransfer(msg.sender)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. */ function balanceOf(address _owner) public view override returns (uint256 balance) { return balances[_owner]; } mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) { require(_to != address(0)); // require(canTransfer(msg.sender)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public override returns (bool hello) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. */ function allowance(address _owner, address _spender) public view override returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } contract VOILA is BurnableToken { string public constant name = "VOILA"; string public constant symbol = "VLA"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 100000000000 * (10 ** uint256(decimals)); // Constructors constructor () public{ totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner //allowedAddresses[owner] = true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a13565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd9565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e6a565b6040518082815260200191505060405180910390f35b6103b1610eb3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f10565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e4565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112e0565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611367565b005b6040518060400160405280600581526020017f564f494c4100000000000000000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b690919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a64174876e8000281565b60008111610a2057600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6c57600080fd5b6000339050610ac382600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1b826001546114b690919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610cea576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7e565b610cfd83826114b690919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f564c41000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4b57600080fd5b610f9d82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103282600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117582600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113bf57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c257fe5b818303905092915050565b6000808284019050838110156114df57fe5b809150509291505056fea264697066735822122018008dc4f24c16f9db1d4ae04a28ec0a60283f16080dcf5dd78f3e1a86a97c9b64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,498
0xd7588254a4b16b3a0d4b544b0d0a13523115c140
// SPDX-License-Identifier: MIT pragma solidity 0.8.2; interface IERC20Token { function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); } interface IERC721 { function setPaymentDate(uint256 _asset) external; function getTokenDetails(uint256 index) external view returns (uint128 lastvalue, uint32 aType, uint32 customDetails, uint32 lastTx, uint32 lastPayment); function polkaCitizens() external view returns(uint256 _citizens); function assetsByType(uint256 _assetType) external view returns (uint64 maxAmount, uint64 mintedAmount, uint128 baseValue); function ownerOf(uint256 tokenId) external view returns (address owner); function balanceOf(address _owner) external view returns (uint256); } library Address { 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; } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable { address private owner; event OwnerSet(address indexed oldOwner, address indexed newOwner); modifier onlyOwner() { require(msg.sender == owner, "Caller is not owner"); _; } constructor() { owner = msg.sender; // 'msg.sender' is sender of current call, contract deployer for a constructor emit OwnerSet(address(0), owner); } function changeOwner(address newOwner) public onlyOwner { emit OwnerSet(owner, newOwner); owner = newOwner; } function getOwner() external view returns (address) { return owner; } } contract PolkaProfitContract is Ownable { event Payment(address indexed to, uint256 amount, uint8 network, uint256 gasFee); bool public paused; struct paymentByType { uint256 weeklyPayment; uint256 variantFactor; uint256 basePriceFactor; } struct Claim { address account; uint8 dNetwork; // 1= Ethereum 2= BSC uint256 assetId; uint256 amount; uint256 date; } Claim[] public payments; mapping (address => bool) public blackListed; mapping (uint256 => paymentByType) public paymentAmount; address public nftAddress = 0x57E9a39aE8eC404C08f88740A9e6E306f50c937f; address public tokenAddress = 0xaA8330FB2B4D5D07ABFE7A72262752a8505C6B37; address payable public walletAddress; uint256 public gasFee = 1000000000000000; uint256 wUnit = 1 weeks; constructor() { fillPayments(1, 60000000000000000000, 10, 15000000000000); fillPayments(2, 135000000000000000000, 10, 30000000000000); fillPayments(3, 375000000000000000000, 10, 75000000000000); fillPayments(4, 550000000000000000000, 10, 100000000000000); fillPayments(5, 937500000000000000000, 10, 150000000000000); fillPayments(6, 8250000000000000000000, 10, 750000000000000); fillPayments(7, 6500000000000000000000, 10, 655000000000000); fillPayments(8, 3000000000000000000000, 20, 400000000000000); fillPayments(9, 10800000000000000000000, 50, 900000000000000); fillPayments(10, 5225000000000000000000, 30, 550000000000000); fillPayments(11,13125000000000000000000, 20, 1050000000000000); fillPayments(12, 4500000000000000000000, 10, 500000000000000); fillPayments(13, 1500000000000000000000, 10, 225000000000000); fillPayments(14, 2100000000000000000000, 15, 300000000000000); fillPayments(15, 3750000000000000000000, 10, 450000000000000); walletAddress = payable(0xAD334543437EF71642Ee59285bAf2F4DAcBA613F); } function fillPayments(uint256 _assetId, uint256 _weeklyPayment, uint256 _variantFactor, uint256 _basePriceFactor) private { paymentAmount[_assetId].weeklyPayment = _weeklyPayment; paymentAmount[_assetId].variantFactor = _variantFactor; paymentAmount[_assetId].basePriceFactor = _basePriceFactor; } function profitsPayment(uint256 _assetId) public returns (bool success) { require(paused == false, "Contract is paused"); IERC721 nft = IERC721(nftAddress); address assetOwner = nft.ownerOf(_assetId); require(assetOwner == msg.sender, "Only asset owner can claim profits"); require(blackListed[assetOwner] == false, "This address cannot claim profits"); (uint256 totalPayment, ) = calcProfit(_assetId); require (totalPayment > 0, "You need to wait at least 1 week to claim"); nft.setPaymentDate(_assetId); IERC20Token token = IERC20Token(tokenAddress); require(token.transferFrom(walletAddress, assetOwner, totalPayment), "ERC20 transfer fail"); Claim memory thisclaim = Claim(msg.sender, 1, _assetId, totalPayment, block.timestamp); payments.push(thisclaim); emit Payment(msg.sender, totalPayment, 1, 0); return true; } function profitsPaymentBSC(uint256 _assetId) public payable returns (bool success) { require(paused == false, "Contract is paused"); require(msg.value >= gasFee, "Gas fee too low"); IERC721 nft = IERC721(nftAddress); address assetOwner = nft.ownerOf(_assetId); require(assetOwner == msg.sender, "Only asset owner can claim profits"); require(blackListed[assetOwner] == false, "This address cannot claim profits"); (uint256 totalPayment, ) = calcProfit(_assetId); require (totalPayment > 0, "You need to wait at least 1 week to claim"); nft.setPaymentDate(_assetId); Address.sendValue(walletAddress, msg.value); Claim memory thisclaim = Claim(msg.sender, 2, _assetId, totalPayment, block.timestamp); payments.push(thisclaim); emit Payment(msg.sender, totalPayment, 2, msg.value); return true; } function calcProfit(uint256 _assetId) public view returns (uint256 _profit, uint256 _lastPayment) { IERC721 nft = IERC721(nftAddress); ( , uint32 assetType,, uint32 lastTransfer, uint32 lastPayment ) = nft.getTokenDetails(_assetId); uint256 cTime = block.timestamp - lastTransfer; uint256 dTime = 0; if (lastTransfer < lastPayment) { dTime = lastPayment - lastTransfer; } if ((cTime) < wUnit) { return (0, lastTransfer); } else { uint256 weekCount; if (dTime == 0) { weekCount = ((cTime)/(wUnit)); } else { weekCount = ((cTime)/(wUnit)) - (dTime)/(wUnit); } if (weekCount < 1) { return (0, lastPayment); } else { uint256 daysCount = weekCount * 7; // uint256 variantCount; if (assetType == 8 || assetType == 15) { variantCount = countTaxis(); } else { variantCount = nft.polkaCitizens(); } uint256 totalPayment; paymentByType memory thisPayment = paymentAmount[uint256(assetType)]; uint256 dailyProfit = ((thisPayment.basePriceFactor*(variantCount*thisPayment.variantFactor))/30)*daysCount; totalPayment = ((weekCount * thisPayment.weeklyPayment) + dailyProfit); return (totalPayment, lastPayment); } } } function calcTotalEarnings(uint256 _assetId) public view returns (uint256 _profit, uint256 _lastPayment) { IERC721 nft = IERC721(nftAddress); ( , uint32 assetType,, uint32 lastTransfer, ) = nft.getTokenDetails(_assetId); uint256 timeFrame = block.timestamp - lastTransfer; if (timeFrame < wUnit) { return (0, lastTransfer); } else { uint256 weekCount = timeFrame/(wUnit); uint256 daysCount = weekCount * 7; uint256 variantCount; if (assetType == 8 || assetType == 15) { variantCount = countTaxis(); } else { variantCount = nft.polkaCitizens(); } uint256 totalPayment; paymentByType memory thisPayment = paymentAmount[uint256(assetType)]; uint256 dailyProfit = ((thisPayment.basePriceFactor*(variantCount*thisPayment.variantFactor))/30)*daysCount; totalPayment = ((weekCount * thisPayment.weeklyPayment) + dailyProfit); return (totalPayment, lastTransfer); } } function countTaxis() private view returns (uint256 taxis) { uint256 taxiCount = 0; uint64 assetMinted; IERC721 nft = IERC721(nftAddress); (, assetMinted,) = nft.assetsByType(1); taxiCount += uint256(assetMinted); (, assetMinted,) = nft.assetsByType(2); taxiCount += uint256(assetMinted); (, assetMinted,) = nft.assetsByType(3); taxiCount += uint256(assetMinted); (, assetMinted,) = nft.assetsByType(4); taxiCount += assetMinted; (, assetMinted,) = nft.assetsByType(5); taxiCount += uint256(assetMinted); return taxiCount; } function pauseContract(bool _paused) public onlyOwner { paused = _paused; } function blackList(address _wallet, bool _blacklist) public onlyOwner { blackListed[_wallet] = _blacklist; } function paymentCount() public view returns (uint256 _paymentCount) { return payments.length; } function paymentDetail(uint256 _paymentIndex) public view returns (address _to, uint8 _network, uint256 assetId, uint256 _amount, uint256 _date) { Claim memory thisPayment = payments[_paymentIndex]; return (thisPayment.account, thisPayment.dNetwork, thisPayment.assetId, thisPayment.amount, thisPayment.date); } function setGasFee(uint256 _gasFee) public onlyOwner { gasFee = _gasFee; } function setWalletAddress(address _wallet) public onlyOwner { walletAddress = payable(_wallet); } }
0x60806040526004361061011f5760003560e01c806387d81789116100a0578063ac1a386a11610064578063ac1a386a146103a7578063bbde5b25146103c7578063bcdd9af7146103f7578063c23268b714610417578063e272b8921461042a5761011f565b806387d8178914610309578063893d20e8146103295780639c8e841d146103475780639d76ea5814610367578063a6f9dae1146103875761011f565b8063643b9340116100e7578063643b93401461023d578063658612e91461025d578063678edca3146102735780636ad5b3ea146102955780636cd10af5146102b55761011f565b80630937e68a146101245780632cf18bb4146101485780634b50b21b1461017d5780635bf8633a146101d45780635c975abb1461020c575b600080fd5b34801561013057600080fd5b506001545b6040519081526020015b60405180910390f35b34801561015457600080fd5b506101686101633660046118ac565b61044a565b6040805192835260208301919091520161013f565b34801561018957600080fd5b506101b96101983660046118ac565b60036020526000908152604090208054600182015460029092015490919083565b6040805193845260208401929092529082015260600161013f565b3480156101e057600080fd5b506004546101f4906001600160a01b031681565b6040516001600160a01b03909116815260200161013f565b34801561021857600080fd5b5060005461022d90600160a01b900460ff1681565b604051901515815260200161013f565b34801561024957600080fd5b506101686102583660046118ac565b6106fe565b34801561026957600080fd5b5061013560075481565b34801561027f57600080fd5b5061029361028e3660046118ac565b61092c565b005b3480156102a157600080fd5b506006546101f4906001600160a01b031681565b3480156102c157600080fd5b506102d56102d03660046118ac565b610964565b604080516001600160a01b03909616865260ff9094166020860152928401919091526060830152608082015260a00161013f565b34801561031557600080fd5b506102d56103243660046118ac565b610a02565b34801561033557600080fd5b506000546001600160a01b03166101f4565b34801561035357600080fd5b506102936103623660046117d8565b610a51565b34801561037357600080fd5b506005546101f4906001600160a01b031681565b34801561039357600080fd5b506102936103a2366004611799565b610aa6565b3480156103b357600080fd5b506102936103c2366004611799565b610b2b565b3480156103d357600080fd5b5061022d6103e2366004611799565b60026020526000908152604090205460ff1681565b34801561040357600080fd5b5061022d6104123660046118ac565b610b77565b61022d6104253660046118ac565b610f68565b34801561043657600080fd5b50610293610445366004611810565b6112ea565b6004805460405163183c06e560e31b815291820183905260009182916001600160a01b031690829081908190849063c1e037289060240160a06040518083038186803b15801561049957600080fd5b505afa1580156104ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d19190611848565b945094505093505060008263ffffffff16426104ed9190611a6e565b905060008263ffffffff168463ffffffff1610156105185761050f8484611a85565b63ffffffff1690505b600854821015610539575060009650505063ffffffff1692506106f9915050565b6000816105545760085461054d9084611a2f565b905061057b565b6008546105619083611a2f565b60085461056e9085611a2f565b6105789190611a6e565b90505b600181101561059c575060009750505063ffffffff1693506106f992505050565b60006105a9826007611a4f565b905060008763ffffffff16600814806105c857508763ffffffff16600f145b156105dc576105d5611332565b9050610650565b886001600160a01b0316630c4192cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561061557600080fd5b505afa158015610629573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064d91906118c4565b90505b63ffffffff881660009081526003602090815260408083208151606081018352815481526001820154938101849052600290910154918101919091529082908590601e9061069e9087611a4f565b84604001516106ad9190611a4f565b6106b79190611a2f565b6106c19190611a4f565b825190915081906106d29088611a4f565b6106dc9190611a17565b9d505063ffffffff9097169a506106f99950505050505050505050565b915091565b6004805460405163183c06e560e31b815291820183905260009182916001600160a01b03169082908190839063c1e037289060240160a06040518083038186803b15801561074b57600080fd5b505afa15801561075f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107839190611848565b5093505092505060008163ffffffff164261079e9190611a6e565b90506008548110156107bf57506000945063ffffffff1692506106f9915050565b6000600854826107cf9190611a2f565b905060006107de826007611a4f565b905060008563ffffffff16600814806107fd57508563ffffffff16600f145b156108115761080a611332565b9050610885565b866001600160a01b0316630c4192cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561084a57600080fd5b505afa15801561085e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088291906118c4565b90505b63ffffffff861660009081526003602090815260408083208151606081018352815481526001820154938101849052600290910154918101919091529082908590601e906108d39087611a4f565b84604001516108e29190611a4f565b6108ec9190611a2f565b6108f69190611a4f565b825190915081906109079088611a4f565b6109119190611a17565b9b505063ffffffff90961698506106f9975050505050505050565b6000546001600160a01b0316331461095f5760405162461bcd60e51b81526004016109569061191e565b60405180910390fd5b600755565b6000806000806000806001878154811061098e57634e487b7160e01b600052603260045260246000fd5b60009182526020918290206040805160a08101825260049390930290910180546001600160a01b038116808552600160a01b90910460ff16948401859052600182015492840183905260028201546060850181905260039092015460809094018490529b939a509098509650945092505050565b60018181548110610a1257600080fd5b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b0383169450600160a01b90920460ff1692909185565b6000546001600160a01b03163314610a7b5760405162461bcd60e51b81526004016109569061191e565b6001600160a01b03919091166000908152600260205260409020805460ff1916911515919091179055565b6000546001600160a01b03163314610ad05760405162461bcd60e51b81526004016109569061191e565b600080546040516001600160a01b03808516939216917f342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a73591a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610b555760405162461bcd60e51b81526004016109569061191e565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b60008054600160a01b900460ff1615610bc75760405162461bcd60e51b815260206004820152601260248201527110dbdb9d1c9858dd081a5cc81c185d5cd95960721b6044820152606401610956565b600480546040516331a9108f60e11b81529182018490526001600160a01b0316906000908290636352211e9060240160206040518083038186803b158015610c0e57600080fd5b505afa158015610c22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4691906117bc565b90506001600160a01b0381163314610c705760405162461bcd60e51b81526004016109569061194b565b6001600160a01b03811660009081526002602052604090205460ff1615610ca95760405162461bcd60e51b8152600401610956906119d6565b6000610cb48561044a565b50905060008111610cd75760405162461bcd60e51b81526004016109569061198d565b60405163a1cfb5ed60e01b8152600481018690526001600160a01b0384169063a1cfb5ed90602401600060405180830381600087803b158015610d1957600080fd5b505af1158015610d2d573d6000803e3d6000fd5b50506005546006546040516323b872dd60e01b81526001600160a01b039182166004820152868216602482015260448101869052911692508291506323b872dd90606401602060405180830381600087803b158015610d8b57600080fd5b505af1158015610d9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc3919061182c565b610e055760405162461bcd60e51b8152602060048201526013602482015272115490cc8c081d1c985b9cd9995c8819985a5b606a1b6044820152606401610956565b6040805160a08101825233808252600160208084018281528486018c815260608087018a815242608089019081528654808801885560008881528a5160049092027fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf681018054985160ff16600160a01b0260ff60a01b196001600160a01b039095166001600160a01b0319909a1699909917939093169790971790915593517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf786015590517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf8850155517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf99093019290925586518981529283019390935294810191909152919290917f57ab651caaa1b117a457ba4089dc2eb29d7d41f7c276d06e07f5cf282bf82c57910160405180910390a26001955050505050505b919050565b60008054600160a01b900460ff1615610fb85760405162461bcd60e51b815260206004820152601260248201527110dbdb9d1c9858dd081a5cc81c185d5cd95960721b6044820152606401610956565b600754341015610ffc5760405162461bcd60e51b815260206004820152600f60248201526e4761732066656520746f6f206c6f7760881b6044820152606401610956565b600480546040516331a9108f60e11b81529182018490526001600160a01b0316906000908290636352211e9060240160206040518083038186803b15801561104357600080fd5b505afa158015611057573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107b91906117bc565b90506001600160a01b03811633146110a55760405162461bcd60e51b81526004016109569061194b565b6001600160a01b03811660009081526002602052604090205460ff16156110de5760405162461bcd60e51b8152600401610956906119d6565b60006110e98561044a565b5090506000811161110c5760405162461bcd60e51b81526004016109569061198d565b60405163a1cfb5ed60e01b8152600481018690526001600160a01b0384169063a1cfb5ed90602401600060405180830381600087803b15801561114e57600080fd5b505af1158015611162573d6000803e3d6000fd5b505060065461117d92506001600160a01b031690503461162f565b6040805160a081018252338082526002602083018181528385018a8152606085018781524260808701908152600180548082018255600091909152875160049091027fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf681018054965160ff16600160a01b0260ff60a01b196001600160a01b03949094166001600160a01b0319909816979097179290921695909517905591517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf7840155517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf8830155517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf9909101559251919290917f57ab651caaa1b117a457ba4089dc2eb29d7d41f7c276d06e07f5cf282bf82c57916112d691869190349092835260ff919091166020830152604082015260600190565b60405180910390a250600195945050505050565b6000546001600160a01b031633146113145760405162461bcd60e51b81526004016109569061191e565b60008054911515600160a01b0260ff60a01b19909216919091179055565b600480546040516305c0ec1b60e21b8152600092839283926001600160a01b03909116918291631703b06c9161136f916001910190815260200190565b60606040518083038186803b15801561138757600080fd5b505afa15801561139b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bf91906118dc565b5092506113d8905067ffffffffffffffff831684611a17565b6040516305c0ec1b60e21b8152600260048201529093506001600160a01b03821690631703b06c9060240160606040518083038186803b15801561141b57600080fd5b505afa15801561142f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061145391906118dc565b50925061146c905067ffffffffffffffff831684611a17565b6040516305c0ec1b60e21b8152600360048201529093506001600160a01b03821690631703b06c9060240160606040518083038186803b1580156114af57600080fd5b505afa1580156114c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114e791906118dc565b509250611500905067ffffffffffffffff831684611a17565b6040516305c0ec1b60e21b81526004808201529093506001600160a01b03821690631703b06c9060240160606040518083038186803b15801561154257600080fd5b505afa158015611556573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061157a91906118dc565b509250611593905067ffffffffffffffff831684611a17565b6040516305c0ec1b60e21b8152600560048201529093506001600160a01b03821690631703b06c9060240160606040518083038186803b1580156115d657600080fd5b505afa1580156115ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061160e91906118dc565b509250611627905067ffffffffffffffff831684611a17565b935050505090565b8047101561167f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610956565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146116cc576040519150601f19603f3d011682016040523d82523d6000602084013e6116d1565b606091505b50509050806117485760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610956565b505050565b80516fffffffffffffffffffffffffffffffff81168114610f6357600080fd5b805163ffffffff81168114610f6357600080fd5b805167ffffffffffffffff81168114610f6357600080fd5b6000602082840312156117aa578081fd5b81356117b581611ac0565b9392505050565b6000602082840312156117cd578081fd5b81516117b581611ac0565b600080604083850312156117ea578081fd5b82356117f581611ac0565b9150602083013561180581611ad8565b809150509250929050565b600060208284031215611821578081fd5b81356117b581611ad8565b60006020828403121561183d578081fd5b81516117b581611ad8565b600080600080600060a0868803121561185f578081fd5b6118688661174d565b94506118766020870161176d565b93506118846040870161176d565b92506118926060870161176d565b91506118a06080870161176d565b90509295509295909350565b6000602082840312156118bd578081fd5b5035919050565b6000602082840312156118d5578081fd5b5051919050565b6000806000606084860312156118f0578283fd5b6118f984611781565b925061190760208501611781565b91506119156040850161174d565b90509250925092565b60208082526013908201527221b0b63632b91034b9903737ba1037bbb732b960691b604082015260600190565b60208082526022908201527f4f6e6c79206173736574206f776e65722063616e20636c61696d2070726f6669604082015261747360f01b606082015260800190565b60208082526029908201527f596f75206e65656420746f2077616974206174206c656173742031207765656b60408201526820746f20636c61696d60b81b606082015260800190565b60208082526021908201527f5468697320616464726573732063616e6e6f7420636c61696d2070726f6669746040820152607360f81b606082015260800190565b60008219821115611a2a57611a2a611aaa565b500190565b600082611a4a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a6957611a69611aaa565b500290565b600082821015611a8057611a80611aaa565b500390565b600063ffffffff83811690831681811015611aa257611aa2611aaa565b039392505050565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114611ad557600080fd5b50565b8015158114611ad557600080fdfea2646970667358221220c3989b85afeffc73403a51fa952e0bb9dfe7bafbc12e6725fd84de11b7795f2664736f6c63430008020033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
6,499